evutil_rand.c:arc4_stir:
  369|      2|{
  370|      2|	int     i;
  371|      2|	ARC4RANDOM_UINT32 rekey_fuzz; 
  ------------------
  |  |  129|      2|#define ARC4RANDOM_UINT32 ev_uint32_t
  |  |  ------------------
  |  |  |  |  148|      2|#define ev_uint32_t uint32_t
  |  |  ------------------
  ------------------
  372|       |
  373|      2|	if (!rs_initialized) {
  ------------------
  |  Branch (373:6): [True: 1, False: 1]
  ------------------
  374|      1|		arc4_init();
  375|      1|		rs_initialized = 1;
  376|      1|	}
  377|       |
  378|      2|	if (0 != arc4_seed())
  ------------------
  |  Branch (378:6): [True: 0, False: 2]
  ------------------
  379|      0|		return -1;
  380|       |
  381|       |	/*
  382|       |	 * Discard early keystream, as per recommendations in
  383|       |	 * "Weaknesses in the Key Scheduling Algorithm of RC4" by
  384|       |	 * Scott Fluhrer, Itsik Mantin, and Adi Shamir.
  385|       |	 * http://www.wisdom.weizmann.ac.il/~itsik/RC4/Papers/Rc4_ksa.ps
  386|       |	 *
  387|       |	 * Ilya Mironov's "(Not So) Random Shuffles of RC4" suggests that
  388|       |	 * we drop at least 2*256 bytes, with 12*256 as a conservative
  389|       |	 * value.
  390|       |	 *
  391|       |	 * RFC4345 says to drop 6*256.
  392|       |	 *
  393|       |	 * At least some versions of this code drop 4*256, in a mistaken
  394|       |	 * belief that "words" in the Fluhrer/Mantin/Shamir paper refers
  395|       |	 * to processor words.
  396|       |	 *
  397|       |	 * We add another sect to the cargo cult, and choose 16*256.
  398|       |	 */
  399|  8.19k|	for (i = 0; i < 16*256; i++)
  ------------------
  |  Branch (399:14): [True: 8.19k, False: 2]
  ------------------
  400|  8.19k|		(void)arc4_getbyte();
  401|       |
  402|      2|	rekey_fuzz = arc4_getword();
  403|       |	/* rekey interval should not be predictable */
  404|      2|	arc4_count = REKEY_BASE + (rekey_fuzz % REKEY_BASE);
  ------------------
  |  |   82|      2|#define REKEY_BASE (1024*1024) /* NB. should be a power of 2 */
  ------------------
              	arc4_count = REKEY_BASE + (rekey_fuzz % REKEY_BASE);
  ------------------
  |  |   82|      2|#define REKEY_BASE (1024*1024) /* NB. should be a power of 2 */
  ------------------
  405|       |
  406|      2|	return 0;
  407|      2|}
evutil_rand.c:arc4_init:
  108|      1|{
  109|      1|	int     n;
  110|       |
  111|    257|	for (n = 0; n < 256; n++)
  ------------------
  |  Branch (111:14): [True: 256, False: 1]
  ------------------
  112|    256|		rs.s[n] = n;
  113|      1|	rs.i = 0;
  114|      1|	rs.j = 0;
  115|      1|}
evutil_rand.c:arc4_seed:
  336|      2|{
  337|      2|	int ok = 0;
  338|       |	/* We try every method that might work, and don't give up even if one
  339|       |	 * does seem to work.  There's no real harm in over-seeding, and if
  340|       |	 * one of these sources turns out to be broken, that would be bad. */
  341|       |#ifdef TRY_SEED_WIN32
  342|       |	if (0 == arc4_seed_win32())
  343|       |		ok = 1;
  344|       |#endif
  345|      2|#ifdef TRY_SEED_GETRANDOM
  346|      2|	if (0 == arc4_seed_getrandom())
  ------------------
  |  Branch (346:6): [True: 2, False: 0]
  ------------------
  347|      2|		ok = 1;
  348|      2|#endif
  349|      2|#ifdef TRY_SEED_URANDOM
  350|      2|	if (0 == arc4_seed_urandom())
  ------------------
  |  Branch (350:6): [True: 2, False: 0]
  ------------------
  351|      2|		ok = 1;
  352|      2|#endif
  353|      2|#ifdef TRY_SEED_PROC_SYS_KERNEL_RANDOM_UUID
  354|      2|	if (arc4random_urandom_filename == NULL &&
  ------------------
  |  Branch (354:6): [True: 2, False: 0]
  ------------------
  355|      2|	    0 == arc4_seed_proc_sys_kernel_random_uuid())
  ------------------
  |  Branch (355:6): [True: 2, False: 0]
  ------------------
  356|      2|		ok = 1;
  357|      2|#endif
  358|       |#ifdef TRY_SEED_SYSCTL_BSD
  359|       |	if (0 == arc4_seed_sysctl_bsd())
  360|       |		ok = 1;
  361|       |#endif
  362|      2|	return ok ? 0 : -1;
  ------------------
  |  Branch (362:9): [True: 2, False: 0]
  ------------------
  363|      2|}
evutil_rand.c:arc4_seed_getrandom:
  190|      2|{
  191|      2|	unsigned char buf[ADD_ENTROPY];
  192|      2|	size_t len;
  193|      2|	ssize_t n = 0;
  ------------------
  |  |  120|      2|#define ssize_t EVENT__ssize_t
  |  |  ------------------
  |  |  |  |  473|      2|#define EVENT__ssize_t ssize_t
  |  |  ------------------
  ------------------
  194|       |
  195|      4|	for (len = 0; len < sizeof(buf); len += n) {
  ------------------
  |  Branch (195:16): [True: 2, False: 2]
  ------------------
  196|      2|		n = getrandom(&buf[len], sizeof(buf) - len, 0);
  197|      2|		if (n < 0)
  ------------------
  |  Branch (197:7): [True: 0, False: 2]
  ------------------
  198|      0|			return -1;
  199|      2|	}
  200|      2|	arc4_addrandom(buf, sizeof(buf));
  201|      2|	evutil_memclear_(buf, sizeof(buf));
  202|      2|	return 0;
  203|      2|}
evutil_rand.c:arc4_addrandom:
  119|      9|{
  120|      9|	int     n;
  121|      9|	unsigned char si;
  122|       |
  123|      9|	rs.i--;
  124|  2.31k|	for (n = 0; n < 256; n++) {
  ------------------
  |  Branch (124:14): [True: 2.30k, False: 9]
  ------------------
  125|  2.30k|		rs.i = (rs.i + 1);
  126|  2.30k|		si = rs.s[rs.i];
  127|  2.30k|		rs.j = (rs.j + si + dat[n % datlen]);
  128|  2.30k|		rs.s[rs.i] = rs.s[rs.j];
  129|  2.30k|		rs.s[rs.j] = si;
  130|  2.30k|	}
  131|      9|	rs.j = rs.i;
  132|      9|}
evutil_rand.c:arc4_seed_urandom:
  315|      2|{
  316|       |	/* This is adapted from Tor's crypto_seed_rng() */
  317|      2|	static const char *filenames[] = {
  318|      2|		"/dev/srandom", "/dev/urandom", "/dev/random", NULL
  319|      2|	};
  320|      2|	int i;
  321|      2|	if (arc4random_urandom_filename)
  ------------------
  |  Branch (321:6): [True: 0, False: 2]
  ------------------
  322|      0|		return arc4_seed_urandom_helper_(arc4random_urandom_filename);
  323|       |
  324|      4|	for (i = 0; filenames[i]; ++i) {
  ------------------
  |  Branch (324:14): [True: 4, False: 0]
  ------------------
  325|      4|		if (arc4_seed_urandom_helper_(filenames[i]) == 0) {
  ------------------
  |  Branch (325:7): [True: 2, False: 2]
  ------------------
  326|      2|			return 0;
  327|      2|		}
  328|      4|	}
  329|       |
  330|      0|	return -1;
  331|      2|}
evutil_rand.c:arc4_seed_urandom_helper_:
  296|      4|{
  297|      4|	unsigned char buf[ADD_ENTROPY];
  298|      4|	int fd;
  299|      4|	size_t n;
  300|       |
  301|      4|	fd = evutil_open_closeonexec_(fname, O_RDONLY, 0);
  302|      4|	if (fd<0)
  ------------------
  |  Branch (302:6): [True: 2, False: 2]
  ------------------
  303|      2|		return -1;
  304|      2|	n = read_all(fd, buf, sizeof(buf));
  305|      2|	close(fd);
  306|      2|	if (n != sizeof(buf))
  ------------------
  |  Branch (306:6): [True: 0, False: 2]
  ------------------
  307|      0|		return -1;
  308|      2|	arc4_addrandom(buf, sizeof(buf));
  309|      2|	evutil_memclear_(buf, sizeof(buf));
  310|      2|	return 0;
  311|      2|}
evutil_rand.c:read_all:
  137|      2|{
  138|      2|	size_t numread = 0;
  139|      2|	ssize_t result;
  ------------------
  |  |  120|      2|#define ssize_t EVENT__ssize_t
  |  |  ------------------
  |  |  |  |  473|      2|#define EVENT__ssize_t ssize_t
  |  |  ------------------
  ------------------
  140|       |
  141|      4|	while (numread < count) {
  ------------------
  |  Branch (141:9): [True: 2, False: 2]
  ------------------
  142|      2|		result = read(fd, buf+numread, count-numread);
  143|      2|		if (result<0)
  ------------------
  |  Branch (143:7): [True: 0, False: 2]
  ------------------
  144|      0|			return -1;
  145|      2|		else if (result == 0)
  ------------------
  |  Branch (145:12): [True: 0, False: 2]
  ------------------
  146|      0|			break;
  147|      2|		numread += result;
  148|      2|	}
  149|       |
  150|      2|	return (ssize_t)numread;
  151|      2|}
evutil_rand.c:arc4_seed_proc_sys_kernel_random_uuid:
  251|      2|{
  252|       |	/* Occasionally, somebody will make /proc/sys accessible in a chroot,
  253|       |	 * but not /dev/urandom.  Let's try /proc/sys/kernel/random/uuid.
  254|       |	 * Its format is stupid, so we need to decode it from hex.
  255|       |	 */
  256|      2|	int fd;
  257|      2|	char buf[128];
  258|      2|	unsigned char entropy[64];
  259|      2|	int bytes, n, i, nybbles;
  260|      6|	for (bytes = 0; bytes<ADD_ENTROPY; ) {
  ------------------
  |  |   80|      6|#define ADD_ENTROPY 32
  ------------------
  |  Branch (260:18): [True: 4, False: 2]
  ------------------
  261|      4|		fd = evutil_open_closeonexec_("/proc/sys/kernel/random/uuid", O_RDONLY, 0);
  262|      4|		if (fd < 0)
  ------------------
  |  Branch (262:7): [True: 0, False: 4]
  ------------------
  263|      0|			return -1;
  264|      4|		n = read(fd, buf, sizeof(buf));
  265|      4|		close(fd);
  266|      4|		if (n<=0)
  ------------------
  |  Branch (266:7): [True: 0, False: 4]
  ------------------
  267|      0|			return -1;
  268|      4|		memset(entropy, 0, sizeof(entropy));
  269|    152|		for (i=nybbles=0; i<n; ++i) {
  ------------------
  |  Branch (269:21): [True: 148, False: 4]
  ------------------
  270|    148|			if (EVUTIL_ISXDIGIT_(buf[i])) {
  ------------------
  |  Branch (270:8): [True: 128, False: 20]
  ------------------
  271|    128|				int nyb = evutil_hex_char_to_int_(buf[i]);
  272|    128|				if (nybbles & 1) {
  ------------------
  |  Branch (272:9): [True: 64, False: 64]
  ------------------
  273|     64|					entropy[nybbles/2] |= nyb;
  274|     64|				} else {
  275|     64|					entropy[nybbles/2] |= nyb<<4;
  276|     64|				}
  277|    128|				++nybbles;
  278|    128|			}
  279|    148|		}
  280|      4|		if (nybbles < 2)
  ------------------
  |  Branch (280:7): [True: 0, False: 4]
  ------------------
  281|      0|			return -1;
  282|      4|		arc4_addrandom(entropy, nybbles/2);
  283|      4|		bytes += nybbles/2;
  284|      4|	}
  285|      2|	evutil_memclear_(entropy, sizeof(entropy));
  286|      2|	evutil_memclear_(buf, sizeof(buf));
  287|      2|	return 0;
  288|      2|}
evutil_rand.c:arc4_getbyte:
  424|  8.45k|{
  425|  8.45k|	unsigned char si, sj;
  426|       |
  427|  8.45k|	rs.i = (rs.i + 1);
  428|  8.45k|	si = rs.s[rs.i];
  429|  8.45k|	rs.j = (rs.j + si);
  430|  8.45k|	sj = rs.s[rs.j];
  431|  8.45k|	rs.s[rs.i] = sj;
  432|  8.45k|	rs.s[rs.j] = si;
  433|  8.45k|	return (rs.s[(si + sj) & 0xff]);
  434|  8.45k|}
evutil_rand.c:arc4_getword:
  438|      2|{
  439|      2|	unsigned int val;
  440|       |
  441|      2|	val = (unsigned)arc4_getbyte() << 24;
  442|      2|	val |= arc4_getbyte() << 16;
  443|      2|	val |= arc4_getbyte() << 8;
  444|      2|	val |= arc4_getbyte();
  445|       |
  446|      2|	return val;
  447|      2|}
evutil_rand.c:arc4random_buf:
  497|      1|{
  498|      1|	unsigned char *buf = buf_;
  499|      1|	ARC4_LOCK_();
  ------------------
  |  |  123|      1|#define ARC4_LOCK_() EVLOCK_LOCK(arc4rand_lock, 0)
  |  |  ------------------
  |  |  |  |   94|      1|	do {								\
  |  |  |  |   95|      1|		if (lockvar)						\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:7): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |   96|      1|			evthread_lock_fns_.lock(mode, lockvar);		\
  |  |  |  |   97|      1|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (97:11): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  500|      1|	arc4_stir_if_needed();
  501|    257|	while (n--) {
  ------------------
  |  Branch (501:9): [True: 256, False: 1]
  ------------------
  502|    256|		if (--arc4_count <= 0)
  ------------------
  |  Branch (502:7): [True: 0, False: 256]
  ------------------
  503|      0|			arc4_stir();
  504|    256|		buf[n] = arc4_getbyte();
  505|    256|	}
  506|      1|	ARC4_UNLOCK_();
  ------------------
  |  |  124|      1|#define ARC4_UNLOCK_() EVLOCK_UNLOCK(arc4rand_lock, 0)
  |  |  ------------------
  |  |  |  |  101|      1|	do {								\
  |  |  |  |  102|      1|		if (lockvar)						\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:7): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  103|      1|			evthread_lock_fns_.unlock(mode, lockvar);	\
  |  |  |  |  104|      1|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (104:11): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  507|      1|}
evutil_rand.c:arc4_stir_if_needed:
  412|      1|{
  413|      1|	pid_t pid = getpid();
  414|       |
  415|      1|	if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid)
  ------------------
  |  Branch (415:6): [True: 0, False: 1]
  |  Branch (415:25): [True: 0, False: 1]
  |  Branch (415:44): [True: 1, False: 0]
  ------------------
  416|      1|	{
  417|      1|		arc4_stir_pid = pid;
  418|      1|		arc4_stir();
  419|      1|	}
  420|      1|}
evutil_rand.c:arc4random_addrandom:
  464|      1|{
  465|      1|	int j;
  466|      1|	ARC4_LOCK_();
  ------------------
  |  |  123|      1|#define ARC4_LOCK_() EVLOCK_LOCK(arc4rand_lock, 0)
  |  |  ------------------
  |  |  |  |   94|      1|	do {								\
  |  |  |  |   95|      1|		if (lockvar)						\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:7): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |   96|      1|			evthread_lock_fns_.lock(mode, lockvar);		\
  |  |  |  |   97|      1|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (97:11): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  467|      1|	if (!rs_initialized)
  ------------------
  |  Branch (467:6): [True: 0, False: 1]
  ------------------
  468|      0|		arc4_stir();
  469|      2|	for (j = 0; j < datlen; j += 256) {
  ------------------
  |  Branch (469:14): [True: 1, False: 1]
  ------------------
  470|       |		/* arc4_addrandom() ignores all but the first 256 bytes of
  471|       |		 * its input.  We want to make sure to look at ALL the
  472|       |		 * data in 'dat', just in case the user is doing something
  473|       |		 * crazy like passing us all the files in /var/log. */
  474|      1|		arc4_addrandom(dat + j, datlen - j);
  475|      1|	}
  476|      1|	ARC4_UNLOCK_();
  ------------------
  |  |  124|      1|#define ARC4_UNLOCK_() EVLOCK_UNLOCK(arc4rand_lock, 0)
  |  |  ------------------
  |  |  |  |  101|      1|	do {								\
  |  |  |  |  102|      1|		if (lockvar)						\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:7): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  103|      1|			evthread_lock_fns_.unlock(mode, lockvar);	\
  |  |  |  |  104|      1|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (104:11): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|      1|}

evutil_open_closeonexec_:
  144|      8|{
  145|      8|	int fd;
  146|       |
  147|      8|#ifdef O_CLOEXEC
  148|      8|	fd = open(pathname, flags|O_CLOEXEC, (mode_t)mode);
  149|      8|	if (fd >= 0 || errno == EINVAL)
  ------------------
  |  Branch (149:6): [True: 6, False: 2]
  |  Branch (149:17): [True: 0, False: 2]
  ------------------
  150|      6|		return fd;
  151|       |	/* If we got an EINVAL, fall through and try without O_CLOEXEC */
  152|      2|#endif
  153|      2|	fd = open(pathname, flags, (mode_t)mode);
  154|      2|	if (fd < 0)
  ------------------
  |  Branch (154:6): [True: 2, False: 0]
  ------------------
  155|      2|		return -1;
  156|       |
  157|      0|#if defined(FD_CLOEXEC)
  158|      0|	if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
  ------------------
  |  Branch (158:6): [True: 0, False: 0]
  ------------------
  159|      0|		close(fd);
  160|      0|		return -1;
  161|      0|	}
  162|      0|#endif
  163|       |
  164|      0|	return fd;
  165|      0|}
EVUTIL_ISXDIGIT_:
 2603|    148|	int EVUTIL_##name##_(char c) {					\
 2604|    148|		ev_uint8_t u = c;					\
  ------------------
  |  |  186|    148|#define ev_uint8_t uint8_t
  ------------------
 2605|    148|		return !!(EVUTIL_##name##_TABLE[(u >> 5) & 7] & (1U << (u & 31))); \
 2606|    148|	}
evutil_memclear_:
 2781|      8|{
 2782|      8|	evutil_memset_volatile_(mem, 0, len);
 2783|      8|}
evutil_hex_char_to_int_:
 2804|    128|{
 2805|    128|	switch(c)
  ------------------
  |  Branch (2805:9): [True: 128, False: 0]
  ------------------
 2806|    128|	{
 2807|     12|		case '0': return 0;
  ------------------
  |  Branch (2807:3): [True: 12, False: 116]
  ------------------
 2808|      8|		case '1': return 1;
  ------------------
  |  Branch (2808:3): [True: 8, False: 120]
  ------------------
 2809|     11|		case '2': return 2;
  ------------------
  |  Branch (2809:3): [True: 11, False: 117]
  ------------------
 2810|      6|		case '3': return 3;
  ------------------
  |  Branch (2810:3): [True: 6, False: 122]
  ------------------
 2811|      9|		case '4': return 4;
  ------------------
  |  Branch (2811:3): [True: 9, False: 119]
  ------------------
 2812|      7|		case '5': return 5;
  ------------------
  |  Branch (2812:3): [True: 7, False: 121]
  ------------------
 2813|      8|		case '6': return 6;
  ------------------
  |  Branch (2813:3): [True: 8, False: 120]
  ------------------
 2814|      2|		case '7': return 7;
  ------------------
  |  Branch (2814:3): [True: 2, False: 126]
  ------------------
 2815|     13|		case '8': return 8;
  ------------------
  |  Branch (2815:3): [True: 13, False: 115]
  ------------------
 2816|      9|		case '9': return 9;
  ------------------
  |  Branch (2816:3): [True: 9, False: 119]
  ------------------
 2817|      8|		case 'A': case 'a': return 10;
  ------------------
  |  Branch (2817:3): [True: 0, False: 128]
  |  Branch (2817:13): [True: 8, False: 120]
  ------------------
 2818|      5|		case 'B': case 'b': return 11;
  ------------------
  |  Branch (2818:3): [True: 0, False: 128]
  |  Branch (2818:13): [True: 5, False: 123]
  ------------------
 2819|      5|		case 'C': case 'c': return 12;
  ------------------
  |  Branch (2819:3): [True: 0, False: 128]
  |  Branch (2819:13): [True: 5, False: 123]
  ------------------
 2820|      8|		case 'D': case 'd': return 13;
  ------------------
  |  Branch (2820:3): [True: 0, False: 128]
  |  Branch (2820:13): [True: 8, False: 120]
  ------------------
 2821|     10|		case 'E': case 'e': return 14;
  ------------------
  |  Branch (2821:3): [True: 0, False: 128]
  |  Branch (2821:13): [True: 10, False: 118]
  ------------------
 2822|      7|		case 'F': case 'f': return 15;
  ------------------
  |  Branch (2822:3): [True: 0, False: 128]
  |  Branch (2822:13): [True: 7, False: 121]
  ------------------
 2823|    128|	}
 2824|      0|	return -1;
 2825|    128|}

evutil_secure_rng_init:
  170|      1|{
  171|      1|	int val;
  172|       |
  173|      1|	ARC4_LOCK_();
  ------------------
  |  |  123|      1|#define ARC4_LOCK_() EVLOCK_LOCK(arc4rand_lock, 0)
  |  |  ------------------
  |  |  |  |   94|      1|	do {								\
  |  |  |  |   95|      1|		if (lockvar)						\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:7): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |   96|      1|			evthread_lock_fns_.lock(mode, lockvar);		\
  |  |  |  |   97|      1|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (97:11): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  174|      1|	val = (!arc4_stir()) ? 0 : -1;
  ------------------
  |  Branch (174:8): [True: 1, False: 0]
  ------------------
  175|      1|	ARC4_UNLOCK_();
  ------------------
  |  |  124|      1|#define ARC4_UNLOCK_() EVLOCK_UNLOCK(arc4rand_lock, 0)
  |  |  ------------------
  |  |  |  |  101|      1|	do {								\
  |  |  |  |  102|      1|		if (lockvar)						\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:7): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  103|      1|			evthread_lock_fns_.unlock(mode, lockvar);	\
  |  |  |  |  104|      1|	} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (104:11): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|      1|	return val;
  177|      1|}
evutil_secure_rng_get_bytes:
  189|      1|{
  190|      1|	ev_arc4random_buf(buf, n);
  191|      1|}
evutil_secure_rng_add_bytes:
  195|      1|{
  196|      1|#if !defined(EVENT__HAVE_ARC4RANDOM)
  197|      1|	arc4random_addrandom((unsigned char*)buf,
  198|      1|	    n>(size_t)INT_MAX ? INT_MAX : (int)n);
  ------------------
  |  Branch (198:6): [True: 0, False: 1]
  ------------------
  199|       |#elif defined(EVENT__HAVE_ARC4RANDOM_STIR)
  200|       |    arc4random_stir();
  201|       |#endif
  202|      1|}
evutil_rand.c:ev_arc4random_buf:
  181|      1|{
  182|      1|	arc4random_buf(buf, n);
  183|      1|}

ossl_aes_ctr_vaes_eligible:
  485|      2|{
  486|      2|    return ossl_aes_vaes_cleanup_eligible()
  ------------------
  |  Branch (486:12): [True: 2, False: 0]
  ------------------
  487|      2|        && ossl_vaes512_cpu_capable();
  ------------------
  |  Branch (487:12): [True: 0, False: 2]
  ------------------
  488|      2|}
aes_vaes512_intrinsics.c:ossl_vaes512_cpu_capable:
  107|      2|{
  108|      2|    return (OPENSSL_ia32cap_P[2] & (1 << 16)) /* AVX512F    */
  ------------------
  |  Branch (108:12): [True: 0, False: 2]
  ------------------
  109|      0|        && (OPENSSL_ia32cap_P[2] & (1 << 17)) /* AVX512DQ   */
  ------------------
  |  Branch (109:12): [True: 0, False: 0]
  ------------------
  110|      0|        && (OPENSSL_ia32cap_P[2] & (1 << 30)) /* AVX512BW   */
  ------------------
  |  Branch (110:12): [True: 0, False: 0]
  ------------------
  111|      0|        && (OPENSSL_ia32cap_P[3] & (1 << 9)); /* AVX512VAES */
  ------------------
  |  Branch (111:12): [True: 0, False: 0]
  ------------------
  112|      2|}

CRYPTO_calloc:
   29|    951|{
   30|    951|    size_t bytes;
   31|       |
   32|    951|    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
  ------------------
  |  |   24|    951|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 951]
  |  |  ------------------
  ------------------
   33|      0|        return NULL;
   34|       |
   35|    951|    return CRYPTO_zalloc(bytes, file, line);
   36|    951|}
CRYPTO_aligned_alloc_array:
   40|      1|{
   41|      1|    size_t bytes;
   42|       |
   43|      1|    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line))) {
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
   44|      0|        *freeptr = NULL;
   45|       |
   46|      0|        return NULL;
   47|      0|    }
   48|       |
   49|      1|    return CRYPTO_aligned_alloc(bytes, align, freeptr, file, line);
   50|      1|}
CRYPTO_realloc_array:
   54|     23|{
   55|     23|    size_t bytes;
   56|       |
   57|     23|    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
  ------------------
  |  |   24|     23|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 23]
  |  |  ------------------
  ------------------
   58|      0|        return NULL;
   59|       |
   60|     23|    return CRYPTO_realloc(addr, bytes, file, line);
   61|     23|}

ASN1_OBJECT_free:
  360|    159|{
  361|    159|    if (a == NULL)
  ------------------
  |  Branch (361:9): [True: 0, False: 159]
  ------------------
  362|      0|        return;
  363|    159|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) {
  ------------------
  |  |  143|    159|#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
  ------------------
  |  Branch (363:9): [True: 0, False: 159]
  ------------------
  364|      0|#ifndef CONST_STRICT
  365|       |        /*
  366|       |         * Disable purely for compile-time strict const checking.  Doing this
  367|       |         * on a "real" compile will cause memory leaks
  368|       |         */
  369|      0|        OPENSSL_free((void *)a->sn);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|      0|        OPENSSL_free((void *)a->ln);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  371|      0|#endif
  372|      0|        a->sn = a->ln = NULL;
  373|      0|    }
  374|    159|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) {
  ------------------
  |  |  144|    159|#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
  ------------------
  |  Branch (374:9): [True: 0, False: 159]
  ------------------
  375|      0|        OPENSSL_free((void *)a->data);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  376|      0|        a->data = NULL;
  377|      0|        a->length = 0;
  378|      0|    }
  379|    159|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
  ------------------
  |  |  141|    159|#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
  ------------------
  |  Branch (379:9): [True: 0, False: 159]
  ------------------
  380|      0|        OPENSSL_free(a);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  381|    159|}

evp_pkey_asn1_get_count:
   34|      1|{
   35|      1|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|      1|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
   36|      1|    return num;
   37|      1|}
evp_pkey_asn1_get0:
   40|     15|{
   41|     15|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|     15|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
   42|       |
   43|     15|    if (idx < 0 || idx >= num)
  ------------------
  |  Branch (43:9): [True: 0, False: 15]
  |  Branch (43:20): [True: 0, False: 15]
  ------------------
   44|      0|        return NULL;
   45|       |
   46|     15|    return standard_methods[idx];
   47|     15|}
evp_pkey_asn1_get0_info:
  101|     15|{
  102|     15|    if (!ameth)
  ------------------
  |  Branch (102:9): [True: 0, False: 15]
  ------------------
  103|      0|        return 0;
  104|     15|    if (ppkey_id)
  ------------------
  |  Branch (104:9): [True: 15, False: 0]
  ------------------
  105|     15|        *ppkey_id = ameth->pkey_id;
  106|     15|    if (ppkey_base_id)
  ------------------
  |  Branch (106:9): [True: 15, False: 0]
  ------------------
  107|     15|        *ppkey_base_id = ameth->pkey_base_id;
  108|     15|    if (ppkey_flags)
  ------------------
  |  Branch (108:9): [True: 15, False: 0]
  ------------------
  109|     15|        *ppkey_flags = ameth->pkey_flags;
  110|     15|    if (pinfo)
  ------------------
  |  Branch (110:9): [True: 0, False: 15]
  ------------------
  111|      0|        *pinfo = ameth->info;
  112|     15|    if (ppem_str)
  ------------------
  |  Branch (112:9): [True: 15, False: 0]
  ------------------
  113|     15|        *ppem_str = ameth->pem_str;
  114|     15|    return 1;
  115|     15|}

ossl_err_load_ASN1_strings:
  210|      1|{
  211|      1|#ifndef OPENSSL_NO_ERR
  212|      1|    if (ERR_reason_error_string(ASN1_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (212:9): [True: 1, False: 0]
  ------------------
  213|      1|        ERR_load_strings_const(ASN1_str_reasons);
  214|      1|#endif
  215|      1|    return 1;
  216|      1|}

ossl_vasprintf:
   16|      1|{
   17|      1|    char *candidate = NULL;
   18|      1|    size_t candidate_len = 64;
   19|      1|    size_t tmp_len = 0;
   20|      1|    char *tmp = NULL;
   21|      1|    int ret;
   22|       |
   23|      1|    if ((candidate = OPENSSL_malloc(candidate_len)) == NULL)
  ------------------
  |  |  111|      1|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (23:9): [True: 0, False: 1]
  ------------------
   24|      0|        goto err;
   25|      1|    va_list args_copy;
   26|      1|    va_copy(args_copy, args);
   27|      1|    ret = vsnprintf(candidate, candidate_len, format, args_copy);
   28|      1|    va_end(args_copy);
   29|      1|    if (ret < 0)
  ------------------
  |  Branch (29:9): [True: 0, False: 1]
  ------------------
   30|      0|        goto err;
   31|      1|    if ((size_t)ret >= candidate_len) {
  ------------------
  |  Branch (31:9): [True: 0, False: 1]
  ------------------
   32|       |        /*  Too big to fit in allocation. */
   33|       |
   34|      0|        tmp_len = (size_t)ret + 1;
   35|      0|        if ((tmp = OPENSSL_malloc(tmp_len)) == NULL)
  ------------------
  |  |  111|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (35:13): [True: 0, False: 0]
  ------------------
   36|      0|            goto err;
   37|      0|        OPENSSL_clear_free(candidate, candidate_len);
  ------------------
  |  |  134|      0|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|      0|        candidate = tmp;
   39|      0|        candidate_len = tmp_len;
   40|      0|        tmp = NULL;
   41|      0|        ret = vsnprintf(candidate, candidate_len, format, args);
   42|      0|    }
   43|       |    /* At this point this should not happen unless vsnprintf is insane. */
   44|      1|    if (ret < 0 || (size_t)ret >= candidate_len)
  ------------------
  |  Branch (44:9): [True: 0, False: 1]
  |  Branch (44:20): [True: 0, False: 1]
  ------------------
   45|      0|        goto err;
   46|      1|    *str = candidate;
   47|      1|    return ret;
   48|       |
   49|      0|err:
   50|      0|    OPENSSL_clear_free(candidate, candidate_len);
  ------------------
  |  |  134|      0|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|      0|    OPENSSL_clear_free(tmp, tmp_len);
  ------------------
  |  |  134|      0|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|       |    *str = NULL;
   53|      0|    return -1;
   54|      1|}
ossl_asprintf:
   57|      1|{
   58|      1|    va_list args;
   59|      1|    int ret;
   60|       |
   61|      1|    va_start(args, format);
   62|      1|    ret = ossl_vasprintf(str, format, args);
   63|       |    va_end(args);
   64|      1|    return ret;
   65|      1|}

async_local_init:
   28|      1|{
   29|      1|    async_mem_lock = CRYPTO_THREAD_lock_new();
   30|       |    return async_mem_lock != NULL;
   31|      1|}

async_get_ctx:
   59|      1|{
   60|      1|    return (async_ctx *)CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ASYNC_CTX_KEY,
   61|      1|        CRYPTO_THREAD_NO_CONTEXT);
  ------------------
  |  |   47|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
   62|      1|}
async_init:
  336|      1|{
  337|      1|    return async_local_init();
  338|      1|}
ASYNC_get_current_job:
  430|      1|{
  431|      1|    async_ctx *ctx;
  432|       |
  433|      1|    if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL))
  ------------------
  |  |  555|      1|#define OPENSSL_INIT_ASYNC 0x00000100L
  ------------------
  |  Branch (433:9): [True: 0, False: 1]
  ------------------
  434|      0|        return NULL;
  435|       |
  436|      1|    ctx = async_get_ctx();
  437|      1|    if (ctx == NULL)
  ------------------
  |  Branch (437:9): [True: 1, False: 0]
  ------------------
  438|      1|        return NULL;
  439|       |
  440|      0|    return ctx->currjob;
  441|      1|}

ossl_err_load_ASYNC_strings:
   31|      1|{
   32|      1|#ifndef OPENSSL_NO_ERR
   33|      1|    if (ERR_reason_error_string(ASYNC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (33:9): [True: 1, False: 0]
  ------------------
   34|      1|        ERR_load_strings_const(ASYNC_str_reasons);
   35|      1|#endif
   36|      1|    return 1;
   37|      1|}

ossl_err_load_BIO_strings:
   91|      1|{
   92|      1|#ifndef OPENSSL_NO_ERR
   93|      1|    if (ERR_reason_error_string(BIO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (93:9): [True: 1, False: 0]
  ------------------
   94|      1|        ERR_load_strings_const(BIO_str_reasons);
   95|      1|#endif
   96|      1|    return 1;
   97|      1|}

BIO_meth_new:
   38|      1|{
   39|      1|    BIO_METHOD *biom = OPENSSL_zalloc(sizeof(BIO_METHOD));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|       |
   41|      1|    if (biom == NULL
  ------------------
  |  Branch (41:9): [True: 0, False: 1]
  ------------------
   42|      1|        || (biom->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  140|      1|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (42:12): [True: 0, False: 1]
  ------------------
   43|      0|        OPENSSL_free(biom);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|      1|    biom->type = type;
   47|      1|    return biom;
   48|      1|}
BIO_meth_set_write_ex:
  101|      1|{
  102|       |    biom->bwrite_old = NULL;
  103|      1|    biom->bwrite = bwrite;
  104|      1|    return 1;
  105|      1|}
BIO_meth_set_read_ex:
  162|      1|{
  163|       |    biom->bread_old = NULL;
  164|      1|    biom->bread = bread;
  165|      1|    return 1;
  166|      1|}
BIO_meth_set_puts:
  177|      1|{
  178|      1|    biom->bputs = bputs;
  179|      1|    return 1;
  180|      1|}
BIO_meth_set_gets:
  191|      1|{
  192|      1|    biom->bgets = bgets;
  193|      1|    return 1;
  194|      1|}
BIO_meth_set_ctrl:
  205|      1|{
  206|      1|    biom->ctrl = ctrl;
  207|      1|    return 1;
  208|      1|}
BIO_meth_set_create:
  218|      1|{
  219|      1|    biom->create = create;
  220|      1|    return 1;
  221|      1|}
BIO_meth_set_destroy:
  231|      1|{
  232|      1|    biom->destroy = destroy;
  233|      1|    return 1;
  234|      1|}

ossl_bio_core_globals_new:
   31|      1|{
   32|      1|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      1|}

BIO_new_file:
   58|      1|{
   59|      1|    BIO *ret;
   60|      1|    FILE *file;
   61|      1|    int fp_flags = BIO_CLOSE;
  ------------------
  |  |   85|      1|#define BIO_CLOSE 0x01
  ------------------
   62|       |
   63|      1|    if (strchr(mode, 'b') == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 1]
  ------------------
   64|      0|        fp_flags |= BIO_FP_TEXT;
  ------------------
  |  |  220|      0|#define BIO_FP_TEXT 0x10
  ------------------
   65|       |
   66|      1|    if (filename == NULL) {
  ------------------
  |  Branch (66:9): [True: 0, False: 1]
  ------------------
   67|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   68|      0|        return NULL;
   69|      0|    }
   70|       |
   71|      1|    file = openssl_fopen(filename, mode);
   72|      1|    if (file == NULL) {
  ------------------
  |  Branch (72:9): [True: 1, False: 0]
  ------------------
   73|      1|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  359|      1|    (ERR_new(),                                                  \
  |  |  360|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      1|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      1|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   55|      1|#define ERR_LIB_SYS 2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      1|#define get_last_sys_error() errno
  ------------------
   74|      1|            "calling fopen(%s, %s)",
   75|      1|            filename, mode);
   76|      1|        if (errno == ENOENT
  ------------------
  |  Branch (76:13): [True: 1, False: 0]
  ------------------
   77|      0|#ifdef ENXIO
   78|      1|            || errno == ENXIO
  ------------------
  |  Branch (78:16): [True: 0, False: 0]
  ------------------
   79|      1|#endif
   80|      1|        )
   81|      1|            ERR_raise(ERR_LIB_BIO, BIO_R_NO_SUCH_FILE);
  ------------------
  |  |  357|      1|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      1|    (ERR_new(),                                                  \
  |  |  |  |  360|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      1|        ERR_set_error)
  |  |  ------------------
  ------------------
   82|      0|        else
   83|      1|            ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   84|      1|        return NULL;
   85|      1|    }
   86|      0|    if ((ret = BIO_new(BIO_s_file())) == NULL) {
  ------------------
  |  Branch (86:9): [True: 0, False: 0]
  ------------------
   87|      0|        fclose(file);
   88|      0|        return NULL;
   89|      0|    }
   90|       |
   91|       |    /* we did fopen -> we disengage UPLINK */
   92|      0|    BIO_clear_flags(ret, BIO_FLAGS_UPLINK_INTERNAL);
  ------------------
  |  |   18|      0|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
   93|      0|    BIO_set_fp(ret, file, fp_flags);
  ------------------
  |  |  616|      0|#define BIO_set_fp(b, fp, c) BIO_ctrl(b, BIO_C_SET_FILE_PTR, c, (char *)(fp))
  |  |  ------------------
  |  |  |  |  487|      0|#define BIO_C_SET_FILE_PTR 106
  |  |  ------------------
  ------------------
   94|      0|    return ret;
   95|      0|}

BN_hex2bn:
  122|      2|{
  123|      2|    BIGNUM *ret = NULL;
  124|      2|    BN_ULONG l = 0;
  125|      2|    int neg = 0, h, m, i, j, k, c;
  126|      2|    int num;
  127|       |
  128|      2|    if (a == NULL || *a == '\0')
  ------------------
  |  Branch (128:9): [True: 0, False: 2]
  |  Branch (128:22): [True: 0, False: 2]
  ------------------
  129|      0|        return 0;
  130|       |
  131|      2|    if (*a == '-') {
  ------------------
  |  Branch (131:9): [True: 0, False: 2]
  ------------------
  132|      0|        neg = 1;
  133|      0|        a++;
  134|      0|    }
  135|       |
  136|    770|    for (i = 0; i <= INT_MAX / 4 && ossl_isxdigit(a[i]); i++)
  ------------------
  |  |   83|    770|#define ossl_isxdigit(c) (ossl_ctype_check((c), CTYPE_MASK_xdigit))
  |  |  ------------------
  |  |  |  |   31|    770|#define CTYPE_MASK_xdigit 0x10
  |  |  ------------------
  |  |  |  Branch (83:26): [True: 768, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (136:17): [True: 770, False: 0]
  ------------------
  137|    768|        continue;
  138|       |
  139|      2|    if (i == 0 || i > INT_MAX / 4)
  ------------------
  |  Branch (139:9): [True: 0, False: 2]
  |  Branch (139:19): [True: 0, False: 2]
  ------------------
  140|      0|        return 0;
  141|       |
  142|      2|    num = i + neg;
  143|      2|    if (bn == NULL)
  ------------------
  |  Branch (143:9): [True: 0, False: 2]
  ------------------
  144|      0|        return num;
  145|       |
  146|       |    /* a is the start of the hex digits, and it is 'i' long */
  147|      2|    if (*bn == NULL) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|        if ((ret = BN_new()) == NULL)
  ------------------
  |  Branch (148:13): [True: 0, False: 0]
  ------------------
  149|      0|            return 0;
  150|      2|    } else {
  151|      2|        ret = *bn;
  152|      2|        if (BN_get_flags(ret, BN_FLG_STATIC_DATA)) {
  ------------------
  |  |   59|      2|#define BN_FLG_STATIC_DATA 0x02
  ------------------
  |  Branch (152:13): [True: 0, False: 2]
  ------------------
  153|      0|            ERR_raise(ERR_LIB_BN, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  154|      0|            return 0;
  155|      0|        }
  156|      2|        BN_zero(ret);
  ------------------
  |  |  201|      2|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  157|      2|    }
  158|       |
  159|       |    /* i is the number of hex digits */
  160|      2|    if (bn_expand(ret, i * 4) == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 2]
  ------------------
  161|      0|        goto err;
  162|       |
  163|      2|    j = i; /* least significant 'hex' */
  164|      2|    m = 0;
  165|      2|    h = 0;
  166|     50|    while (j > 0) {
  ------------------
  |  Branch (166:12): [True: 48, False: 2]
  ------------------
  167|     48|        m = (BN_BYTES * 2 <= j) ? BN_BYTES * 2 : j;
  ------------------
  |  |   38|     48|#define BN_BYTES 8
  ------------------
                      m = (BN_BYTES * 2 <= j) ? BN_BYTES * 2 : j;
  ------------------
  |  |   38|     48|#define BN_BYTES 8
  ------------------
  |  Branch (167:13): [True: 48, False: 0]
  ------------------
  168|     48|        l = 0;
  169|    768|        for (;;) {
  170|    768|            c = a[j - m];
  171|    768|            k = OPENSSL_hexchar2int(c);
  172|    768|            if (k < 0)
  ------------------
  |  Branch (172:17): [True: 0, False: 768]
  ------------------
  173|      0|                k = 0; /* paranoia */
  174|    768|            l = (l << 4) | k;
  175|       |
  176|    768|            if (--m <= 0) {
  ------------------
  |  Branch (176:17): [True: 48, False: 720]
  ------------------
  177|     48|                ret->d[h++] = l;
  178|     48|                break;
  179|     48|            }
  180|    768|        }
  181|     48|        j -= BN_BYTES * 2;
  ------------------
  |  |   38|     48|#define BN_BYTES 8
  ------------------
  182|     48|    }
  183|      2|    ret->top = h;
  184|      2|    bn_correct_top(ret);
  185|       |
  186|      2|    *bn = ret;
  187|      2|    bn_check_top(ret);
  188|       |    /* Don't set the negative flag if it's zero. */
  189|      2|    if (ret->top != 0)
  ------------------
  |  Branch (189:9): [True: 2, False: 0]
  ------------------
  190|      2|        ret->neg = neg;
  191|      2|    return num;
  192|      0|err:
  193|      0|    if (*bn == NULL)
  ------------------
  |  Branch (193:9): [True: 0, False: 0]
  ------------------
  194|      0|        BN_free(ret);
  195|      0|    return 0;
  196|      2|}

ossl_err_load_BN_strings:
   50|      1|{
   51|      1|#ifndef OPENSSL_NO_ERR
   52|      1|    if (ERR_reason_error_string(BN_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 1, False: 0]
  ------------------
   53|      1|        ERR_load_strings_const(BN_str_reasons);
   54|      1|#endif
   55|      1|    return 1;
   56|      1|}

BN_free:
  220|    206|{
  221|    206|    if (a == NULL)
  ------------------
  |  Branch (221:9): [True: 206, False: 0]
  ------------------
  222|    206|        return;
  223|      0|    if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|      0|#define BN_FLG_STATIC_DATA 0x02
  ------------------
  |  Branch (223:9): [True: 0, False: 0]
  ------------------
  224|      0|        bn_free_d(a, 0);
  225|      0|    if (a->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|      0|#define BN_FLG_MALLOCED 0x01
  ------------------
  |  Branch (225:9): [True: 0, False: 0]
  ------------------
  226|      0|        OPENSSL_free(a);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  227|      0|}
BN_new:
  238|      3|{
  239|      3|    BIGNUM *ret;
  240|       |
  241|      3|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  113|      3|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (241:9): [True: 0, False: 3]
  ------------------
  242|      0|        return NULL;
  243|      3|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|      3|#define BN_FLG_MALLOCED 0x01
  ------------------
  244|      3|    bn_check_top(ret);
  245|      3|    return ret;
  246|      3|}
bn_expand2:
  294|      3|{
  295|      3|    if (ossl_likely(words > b->dmax)) {
  ------------------
  |  |   23|      3|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  296|      3|        BN_ULONG *a = bn_expand_internal(b, words);
  297|       |
  298|      3|        if (ossl_unlikely(!a))
  ------------------
  |  |   24|      3|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  299|      0|            return NULL;
  300|      3|        if (b->d != NULL)
  ------------------
  |  Branch (300:13): [True: 0, False: 3]
  ------------------
  301|      0|            bn_free_d(b, 1);
  302|      3|        b->d = a;
  303|      3|        b->dmax = words;
  304|      3|    }
  305|       |
  306|      3|    return b;
  307|      3|}
BN_set_word:
  410|      1|{
  411|      1|    bn_check_top(a);
  412|      1|    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 1]
  ------------------
  413|      0|        return 0;
  414|      1|    a->neg = 0;
  415|      1|    a->d[0] = w;
  416|      1|    a->top = (w ? 1 : 0);
  ------------------
  |  Branch (416:15): [True: 1, False: 0]
  ------------------
  417|      1|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  213|      1|#define BN_FLG_FIXED_TOP 0
  ------------------
  418|      1|    bn_check_top(a);
  419|      1|    return 1;
  420|      1|}
BN_zero_ex:
 1040|      2|{
 1041|      2|    a->neg = 0;
 1042|      2|    a->top = 0;
 1043|      2|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  213|      2|#define BN_FLG_FIXED_TOP 0
  ------------------
 1044|      2|}
BN_get_flags:
 1132|      8|{
 1133|      8|    return b->flags & n;
 1134|      8|}
bn_correct_top:
 1189|      2|{
 1190|      2|    BN_ULONG *ftl;
 1191|      2|    int tmp_top = a->top;
 1192|       |
 1193|      2|    if (ossl_likely(tmp_top > 0)) {
  ------------------
  |  |   23|      2|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 2, False: 0]
  |  |  ------------------
  ------------------
 1194|      2|        for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
  ------------------
  |  Branch (1194:38): [True: 2, False: 0]
  ------------------
 1195|      2|            ftl--;
 1196|      2|            if (*ftl != 0)
  ------------------
  |  Branch (1196:17): [True: 2, False: 0]
  ------------------
 1197|      2|                break;
 1198|      2|        }
 1199|      2|        a->top = tmp_top;
 1200|      2|    }
 1201|      2|    if (a->top == 0)
  ------------------
  |  Branch (1201:9): [True: 0, False: 2]
  ------------------
 1202|      0|        a->neg = 0;
 1203|      2|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  213|      2|#define BN_FLG_FIXED_TOP 0
  ------------------
 1204|      2|    bn_pollute(a);
 1205|      2|}
bn_lib.c:bn_expand_internal:
  260|      3|{
  261|      3|    BN_ULONG *a = NULL;
  262|       |
  263|      3|    if (ossl_unlikely(words > (INT_MAX / (4 * BN_BITS2)))) {
  ------------------
  |  |   24|      3|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  264|      0|        ERR_raise(ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  265|      0|        return NULL;
  266|      0|    }
  267|      3|    if (ossl_unlikely(BN_get_flags(b, BN_FLG_STATIC_DATA))) {
  ------------------
  |  |   24|      3|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  268|      0|        ERR_raise(ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  269|      0|        return NULL;
  270|      0|    }
  271|      3|    if (BN_get_flags(b, BN_FLG_SECURE))
  ------------------
  |  |   68|      3|#define BN_FLG_SECURE 0x08
  ------------------
  |  Branch (271:9): [True: 0, False: 3]
  ------------------
  272|      0|        a = OPENSSL_secure_calloc(words, sizeof(*a));
  ------------------
  |  |  150|      0|    CRYPTO_secure_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  273|      3|    else
  274|      3|        a = OPENSSL_calloc(words, sizeof(*a));
  ------------------
  |  |  117|      3|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  275|      3|    if (ossl_unlikely(a == NULL))
  ------------------
  |  |   24|      3|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  276|      0|        return NULL;
  277|       |
  278|      3|    assert(b->top <= words);
  279|      3|    if (b->top > 0)
  ------------------
  |  Branch (279:9): [True: 0, False: 3]
  ------------------
  280|      0|        memcpy(a, b->d, sizeof(*a) * b->top);
  281|       |
  282|      3|    return a;
  283|      3|}

bn_conv.c:bn_expand:
  674|      2|{
  675|      2|    if (bits > (INT_MAX - BN_BITS2 + 1))
  ------------------
  |  |   54|      2|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      2|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (675:9): [True: 0, False: 2]
  ------------------
  676|      0|        return NULL;
  677|       |
  678|      2|    if (((bits + BN_BITS2 - 1) / BN_BITS2) <= (a)->dmax)
  ------------------
  |  |   54|      2|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      2|#define BN_BYTES 8
  |  |  ------------------
  ------------------
                  if (((bits + BN_BITS2 - 1) / BN_BITS2) <= (a)->dmax)
  ------------------
  |  |   54|      2|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      2|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (678:9): [True: 0, False: 2]
  ------------------
  679|      0|        return a;
  680|       |
  681|      2|    return bn_expand2((a), (bits + BN_BITS2 - 1) / BN_BITS2);
  ------------------
  |  |   54|      2|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      2|#define BN_BYTES 8
  |  |  ------------------
  ------------------
                  return bn_expand2((a), (bits + BN_BITS2 - 1) / BN_BITS2);
  ------------------
  |  |   54|      2|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      2|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  682|      2|}
bn_lib.c:bn_expand:
  674|      1|{
  675|      1|    if (bits > (INT_MAX - BN_BITS2 + 1))
  ------------------
  |  |   54|      1|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      1|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (675:9): [True: 0, False: 1]
  ------------------
  676|      0|        return NULL;
  677|       |
  678|      1|    if (((bits + BN_BITS2 - 1) / BN_BITS2) <= (a)->dmax)
  ------------------
  |  |   54|      1|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      1|#define BN_BYTES 8
  |  |  ------------------
  ------------------
                  if (((bits + BN_BITS2 - 1) / BN_BITS2) <= (a)->dmax)
  ------------------
  |  |   54|      1|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      1|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (678:9): [True: 0, False: 1]
  ------------------
  679|      0|        return a;
  680|       |
  681|      1|    return bn_expand2((a), (bits + BN_BITS2 - 1) / BN_BITS2);
  ------------------
  |  |   54|      1|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      1|#define BN_BYTES 8
  |  |  ------------------
  ------------------
                  return bn_expand2((a), (bits + BN_BITS2 - 1) / BN_BITS2);
  ------------------
  |  |   54|      1|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|      1|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  682|      1|}

ossl_err_load_BUF_strings:
   24|      1|{
   25|      1|#ifndef OPENSSL_NO_ERR
   26|      1|    if (ERR_reason_error_string(BUF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (26:9): [True: 1, False: 0]
  ------------------
   27|      1|        ERR_load_strings_const(BUF_str_reasons);
   28|      1|#endif
   29|      1|    return 1;
   30|      1|}

ossl_err_load_CMP_strings:
  199|      1|{
  200|      1|#ifndef OPENSSL_NO_ERR
  201|      1|    if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (201:9): [True: 1, False: 0]
  ------------------
  202|      1|        ERR_load_strings_const(CMP_str_reasons);
  203|      1|#endif
  204|      1|    return 1;
  205|      1|}

ossl_err_load_CMS_strings:
  182|      1|{
  183|      1|#ifndef OPENSSL_NO_ERR
  184|      1|    if (ERR_reason_error_string(CMS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (184:9): [True: 1, False: 0]
  ------------------
  185|      1|        ERR_load_strings_const(CMS_str_reasons);
  186|      1|#endif
  187|      1|    return 1;
  188|      1|}

COMP_zlib:
  311|      1|{
  312|      1|    COMP_METHOD *meth = NULL;
  313|       |
  314|       |#ifndef OPENSSL_NO_ZLIB
  315|       |    if (RUN_ONCE(&zlib_once, ossl_comp_zlib_init))
  316|       |        meth = &zlib_stateful_method;
  317|       |#endif
  318|       |
  319|      1|    return meth;
  320|      1|}

ossl_err_load_COMP_strings:
   45|      1|{
   46|      1|#ifndef OPENSSL_NO_ERR
   47|      1|    if (ERR_reason_error_string(COMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (47:9): [True: 1, False: 0]
  ------------------
   48|      1|        ERR_load_strings_const(COMP_str_reasons);
   49|      1|#endif
   50|      1|    return 1;
   51|      1|}

COMP_get_type:
   41|      1|{
   42|      1|    if (meth == NULL)
  ------------------
  |  Branch (42:9): [True: 1, False: 0]
  ------------------
   43|      1|        return NID_undef;
  ------------------
  |  |   19|      1|#define NID_undef                       0
  ------------------
   44|      0|    return meth->type;
   45|      1|}

ossl_load_builtin_compressions:
   29|      1|{
   30|      1|    STACK_OF(SSL_COMP) *comp_methods = NULL;
  ------------------
  |  |   33|      1|#define STACK_OF(type) struct stack_st_##type
  ------------------
   31|      1|#ifndef OPENSSL_NO_COMP
   32|      1|    SSL_COMP *comp = NULL;
   33|      1|    COMP_METHOD *method = COMP_zlib();
   34|       |
   35|      1|    comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
  ------------------
  |  |   73|      1|    ((STACK_OF(SSL_COMP) *)OPENSSL_sk_set_thunks( \
  |  |   74|      1|        OPENSSL_sk_set_copy_thunks( \
  |  |   75|      1|            OPENSSL_sk_set_cmp_thunks( \
  |  |   76|      1|                OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp)), \
  |  |   77|      1|                sk_SSL_COMP_cmpfunc_thunk), \
  |  |   78|      1|            sk_SSL_COMP_copyfunc_thunk), \
  |  |   79|      1|        sk_SSL_COMP_freefunc_thunk))
  ------------------
   36|       |
   37|      1|    if (COMP_get_type(method) != NID_undef && comp_methods != NULL) {
  ------------------
  |  |   19|      2|#define NID_undef                       0
  ------------------
  |  Branch (37:9): [True: 0, False: 1]
  |  Branch (37:47): [True: 0, False: 0]
  ------------------
   38|      0|        comp = OPENSSL_malloc(sizeof(*comp));
  ------------------
  |  |  111|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      0|        if (comp != NULL) {
  ------------------
  |  Branch (39:13): [True: 0, False: 0]
  ------------------
   40|      0|            comp->method = method;
   41|      0|            comp->id = SSL_COMP_ZLIB_IDX;
  ------------------
  |  |   18|      0|#define SSL_COMP_ZLIB_IDX 1
  ------------------
   42|      0|            comp->name = COMP_get_name(method);
   43|      0|            if (!sk_SSL_COMP_push(comp_methods, comp))
  ------------------
  |  |  101|      0|#define sk_SSL_COMP_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
  ------------------
  |  Branch (43:17): [True: 0, False: 0]
  ------------------
   44|      0|                OPENSSL_free(comp);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|      0|        }
   46|      0|    }
   47|      1|#endif
   48|      1|    return comp_methods;
   49|      1|}

_CONF_free_data:
  142|      1|{
  143|      1|    if (conf == NULL)
  ------------------
  |  Branch (143:9): [True: 0, False: 1]
  ------------------
  144|      0|        return;
  145|       |
  146|      1|    OPENSSL_free(conf->includedir);
  ------------------
  |  |  136|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  147|      1|    if (conf->data == NULL)
  ------------------
  |  Branch (147:9): [True: 1, False: 0]
  ------------------
  148|      1|        return;
  149|       |
  150|       |    /* evil thing to make sure the 'OPENSSL_free()' works as expected */
  151|      0|    lh_CONF_VALUE_set_down_load(conf->data, 0);
  ------------------
  |  |  124|      0|#define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl)
  ------------------
  152|      0|    lh_CONF_VALUE_doall_LH_CONF_VALUE(conf->data, value_free_hash, conf->data);
  153|       |
  154|       |    /*
  155|       |     * We now have only 'section' entries in the hash table. Due to problems
  156|       |     * with
  157|       |     */
  158|       |
  159|      0|    lh_CONF_VALUE_doall(conf->data, value_free_stack_doall);
  ------------------
  |  |  125|      0|#define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn))
  ------------------
  160|      0|    lh_CONF_VALUE_free(conf->data);
  ------------------
  |  |  113|      0|#define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh))
  ------------------
  161|      0|}

NCONF_default:
   87|      1|{
   88|      1|    return &default_method;
   89|      1|}
conf_def.c:def_create:
  112|      1|{
  113|      1|    CONF *ret;
  114|       |
  115|      1|    ret = OPENSSL_malloc(sizeof(*ret));
  ------------------
  |  |  111|      1|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|      1|    if (ret != NULL)
  ------------------
  |  Branch (116:9): [True: 1, False: 0]
  ------------------
  117|      1|        if (meth->init(ret) == 0) {
  ------------------
  |  Branch (117:13): [True: 0, False: 1]
  ------------------
  118|      0|            OPENSSL_free(ret);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  119|       |            ret = NULL;
  120|      0|        }
  121|      1|    return ret;
  122|      1|}
conf_def.c:def_init_default:
  125|      1|{
  126|      1|    if (conf == NULL)
  ------------------
  |  Branch (126:9): [True: 0, False: 1]
  ------------------
  127|      0|        return 0;
  128|       |
  129|      1|    memset(conf, 0, sizeof(*conf));
  130|      1|    conf->meth = &default_method;
  131|      1|    conf->meth_data = (void *)CONF_type_default;
  132|       |
  133|      1|    return 1;
  134|      1|}
conf_def.c:def_destroy:
  151|      1|{
  152|      1|    if (def_destroy_data(conf)) {
  ------------------
  |  Branch (152:9): [True: 1, False: 0]
  ------------------
  153|      1|        OPENSSL_free(conf);
  ------------------
  |  |  136|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|      1|        return 1;
  155|      1|    }
  156|      0|    return 0;
  157|      1|}
conf_def.c:def_destroy_data:
  160|      1|{
  161|      1|    if (conf == NULL)
  ------------------
  |  Branch (161:9): [True: 0, False: 1]
  ------------------
  162|      0|        return 0;
  163|      1|    _CONF_free_data(conf);
  164|      1|    return 1;
  165|      1|}
conf_def.c:def_load:
  168|      1|{
  169|      1|    int ret;
  170|      1|    BIO *in = NULL;
  171|       |
  172|       |#ifdef OPENSSL_SYS_VMS
  173|       |    in = BIO_new_file(name, "r");
  174|       |#else
  175|      1|    in = BIO_new_file(name, "rb");
  176|      1|#endif
  177|      1|    if (in == NULL) {
  ------------------
  |  Branch (177:9): [True: 1, False: 0]
  ------------------
  178|      1|        if (ERR_GET_REASON(ERR_peek_last_error()) == BIO_R_NO_SUCH_FILE)
  ------------------
  |  |   46|      1|#define BIO_R_NO_SUCH_FILE 128
  ------------------
  |  Branch (178:13): [True: 1, False: 0]
  ------------------
  179|      1|            ERR_raise(ERR_LIB_CONF, CONF_R_NO_SUCH_FILE);
  ------------------
  |  |  357|      1|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      1|    (ERR_new(),                                                  \
  |  |  |  |  360|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      1|        ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|        else
  181|      1|            ERR_raise(ERR_LIB_CONF, ERR_R_SYS_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  182|      1|        return 0;
  183|      1|    }
  184|       |
  185|      0|    ret = def_load_bio(conf, in, line);
  186|      0|    BIO_free(in);
  187|       |
  188|      0|    return ret;
  189|      1|}

ossl_err_load_CONF_strings:
   68|      1|{
   69|      1|#ifndef OPENSSL_NO_ERR
   70|      1|    if (ERR_reason_error_string(CONF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 1, False: 0]
  ------------------
   71|      1|        ERR_load_strings_const(CONF_str_reasons);
   72|      1|#endif
   73|      1|    return 1;
   74|      1|}

NCONF_new_ex:
  183|      1|{
  184|      1|    CONF *ret;
  185|       |
  186|      1|    if (meth == NULL)
  ------------------
  |  Branch (186:9): [True: 1, False: 0]
  ------------------
  187|      1|        meth = NCONF_default();
  188|       |
  189|      1|    ret = meth->create(meth);
  190|      1|    if (ret == NULL) {
  ------------------
  |  Branch (190:9): [True: 0, False: 1]
  ------------------
  191|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_CONF_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  192|      0|        return NULL;
  193|      0|    }
  194|      1|    ret->libctx = libctx;
  195|       |
  196|      1|    return ret;
  197|      1|}
NCONF_free:
  205|      1|{
  206|      1|    if (conf == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 1]
  ------------------
  207|      0|        return;
  208|      1|    conf->meth->destroy(conf);
  209|      1|}
NCONF_load:
  252|      1|{
  253|      1|    if (conf == NULL) {
  ------------------
  |  Branch (253:9): [True: 0, False: 1]
  ------------------
  254|      0|        ERR_raise(ERR_LIB_CONF, CONF_R_NO_CONF);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  255|      0|        return 0;
  256|      0|    }
  257|       |
  258|      1|    return conf->meth->load(conf, file, eline);
  259|      1|}

CONF_modules_load_file_ex:
  156|      1|{
  157|      1|    char *file = NULL;
  158|      1|    CONF *conf = NULL;
  159|      1|    int ret = 0, diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  160|       |
  161|      1|    ERR_set_mark();
  162|       |
  163|      1|    if (filename == NULL) {
  ------------------
  |  Branch (163:9): [True: 1, False: 0]
  ------------------
  164|      1|        file = CONF_get1_default_config_file();
  165|      1|        if (file == NULL)
  ------------------
  |  Branch (165:13): [True: 0, False: 1]
  ------------------
  166|      0|            goto err;
  167|      1|        if (*file == '\0') {
  ------------------
  |  Branch (167:13): [True: 0, False: 1]
  ------------------
  168|       |            /* Do not try to load an empty file name but do not error out */
  169|      0|            ret = 1;
  170|      0|            goto err;
  171|      0|        }
  172|      1|    } else {
  173|      0|        file = (char *)filename;
  174|      0|    }
  175|       |
  176|      1|    conf = NCONF_new_ex(libctx, NULL);
  177|      1|    if (conf == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 1]
  ------------------
  178|      0|        goto err;
  179|       |
  180|      1|    if (NCONF_load(conf, file, NULL) <= 0) {
  ------------------
  |  Branch (180:9): [True: 1, False: 0]
  ------------------
  181|      1|        if ((flags & CONF_MFLAGS_IGNORE_MISSING_FILE) && (ERR_GET_REASON(ERR_peek_last_error()) == CONF_R_NO_SUCH_FILE)) {
  ------------------
  |  |  152|      1|#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  ------------------
                      if ((flags & CONF_MFLAGS_IGNORE_MISSING_FILE) && (ERR_GET_REASON(ERR_peek_last_error()) == CONF_R_NO_SUCH_FILE)) {
  ------------------
  |  |   34|      1|#define CONF_R_NO_SUCH_FILE 114
  ------------------
  |  Branch (181:13): [True: 1, False: 0]
  |  Branch (181:58): [True: 1, False: 0]
  ------------------
  182|      1|            ret = 1;
  183|      1|        }
  184|      1|        goto err;
  185|      1|    }
  186|       |
  187|      0|    ret = CONF_modules_load(conf, appname, flags);
  188|       |    /* CONF_modules_load() might change the diagnostics setting, reread it. */
  189|      0|    diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  190|       |
  191|      1|err:
  192|      1|    if (filename == NULL)
  ------------------
  |  Branch (192:9): [True: 1, False: 0]
  ------------------
  193|      1|        OPENSSL_free(file);
  ------------------
  |  |  136|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  194|      1|    NCONF_free(conf);
  195|       |
  196|      1|    if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics)
  ------------------
  |  |  149|      1|#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  ------------------
  |  Branch (196:9): [True: 1, False: 0]
  |  Branch (196:59): [True: 1, False: 0]
  ------------------
  197|      1|        ret = 1;
  198|       |
  199|      1|    if (ret > 0)
  ------------------
  |  Branch (199:9): [True: 1, False: 0]
  ------------------
  200|      1|        ERR_pop_to_mark();
  201|      0|    else
  202|      0|        ERR_clear_last_mark();
  203|       |
  204|      1|    return ret;
  205|      0|}
CONF_get1_default_config_file:
  646|      1|{
  647|      1|    const char *t;
  648|      1|    char *file, *sep = "";
  649|       |
  650|      1|    if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL)
  ------------------
  |  Branch (650:9): [True: 0, False: 1]
  ------------------
  651|      0|        return OPENSSL_strdup(file);
  ------------------
  |  |  140|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  652|       |
  653|      1|    t = X509_get_default_cert_area();
  654|       |    /*
  655|       |     * On windows systems with -DOSSL_WINCTX set, if the needed registry
  656|       |     * keys are not yet set, openssl applets will return, due to an inability
  657|       |     * to locate various directories, like the default cert area.  In that
  658|       |     * event, clone an empty string here, so that commands like openssl version
  659|       |     * continue to operate properly without needing to set OPENSSL_CONF.
  660|       |     * Applets like cms will fail gracefully later when they try to parse an
  661|       |     * empty config file
  662|       |     */
  663|      1|    if (t == NULL)
  ------------------
  |  Branch (663:9): [True: 0, False: 1]
  ------------------
  664|      0|        return OPENSSL_strdup("");
  ------------------
  |  |  140|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  665|       |
  666|      1|#ifndef OPENSSL_SYS_VMS
  667|      1|    sep = "/";
  668|      1|#endif
  669|      1|    if (ossl_asprintf(&file, "%s%s%s", t, sep, OPENSSL_CONF) < 0)
  ------------------
  |  |   91|      1|#define OPENSSL_CONF "openssl.cnf"
  ------------------
  |  Branch (669:9): [True: 0, False: 1]
  ------------------
  670|      0|        return NULL;
  671|       |
  672|      1|    return file;
  673|      1|}

ossl_config_int:
   46|      1|{
   47|      1|    int ret = 0;
   48|      1|#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
   49|      1|    const char *filename;
   50|      1|    const char *appname;
   51|      1|    unsigned long flags;
   52|      1|#endif
   53|       |
   54|      1|    if (openssl_configured)
  ------------------
  |  Branch (54:9): [True: 0, False: 1]
  ------------------
   55|      0|        return 1;
   56|       |
   57|      1|#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
   58|      1|    filename = settings ? settings->filename : NULL;
  ------------------
  |  Branch (58:16): [True: 0, False: 1]
  ------------------
   59|      1|    appname = settings ? settings->appname : NULL;
  ------------------
  |  Branch (59:15): [True: 0, False: 1]
  ------------------
   60|      1|    flags = settings ? settings->flags : DEFAULT_CONF_MFLAGS;
  ------------------
  |  |   20|      2|    (CONF_MFLAGS_DEFAULT_SECTION | CONF_MFLAGS_IGNORE_MISSING_FILE | CONF_MFLAGS_IGNORE_RETURN_CODES)
  |  |  ------------------
  |  |  |  |  153|      1|#define CONF_MFLAGS_DEFAULT_SECTION 0x20
  |  |  ------------------
  |  |                   (CONF_MFLAGS_DEFAULT_SECTION | CONF_MFLAGS_IGNORE_MISSING_FILE | CONF_MFLAGS_IGNORE_RETURN_CODES)
  |  |  ------------------
  |  |  |  |  152|      1|#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  |  |  ------------------
  |  |                   (CONF_MFLAGS_DEFAULT_SECTION | CONF_MFLAGS_IGNORE_MISSING_FILE | CONF_MFLAGS_IGNORE_RETURN_CODES)
  |  |  ------------------
  |  |  |  |  149|      1|#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  |  |  ------------------
  ------------------
  |  Branch (60:13): [True: 0, False: 1]
  ------------------
   61|      1|#endif
   62|       |
   63|       |#ifdef OPENSSL_INIT_DEBUG
   64|       |    fprintf(stderr, "OPENSSL_INIT: ossl_config_int(%s, %s, %lu)\n",
   65|       |        filename, appname, flags);
   66|       |#endif
   67|       |
   68|      1|#ifndef OPENSSL_SYS_UEFI
   69|      1|    ret = CONF_modules_load_file_ex(OSSL_LIB_CTX_get0_global_default(),
   70|      1|        filename, appname, flags);
   71|       |#else
   72|       |    ret = 1;
   73|       |#endif
   74|      1|    openssl_configured = 1;
   75|      1|    return ret;
   76|      1|}

ossl_lib_ctx_write_lock:
   59|      1|{
   60|      1|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 1]
  ------------------
   61|      0|        return 0;
   62|      1|    return CRYPTO_THREAD_write_lock(ctx->lock);
   63|      1|}
ossl_lib_ctx_read_lock:
   66|    166|{
   67|    166|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (67:9): [True: 0, False: 166]
  ------------------
   68|      0|        return 0;
   69|    166|    return CRYPTO_THREAD_read_lock(ctx->lock);
   70|    166|}
ossl_lib_ctx_unlock:
   73|    167|{
   74|    167|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 167]
  ------------------
   75|      0|        return 0;
   76|    167|    return CRYPTO_THREAD_unlock(ctx->lock);
   77|    167|}
OSSL_LIB_CTX_get0_global_default:
  550|      1|{
  551|      1|    if (!RUN_ONCE(&default_context_thread_key_init, default_context_do_thread_key_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (551:9): [True: 0, False: 1]
  ------------------
  552|      0|        return NULL;
  553|       |
  554|      1|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (554:9): [True: 0, False: 1]
  ------------------
  555|      0|        return NULL;
  556|       |
  557|      1|    return &default_context_int;
  558|      1|}
ossl_lib_ctx_get_concrete:
  584|  1.23k|{
  585|  1.23k|#ifndef FIPS_MODULE
  586|  1.23k|    if (ctx == NULL)
  ------------------
  |  Branch (586:9): [True: 103, False: 1.13k]
  ------------------
  587|    103|        return get_default_context();
  588|  1.13k|#endif
  589|  1.13k|    return ctx;
  590|  1.23k|}
ossl_lib_ctx_is_default:
  593|     10|{
  594|     10|#ifndef FIPS_MODULE
  595|     10|    if (ctx == NULL || ctx == get_default_context())
  ------------------
  |  Branch (595:9): [True: 3, False: 7]
  |  Branch (595:24): [True: 7, False: 0]
  ------------------
  596|     10|        return 1;
  597|      0|#endif
  598|      0|    return 0;
  599|     10|}
ossl_lib_ctx_get_data:
  620|    892|{
  621|    892|    ctx = ossl_lib_ctx_get_concrete(ctx);
  622|    892|    if (ctx == NULL)
  ------------------
  |  Branch (622:9): [True: 0, False: 892]
  ------------------
  623|      0|        return NULL;
  624|       |
  625|    892|    switch (index) {
  626|     14|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |   99|     14|#define OSSL_LIB_CTX_PROPERTY_STRING_INDEX 3
  ------------------
  |  Branch (626:5): [True: 14, False: 878]
  ------------------
  627|     14|        return ctx->property_string_data;
  628|    189|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   96|    189|#define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX 0
  ------------------
  |  Branch (628:5): [True: 189, False: 703]
  ------------------
  629|    189|        return ctx->evp_method_store;
  630|      5|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   97|      5|#define OSSL_LIB_CTX_PROVIDER_STORE_INDEX 1
  ------------------
  |  Branch (630:5): [True: 5, False: 887]
  ------------------
  631|      5|        return ctx->provider_store;
  632|    503|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  100|    503|#define OSSL_LIB_CTX_NAMEMAP_INDEX 4
  ------------------
  |  Branch (632:5): [True: 503, False: 389]
  ------------------
  633|    503|        return ctx->namemap;
  634|    167|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |   98|    167|#define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX 2
  ------------------
  |  Branch (634:5): [True: 167, False: 725]
  ------------------
  635|    167|        return ctx->property_defns;
  636|      5|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  112|      5|#define OSSL_LIB_CTX_GLOBAL_PROPERTIES 14
  ------------------
  |  Branch (636:5): [True: 5, False: 887]
  ------------------
  637|      5|        return ctx->global_properties;
  638|      8|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  101|      8|#define OSSL_LIB_CTX_DRBG_INDEX 5
  ------------------
  |  Branch (638:5): [True: 8, False: 884]
  ------------------
  639|      8|        return ctx->drbg;
  640|      0|    case OSSL_LIB_CTX_DRBG_NONCE_INDEX:
  ------------------
  |  |  102|      0|#define OSSL_LIB_CTX_DRBG_NONCE_INDEX 6
  ------------------
  |  Branch (640:5): [True: 0, False: 892]
  ------------------
  641|      0|        return ctx->drbg_nonce;
  642|      0|#ifndef FIPS_MODULE
  643|      0|    case OSSL_LIB_CTX_PROVIDER_CONF_INDEX:
  ------------------
  |  |  114|      0|#define OSSL_LIB_CTX_PROVIDER_CONF_INDEX 16
  ------------------
  |  Branch (643:5): [True: 0, False: 892]
  ------------------
  644|      0|        return ctx->provider_conf;
  645|      0|    case OSSL_LIB_CTX_BIO_CORE_INDEX:
  ------------------
  |  |  115|      0|#define OSSL_LIB_CTX_BIO_CORE_INDEX 17
  ------------------
  |  Branch (645:5): [True: 0, False: 892]
  ------------------
  646|      0|        return ctx->bio_core;
  647|      0|    case OSSL_LIB_CTX_CHILD_PROVIDER_INDEX:
  ------------------
  |  |  116|      0|#define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX 18
  ------------------
  |  Branch (647:5): [True: 0, False: 892]
  ------------------
  648|      0|        return ctx->child_provider;
  649|      0|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  109|      0|#define OSSL_LIB_CTX_DECODER_STORE_INDEX 11
  ------------------
  |  Branch (649:5): [True: 0, False: 892]
  ------------------
  650|      0|        return ctx->decoder_store;
  651|      0|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  118|      0|#define OSSL_LIB_CTX_DECODER_CACHE_INDEX 20
  ------------------
  |  Branch (651:5): [True: 0, False: 892]
  ------------------
  652|      0|        return ctx->decoder_cache;
  653|      0|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  108|      0|#define OSSL_LIB_CTX_ENCODER_STORE_INDEX 10
  ------------------
  |  Branch (653:5): [True: 0, False: 892]
  ------------------
  654|      0|        return ctx->encoder_store;
  655|      0|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  113|      0|#define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX 15
  ------------------
  |  Branch (655:5): [True: 0, False: 892]
  ------------------
  656|      0|        return ctx->store_loader_store;
  657|      0|    case OSSL_LIB_CTX_SELF_TEST_CB_INDEX:
  ------------------
  |  |  110|      0|#define OSSL_LIB_CTX_SELF_TEST_CB_INDEX 12
  ------------------
  |  Branch (657:5): [True: 0, False: 892]
  ------------------
  658|      0|        return ctx->self_test_cb;
  659|      0|    case OSSL_LIB_CTX_INDICATOR_CB_INDEX:
  ------------------
  |  |  120|      0|#define OSSL_LIB_CTX_INDICATOR_CB_INDEX 22
  ------------------
  |  Branch (659:5): [True: 0, False: 892]
  ------------------
  660|      0|        return ctx->indicator_cb;
  661|      0|#endif
  662|      0|#ifndef OPENSSL_NO_THREAD_POOL
  663|      0|    case OSSL_LIB_CTX_THREAD_INDEX:
  ------------------
  |  |  117|      0|#define OSSL_LIB_CTX_THREAD_INDEX 19
  ------------------
  |  Branch (663:5): [True: 0, False: 892]
  ------------------
  664|      0|        return ctx->threads;
  665|      0|#endif
  666|       |
  667|       |#ifdef FIPS_MODULE
  668|       |    case OSSL_LIB_CTX_FIPS_PROV_INDEX:
  669|       |        return ctx->fips_prov;
  670|       |#endif
  671|       |
  672|      1|    case OSSL_LIB_CTX_COMP_METHODS:
  ------------------
  |  |  119|      1|#define OSSL_LIB_CTX_COMP_METHODS 21
  ------------------
  |  Branch (672:5): [True: 1, False: 891]
  ------------------
  673|      1|        return (void *)&ctx->comp_methods;
  674|       |
  675|      0|    case OSSL_LIB_CTX_SSL_CONF_IMODULE:
  ------------------
  |  |  121|      0|#define OSSL_LIB_CTX_SSL_CONF_IMODULE 23
  ------------------
  |  Branch (675:5): [True: 0, False: 892]
  ------------------
  676|      0|        return (void *)ctx->ssl_imod;
  677|       |
  678|      0|    default:
  ------------------
  |  Branch (678:5): [True: 0, False: 892]
  ------------------
  679|       |        return NULL;
  680|    892|    }
  681|    892|}
OSSL_LIB_CTX_get_data:
  684|      1|{
  685|      1|    return ossl_lib_ctx_get_data(ctx, index);
  686|      1|}
ossl_lib_ctx_get_ex_data_global:
  689|      1|{
  690|      1|    ctx = ossl_lib_ctx_get_concrete(ctx);
  691|      1|    if (ctx == NULL)
  ------------------
  |  Branch (691:9): [True: 0, False: 1]
  ------------------
  692|      0|        return NULL;
  693|      1|    return &ctx->global;
  694|      1|}
OSSL_LIB_CTX_get_conf_diagnostics:
  710|      1|{
  711|      1|    libctx = ossl_lib_ctx_get_concrete(libctx);
  712|      1|    if (libctx == NULL)
  ------------------
  |  Branch (712:9): [True: 0, False: 1]
  ------------------
  713|      0|        return 0;
  714|      1|    return libctx->conf_diagnostics;
  715|      1|}
context.c:context_init:
  119|      1|{
  120|      1|    int exdata_done = 0;
  121|       |
  122|      1|    ctx->lock = CRYPTO_THREAD_lock_new();
  123|      1|    if (ctx->lock == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 1]
  ------------------
  124|      0|        goto err;
  125|       |
  126|       |    /* Initialize ex_data. */
  127|      1|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (127:9): [True: 0, False: 1]
  ------------------
  128|      0|        goto err;
  129|      1|    exdata_done = 1;
  130|       |
  131|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  132|      1|    ctx->evp_method_store = ossl_method_store_new(ctx);
  133|      1|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 1]
  ------------------
  134|      0|        goto err;
  135|      1|    OSSL_TRACE1(QUERY, "context_init: allocating store %p\n", ctx->evp_method_store);
  ------------------
  |  |  291|      1|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  136|       |
  137|      1|#ifndef FIPS_MODULE
  138|       |    /* P2. Must be freed before the provider store is freed */
  139|      1|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  140|      1|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|        goto err;
  142|      1|#endif
  143|       |
  144|       |    /* P2. */
  145|      1|    ctx->drbg = ossl_rand_ctx_new(ctx);
  146|      1|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 1]
  ------------------
  147|      0|        goto err;
  148|       |
  149|      1|#ifndef FIPS_MODULE
  150|       |    /*
  151|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  152|       |     * provider store
  153|       |     */
  154|      1|    ctx->decoder_store = ossl_method_store_new(ctx);
  155|      1|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (155:9): [True: 0, False: 1]
  ------------------
  156|      0|        goto err;
  157|      1|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  158|      1|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (158:9): [True: 0, False: 1]
  ------------------
  159|      0|        goto err;
  160|       |
  161|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  162|      1|    ctx->encoder_store = ossl_method_store_new(ctx);
  163|      1|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 1]
  ------------------
  164|      0|        goto err;
  165|       |
  166|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  167|      1|    ctx->store_loader_store = ossl_method_store_new(ctx);
  168|      1|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (168:9): [True: 0, False: 1]
  ------------------
  169|      0|        goto err;
  170|      1|#endif
  171|       |
  172|       |    /* P1. Needs to be freed before the child provider data is freed */
  173|      1|    ctx->provider_store = ossl_provider_store_new(ctx);
  174|      1|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (174:9): [True: 0, False: 1]
  ------------------
  175|      0|        goto err;
  176|       |
  177|       |    /* Default priority. */
  178|      1|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  179|      1|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 1]
  ------------------
  180|      0|        goto err;
  181|       |
  182|      1|    ctx->namemap = ossl_stored_namemap_new(ctx);
  183|      1|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (183:9): [True: 0, False: 1]
  ------------------
  184|      0|        goto err;
  185|       |
  186|      1|    ctx->property_defns = ossl_property_defns_new(ctx);
  187|      1|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (187:9): [True: 0, False: 1]
  ------------------
  188|      0|        goto err;
  189|       |
  190|      1|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  191|      1|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (191:9): [True: 0, False: 1]
  ------------------
  192|      0|        goto err;
  193|       |
  194|      1|#ifndef FIPS_MODULE
  195|      1|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  196|      1|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (196:9): [True: 0, False: 1]
  ------------------
  197|      0|        goto err;
  198|      1|#endif
  199|       |
  200|      1|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  201|      1|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (201:9): [True: 0, False: 1]
  ------------------
  202|      0|        goto err;
  203|       |
  204|      1|#ifndef FIPS_MODULE
  205|      1|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  206|      1|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 1]
  ------------------
  207|      0|        goto err;
  208|      1|    ctx->indicator_cb = ossl_indicator_set_callback_new(ctx);
  209|      1|    if (ctx->indicator_cb == NULL)
  ------------------
  |  Branch (209:9): [True: 0, False: 1]
  ------------------
  210|      0|        goto err;
  211|      1|#endif
  212|       |
  213|       |#ifdef FIPS_MODULE
  214|       |    if (!ossl_thread_event_ctx_new(ctx))
  215|       |        goto err;
  216|       |
  217|       |    ctx->fips_prov = ossl_fips_prov_ossl_ctx_new(ctx);
  218|       |    if (ctx->fips_prov == NULL)
  219|       |        goto err;
  220|       |#endif
  221|       |
  222|      1|#ifndef OPENSSL_NO_THREAD_POOL
  223|      1|    ctx->threads = ossl_threads_ctx_new(ctx);
  224|      1|    if (ctx->threads == NULL)
  ------------------
  |  Branch (224:9): [True: 0, False: 1]
  ------------------
  225|      0|        goto err;
  226|      1|#endif
  227|       |
  228|       |    /* Low priority. */
  229|      1|#ifndef FIPS_MODULE
  230|      1|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  231|      1|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 1]
  ------------------
  232|      0|        goto err;
  233|      1|#endif
  234|       |
  235|       |    /* Everything depends on properties, so we also pre-initialise that */
  236|      1|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (236:9): [True: 0, False: 1]
  ------------------
  237|      0|        goto err;
  238|       |
  239|      1|#ifndef FIPS_MODULE
  240|      1|    ctx->comp_methods = ossl_load_builtin_compressions();
  241|      1|#endif
  242|       |
  243|      1|    return 1;
  244|       |
  245|      0|err:
  246|      0|    context_deinit_objs(ctx);
  247|       |
  248|      0|    if (exdata_done)
  ------------------
  |  Branch (248:9): [True: 0, False: 0]
  ------------------
  249|      0|        ossl_crypto_cleanup_all_ex_data_int(ctx);
  250|       |
  251|      0|    CRYPTO_THREAD_lock_free(ctx->lock);
  252|      0|    memset(ctx, '\0', sizeof(*ctx));
  253|      0|    return 0;
  254|      1|}
context.c:default_context_do_thread_key_init:
  414|      1|{
  415|      1|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (415:9): [True: 0, False: 1]
  ------------------
  416|      0|        return 0;
  417|      1|    return 1;
  418|      1|}
context.c:default_context_do_init:
  421|      1|{
  422|      1|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (422:9): [True: 0, False: 1]
  ------------------
  423|      0|        return 0;
  424|       |
  425|      1|    default_context_inited = 1;
  426|      1|    return 1;
  427|      1|}
context.c:get_default_context:
  458|    110|{
  459|    110|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  460|       |
  461|    110|    if (current_defctx == NULL && default_context_inited)
  ------------------
  |  Branch (461:9): [True: 110, False: 0]
  |  Branch (461:35): [True: 110, False: 0]
  ------------------
  462|    110|        current_defctx = &default_context_int;
  463|    110|    return current_defctx;
  464|    110|}
context.c:get_thread_default_context:
  439|    110|{
  440|    110|    if (!RUN_ONCE(&default_context_thread_key_init, default_context_do_thread_key_init))
  ------------------
  |  |  130|    110|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 110, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (440:9): [True: 0, False: 110]
  ------------------
  441|      0|        return NULL;
  442|       |
  443|    110|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|    110|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 110, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (443:9): [True: 0, False: 110]
  ------------------
  444|      0|        return NULL;
  445|       |
  446|    110|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  447|    110|}

ossl_algorithm_do_all:
  149|      5|{
  150|      5|    struct algorithm_data_st cbdata = {
  151|      5|        0,
  152|      5|    };
  153|       |
  154|      5|    cbdata.libctx = libctx;
  155|      5|    cbdata.operation_id = operation_id;
  156|      5|    cbdata.pre = pre;
  157|      5|    cbdata.reserve_store = reserve_store;
  158|      5|    cbdata.fn = fn;
  159|      5|    cbdata.unreserve_store = unreserve_store;
  160|      5|    cbdata.post = post;
  161|      5|    cbdata.data = data;
  162|       |
  163|      5|    if (provider == NULL) {
  ------------------
  |  Branch (163:9): [True: 5, False: 0]
  ------------------
  164|      5|        ossl_provider_doall_activated(libctx, algorithm_do_this, &cbdata);
  165|      5|    } else {
  166|      0|        OSSL_LIB_CTX *libctx2 = ossl_provider_libctx(provider);
  167|       |
  168|       |        /*
  169|       |         * If a provider is given, its library context MUST match the library
  170|       |         * context we're passed.  If this turns out not to be true, there is
  171|       |         * a programming error in the functions up the call stack.
  172|       |         */
  173|      0|        if (!ossl_assert(ossl_lib_ctx_get_concrete(libctx)
  ------------------
  |  |   45|      0|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (173:13): [True: 0, False: 0]
  ------------------
  174|      0|                == ossl_lib_ctx_get_concrete(libctx2)))
  175|      0|            return;
  176|       |
  177|      0|        cbdata.libctx = libctx2;
  178|      0|        algorithm_do_this(provider, &cbdata);
  179|      0|    }
  180|      5|}
ossl_algorithm_get1_first_name:
  183|    166|{
  184|    166|    const char *first_name_end = NULL;
  185|    166|    size_t first_name_len = 0;
  186|    166|    char *ret;
  187|       |
  188|    166|    if (algo->algorithm_names == NULL)
  ------------------
  |  Branch (188:9): [True: 0, False: 166]
  ------------------
  189|      0|        return NULL;
  190|       |
  191|    166|    first_name_end = strchr(algo->algorithm_names, ':');
  192|    166|    if (first_name_end == NULL)
  ------------------
  |  Branch (192:9): [True: 62, False: 104]
  ------------------
  193|     62|        first_name_len = strlen(algo->algorithm_names);
  194|    104|    else
  195|    104|        first_name_len = first_name_end - algo->algorithm_names;
  196|       |
  197|    166|    ret = OPENSSL_strndup(algo->algorithm_names, first_name_len);
  ------------------
  |  |  142|    166|    CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  198|    166|    return ret;
  199|    166|}
core_algorithm.c:algorithm_do_this:
  103|      5|{
  104|      5|    struct algorithm_data_st *data = cbdata;
  105|      5|    int first_operation = 1;
  106|      5|    int last_operation = OSSL_OP__HIGHEST;
  ------------------
  |  |  299|      5|#define OSSL_OP__HIGHEST 22
  ------------------
  107|      5|    int cur_operation;
  108|      5|    int ok = 1;
  109|       |
  110|      5|    if (data->operation_id != 0)
  ------------------
  |  Branch (110:9): [True: 5, False: 0]
  ------------------
  111|      5|        first_operation = last_operation = data->operation_id;
  112|       |
  113|      5|    for (cur_operation = first_operation;
  114|     10|        cur_operation <= last_operation;
  ------------------
  |  Branch (114:9): [True: 5, False: 5]
  ------------------
  115|      5|        cur_operation++) {
  116|      5|        int no_store = 0; /* Assume caching is ok */
  117|      5|        const OSSL_ALGORITHM *map = NULL;
  118|      5|        int ret = 0;
  119|       |
  120|      5|        map = ossl_provider_query_operation(provider, cur_operation,
  121|      5|            &no_store);
  122|      5|        ret = algorithm_do_map(provider, map, cur_operation, no_store, data);
  123|      5|        ossl_provider_unquery_operation(provider, cur_operation, map);
  124|       |
  125|      5|        if (ret < 0)
  ------------------
  |  Branch (125:13): [True: 0, False: 5]
  ------------------
  126|       |            /* Hard error, bail out immediately! */
  127|      0|            return 0;
  128|       |
  129|       |        /* If post-condition not fulfilled, set general failure */
  130|      5|        if (!ret)
  ------------------
  |  Branch (130:13): [True: 0, False: 5]
  ------------------
  131|      0|            ok = 0;
  132|      5|    }
  133|       |
  134|      5|    return ok;
  135|      5|}
core_algorithm.c:algorithm_do_map:
   44|      5|{
   45|      5|    struct algorithm_data_st *data = cbdata;
   46|      5|    int ret = 0;
   47|       |
   48|      5|    if (!data->reserve_store(no_store, data->data))
  ------------------
  |  Branch (48:9): [True: 0, False: 5]
  ------------------
   49|       |        /* Error, bail out! */
   50|      0|        return -1;
   51|       |
   52|       |    /* Do we fulfill pre-conditions? */
   53|      5|    if (data->pre == NULL) {
  ------------------
  |  Branch (53:9): [True: 0, False: 5]
  ------------------
   54|       |        /* If there is no pre-condition function, assume "yes" */
   55|      0|        ret = 1;
   56|      5|    } else if (!data->pre(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (56:16): [True: 0, False: 5]
  ------------------
   57|      5|                   &ret)) {
   58|       |        /* Error, bail out! */
   59|      0|        ret = -1;
   60|      0|        goto end;
   61|      0|    }
   62|       |
   63|       |    /*
   64|       |     * If pre-condition not fulfilled don't add this set of implementations,
   65|       |     * but do continue with the next.  This simply means that another thread
   66|       |     * got to it first.
   67|       |     */
   68|      5|    if (ret == 0) {
  ------------------
  |  Branch (68:9): [True: 2, False: 3]
  ------------------
   69|      2|        ret = 1;
   70|      2|        goto end;
   71|      2|    }
   72|       |
   73|      3|    if (map != NULL) {
  ------------------
  |  Branch (73:9): [True: 3, False: 0]
  ------------------
   74|      3|        const OSSL_ALGORITHM *thismap;
   75|       |
   76|    169|        for (thismap = map; thismap->algorithm_names != NULL; thismap++)
  ------------------
  |  Branch (76:29): [True: 166, False: 3]
  ------------------
   77|    166|            data->fn(provider, thismap, no_store, data->data);
   78|      3|    }
   79|       |
   80|       |    /* Do we fulfill post-conditions? */
   81|      3|    if (data->post == NULL) {
  ------------------
  |  Branch (81:9): [True: 0, False: 3]
  ------------------
   82|       |        /* If there is no post-condition function, assume "yes" */
   83|      0|        ret = 1;
   84|      3|    } else if (!data->post(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (84:16): [True: 0, False: 3]
  ------------------
   85|      3|                   &ret)) {
   86|       |        /* Error, bail out! */
   87|      0|        ret = -1;
   88|      0|    }
   89|       |
   90|      5|end:
   91|      5|    data->unreserve_store(data->data);
   92|       |
   93|      5|    return ret;
   94|      3|}

ossl_method_construct:
  137|      5|{
  138|      5|    void *method = NULL;
  139|      5|    OSSL_PROVIDER *provider = provider_rw != NULL ? *provider_rw : NULL;
  ------------------
  |  Branch (139:31): [True: 5, False: 0]
  ------------------
  140|      5|    struct construct_data_st cbdata;
  141|       |
  142|       |    /*
  143|       |     * We might be tempted to try to look into the method store without
  144|       |     * constructing to see if we can find our method there already.
  145|       |     * Unfortunately that does not work well if the query contains
  146|       |     * optional properties as newly loaded providers can match them better.
  147|       |     * We trust that ossl_method_construct_precondition() and
  148|       |     * ossl_method_construct_postcondition() make sure that the
  149|       |     * ossl_algorithm_do_all() does very little when methods from
  150|       |     * a provider have already been constructed.
  151|       |     */
  152|       |
  153|      5|    cbdata.store = NULL;
  154|      5|    cbdata.force_store = force_store;
  155|      5|    cbdata.mcm = mcm;
  156|      5|    cbdata.mcm_data = mcm_data;
  157|      5|    ossl_algorithm_do_all(libctx, operation_id, provider,
  158|      5|        ossl_method_construct_precondition,
  159|      5|        ossl_method_construct_reserve_store,
  160|      5|        ossl_method_construct_this,
  161|      5|        ossl_method_construct_unreserve_store,
  162|      5|        ossl_method_construct_postcondition,
  163|      5|        &cbdata);
  164|       |
  165|       |    /* If there is a temporary store, try there first */
  166|      5|    if (cbdata.store != NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 5]
  ------------------
  167|      0|        method = mcm->get(cbdata.store, (const OSSL_PROVIDER **)provider_rw,
  168|      0|            mcm_data);
  169|       |
  170|       |    /* If no method was found yet, try the global store */
  171|      5|    if (method == NULL)
  ------------------
  |  Branch (171:9): [True: 5, False: 0]
  ------------------
  172|      5|        method = mcm->get(NULL, (const OSSL_PROVIDER **)provider_rw, mcm_data);
  173|       |
  174|      5|    return method;
  175|      5|}
core_fetch.c:ossl_method_construct_precondition:
   63|      5|{
   64|      5|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   45|      5|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      5|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (64:9): [True: 0, False: 5]
  ------------------
   65|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|       |
   69|       |    /* Assume that no bits are set */
   70|      5|    *result = 0;
   71|       |
   72|       |    /* No flag bits for temporary stores */
   73|      5|    if (!is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (73:9): [True: 5, False: 0]
  ------------------
   74|      5|        && !ossl_provider_test_operation_bit(provider, operation_id, result))
  ------------------
  |  Branch (74:12): [True: 0, False: 5]
  ------------------
   75|      0|        return 0;
   76|       |
   77|       |    /*
   78|       |     * The result we get tells if methods have already been constructed.
   79|       |     * However, we want to tell whether construction should happen (true)
   80|       |     * or not (false), which is the opposite of what we got.
   81|       |     */
   82|      5|    *result = !*result;
   83|       |
   84|      5|    return 1;
   85|      5|}
core_fetch.c:is_temporary_method_store:
   29|     13|{
   30|     13|    struct construct_data_st *data = cbdata;
   31|       |
   32|     13|    return no_store && !data->force_store;
  ------------------
  |  Branch (32:12): [True: 0, False: 13]
  |  Branch (32:24): [True: 0, False: 0]
  ------------------
   33|     13|}
core_fetch.c:ossl_method_construct_reserve_store:
   36|      5|{
   37|      5|    struct construct_data_st *data = cbdata;
   38|       |
   39|      5|    if (is_temporary_method_store(no_store, data) && data->store == NULL) {
  ------------------
  |  Branch (39:9): [True: 0, False: 5]
  |  Branch (39:54): [True: 0, False: 0]
  ------------------
   40|       |        /*
   41|       |         * If we have been told not to store the method "permanently", we
   42|       |         * ask for a temporary store, and store the method there.
   43|       |         * The owner of |data->mcm| is completely responsible for managing
   44|       |         * that temporary store.
   45|       |         */
   46|      0|        if ((data->store = data->mcm->get_tmp_store(data->mcm_data)) == NULL)
  ------------------
  |  Branch (46:13): [True: 0, False: 0]
  ------------------
   47|      0|            return 0;
   48|      0|    }
   49|       |
   50|      5|    return data->mcm->lock_store(data->store, data->mcm_data);
   51|      5|}
core_fetch.c:ossl_method_construct_this:
  106|    166|{
  107|    166|    struct construct_data_st *data = cbdata;
  108|    166|    void *method = NULL;
  109|       |
  110|    166|    if ((method = data->mcm->construct(algo, provider, data->mcm_data, no_store))
  ------------------
  |  Branch (110:9): [True: 0, False: 166]
  ------------------
  111|    166|        == NULL)
  112|      0|        return;
  113|       |
  114|    166|    OSSL_TRACE2(QUERY,
  ------------------
  |  |  293|    166|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    166|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  115|    166|        "ossl_method_construct_this: putting an algo to the store %p with no_store %d\n",
  116|    166|        (void *)data->store, no_store);
  117|       |    /*
  118|       |     * Note regarding putting the method in stores:
  119|       |     *
  120|       |     * we don't need to care if it actually got in or not here.
  121|       |     * If it didn't get in, it will simply not be available when
  122|       |     * ossl_method_construct() tries to get it from the store.
  123|       |     *
  124|       |     * It is *expected* that the put function increments the refcnt
  125|       |     * of the passed method.
  126|       |     */
  127|    166|    data->mcm->put(no_store ? data->store : NULL, method, provider, algo->algorithm_names,
  ------------------
  |  Branch (127:20): [True: 0, False: 166]
  ------------------
  128|    166|        algo->property_definition, data->mcm_data);
  129|       |
  130|       |    /* refcnt-- because we're dropping the reference */
  131|    166|    data->mcm->destruct(method, data->mcm_data);
  132|    166|}
core_fetch.c:ossl_method_construct_unreserve_store:
   54|      5|{
   55|      5|    struct construct_data_st *data = cbdata;
   56|       |
   57|      5|    return data->mcm->unlock_store(data->store, data->mcm_data);
   58|      5|}
core_fetch.c:ossl_method_construct_postcondition:
   90|      3|{
   91|      3|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   45|      3|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      3|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (91:9): [True: 0, False: 3]
  ------------------
   92|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   93|      0|        return 0;
   94|      0|    }
   95|       |
   96|      3|    *result = 1;
   97|       |
   98|       |    /* No flag bits for temporary stores */
   99|      3|    return is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (99:12): [True: 0, False: 3]
  ------------------
  100|      3|        || ossl_provider_set_operation_bit(provider, operation_id);
  ------------------
  |  Branch (100:12): [True: 3, False: 0]
  ------------------
  101|      3|}

ossl_stored_namemap_new:
   58|      1|{
   59|      1|    OSSL_NAMEMAP *namemap = ossl_namemap_new(libctx);
   60|       |
   61|      1|    if (namemap != NULL)
  ------------------
  |  Branch (61:9): [True: 1, False: 0]
  ------------------
   62|      1|        namemap->stored = 1;
   63|       |
   64|      1|    return namemap;
   65|      1|}
ossl_namemap_empty:
   84|    503|{
   85|       |#ifdef TSAN_REQUIRES_LOCKING
   86|       |    /* No TSAN support */
   87|       |    int rv;
   88|       |
   89|       |    if (namemap == NULL)
   90|       |        return 1;
   91|       |
   92|       |    if (!CRYPTO_THREAD_read_lock(namemap->lock))
   93|       |        return -1;
   94|       |    rv = namemap->max_number == 0;
   95|       |    CRYPTO_THREAD_unlock(namemap->lock);
   96|       |    return rv;
   97|       |#else
   98|       |    /* Have TSAN support */
   99|    503|    return namemap == NULL || tsan_load(&namemap->max_number) == 0;
  ------------------
  |  |   61|    503|#define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (99:12): [True: 0, False: 503]
  |  Branch (99:31): [True: 1, False: 502]
  ------------------
  100|    503|#endif
  101|    503|}
ossl_namemap_doall_names:
  111|    161|{
  112|    161|    int i;
  113|    161|    NAMES *names;
  114|       |
  115|    161|    if (namemap == NULL || number <= 0)
  ------------------
  |  Branch (115:9): [True: 0, False: 161]
  |  Branch (115:28): [True: 0, False: 161]
  ------------------
  116|      0|        return 0;
  117|       |
  118|       |    /*
  119|       |     * We duplicate the NAMES stack under a read lock. Subsequently we call
  120|       |     * the user function, so that we're not holding the read lock when in user
  121|       |     * code. This could lead to deadlocks.
  122|       |     */
  123|    161|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (123:9): [True: 0, False: 161]
  ------------------
  124|      0|        return 0;
  125|       |
  126|    161|    names = sk_NAMES_value(namemap->numnames, number - 1);
  127|    161|    if (names != NULL)
  ------------------
  |  Branch (127:9): [True: 161, False: 0]
  ------------------
  128|    161|        names = sk_OPENSSL_STRING_dup(names);
  ------------------
  |  |  325|    161|    ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_set_thunks( \
  |  |  326|    161|        OPENSSL_sk_set_copy_thunks( \
  |  |  327|    161|            OPENSSL_sk_set_cmp_thunks( \
  |  |  328|    161|                OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)), \
  |  |  329|    161|                sk_OPENSSL_STRING_cmpfunc_thunk), \
  |  |  330|    161|            sk_OPENSSL_STRING_copyfunc_thunk), \
  |  |  331|    161|        sk_OPENSSL_STRING_freefunc_thunk))
  ------------------
  129|       |
  130|    161|    CRYPTO_THREAD_unlock(namemap->lock);
  131|       |
  132|    161|    if (names == NULL)
  ------------------
  |  Branch (132:9): [True: 0, False: 161]
  ------------------
  133|      0|        return 0;
  134|       |
  135|    483|    for (i = 0; i < sk_OPENSSL_STRING_num(names); i++)
  ------------------
  |  |  281|    483|#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
  ------------------
  |  Branch (135:17): [True: 322, False: 161]
  ------------------
  136|    322|        fn(sk_OPENSSL_STRING_value(names, i), data);
  ------------------
  |  |  282|    322|#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
  ------------------
  137|       |
  138|    161|    sk_OPENSSL_STRING_free(names);
  ------------------
  |  |  308|    161|#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
  ------------------
  139|    161|    return i > 0;
  140|    161|}
ossl_namemap_name2num:
  143|  1.31k|{
  144|  1.31k|    if (name == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 1.31k]
  ------------------
  145|      0|        return 0;
  146|  1.31k|    return ossl_namemap_name2num_n(namemap, name, strlen(name));
  147|  1.31k|}
ossl_namemap_name2num_n:
  151|  1.48k|{
  152|  1.48k|    int number = 0;
  153|  1.48k|    HT_VALUE *val;
  154|  1.48k|    NAMENUM_KEY key;
  155|       |
  156|  1.48k|#ifndef FIPS_MODULE
  157|  1.48k|    if (namemap == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 1.48k]
  ------------------
  158|      0|        namemap = ossl_namemap_stored(NULL);
  159|  1.48k|#endif
  160|       |
  161|  1.48k|    if (namemap == NULL)
  ------------------
  |  Branch (161:9): [True: 0, False: 1.48k]
  ------------------
  162|      0|        return 0;
  163|       |
  164|  1.48k|    if (name_len > NAMEMAP_NAME_LEN)
  ------------------
  |  |   19|  1.48k|#define NAMEMAP_NAME_LEN 64
  ------------------
  |  Branch (164:9): [True: 0, False: 1.48k]
  ------------------
  165|      0|        name_len = NAMEMAP_NAME_LEN;
  ------------------
  |  |   19|      0|#define NAMEMAP_NAME_LEN 64
  ------------------
  166|       |
  167|  1.48k|    HT_INIT_RAW_KEY(&key);
  ------------------
  |  |  132|  1.48k|    do {                               \
  |  |  133|  1.48k|        HT_INIT_KEY((key));            \
  |  |  ------------------
  |  |  |  |  114|  1.48k|    do {                                                                                           \
  |  |  |  |  115|  1.48k|        memset((key), 0, sizeof(*(key)));                                                          \
  |  |  |  |  116|  1.48k|        (key)->key_header.keysize = (key)->key_header.bufsize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  |  |  117|  1.48k|        (key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY));                            \
  |  |  |  |  118|  1.48k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (118:14): [Folded, False: 1.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  134|  1.48k|        (key)->key_header.keysize = 0; \
  |  |  135|  1.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 1.48k]
  |  |  ------------------
  ------------------
  168|  1.48k|    HT_COPY_RAW_KEY_CASE(TO_HT_KEY(&key), name, name_len);
  ------------------
  |  |  166|  1.48k|    do {                                                                               \
  |  |  167|  1.48k|        size_t tmplen = (size_t)(len);                                                 \
  |  |  168|  1.48k|        if (tmplen > (key)->bufsize - (key)->keysize)                                  \
  |  |  ------------------
  |  |  |  Branch (168:13): [True: 0, False: 1.48k]
  |  |  ------------------
  |  |  169|  1.48k|            tmplen = (key)->bufsize - (key)->keysize;                                  \
  |  |  170|  1.48k|        ossl_ht_strcase((key), (char *)&((key)->keybuf[(key)->keysize]), buf, tmplen); \
  |  |  171|  1.48k|        (key)->keysize += tmplen;                                                      \
  |  |  172|  1.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (172:14): [Folded, False: 1.48k]
  |  |  ------------------
  ------------------
  169|       |
  170|  1.48k|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  258|  1.48k|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  171|       |
  172|  1.48k|    if (val != NULL)
  ------------------
  |  Branch (172:9): [True: 936, False: 547]
  ------------------
  173|       |        /* We store a (small) int directly instead of a pointer to it. */
  174|    936|        number = (int)(intptr_t)val->value;
  175|       |
  176|  1.48k|    return number;
  177|  1.48k|}
ossl_namemap_add_name:
  277|    649|{
  278|    649|    int tmp_number;
  279|       |
  280|    649|#ifndef FIPS_MODULE
  281|    649|    if (namemap == NULL)
  ------------------
  |  Branch (281:9): [True: 0, False: 649]
  ------------------
  282|      0|        namemap = ossl_namemap_stored(NULL);
  283|    649|#endif
  284|       |
  285|    649|    if (name == NULL || *name == 0 || namemap == NULL)
  ------------------
  |  Branch (285:9): [True: 0, False: 649]
  |  Branch (285:25): [True: 0, False: 649]
  |  Branch (285:39): [True: 0, False: 649]
  ------------------
  286|      0|        return 0;
  287|       |
  288|    649|    if (!CRYPTO_THREAD_write_lock(namemap->lock))
  ------------------
  |  Branch (288:9): [True: 0, False: 649]
  ------------------
  289|      0|        return 0;
  290|    649|    tmp_number = namemap_add_name(namemap, number, name);
  291|    649|    CRYPTO_THREAD_unlock(namemap->lock);
  292|    649|    return tmp_number;
  293|    649|}
ossl_namemap_add_names:
  297|    166|{
  298|    166|    char *tmp, *p, *q, *endp;
  299|       |
  300|       |    /* Check that we have a namemap */
  301|    166|    if (!ossl_assert(namemap != NULL)) {
  ------------------
  |  |   45|    166|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|    166|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (301:9): [True: 0, False: 166]
  ------------------
  302|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  303|      0|        return 0;
  304|      0|    }
  305|       |
  306|    166|    if ((tmp = OPENSSL_strdup(names)) == NULL)
  ------------------
  |  |  140|    166|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (306:9): [True: 0, False: 166]
  ------------------
  307|      0|        return 0;
  308|       |
  309|    166|    if (!CRYPTO_THREAD_write_lock(namemap->lock)) {
  ------------------
  |  Branch (309:9): [True: 0, False: 166]
  ------------------
  310|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|      0|        return 0;
  312|      0|    }
  313|       |    /*
  314|       |     * Check that no name is an empty string, and that all names have at
  315|       |     * most one numeric identity together.
  316|       |     */
  317|    494|    for (p = tmp; *p != '\0'; p = q) {
  ------------------
  |  Branch (317:19): [True: 328, False: 166]
  ------------------
  318|    328|        int this_number;
  319|    328|        size_t l;
  320|       |
  321|    328|        if ((q = strchr(p, separator)) == NULL) {
  ------------------
  |  Branch (321:13): [True: 166, False: 162]
  ------------------
  322|    166|            l = strlen(p); /* offset to \0 */
  323|    166|            q = p + l;
  324|    166|        } else {
  325|    162|            l = q - p; /* offset to the next separator */
  326|    162|            *q++ = '\0';
  327|    162|        }
  328|       |
  329|    328|        if (*p == '\0') {
  ------------------
  |  Branch (329:13): [True: 0, False: 328]
  ------------------
  330|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_BAD_ALGORITHM_NAME);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  331|      0|            number = 0;
  332|      0|            goto end;
  333|      0|        }
  334|       |
  335|    328|        this_number = ossl_namemap_name2num(namemap, p);
  336|       |
  337|    328|        if (number == 0) {
  ------------------
  |  Branch (337:13): [True: 210, False: 118]
  ------------------
  338|    210|            number = this_number;
  339|    210|        } else if (this_number != 0 && this_number != number) {
  ------------------
  |  Branch (339:20): [True: 94, False: 24]
  |  Branch (339:40): [True: 0, False: 94]
  ------------------
  340|      0|            ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |   68|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |   23|      0|#define CRYPTO_R_CONFLICTING_NAMES 118
  ------------------
  341|      0|                "\"%s\" has an existing different identity %d (from \"%s\")",
  342|      0|                p, this_number, names);
  343|      0|            number = 0;
  344|      0|            goto end;
  345|      0|        }
  346|    328|    }
  347|    166|    endp = p;
  348|       |
  349|       |    /* Now that we have checked, register all names */
  350|    494|    for (p = tmp; p < endp; p = q) {
  ------------------
  |  Branch (350:19): [True: 328, False: 166]
  ------------------
  351|    328|        int this_number;
  352|       |
  353|    328|        q = p + strlen(p) + 1;
  354|       |
  355|    328|        this_number = namemap_add_name(namemap, number, p);
  356|    328|        if (number == 0) {
  ------------------
  |  Branch (356:13): [True: 75, False: 253]
  ------------------
  357|     75|            number = this_number;
  358|    253|        } else if (this_number != number) {
  ------------------
  |  Branch (358:20): [True: 0, False: 253]
  ------------------
  359|      0|            ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |   68|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  308|      0|#define ERR_R_INTERNAL_ERROR (259 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  304|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  211|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  211|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|      0|                "Got number %d when expecting %d",
  361|      0|                this_number, number);
  362|      0|            number = 0;
  363|      0|            goto end;
  364|      0|        }
  365|    328|    }
  366|       |
  367|    166|end:
  368|    166|    CRYPTO_THREAD_unlock(namemap->lock);
  369|    166|    OPENSSL_free(tmp);
  ------------------
  |  |  136|    166|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|    166|    return number;
  371|    166|}
ossl_namemap_stored:
  471|    503|{
  472|    503|#ifndef FIPS_MODULE
  473|    503|    int nms;
  474|    503|#endif
  475|    503|    OSSL_NAMEMAP *namemap = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_NAMEMAP_INDEX);
  ------------------
  |  |  100|    503|#define OSSL_LIB_CTX_NAMEMAP_INDEX 4
  ------------------
  476|       |
  477|    503|    if (namemap == NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 503]
  ------------------
  478|      0|        return NULL;
  479|       |
  480|    503|#ifndef FIPS_MODULE
  481|    503|    nms = ossl_namemap_empty(namemap);
  482|    503|    if (nms < 0) {
  ------------------
  |  Branch (482:9): [True: 0, False: 503]
  ------------------
  483|       |        /*
  484|       |         * Could not get lock to make the count, so maybe internal objects
  485|       |         * weren't added. This seems safest.
  486|       |         */
  487|      0|        return NULL;
  488|      0|    }
  489|    503|    if (nms == 1) {
  ------------------
  |  Branch (489:9): [True: 1, False: 502]
  ------------------
  490|      1|        int num;
  491|       |
  492|       |        /* Before pilfering, we make sure the legacy database is populated */
  493|      1|        OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  549|      1|#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
  ------------------
  494|      1|                | OPENSSL_INIT_ADD_ALL_DIGESTS,
  ------------------
  |  |  550|      1|#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
  ------------------
  495|      1|            NULL);
  496|       |
  497|      1|        OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  ------------------
  498|      1|            get_legacy_cipher_names, namemap);
  499|      1|        OBJ_NAME_do_all(OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
  500|      1|            get_legacy_md_names, namemap);
  501|       |
  502|       |        /*
  503|       |         * Some old providers (<= 3.5) may not have the rsassaPSS alias which
  504|       |         * may cause problems in some cases. We add it manually here
  505|       |         */
  506|      1|        num = ossl_namemap_add_name(namemap, 0, "RSA-PSS");
  507|      1|        if (num != 0) {
  ------------------
  |  Branch (507:13): [True: 1, False: 0]
  ------------------
  508|      1|            ossl_namemap_add_name(namemap, num, "rsassaPss");
  509|       |            /* Add other RSA-PSS aliases as well */
  510|      1|            ossl_namemap_add_name(namemap, num, "RSASSA-PSS");
  511|      1|            ossl_namemap_add_name(namemap, num, "1.2.840.113549.1.1.10");
  512|      1|        }
  513|      1|#ifndef OPENSSL_NO_DEPRECATED_3_6
  514|      1|        {
  515|      1|            int i, end;
  516|       |
  517|       |            /* We also pilfer data from the legacy EVP_PKEY_ASN1_METHODs */
  518|     16|            for (i = 0, end = evp_pkey_asn1_get_count(); i < end; i++)
  ------------------
  |  Branch (518:58): [True: 15, False: 1]
  ------------------
  519|     15|                get_legacy_pkey_meth_names(evp_pkey_asn1_get0(i), namemap);
  520|      1|        }
  521|      1|#endif
  522|      1|    }
  523|    503|#endif
  524|       |
  525|    503|    return namemap;
  526|    503|}
ossl_namemap_new:
  529|      1|{
  530|      1|    OSSL_NAMEMAP *namemap;
  531|      1|    HT_CONFIG htconf = { NULL, NULL, NULL, NAMEMAP_HT_BUCKETS, 1, 1, 0 };
  ------------------
  |  |   17|      1|#define NAMEMAP_HT_BUCKETS 512
  ------------------
  532|       |
  533|      1|    htconf.ctx = libctx;
  534|       |
  535|      1|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) == NULL)
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (535:9): [True: 0, False: 1]
  ------------------
  536|      0|        goto err;
  537|       |
  538|      1|    if ((namemap->lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (538:9): [True: 0, False: 1]
  ------------------
  539|      0|        goto err;
  540|       |
  541|      1|    if ((namemap->namenum_ht = ossl_ht_new(&htconf)) == NULL)
  ------------------
  |  Branch (541:9): [True: 0, False: 1]
  ------------------
  542|      0|        goto err;
  543|       |
  544|      1|    if ((namemap->numnames = sk_NAMES_new_null()) == NULL)
  ------------------
  |  Branch (544:9): [True: 0, False: 1]
  ------------------
  545|      0|        goto err;
  546|       |
  547|      1|    return namemap;
  548|       |
  549|      0|err:
  550|      0|    ossl_namemap_free(namemap);
  551|       |    return NULL;
  552|      1|}
core_namemap.c:namemap_add_name:
  244|    977|{
  245|    977|    int ret;
  246|    977|    HT_VALUE val = { 0 };
  247|    977|    NAMENUM_KEY key;
  248|       |
  249|       |    /* If it already exists, we don't add it */
  250|    977|    if ((ret = ossl_namemap_name2num(namemap, name)) != 0)
  ------------------
  |  Branch (250:9): [True: 575, False: 402]
  ------------------
  251|    575|        return ret;
  252|       |
  253|    402|    if ((number = numname_insert(namemap, number, name)) == 0)
  ------------------
  |  Branch (253:9): [True: 0, False: 402]
  ------------------
  254|      0|        return 0;
  255|       |
  256|       |    /* Using tsan_store alone here is safe since we're under lock */
  257|    402|    tsan_store(&namemap->max_number, number);
  ------------------
  |  |   62|    402|#define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  258|       |
  259|    402|    HT_INIT_RAW_KEY(&key);
  ------------------
  |  |  132|    402|    do {                               \
  |  |  133|    402|        HT_INIT_KEY((key));            \
  |  |  ------------------
  |  |  |  |  114|    402|    do {                                                                                           \
  |  |  |  |  115|    402|        memset((key), 0, sizeof(*(key)));                                                          \
  |  |  |  |  116|    402|        (key)->key_header.keysize = (key)->key_header.bufsize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  |  |  117|    402|        (key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY));                            \
  |  |  |  |  118|    402|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (118:14): [Folded, False: 402]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  134|    402|        (key)->key_header.keysize = 0; \
  |  |  135|    402|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 402]
  |  |  ------------------
  ------------------
  260|    402|    HT_COPY_RAW_KEY_CASE(TO_HT_KEY(&key), name, strlen(name));
  ------------------
  |  |  166|    402|    do {                                                                               \
  |  |  167|    402|        size_t tmplen = (size_t)(len);                                                 \
  |  |  168|    402|        if (tmplen > (key)->bufsize - (key)->keysize)                                  \
  |  |  ------------------
  |  |  |  Branch (168:13): [True: 0, False: 402]
  |  |  ------------------
  |  |  169|    402|            tmplen = (key)->bufsize - (key)->keysize;                                  \
  |  |  170|    402|        ossl_ht_strcase((key), (char *)&((key)->keybuf[(key)->keysize]), buf, tmplen); \
  |  |  171|    402|        (key)->keysize += tmplen;                                                      \
  |  |  172|    402|    } while (0)
  |  |  ------------------
  |  |  |  Branch (172:14): [Folded, False: 402]
  |  |  ------------------
  ------------------
  261|       |
  262|    402|    val.value = (void *)(intptr_t)number;
  263|    402|    ret = ossl_ht_insert(namemap->namenum_ht, TO_HT_KEY(&key), &val, NULL);
  ------------------
  |  |  258|    402|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  264|    402|    if (ret <= 0) {
  ------------------
  |  Branch (264:9): [True: 0, False: 402]
  ------------------
  265|       |        /*
  266|       |         * We either got an allocation failure (INTERNAL_ERROR), or
  267|       |         * hit too many conflicts in the table (TOO_MANY_NAMES)
  268|       |         */
  269|      0|        ERR_raise(ERR_LIB_CRYPTO, (ret < 0) ? CRYPTO_R_TOO_MANY_NAMES : ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  |  |  |  Branch (357:55): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  270|      0|        return 0;
  271|      0|    }
  272|    402|    return number;
  273|    402|}
core_namemap.c:numname_insert:
  203|    402|{
  204|    402|    NAMES *names;
  205|    402|    char *tmpname;
  206|       |
  207|    402|    if (number > 0) {
  ------------------
  |  Branch (207:9): [True: 208, False: 194]
  ------------------
  208|    208|        names = sk_NAMES_value(namemap->numnames, number - 1);
  209|    208|        if (!ossl_assert(names != NULL)) {
  ------------------
  |  |   45|    208|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|    208|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (209:13): [True: 0, False: 208]
  ------------------
  210|       |            /* cannot happen */
  211|      0|            return 0;
  212|      0|        }
  213|    208|    } else {
  214|       |        /* a completely new entry */
  215|    194|        names = sk_OPENSSL_STRING_new_null();
  ------------------
  |  |  292|    194|    ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_set_thunks( \
  |  |  293|    194|        OPENSSL_sk_set_copy_thunks( \
  |  |  294|    194|            OPENSSL_sk_set_cmp_thunks( \
  |  |  295|    194|                OPENSSL_sk_new_null(), \
  |  |  296|    194|                sk_OPENSSL_STRING_cmpfunc_thunk), \
  |  |  297|    194|            sk_OPENSSL_STRING_copyfunc_thunk), \
  |  |  298|    194|        sk_OPENSSL_STRING_freefunc_thunk))
  ------------------
  216|    194|        if (names == NULL)
  ------------------
  |  Branch (216:13): [True: 0, False: 194]
  ------------------
  217|      0|            return 0;
  218|    194|    }
  219|       |
  220|    402|    if ((tmpname = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  140|    402|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (220:9): [True: 0, False: 402]
  ------------------
  221|      0|        goto err;
  222|       |
  223|    402|    if (!sk_OPENSSL_STRING_push(names, tmpname))
  ------------------
  |  |  312|    402|#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
  ------------------
  |  Branch (223:9): [True: 0, False: 402]
  ------------------
  224|      0|        goto err;
  225|    402|    tmpname = NULL;
  226|       |
  227|    402|    if (number <= 0) {
  ------------------
  |  Branch (227:9): [True: 194, False: 208]
  ------------------
  228|    194|        if (!sk_NAMES_push(namemap->numnames, names))
  ------------------
  |  Branch (228:13): [True: 0, False: 194]
  ------------------
  229|      0|            goto err;
  230|    194|        number = sk_NAMES_num(namemap->numnames);
  231|    194|    }
  232|    402|    return number;
  233|       |
  234|      0|err:
  235|      0|    if (number <= 0)
  ------------------
  |  Branch (235:9): [True: 0, False: 0]
  ------------------
  236|      0|        sk_OPENSSL_STRING_pop_free(names, name_string_free);
  ------------------
  |  |  316|      0|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
  237|      0|    OPENSSL_free(tmpname);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  238|      0|    return 0;
  239|    402|}
core_namemap.c:get_legacy_cipher_names:
  408|    183|{
  409|    183|    const EVP_CIPHER *cipher = (void *)OBJ_NAME_get(on->name, on->type);
  410|       |
  411|    183|    if (cipher != NULL)
  ------------------
  |  Branch (411:9): [True: 183, False: 0]
  ------------------
  412|    183|        get_legacy_evp_names(NID_undef, EVP_CIPHER_get_type(cipher), NULL, arg);
  ------------------
  |  |   19|    183|#define NID_undef                       0
  ------------------
  413|    183|}
core_namemap.c:get_legacy_evp_names:
  384|    258|{
  385|    258|    int num = 0;
  386|    258|    ASN1_OBJECT *obj;
  387|       |
  388|    258|    if (base_nid != NID_undef) {
  ------------------
  |  |   19|    258|#define NID_undef                       0
  ------------------
  |  Branch (388:9): [True: 4, False: 254]
  ------------------
  389|      4|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(base_nid));
  390|      4|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(base_nid));
  391|      4|    }
  392|       |
  393|    258|    if (nid != NID_undef) {
  ------------------
  |  |   19|    258|#define NID_undef                       0
  ------------------
  |  Branch (393:9): [True: 210, False: 48]
  ------------------
  394|    210|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(nid));
  395|    210|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(nid));
  396|    210|        if ((obj = OBJ_nid2obj(nid)) != NULL) {
  ------------------
  |  Branch (396:13): [True: 210, False: 0]
  ------------------
  397|    210|            char txtoid[OSSL_MAX_NAME_SIZE];
  398|       |
  399|    210|            if (OBJ_obj2txt(txtoid, sizeof(txtoid), obj, 1) > 0)
  ------------------
  |  Branch (399:17): [True: 206, False: 4]
  ------------------
  400|    206|                num = ossl_namemap_add_name(arg, num, txtoid);
  401|    210|        }
  402|    210|    }
  403|    258|    if (pem_name != NULL)
  ------------------
  |  Branch (403:9): [True: 11, False: 247]
  ------------------
  404|     11|        num = ossl_namemap_add_name(arg, num, pem_name);
  405|    258|}
core_namemap.c:get_legacy_md_names:
  416|     59|{
  417|     59|    const EVP_MD *md = (void *)OBJ_NAME_get(on->name, on->type);
  418|       |
  419|     59|    if (md != NULL)
  ------------------
  |  Branch (419:9): [True: 59, False: 0]
  ------------------
  420|     59|        get_legacy_evp_names(NID_undef, EVP_MD_get_type(md), NULL, arg);
  ------------------
  |  |   19|     59|#define NID_undef                       0
  ------------------
  421|     59|}
core_namemap.c:get_legacy_pkey_meth_names:
  426|     15|{
  427|     15|    int nid = 0, base_nid = 0, flags = 0;
  428|     15|    const char *pem_name = NULL;
  429|       |
  430|     15|    evp_pkey_asn1_get0_info(&nid, &base_nid, &flags, NULL, &pem_name, ameth);
  431|     15|    if (nid != NID_undef) {
  ------------------
  |  |   19|     15|#define NID_undef                       0
  ------------------
  |  Branch (431:9): [True: 15, False: 0]
  ------------------
  432|     15|        if ((flags & ASN1_PKEY_ALIAS) == 0) {
  ------------------
  |  | 1582|     15|#define ASN1_PKEY_ALIAS 0x1
  ------------------
  |  Branch (432:13): [True: 10, False: 5]
  ------------------
  433|     10|            switch (nid) {
  434|      1|            case EVP_PKEY_DHX:
  ------------------
  |  |   77|      1|#define EVP_PKEY_DHX NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5539|      1|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (434:13): [True: 1, False: 9]
  ------------------
  435|       |                /* We know that the name "DHX" is used too */
  436|      1|                get_legacy_evp_names(0, nid, "DHX", arg);
  437|       |                /* FALLTHRU */
  438|     10|            default:
  ------------------
  |  Branch (438:13): [True: 9, False: 1]
  ------------------
  439|     10|                get_legacy_evp_names(0, nid, pem_name, arg);
  440|     10|            }
  441|     10|        } else {
  442|       |            /*
  443|       |             * Treat aliases carefully, some of them are undesirable, or
  444|       |             * should not be treated as such for providers.
  445|       |             */
  446|       |
  447|      5|            switch (nid) {
  448|      1|            case EVP_PKEY_SM2:
  ------------------
  |  |   79|      1|#define EVP_PKEY_SM2 NID_sm2
  |  |  ------------------
  |  |  |  | 1260|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (448:13): [True: 1, False: 4]
  ------------------
  449|       |                /*
  450|       |                 * SM2 is a separate keytype with providers, not an alias for
  451|       |                 * EC.
  452|       |                 */
  453|      1|                get_legacy_evp_names(0, nid, pem_name, arg);
  454|      1|                break;
  455|      4|            default:
  ------------------
  |  Branch (455:13): [True: 4, False: 1]
  ------------------
  456|       |                /* Use the short name of the base nid as the common reference */
  457|      4|                get_legacy_evp_names(base_nid, nid, pem_name, arg);
  458|      5|            }
  459|      5|        }
  460|     15|    }
  461|     15|}

ossl_err_load_CRYPTO_strings:
   83|      1|{
   84|      1|#ifndef OPENSSL_NO_ERR
   85|      1|    if (ERR_reason_error_string(CRYPTO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (85:9): [True: 1, False: 0]
  ------------------
   86|      1|        ERR_load_strings_const(CRYPTO_str_reasons);
   87|      1|#endif
   88|      1|    return 1;
   89|      1|}

OPENSSL_cpuid_setup:
   95|      3|{
   96|      3|    static int trigger = 0;
   97|      3|    IA32CAP OPENSSL_ia32_cpuid(unsigned int *);
   98|      3|    IA32CAP vec;
   99|      3|    const variant_char *env;
  100|      3|    int index = 2;
  101|       |
  102|      3|    if (trigger)
  ------------------
  |  Branch (102:9): [True: 1, False: 2]
  ------------------
  103|      1|        return;
  104|       |
  105|      2|    trigger = 1;
  106|      2|    if ((env = ossl_getenv("OPENSSL_ia32cap")) != NULL) {
  ------------------
  |  |   45|      2|#define ossl_getenv getenv
  ------------------
  |  Branch (106:9): [True: 0, False: 2]
  ------------------
  107|      0|        int off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (107:19): [True: 0, False: 0]
  ------------------
  108|       |
  109|      0|        vec = ossl_strtouint64(env + off);
  110|       |
  111|      0|        if (off) {
  ------------------
  |  Branch (111:13): [True: 0, False: 0]
  ------------------
  112|      0|            IA32CAP mask = vec;
  113|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P) & ~mask;
  114|      0|            if (mask & (1 << 24)) {
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|       |                /*
  116|       |                 * User disables FXSR bit, mask even other capabilities
  117|       |                 * that operate exclusively on XMM, so we don't have to
  118|       |                 * double-check all the time. We mask PCLMULQDQ, AMD XOP,
  119|       |                 * AES-NI and AVX. Formally speaking we don't have to
  120|       |                 * do it in x86_64 case, but we can safely assume that
  121|       |                 * x86_64 users won't actually flip this flag.
  122|       |                 */
  123|      0|                vec &= ~((IA32CAP)(1 << 1 | 1 << 11 | 1 << 25 | 1 << 28) << 32);
  124|      0|            }
  125|      0|        } else if (env[0] == ':') {
  ------------------
  |  Branch (125:20): [True: 0, False: 0]
  ------------------
  126|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  127|      0|        }
  128|       |
  129|       |        /* Processed indexes 0, 1 */
  130|      0|        if ((env = ossl_strchr(env, ':')) != NULL)
  ------------------
  |  Branch (130:13): [True: 0, False: 0]
  ------------------
  131|      0|            env++;
  132|      0|        for (; index < OPENSSL_IA32CAP_P_MAX_INDEXES; index += 2) {
  ------------------
  |  |   38|      0|#define OPENSSL_IA32CAP_P_MAX_INDEXES 10
  ------------------
  |  Branch (132:16): [True: 0, False: 0]
  ------------------
  133|      0|            if ((env != NULL) && (env[0] != '\0')) {
  ------------------
  |  Branch (133:17): [True: 0, False: 0]
  |  Branch (133:34): [True: 0, False: 0]
  ------------------
  134|       |                /* if env[0] == ':' current index is skipped */
  135|      0|                if (env[0] != ':') {
  ------------------
  |  Branch (135:21): [True: 0, False: 0]
  ------------------
  136|      0|                    IA32CAP vecx;
  137|       |
  138|      0|                    off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (138:27): [True: 0, False: 0]
  ------------------
  139|      0|                    vecx = ossl_strtouint64(env + off);
  140|      0|                    if (off) {
  ------------------
  |  Branch (140:25): [True: 0, False: 0]
  ------------------
  141|      0|                        OPENSSL_ia32cap_P[index] &= ~(unsigned int)vecx;
  142|      0|                        OPENSSL_ia32cap_P[index + 1] &= ~(unsigned int)(vecx >> 32);
  143|      0|                    } else {
  144|      0|                        OPENSSL_ia32cap_P[index] = (unsigned int)vecx;
  145|      0|                        OPENSSL_ia32cap_P[index + 1] = (unsigned int)(vecx >> 32);
  146|      0|                    }
  147|      0|                }
  148|       |                /* skip delimiter */
  149|      0|                if ((env = ossl_strchr(env, ':')) != NULL)
  ------------------
  |  Branch (149:21): [True: 0, False: 0]
  ------------------
  150|      0|                    env++;
  151|      0|            } else { /* zeroize the next two indexes */
  152|      0|                OPENSSL_ia32cap_P[index] = 0;
  153|      0|                OPENSSL_ia32cap_P[index + 1] = 0;
  154|      0|            }
  155|      0|        }
  156|       |
  157|       |        /* If AVX10 is disabled, zero out its detailed cap bits */
  158|      0|        if (!(OPENSSL_ia32cap_P[6] & (1 << 19)))
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|            OPENSSL_ia32cap_P[9] = 0;
  160|      2|    } else {
  161|      2|        vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  162|      2|    }
  163|       |
  164|       |    /*
  165|       |     * |(1<<10) sets a reserved bit to signal that variable
  166|       |     * was initialized already... This is to avoid interference
  167|       |     * with cpuid snippets in ELF .init segment.
  168|       |     */
  169|      2|    OPENSSL_ia32cap_P[0] = (unsigned int)vec | (1 << 10);
  170|      2|    OPENSSL_ia32cap_P[1] = (unsigned int)(vec >> 32);
  171|      2|}

ossl_err_load_CRMF_strings:
   80|      1|{
   81|      1|#ifndef OPENSSL_NO_ERR
   82|      1|    if (ERR_reason_error_string(CRMF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (82:9): [True: 1, False: 0]
  ------------------
   83|      1|        ERR_load_strings_const(CRMF_str_reasons);
   84|      1|#endif
   85|      1|    return 1;
   86|      1|}

ossl_err_load_CT_strings:
   52|      1|{
   53|      1|#ifndef OPENSSL_NO_ERR
   54|      1|    if (ERR_reason_error_string(CT_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (54:9): [True: 1, False: 0]
  ------------------
   55|      1|        ERR_load_strings_const(CT_str_reasons);
   56|      1|#endif
   57|      1|    return 1;
   58|      1|}

ossl_ctype_check:
  253|    863|{
  254|    863|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|    863|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|    863|#define ossl_toascii(c) (c)
  ------------------
  256|       |
  257|    863|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 863, False: 0]
  |  Branch (257:22): [True: 863, False: 0]
  |  Branch (257:33): [True: 816, False: 47]
  ------------------
  258|    863|}
ossl_isdigit:
  270|      3|{
  271|      3|    int a = ossl_toascii(c);
  ------------------
  |  |   56|      3|#define ossl_toascii(c) (c)
  ------------------
  272|       |
  273|      3|    return ASCII_IS_DIGIT(a);
  ------------------
  |  |  265|      3|#define ASCII_IS_DIGIT(c) (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:28): [True: 3, False: 0]
  |  |  |  Branch (265:41): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  274|      3|}
ossl_tolower:
  297|  16.2k|{
  298|  16.2k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  16.2k|#define ossl_toascii(c) (c)
  ------------------
  299|       |
  300|  16.2k|    return ASCII_IS_UPPER(a) ? c ^ case_change : c;
  ------------------
  |  |  266|  16.2k|#define ASCII_IS_UPPER(c) (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:28): [True: 9.56k, False: 6.69k]
  |  |  |  Branch (266:41): [True: 2.96k, False: 6.60k]
  |  |  ------------------
  ------------------
  301|  16.2k|}

OpenSSL_version_num:
   20|      2|{
   21|      2|    return OPENSSL_VERSION_NUMBER;
  ------------------
  |  |  116|      2|    ( (OPENSSL_VERSION_MAJOR<<28)        \
  |  |  ------------------
  |  |  |  |   31|      2|# define OPENSSL_VERSION_MAJOR  4
  |  |  ------------------
  |  |  117|      2|      |(OPENSSL_VERSION_MINOR<<20)       \
  |  |  ------------------
  |  |  |  |   34|      2|# define OPENSSL_VERSION_MINOR  2
  |  |  ------------------
  |  |  118|      2|      |(OPENSSL_VERSION_PATCH<<4)        \
  |  |  ------------------
  |  |  |  |   37|      2|# define OPENSSL_VERSION_PATCH  0
  |  |  ------------------
  |  |  119|      2|      |0x0L )
  ------------------
   22|      2|}
OpenSSL_version:
   75|      1|{
   76|       |#if defined(_WIN32) && defined(OSSL_WINCTX)
   77|       |    /* Cannot really fail but we would return empty strings anyway */
   78|       |    (void)RUN_ONCE(&version_strings_once, version_strings_setup);
   79|       |#endif
   80|       |
   81|      1|    switch (t) {
  ------------------
  |  Branch (81:13): [True: 1, False: 0]
  ------------------
   82|      1|    case OPENSSL_VERSION:
  ------------------
  |  |  188|      1|#define OPENSSL_VERSION 0
  ------------------
  |  Branch (82:5): [True: 1, False: 0]
  ------------------
   83|      1|        return OPENSSL_VERSION_TEXT;
  ------------------
  |  |  110|      1|# define OPENSSL_VERSION_TEXT "OpenSSL 4.2.0-dev "
  ------------------
   84|      0|    case OPENSSL_VERSION_STRING:
  ------------------
  |  |  194|      0|#define OPENSSL_VERSION_STRING 6
  ------------------
  |  Branch (84:5): [True: 0, False: 1]
  ------------------
   85|      0|        return OPENSSL_VERSION_STR;
  ------------------
  |  |   90|      0|# define OPENSSL_VERSION_STR "4.2.0"
  ------------------
   86|      0|    case OPENSSL_FULL_VERSION_STRING:
  ------------------
  |  |  195|      0|#define OPENSSL_FULL_VERSION_STRING 7
  ------------------
  |  Branch (86:5): [True: 0, False: 1]
  ------------------
   87|      0|        return OPENSSL_FULL_VERSION_STR;
  ------------------
  |  |   93|      0|# define OPENSSL_FULL_VERSION_STR "4.2.0-dev"
  ------------------
   88|      0|    case OPENSSL_BUILT_ON:
  ------------------
  |  |  190|      0|#define OPENSSL_BUILT_ON 2
  ------------------
  |  Branch (88:5): [True: 0, False: 1]
  ------------------
   89|      0|        return DATE;
  ------------------
  |  |   14|      0|#define DATE "built on: Sat Oct 17 06:49:33 2026 UTC"
  ------------------
   90|      0|    case OPENSSL_CFLAGS:
  ------------------
  |  |  189|      0|#define OPENSSL_CFLAGS 1
  ------------------
  |  Branch (90:5): [True: 0, False: 1]
  ------------------
   91|      0|        return compiler_flags;
   92|      0|    case OPENSSL_PLATFORM:
  ------------------
  |  |  191|      0|#define OPENSSL_PLATFORM 3
  ------------------
  |  Branch (92:5): [True: 0, False: 1]
  ------------------
   93|      0|        return PLATFORM;
  ------------------
  |  |   13|      0|#define PLATFORM "platform: linux-x86_64-clang"
  ------------------
   94|       |#if defined(_WIN32) && defined(OSSL_WINCTX)
   95|       |    case OPENSSL_DIR:
   96|       |        return openssldir;
   97|       |    case OPENSSL_MODULES_DIR:
   98|       |        return modulesdir;
   99|       |#else
  100|      0|    case OPENSSL_DIR:
  ------------------
  |  |  192|      0|#define OPENSSL_DIR 4
  ------------------
  |  Branch (100:5): [True: 0, False: 1]
  ------------------
  101|      0|#ifdef OPENSSLDIR
  102|      0|        return "OPENSSLDIR: \"" OPENSSLDIR "\"";
  103|       |#else
  104|       |        return "OPENSSLDIR: N/A";
  105|       |#endif
  106|      0|    case OPENSSL_MODULES_DIR:
  ------------------
  |  |  196|      0|#define OPENSSL_MODULES_DIR 8
  ------------------
  |  Branch (106:5): [True: 0, False: 1]
  ------------------
  107|      0|#ifdef MODULESDIR
  108|      0|        return "MODULESDIR: \"" MODULESDIR "\"";
  109|       |#else
  110|       |        return "MODULESDIR: N/A";
  111|       |#endif
  112|      0|#endif
  113|      0|    case OPENSSL_CPU_INFO:
  ------------------
  |  |  197|      0|#define OPENSSL_CPU_INFO 9
  ------------------
  |  Branch (113:5): [True: 0, False: 1]
  ------------------
  114|      0|        if (OPENSSL_info(OPENSSL_INFO_CPU_SETTINGS) != NULL)
  ------------------
  |  |  212|      0|#define OPENSSL_INFO_CPU_SETTINGS 1008
  ------------------
  |  Branch (114:13): [True: 0, False: 0]
  ------------------
  115|      0|            return ossl_cpu_info_str;
  116|      0|        else
  117|      0|            return "CPUINFO: N/A";
  118|      0|    case OPENSSL_WINCTX:
  ------------------
  |  |  198|      0|#define OPENSSL_WINCTX 10
  ------------------
  |  Branch (118:5): [True: 0, False: 1]
  ------------------
  119|       |#if defined(_WIN32) && defined(OSSL_WINCTX)
  120|       |        return OSSL_WINCTX_STRING;
  121|       |#else
  122|      0|        return "OSSL_WINCTX: Undefined";
  123|      0|#endif
  124|      0|    case OPENSSL_ENGINES_DIR:
  ------------------
  |  |  193|      0|#define OPENSSL_ENGINES_DIR 5
  ------------------
  |  Branch (124:5): [True: 0, False: 1]
  ------------------
  125|      0|        return "ENGINESDIR: N/A";
  126|      1|    }
  127|      0|    return "not available";
  128|      1|}

ossl_err_load_DH_strings:
   68|      1|{
   69|      1|#ifndef OPENSSL_NO_ERR
   70|      1|    if (ERR_reason_error_string(DH_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 1, False: 0]
  ------------------
   71|      1|        ERR_load_strings_const(DH_str_reasons);
   72|      1|#endif
   73|      1|    return 1;
   74|      1|}

ossl_err_load_DSA_strings:
   46|      1|{
   47|      1|#ifndef OPENSSL_NO_ERR
   48|      1|    if (ERR_reason_error_string(DSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (48:9): [True: 1, False: 0]
  ------------------
   49|      1|        ERR_load_strings_const(DSA_str_reasons);
   50|      1|#endif
   51|      1|    return 1;
   52|      1|}

ossl_err_load_DSO_strings:
   50|      1|{
   51|      1|#ifndef OPENSSL_NO_ERR
   52|      1|    if (ERR_reason_error_string(DSO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 1, False: 0]
  ------------------
   53|      1|        ERR_load_strings_const(DSO_str_reasons);
   54|      1|#endif
   55|      1|    return 1;
   56|      1|}

ossl_err_load_EC_strings:
  127|      1|{
  128|      1|#ifndef OPENSSL_NO_ERR
  129|      1|    if (ERR_reason_error_string(EC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (129:9): [True: 1, False: 0]
  ------------------
  130|      1|        ERR_load_strings_const(EC_str_reasons);
  131|      1|#endif
  132|      1|    return 1;
  133|      1|}

ossl_decoder_cache_new:
  774|      1|{
  775|      1|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |  111|      1|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  776|       |
  777|      1|    if (cache == NULL)
  ------------------
  |  Branch (777:9): [True: 0, False: 1]
  ------------------
  778|      0|        return NULL;
  779|       |
  780|      1|    cache->lock = CRYPTO_THREAD_lock_new();
  781|      1|    if (cache->lock == NULL) {
  ------------------
  |  Branch (781:9): [True: 0, False: 1]
  ------------------
  782|      0|        OPENSSL_free(cache);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  783|      0|        return NULL;
  784|      0|    }
  785|      1|    cache->hashtable = lh_DECODER_CACHE_ENTRY_new(decoder_cache_entry_hash,
  786|      1|        decoder_cache_entry_cmp);
  787|      1|    if (cache->hashtable == NULL) {
  ------------------
  |  Branch (787:9): [True: 0, False: 1]
  ------------------
  788|      0|        CRYPTO_THREAD_lock_free(cache->lock);
  789|      0|        OPENSSL_free(cache);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  790|      0|        return NULL;
  791|      0|    }
  792|       |
  793|      1|    return cache;
  794|      1|}

ossl_err_load_ERR_strings:
  264|     36|{
  265|     36|#ifndef OPENSSL_NO_ERR
  266|     36|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     36|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 36, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (266:9): [True: 0, False: 36]
  ------------------
  267|      0|        return 0;
  268|       |
  269|     36|    err_load_strings(ERR_str_libraries);
  270|     36|    err_load_strings(ERR_str_reasons);
  271|     36|#endif
  272|     36|    return 1;
  273|     36|}
ERR_load_strings_const:
  289|     35|{
  290|     35|#ifndef OPENSSL_NO_ERR
  291|     35|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (291:9): [True: 0, False: 35]
  ------------------
  292|      0|        return 0;
  293|     35|    err_load_strings(str);
  294|     35|#endif
  295|       |
  296|     35|    return 1;
  297|     35|}
ERR_peek_last_error:
  406|      2|{
  407|      2|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  408|      2|}
ERR_reason_error_string:
  608|     35|{
  609|     35|#ifndef OPENSSL_NO_ERR
  610|     35|    ERR_STRING_DATA d, *p = NULL;
  611|     35|    unsigned long l, r;
  612|       |
  613|     35|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|     35|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 35, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (613:9): [True: 0, False: 35]
  ------------------
  614|      0|        return NULL;
  615|      0|    }
  616|       |
  617|       |    /*
  618|       |     * ERR_reason_error_string() can't safely return system error strings,
  619|       |     * since openssl_strerror_r() needs a buffer for thread safety, and we
  620|       |     * haven't got one that would serve any sensible purpose.
  621|       |     */
  622|     35|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  222|     35|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  201|     35|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (222:35): [True: 0, False: 35]
  |  |  ------------------
  ------------------
  623|      0|        return NULL;
  624|       |
  625|     35|    l = ERR_GET_LIB(e);
  626|     35|    r = ERR_GET_REASON(e);
  627|     35|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  262|     35|    ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  210|     35|#define ERR_LIB_MASK 0xFF
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  209|     35|#define ERR_LIB_OFFSET 23L
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  213|     35|#define ERR_REASON_MASK 0X7FFFFF
  |  |  ------------------
  ------------------
  628|     35|    p = int_err_get_item(&d);
  629|     35|    if (p == NULL) {
  ------------------
  |  Branch (629:9): [True: 35, False: 0]
  ------------------
  630|     35|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  262|     35|    ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  210|     35|#define ERR_LIB_MASK 0xFF
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  209|     35|#define ERR_LIB_OFFSET 23L
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  213|     35|#define ERR_REASON_MASK 0X7FFFFF
  |  |  ------------------
  ------------------
  631|     35|        p = int_err_get_item(&d);
  632|     35|    }
  633|     35|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (633:13): [True: 35, False: 0]
  ------------------
  634|       |#else
  635|       |    return NULL;
  636|       |#endif
  637|     35|}
ossl_err_get_state_int:
  653|     17|{
  654|     17|    ERR_STATE *state;
  655|     17|    int saveerrno = 0;
  656|       |
  657|     17|    if (save_sys_error)
  ------------------
  |  Branch (657:9): [True: 11, False: 6]
  ------------------
  658|     11|        saveerrno = get_last_sys_error();
  ------------------
  |  |   30|     11|#define get_last_sys_error() errno
  ------------------
  659|       |
  660|     17|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|     17|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  |  Branch (660:9): [True: 0, False: 17]
  ------------------
  661|      0|        return NULL;
  662|       |
  663|     17|    state = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  664|     17|        CRYPTO_THREAD_NO_CONTEXT);
  ------------------
  |  |   47|     17|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  665|     17|    if (state == (ERR_STATE *)-1)
  ------------------
  |  Branch (665:9): [True: 0, False: 17]
  ------------------
  666|      0|        return NULL;
  667|       |
  668|     17|    if (state == NULL) {
  ------------------
  |  Branch (668:9): [True: 1, False: 16]
  ------------------
  669|      1|        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  ------------------
  |  Branch (669:13): [True: 0, False: 1]
  ------------------
  670|      1|                CRYPTO_THREAD_NO_CONTEXT, (ERR_STATE *)-1))
  ------------------
  |  |   47|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  671|      0|            return NULL;
  672|       |
  673|      1|        state = OSSL_ERR_STATE_new();
  674|      1|        if (state == NULL) {
  ------------------
  |  Branch (674:13): [True: 0, False: 1]
  ------------------
  675|      0|            CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  676|      0|                CRYPTO_THREAD_NO_CONTEXT, NULL);
  ------------------
  |  |   47|      0|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  677|      0|            return NULL;
  678|      0|        }
  679|       |
  680|      1|        if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
  ------------------
  |  Branch (680:13): [True: 0, False: 1]
  ------------------
  681|      1|            || !CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  ------------------
  |  Branch (681:16): [True: 0, False: 1]
  ------------------
  682|      1|                CRYPTO_THREAD_NO_CONTEXT, state)) {
  ------------------
  |  |   47|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  683|      0|            OSSL_ERR_STATE_free(state);
  684|      0|            CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  685|      0|                CRYPTO_THREAD_NO_CONTEXT, NULL);
  ------------------
  |  |   47|      0|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  686|      0|            return NULL;
  687|      0|        }
  688|       |
  689|       |        /* Ignore failures from these */
  690|      1|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  548|      1|#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
  ------------------
  691|      1|    }
  692|       |
  693|     17|    if (save_sys_error)
  ------------------
  |  Branch (693:9): [True: 11, False: 6]
  ------------------
  694|       |        set_sys_error(saveerrno);
  ------------------
  |  |   32|     17|#define set_sys_error(e) errno = (e)
  ------------------
  695|     17|    return state;
  696|     17|}
err_shelve_state:
  703|      1|{
  704|      1|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|      1|#define get_last_sys_error() errno
  ------------------
  705|       |
  706|       |    /*
  707|       |     * Note, at present our only caller is OPENSSL_init_crypto(), indirectly
  708|       |     * via ossl_init_load_crypto_nodelete(), by which point the requested
  709|       |     * "base" initialization has already been performed, so the below call is a
  710|       |     * NOOP, that re-enters OPENSSL_init_crypto() only to quickly return.
  711|       |     *
  712|       |     * If are no other valid callers of this function, the call below can be
  713|       |     * removed, avoiding the re-entry into OPENSSL_init_crypto().  If there are
  714|       |     * potential uses that are not from inside OPENSSL_init_crypto(), then this
  715|       |     * call is needed, but some care is required to make sure that the re-entry
  716|       |     * remains a NOOP.
  717|       |     */
  718|      1|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      1|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  |  Branch (718:9): [True: 0, False: 1]
  ------------------
  719|      0|        return 0;
  720|       |
  721|      1|    *state = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  722|      1|        CRYPTO_THREAD_NO_CONTEXT);
  ------------------
  |  |   47|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  723|      1|    if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  ------------------
  |  Branch (723:9): [True: 0, False: 1]
  ------------------
  724|      1|            CRYPTO_THREAD_NO_CONTEXT, (ERR_STATE *)-1))
  ------------------
  |  |   47|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  725|      0|        return 0;
  726|       |
  727|      1|    set_sys_error(saveerrno);
  ------------------
  |  |   32|      1|#define set_sys_error(e) errno = (e)
  ------------------
  728|      1|    return 1;
  729|      1|}
err_unshelve_state:
  736|      1|{
  737|      1|    if (state != (void *)-1)
  ------------------
  |  Branch (737:9): [True: 1, False: 0]
  ------------------
  738|      1|        CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  739|      1|            CRYPTO_THREAD_NO_CONTEXT, (ERR_STATE *)state);
  ------------------
  |  |   47|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  740|      1|}
ERR_get_next_error_library:
  743|      1|{
  744|      1|    int ret;
  745|       |
  746|      1|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (746:9): [True: 0, False: 1]
  ------------------
  747|      0|        return 0;
  748|       |
  749|      1|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (749:9): [True: 0, False: 1]
  ------------------
  750|      0|        return 0;
  751|      1|    ret = int_err_library_number++;
  752|      1|    CRYPTO_THREAD_unlock(err_string_lock);
  753|      1|    return ret;
  754|      1|}
err.c:do_err_strings_init:
  208|      1|{
  209|      1|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      1|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  |  Branch (209:9): [True: 0, False: 1]
  ------------------
  210|      0|        return 0;
  211|      1|    err_string_lock = CRYPTO_THREAD_lock_new();
  212|      1|    if (err_string_lock == NULL)
  ------------------
  |  Branch (212:9): [True: 0, False: 1]
  ------------------
  213|      0|        return 0;
  214|      1|#ifndef OPENSSL_NO_ERR
  215|      1|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  330|      1|#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)), lh_ERR_STRING_DATA_hash_thunk, lh_ERR_STRING_DATA_comp_thunk, lh_ERR_STRING_DATA_doall_thunk, lh_ERR_STRING_DATA_doall_arg_thunk))
  ------------------
  216|      1|        err_string_data_cmp);
  217|      1|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (217:9): [True: 0, False: 1]
  ------------------
  218|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  219|      0|        err_string_lock = NULL;
  220|      0|        return 0;
  221|      0|    }
  222|      1|#endif
  223|      1|    return 1;
  224|      1|}
err.c:err_string_data_hash:
  166|  4.82k|{
  167|  4.82k|    unsigned long ret, l;
  168|       |
  169|  4.82k|    l = a->error;
  170|  4.82k|    ret = l ^ ERR_GET_LIB(l);
  171|  4.82k|    return (ret ^ ret % 19 * 13);
  172|  4.82k|}
err.c:err_string_data_cmp:
  176|  3.07k|{
  177|  3.07k|    if (a->error == b->error)
  ------------------
  |  Branch (177:9): [True: 2.87k, False: 208]
  ------------------
  178|  2.87k|        return 0;
  179|    208|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (179:12): [True: 112, False: 96]
  ------------------
  180|  3.07k|}
err.c:err_load_strings:
  252|    107|{
  253|    107|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (253:9): [True: 0, False: 107]
  ------------------
  254|      0|        return 0;
  255|  4.86k|    for (; str->error; str++)
  ------------------
  |  Branch (255:12): [True: 4.75k, False: 107]
  ------------------
  256|  4.75k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  333|  4.86k|#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  257|    107|            (ERR_STRING_DATA *)str);
  258|    107|    CRYPTO_THREAD_unlock(err_string_lock);
  259|    107|    return 1;
  260|    107|}
err.c:get_error_values:
  444|      2|{
  445|      2|    int i = 0;
  446|      2|    ERR_STATE *es;
  447|      2|    unsigned long ret;
  448|       |
  449|      2|    es = ossl_err_get_state_int(1);
  450|      2|    if (es == NULL)
  ------------------
  |  Branch (450:9): [True: 0, False: 2]
  ------------------
  451|      0|        return 0;
  452|       |
  453|       |    /*
  454|       |     * Clear anything that should have been cleared earlier. We do this
  455|       |     * here because this doesn't have constant-time issues.
  456|       |     */
  457|      2|    while (es->bottom != es->top) {
  ------------------
  |  Branch (457:12): [True: 2, False: 0]
  ------------------
  458|      2|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   19|      2|#define ERR_FLAG_CLEAR 0x02
  ------------------
  |  Branch (458:13): [True: 0, False: 2]
  ------------------
  459|      0|            err_clear(es, es->top, 0);
  460|      0|            es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   14|      0|#define ERR_NUM_ERRORS 16
  ------------------
  |  Branch (460:23): [True: 0, False: 0]
  ------------------
  461|      0|            continue;
  462|      0|        }
  463|      2|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   14|      2|#define ERR_NUM_ERRORS 16
  ------------------
  464|      2|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   19|      2|#define ERR_FLAG_CLEAR 0x02
  ------------------
  |  Branch (464:13): [True: 0, False: 2]
  ------------------
  465|      0|            es->bottom = i;
  466|      0|            err_clear(es, es->bottom, 0);
  467|      0|            continue;
  468|      0|        }
  469|      2|        break;
  470|      2|    }
  471|       |
  472|       |    /* If everything has been cleared, the stack is empty. */
  473|      2|    if (es->bottom == es->top)
  ------------------
  |  Branch (473:9): [True: 0, False: 2]
  ------------------
  474|      0|        return 0;
  475|       |
  476|       |    /* Which error, the top of stack (latest one) or the first one? */
  477|      2|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (477:9): [True: 2, False: 0]
  ------------------
  478|      2|        i = es->top;
  479|      0|    else
  480|      0|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   14|      0|#define ERR_NUM_ERRORS 16
  ------------------
  481|       |
  482|      2|    ret = es->err_buffer[i];
  483|      2|    if (g == EV_POP) {
  ------------------
  |  Branch (483:9): [True: 0, False: 2]
  ------------------
  484|      0|        es->bottom = i;
  485|      0|        es->err_buffer[i] = 0;
  486|      0|    }
  487|       |
  488|      2|    if (file != NULL) {
  ------------------
  |  Branch (488:9): [True: 0, False: 2]
  ------------------
  489|      0|        *file = es->err_file[i];
  490|      0|        if (*file == NULL)
  ------------------
  |  Branch (490:13): [True: 0, False: 0]
  ------------------
  491|      0|            *file = "";
  492|      0|    }
  493|      2|    if (line != NULL)
  ------------------
  |  Branch (493:9): [True: 0, False: 2]
  ------------------
  494|      0|        *line = es->err_line[i];
  495|      2|    if (func != NULL) {
  ------------------
  |  Branch (495:9): [True: 0, False: 2]
  ------------------
  496|      0|        *func = es->err_func[i];
  497|      0|        if (*func == NULL)
  ------------------
  |  Branch (497:13): [True: 0, False: 0]
  ------------------
  498|      0|            *func = "";
  499|      0|    }
  500|      2|    if (flags != NULL)
  ------------------
  |  Branch (500:9): [True: 0, False: 2]
  ------------------
  501|      0|        *flags = es->err_data_flags[i];
  502|      2|    if (data == NULL) {
  ------------------
  |  Branch (502:9): [True: 2, False: 0]
  ------------------
  503|      2|        if (g == EV_POP) {
  ------------------
  |  Branch (503:13): [True: 0, False: 2]
  ------------------
  504|      0|            err_clear_data(es, i, 0);
  505|      0|        }
  506|      2|    } else {
  507|      0|        *data = es->err_data[i];
  508|      0|        if (*data == NULL) {
  ------------------
  |  Branch (508:13): [True: 0, False: 0]
  ------------------
  509|      0|            *data = "";
  510|      0|            if (flags != NULL)
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|                *flags = 0;
  512|      0|        }
  513|      0|    }
  514|      2|    return ret;
  515|      2|}
err.c:int_err_get_item:
  183|     70|{
  184|     70|    ERR_STRING_DATA *p = NULL;
  185|       |
  186|     70|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (186:9): [True: 0, False: 70]
  ------------------
  187|      0|        return NULL;
  188|     70|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  335|     70|#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  189|     70|    CRYPTO_THREAD_unlock(err_string_lock);
  190|       |
  191|     70|    return p;
  192|     70|}

ossl_err_load_crypto_strings:
   49|      1|{
   50|      1|    if (0
  ------------------
  |  Branch (50:9): [Folded, False: 1]
  ------------------
   51|      1|#ifndef OPENSSL_NO_ERR
   52|      1|        || ossl_err_load_ERR_strings() == 0 /* include error strings for SYSerr */
  ------------------
  |  Branch (52:12): [True: 0, False: 1]
  ------------------
   53|      1|        || ossl_err_load_BN_strings() == 0
  ------------------
  |  Branch (53:12): [True: 0, False: 1]
  ------------------
   54|      1|        || ossl_err_load_RSA_strings() == 0
  ------------------
  |  Branch (54:12): [True: 0, False: 1]
  ------------------
   55|      1|#ifndef OPENSSL_NO_DH
   56|      1|        || ossl_err_load_DH_strings() == 0
  ------------------
  |  Branch (56:12): [True: 0, False: 1]
  ------------------
   57|      1|#endif
   58|      1|        || ossl_err_load_EVP_strings() == 0
  ------------------
  |  Branch (58:12): [True: 0, False: 1]
  ------------------
   59|      1|        || ossl_err_load_BUF_strings() == 0
  ------------------
  |  Branch (59:12): [True: 0, False: 1]
  ------------------
   60|      1|        || ossl_err_load_OBJ_strings() == 0
  ------------------
  |  Branch (60:12): [True: 0, False: 1]
  ------------------
   61|      1|        || ossl_err_load_PEM_strings() == 0
  ------------------
  |  Branch (61:12): [True: 0, False: 1]
  ------------------
   62|      1|#ifndef OPENSSL_NO_DSA
   63|      1|        || ossl_err_load_DSA_strings() == 0
  ------------------
  |  Branch (63:12): [True: 0, False: 1]
  ------------------
   64|      1|#endif
   65|      1|        || ossl_err_load_X509_strings() == 0
  ------------------
  |  Branch (65:12): [True: 0, False: 1]
  ------------------
   66|      1|        || ossl_err_load_ASN1_strings() == 0
  ------------------
  |  Branch (66:12): [True: 0, False: 1]
  ------------------
   67|      1|        || ossl_err_load_CONF_strings() == 0
  ------------------
  |  Branch (67:12): [True: 0, False: 1]
  ------------------
   68|      1|        || ossl_err_load_CRYPTO_strings() == 0
  ------------------
  |  Branch (68:12): [True: 0, False: 1]
  ------------------
   69|      1|#ifndef OPENSSL_NO_COMP
   70|      1|        || ossl_err_load_COMP_strings() == 0
  ------------------
  |  Branch (70:12): [True: 0, False: 1]
  ------------------
   71|      1|#endif
   72|      1|#ifndef OPENSSL_NO_EC
   73|      1|        || ossl_err_load_EC_strings() == 0
  ------------------
  |  Branch (73:12): [True: 0, False: 1]
  ------------------
   74|      1|#endif
   75|       |        /* skip ossl_err_load_SSL_strings() because it is not in this library */
   76|      1|        || ossl_err_load_BIO_strings() == 0
  ------------------
  |  Branch (76:12): [True: 0, False: 1]
  ------------------
   77|      1|        || ossl_err_load_PKCS7_strings() == 0
  ------------------
  |  Branch (77:12): [True: 0, False: 1]
  ------------------
   78|      1|        || ossl_err_load_X509V3_strings() == 0
  ------------------
  |  Branch (78:12): [True: 0, False: 1]
  ------------------
   79|      1|        || ossl_err_load_PKCS12_strings() == 0
  ------------------
  |  Branch (79:12): [True: 0, False: 1]
  ------------------
   80|      1|        || ossl_err_load_RAND_strings() == 0
  ------------------
  |  Branch (80:12): [True: 0, False: 1]
  ------------------
   81|      1|        || ossl_err_load_DSO_strings() == 0
  ------------------
  |  Branch (81:12): [True: 0, False: 1]
  ------------------
   82|      1|#ifndef OPENSSL_NO_TS
   83|      1|        || ossl_err_load_TS_strings() == 0
  ------------------
  |  Branch (83:12): [True: 0, False: 1]
  ------------------
   84|      1|#endif
   85|      1|#ifndef OPENSSL_NO_HTTP
   86|      1|        || ossl_err_load_HTTP_strings() == 0
  ------------------
  |  Branch (86:12): [True: 0, False: 1]
  ------------------
   87|      1|#endif
   88|      1|#ifndef OPENSSL_NO_OCSP
   89|      1|        || ossl_err_load_OCSP_strings() == 0
  ------------------
  |  Branch (89:12): [True: 0, False: 1]
  ------------------
   90|      1|#endif
   91|      1|        || ossl_err_load_UI_strings() == 0
  ------------------
  |  Branch (91:12): [True: 0, False: 1]
  ------------------
   92|      1|#ifndef OPENSSL_NO_CMS
   93|      1|        || ossl_err_load_CMS_strings() == 0
  ------------------
  |  Branch (93:12): [True: 0, False: 1]
  ------------------
   94|      1|#endif
   95|      1|#ifndef OPENSSL_NO_CRMF
   96|      1|        || ossl_err_load_CRMF_strings() == 0
  ------------------
  |  Branch (96:12): [True: 0, False: 1]
  ------------------
   97|      1|        || ossl_err_load_CMP_strings() == 0
  ------------------
  |  Branch (97:12): [True: 0, False: 1]
  ------------------
   98|      1|#endif
   99|      1|#ifndef OPENSSL_NO_CT
  100|      1|        || ossl_err_load_CT_strings() == 0
  ------------------
  |  Branch (100:12): [True: 0, False: 1]
  ------------------
  101|      1|#endif
  102|      1|        || ossl_err_load_ESS_strings() == 0
  ------------------
  |  Branch (102:12): [True: 0, False: 1]
  ------------------
  103|      1|        || ossl_err_load_ASYNC_strings() == 0
  ------------------
  |  Branch (103:12): [True: 0, False: 1]
  ------------------
  104|      1|#ifndef OPENSSL_NO_SM2
  105|      1|        || ossl_err_load_SM2_strings() == 0
  ------------------
  |  Branch (105:12): [True: 0, False: 1]
  ------------------
  106|      1|#endif
  107|      1|        || ossl_err_load_OSSL_STORE_strings() == 0
  ------------------
  |  Branch (107:12): [True: 0, False: 1]
  ------------------
  108|      1|        || ossl_err_load_PROP_strings() == 0
  ------------------
  |  Branch (108:12): [True: 0, False: 1]
  ------------------
  109|      1|        || ossl_err_load_PROV_strings() == 0
  ------------------
  |  Branch (109:12): [True: 0, False: 1]
  ------------------
  110|      1|#endif
  111|      1|    )
  112|      0|        return 0;
  113|       |
  114|      1|    return 1;
  115|      1|}

ERR_new:
   16|      3|{
   17|      3|    ERR_STATE *es;
   18|       |
   19|      3|    es = ossl_err_get_state_int(1);
   20|      3|    if (es == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 3]
  ------------------
   21|      0|        return;
   22|       |
   23|       |    /* Allocate a slot */
   24|      3|    err_get_slot(es);
   25|      3|    err_clear(es, es->top, 0);
   26|      3|}
ERR_set_debug:
   29|      3|{
   30|      3|    ERR_STATE *es;
   31|       |
   32|      3|    es = ossl_err_get_state_int(1);
   33|      3|    if (es == NULL)
  ------------------
  |  Branch (33:9): [True: 0, False: 3]
  ------------------
   34|      0|        return;
   35|       |
   36|      3|    err_set_debug(es, es->top, file, line, func);
   37|      3|}
ERR_set_error:
   40|      3|{
   41|      3|    va_list args;
   42|       |
   43|      3|    va_start(args, fmt);
   44|      3|    ERR_vset_error(lib, reason, fmt, args);
   45|       |    va_end(args);
   46|      3|}
ERR_vset_error:
   49|      3|{
   50|      3|    ERR_STATE *es;
   51|      3|    char *buf = NULL;
   52|      3|    size_t buf_size = 0;
   53|      3|    unsigned long flags = 0;
   54|      3|    size_t i;
   55|       |
   56|      3|    es = ossl_err_get_state_int(1);
   57|      3|    if (es == NULL)
  ------------------
  |  Branch (57:9): [True: 0, False: 3]
  ------------------
   58|      0|        return;
   59|      3|    i = es->top;
   60|       |
   61|      3|    if (fmt != NULL) {
  ------------------
  |  Branch (61:9): [True: 1, False: 2]
  ------------------
   62|      1|        int printed_len = 0;
   63|      1|        char *rbuf = NULL;
   64|       |
   65|      1|        buf = es->err_data[i];
   66|      1|        buf_size = es->err_data_size[i];
   67|       |
   68|       |        /*
   69|       |         * To protect the string we just grabbed from tampering by other
   70|       |         * functions we may call, or to protect them from freeing a pointer
   71|       |         * that may no longer be valid at that point, we clear away the
   72|       |         * data pointer and the flags.  We will set them again at the end
   73|       |         * of this function.
   74|       |         */
   75|      1|        es->err_data[i] = NULL;
   76|      1|        es->err_data_flags[i] = 0;
   77|       |
   78|       |        /*
   79|       |         * Try to maximize the space available.  If that fails, we use what
   80|       |         * we have.
   81|       |         */
   82|      1|        if (buf_size < ERR_MAX_DATA_SIZE
  ------------------
  |  |  348|      2|#define ERR_MAX_DATA_SIZE 1024
  ------------------
  |  Branch (82:13): [True: 1, False: 0]
  ------------------
   83|      1|            && (rbuf = OPENSSL_realloc(buf, ERR_MAX_DATA_SIZE)) != NULL) {
  ------------------
  |  |  125|      1|    CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (83:16): [True: 1, False: 0]
  ------------------
   84|      1|            buf = rbuf;
   85|      1|            buf_size = ERR_MAX_DATA_SIZE;
  ------------------
  |  |  348|      1|#define ERR_MAX_DATA_SIZE 1024
  ------------------
   86|      1|        }
   87|       |
   88|      1|        if (buf != NULL) {
  ------------------
  |  Branch (88:13): [True: 1, False: 0]
  ------------------
   89|      1|            printed_len = vsnprintf(buf, buf_size, fmt, args);
   90|      1|        }
   91|      1|        if (printed_len < 0 || (size_t)printed_len >= buf_size)
  ------------------
  |  Branch (91:13): [True: 0, False: 1]
  |  Branch (91:32): [True: 0, False: 1]
  ------------------
   92|      0|            printed_len = 0;
   93|      1|        if (buf != NULL)
  ------------------
  |  Branch (93:13): [True: 1, False: 0]
  ------------------
   94|      1|            buf[printed_len] = '\0';
   95|       |
   96|       |        /*
   97|       |         * Try to reduce the size, but only if we maximized above.  If that
   98|       |         * fails, we keep what we have.
   99|       |         * (According to documentation, realloc leaves the old buffer untouched
  100|       |         * if it fails)
  101|       |         */
  102|      1|        if ((rbuf = OPENSSL_realloc(buf, printed_len + 1)) != NULL) {
  ------------------
  |  |  125|      1|    CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (102:13): [True: 1, False: 0]
  ------------------
  103|      1|            buf = rbuf;
  104|      1|            buf_size = printed_len + 1;
  105|      1|            buf[printed_len] = '\0';
  106|      1|        }
  107|       |
  108|      1|        if (buf != NULL)
  ------------------
  |  Branch (108:13): [True: 1, False: 0]
  ------------------
  109|      1|            flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   50|      1|#define ERR_TXT_MALLOCED 0x01
  ------------------
                          flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   51|      1|#define ERR_TXT_STRING 0x02
  ------------------
  110|      1|    }
  111|       |
  112|      3|    err_clear_data(es, es->top, 0);
  113|      3|    err_set_error(es, es->top, lib, reason);
  114|      3|    if (fmt != NULL)
  ------------------
  |  Branch (114:9): [True: 1, False: 2]
  ------------------
  115|      1|        err_set_data(es, es->top, buf, buf_size, flags);
  116|      3|}

err_blocks.c:err_get_slot:
   35|      3|{
   36|      3|    es->top = (es->top + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   14|      3|#define ERR_NUM_ERRORS 16
  ------------------
   37|      3|    if (es->top == es->bottom)
  ------------------
  |  Branch (37:9): [True: 0, False: 3]
  ------------------
   38|      0|        es->bottom = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   14|      0|#define ERR_NUM_ERRORS 16
  ------------------
   39|      3|}
err_blocks.c:err_clear:
  106|      3|{
  107|      3|    err_clear_data(es, i, (deall));
  108|      3|    es->err_marks[i] = 0;
  109|      3|    es->err_flags[i] = 0;
  110|      3|    es->err_buffer[i] = 0;
  111|      3|    es->err_line[i] = -1;
  112|      3|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  136|      3|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  113|      3|    es->err_file[i] = NULL;
  114|      3|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  136|      3|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|       |    es->err_func[i] = NULL;
  116|      3|}
err_blocks.c:err_set_debug:
   71|      3|{
   72|       |    /*
   73|       |     * We dup the file and fn strings because they may be provider owned. If the
   74|       |     * provider gets unloaded, they may not be valid anymore.
   75|       |     */
   76|      3|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  136|      3|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      3|    if (file == NULL || file[0] == '\0')
  ------------------
  |  Branch (77:9): [True: 0, False: 3]
  |  Branch (77:25): [True: 0, False: 3]
  ------------------
   78|      0|        es->err_file[i] = NULL;
   79|      3|    else if ((es->err_file[i] = CRYPTO_malloc(strlen(file) + 1,
  ------------------
  |  Branch (79:14): [True: 3, False: 0]
  ------------------
   80|      3|                  NULL, 0))
   81|      3|        != NULL)
   82|       |        /* We cannot use OPENSSL_strdup due to possible recursion */
   83|      3|        strcpy(es->err_file[i], file);
   84|       |
   85|      3|    es->err_line[i] = line;
   86|      3|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  136|      3|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   87|      3|    if (fn == NULL || fn[0] == '\0')
  ------------------
  |  Branch (87:9): [True: 0, False: 3]
  |  Branch (87:23): [True: 0, False: 3]
  ------------------
   88|      0|        es->err_func[i] = NULL;
   89|      3|    else if ((es->err_func[i] = CRYPTO_malloc(strlen(fn) + 1,
  ------------------
  |  Branch (89:14): [True: 3, False: 0]
  ------------------
   90|      3|                  NULL, 0))
   91|      3|        != NULL)
   92|      3|        strcpy(es->err_func[i], fn);
   93|      3|}
err_blocks.c:err_clear_data:
   42|      6|{
   43|      6|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   50|      6|#define ERR_TXT_MALLOCED 0x01
  ------------------
  |  Branch (43:9): [True: 0, False: 6]
  ------------------
   44|      0|        if (deall) {
  ------------------
  |  Branch (44:13): [True: 0, False: 0]
  ------------------
   45|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   46|      0|            es->err_data[i] = NULL;
   47|      0|            es->err_data_size[i] = 0;
   48|      0|            es->err_data_flags[i] = 0;
   49|      0|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (49:20): [True: 0, False: 0]
  ------------------
   50|      0|            es->err_data[i][0] = '\0';
   51|      0|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   50|      0|#define ERR_TXT_MALLOCED 0x01
  ------------------
   52|      0|        }
   53|      6|    } else {
   54|       |        es->err_data[i] = NULL;
   55|      6|        es->err_data_size[i] = 0;
   56|      6|        es->err_data_flags[i] = 0;
   57|      6|    }
   58|      6|}
err_blocks.c:err_set_error:
   62|      3|{
   63|      3|    es->err_buffer[i] = lib == ERR_LIB_SYS
  ------------------
  |  |   55|      3|#define ERR_LIB_SYS 2
  ------------------
  |  Branch (63:25): [True: 1, False: 2]
  ------------------
   64|      3|        ? (unsigned int)(ERR_SYSTEM_FLAG | reason)
  ------------------
  |  |  201|      1|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  ------------------
   65|      3|        : ERR_PACK(lib, 0, reason);
  ------------------
  |  |  262|      5|    ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  210|      2|#define ERR_LIB_MASK 0xFF
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  209|      2|#define ERR_LIB_OFFSET 23L
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  213|      2|#define ERR_REASON_MASK 0X7FFFFF
  |  |  ------------------
  ------------------
   66|      3|}
err_blocks.c:err_set_data:
   97|      1|{
   98|      1|    if ((es->err_data_flags[i] & ERR_TXT_MALLOCED) != 0)
  ------------------
  |  |   50|      1|#define ERR_TXT_MALLOCED 0x01
  ------------------
  |  Branch (98:9): [True: 0, False: 1]
  ------------------
   99|      0|        OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  100|      1|    es->err_data[i] = data;
  101|      1|    es->err_data_size[i] = datasz;
  102|      1|    es->err_data_flags[i] = flags;
  103|      1|}
err_mark.c:err_clear:
  106|      3|{
  107|      3|    err_clear_data(es, i, (deall));
  108|      3|    es->err_marks[i] = 0;
  109|      3|    es->err_flags[i] = 0;
  110|      3|    es->err_buffer[i] = 0;
  111|      3|    es->err_line[i] = -1;
  112|      3|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  136|      3|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  113|      3|    es->err_file[i] = NULL;
  114|      3|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  136|      3|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|       |    es->err_func[i] = NULL;
  116|      3|}
err_mark.c:err_clear_data:
   42|      3|{
   43|      3|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   50|      3|#define ERR_TXT_MALLOCED 0x01
  ------------------
  |  Branch (43:9): [True: 1, False: 2]
  ------------------
   44|      1|        if (deall) {
  ------------------
  |  Branch (44:13): [True: 0, False: 1]
  ------------------
   45|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   46|      0|            es->err_data[i] = NULL;
   47|      0|            es->err_data_size[i] = 0;
   48|      0|            es->err_data_flags[i] = 0;
   49|      1|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (49:20): [True: 1, False: 0]
  ------------------
   50|      1|            es->err_data[i][0] = '\0';
   51|      1|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   50|      1|#define ERR_TXT_MALLOCED 0x01
  ------------------
   52|      1|        }
   53|      2|    } else {
   54|       |        es->err_data[i] = NULL;
   55|      2|        es->err_data_size[i] = 0;
   56|      2|        es->err_data_flags[i] = 0;
   57|      2|    }
   58|      3|}

ERR_set_mark:
   14|      3|{
   15|      3|    ERR_STATE *es;
   16|       |
   17|      3|    es = ossl_err_get_state_int(0);
   18|      3|    if (es == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 3]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      3|    if (es->bottom == es->top)
  ------------------
  |  Branch (21:9): [True: 3, False: 0]
  ------------------
   22|      3|        return 0;
   23|      0|    es->err_marks[es->top]++;
   24|      0|    return 1;
   25|      3|}
ERR_pop_to_mark:
   41|      3|{
   42|      3|    ERR_STATE *es;
   43|       |
   44|      3|    es = ossl_err_get_state_int(0);
   45|      3|    if (es == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 3]
  ------------------
   46|      0|        return 0;
   47|       |
   48|      6|    while (es->bottom != es->top
  ------------------
  |  Branch (48:12): [True: 3, False: 3]
  ------------------
   49|      3|        && es->err_marks[es->top] == 0) {
  ------------------
  |  Branch (49:12): [True: 3, False: 0]
  ------------------
   50|      3|        err_clear(es, es->top, 0);
   51|      3|        es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   14|      0|#define ERR_NUM_ERRORS 16
  ------------------
  |  Branch (51:19): [True: 3, False: 0]
  ------------------
   52|      3|    }
   53|       |
   54|      3|    if (es->bottom == es->top)
  ------------------
  |  Branch (54:9): [True: 3, False: 0]
  ------------------
   55|      3|        return 0;
   56|      0|    es->err_marks[es->top]--;
   57|      0|    return 1;
   58|      3|}

OSSL_ERR_STATE_new:
   20|      1|{
   21|       |    return CRYPTO_zalloc(sizeof(ERR_STATE), NULL, 0);
   22|      1|}

ossl_err_load_ESS_strings:
   42|      1|{
   43|      1|#ifndef OPENSSL_NO_ERR
   44|      1|    if (ERR_reason_error_string(ESS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (44:9): [True: 1, False: 0]
  ------------------
   45|      1|        ERR_load_strings_const(ESS_str_reasons);
   46|      1|#endif
   47|      1|    return 1;
   48|      1|}

openssl_add_all_ciphers_int:
   18|      1|{
   19|       |
   20|      1|#ifndef OPENSSL_NO_DES
   21|      1|    EVP_add_cipher(EVP_des_cfb());
  ------------------
  |  |  982|      1|#define EVP_des_cfb EVP_des_cfb64
  ------------------
   22|      1|    EVP_add_cipher(EVP_des_cfb1());
   23|      1|    EVP_add_cipher(EVP_des_cfb8());
   24|      1|    EVP_add_cipher(EVP_des_ede_cfb());
  ------------------
  |  |  986|      1|#define EVP_des_ede_cfb EVP_des_ede_cfb64
  ------------------
   25|      1|    EVP_add_cipher(EVP_des_ede3_cfb());
  ------------------
  |  |  988|      1|#define EVP_des_ede3_cfb EVP_des_ede3_cfb64
  ------------------
   26|      1|    EVP_add_cipher(EVP_des_ede3_cfb1());
   27|      1|    EVP_add_cipher(EVP_des_ede3_cfb8());
   28|       |
   29|      1|    EVP_add_cipher(EVP_des_ofb());
   30|      1|    EVP_add_cipher(EVP_des_ede_ofb());
   31|      1|    EVP_add_cipher(EVP_des_ede3_ofb());
   32|       |
   33|      1|    EVP_add_cipher(EVP_desx_cbc());
   34|      1|    EVP_add_cipher_alias(SN_desx_cbc, "DESX");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   35|      1|    EVP_add_cipher_alias(SN_desx_cbc, "desx");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   36|       |
   37|      1|    EVP_add_cipher(EVP_des_cbc());
   38|      1|    EVP_add_cipher_alias(SN_des_cbc, "DES");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   39|      1|    EVP_add_cipher_alias(SN_des_cbc, "des");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   40|      1|    EVP_add_cipher(EVP_des_ede_cbc());
   41|      1|    EVP_add_cipher(EVP_des_ede3_cbc());
   42|      1|    EVP_add_cipher_alias(SN_des_ede3_cbc, "DES3");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   43|      1|    EVP_add_cipher_alias(SN_des_ede3_cbc, "des3");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   44|       |
   45|      1|    EVP_add_cipher(EVP_des_ecb());
   46|      1|    EVP_add_cipher(EVP_des_ede());
   47|      1|    EVP_add_cipher_alias(SN_des_ede_ecb, "DES-EDE-ECB");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   48|      1|    EVP_add_cipher_alias(SN_des_ede_ecb, "des-ede-ecb");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   49|      1|    EVP_add_cipher(EVP_des_ede3());
   50|      1|    EVP_add_cipher_alias(SN_des_ede3_ecb, "DES-EDE3-ECB");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   51|      1|    EVP_add_cipher_alias(SN_des_ede3_ecb, "des-ede3-ecb");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   52|      1|    EVP_add_cipher(EVP_des_ede3_wrap());
   53|      1|    EVP_add_cipher_alias(SN_id_smime_alg_CMS3DESwrap, "des3-wrap");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   54|      1|#endif
   55|       |
   56|      1|#ifndef OPENSSL_NO_RC4
   57|      1|    EVP_add_cipher(EVP_rc4());
   58|      1|    EVP_add_cipher(EVP_rc4_40());
   59|      1|#ifndef OPENSSL_NO_MD5
   60|      1|    EVP_add_cipher(EVP_rc4_hmac_md5());
   61|      1|#endif
   62|      1|#endif
   63|       |
   64|      1|#ifndef OPENSSL_NO_IDEA
   65|      1|    EVP_add_cipher(EVP_idea_ecb());
   66|      1|    EVP_add_cipher(EVP_idea_cfb());
  ------------------
  |  | 1015|      1|#define EVP_idea_cfb EVP_idea_cfb64
  ------------------
   67|      1|    EVP_add_cipher(EVP_idea_ofb());
   68|      1|    EVP_add_cipher(EVP_idea_cbc());
   69|      1|    EVP_add_cipher_alias(SN_idea_cbc, "IDEA");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   70|      1|    EVP_add_cipher_alias(SN_idea_cbc, "idea");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   71|      1|#endif
   72|       |
   73|      1|#ifndef OPENSSL_NO_SEED
   74|      1|    EVP_add_cipher(EVP_seed_ecb());
   75|      1|    EVP_add_cipher(EVP_seed_cfb());
  ------------------
  |  | 1169|      1|#define EVP_seed_cfb EVP_seed_cfb128
  ------------------
   76|      1|    EVP_add_cipher(EVP_seed_ofb());
   77|      1|    EVP_add_cipher(EVP_seed_cbc());
   78|      1|    EVP_add_cipher_alias(SN_seed_cbc, "SEED");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   79|      1|    EVP_add_cipher_alias(SN_seed_cbc, "seed");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   80|      1|#endif
   81|       |
   82|      1|#ifndef OPENSSL_NO_SM4
   83|      1|    EVP_add_cipher(EVP_sm4_ecb());
   84|      1|    EVP_add_cipher(EVP_sm4_cbc());
   85|      1|    EVP_add_cipher(EVP_sm4_cfb());
  ------------------
  |  | 1177|      1|#define EVP_sm4_cfb EVP_sm4_cfb128
  ------------------
   86|      1|    EVP_add_cipher(EVP_sm4_ofb());
   87|      1|    EVP_add_cipher(EVP_sm4_ctr());
   88|      1|    EVP_add_cipher_alias(SN_sm4_cbc, "SM4");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   89|      1|    EVP_add_cipher_alias(SN_sm4_cbc, "sm4");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   90|      1|#endif
   91|       |
   92|      1|#ifndef OPENSSL_NO_RC2
   93|      1|    EVP_add_cipher(EVP_rc2_ecb());
   94|      1|    EVP_add_cipher(EVP_rc2_cfb());
  ------------------
  |  | 1025|      1|#define EVP_rc2_cfb EVP_rc2_cfb64
  ------------------
   95|      1|    EVP_add_cipher(EVP_rc2_ofb());
   96|      1|    EVP_add_cipher(EVP_rc2_cbc());
   97|      1|    EVP_add_cipher(EVP_rc2_40_cbc());
   98|      1|    EVP_add_cipher(EVP_rc2_64_cbc());
   99|      1|    EVP_add_cipher_alias(SN_rc2_cbc, "RC2");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  100|      1|    EVP_add_cipher_alias(SN_rc2_cbc, "rc2");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  101|      1|    EVP_add_cipher_alias(SN_rc2_cbc, "rc2-128");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  102|      1|    EVP_add_cipher_alias(SN_rc2_64_cbc, "rc2-64");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  103|      1|    EVP_add_cipher_alias(SN_rc2_40_cbc, "rc2-40");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  104|      1|#endif
  105|       |
  106|      1|#ifndef OPENSSL_NO_BF
  107|      1|    EVP_add_cipher(EVP_bf_ecb());
  108|      1|    EVP_add_cipher(EVP_bf_cfb());
  ------------------
  |  | 1032|      1|#define EVP_bf_cfb EVP_bf_cfb64
  ------------------
  109|      1|    EVP_add_cipher(EVP_bf_ofb());
  110|      1|    EVP_add_cipher(EVP_bf_cbc());
  111|      1|    EVP_add_cipher_alias(SN_bf_cbc, "BF");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  112|      1|    EVP_add_cipher_alias(SN_bf_cbc, "bf");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  113|      1|    EVP_add_cipher_alias(SN_bf_cbc, "blowfish");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  114|      1|#endif
  115|       |
  116|      1|#ifndef OPENSSL_NO_CAST
  117|      1|    EVP_add_cipher(EVP_cast5_ecb());
  118|      1|    EVP_add_cipher(EVP_cast5_cfb());
  ------------------
  |  | 1039|      1|#define EVP_cast5_cfb EVP_cast5_cfb64
  ------------------
  119|      1|    EVP_add_cipher(EVP_cast5_ofb());
  120|      1|    EVP_add_cipher(EVP_cast5_cbc());
  121|      1|    EVP_add_cipher_alias(SN_cast5_cbc, "CAST");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  122|      1|    EVP_add_cipher_alias(SN_cast5_cbc, "cast");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  123|      1|    EVP_add_cipher_alias(SN_cast5_cbc, "CAST-cbc");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  124|      1|    EVP_add_cipher_alias(SN_cast5_cbc, "cast-cbc");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  125|      1|#endif
  126|       |
  127|      1|#ifndef OPENSSL_NO_RC5
  128|      1|    EVP_add_cipher(EVP_rc5_32_12_16_ecb());
  129|      1|    EVP_add_cipher(EVP_rc5_32_12_16_cfb());
  ------------------
  |  | 1046|      1|#define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64
  ------------------
  130|      1|    EVP_add_cipher(EVP_rc5_32_12_16_ofb());
  131|      1|    EVP_add_cipher(EVP_rc5_32_12_16_cbc());
  132|      1|    EVP_add_cipher_alias(SN_rc5_cbc, "rc5");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  133|      1|    EVP_add_cipher_alias(SN_rc5_cbc, "RC5");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  134|      1|#endif
  135|       |
  136|      1|    EVP_add_cipher(EVP_aes_128_ecb());
  137|      1|    EVP_add_cipher(EVP_aes_128_cbc());
  138|      1|    EVP_add_cipher(EVP_aes_128_cfb());
  ------------------
  |  | 1054|      1|#define EVP_aes_128_cfb EVP_aes_128_cfb128
  ------------------
  139|      1|    EVP_add_cipher(EVP_aes_128_cfb1());
  140|      1|    EVP_add_cipher(EVP_aes_128_cfb8());
  141|      1|    EVP_add_cipher(EVP_aes_128_ofb());
  142|      1|    EVP_add_cipher(EVP_aes_128_ctr());
  143|      1|    EVP_add_cipher(EVP_aes_128_gcm());
  144|      1|#ifndef OPENSSL_NO_OCB
  145|      1|    EVP_add_cipher(EVP_aes_128_ocb());
  146|      1|#endif
  147|      1|    EVP_add_cipher(EVP_aes_128_xts());
  148|      1|    EVP_add_cipher(EVP_aes_128_ccm());
  149|      1|    EVP_add_cipher(EVP_aes_128_wrap());
  150|      1|    EVP_add_cipher_alias(SN_id_aes128_wrap, "aes128-wrap");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  151|      1|    EVP_add_cipher(EVP_aes_128_wrap_pad());
  152|      1|    EVP_add_cipher_alias(SN_id_aes128_wrap_pad, "aes128-wrap-pad");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  153|      1|    EVP_add_cipher_alias(SN_aes_128_cbc, "AES128");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  154|      1|    EVP_add_cipher_alias(SN_aes_128_cbc, "aes128");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  155|      1|    EVP_add_cipher(EVP_aes_192_ecb());
  156|      1|    EVP_add_cipher(EVP_aes_192_cbc());
  157|      1|    EVP_add_cipher(EVP_aes_192_cfb());
  ------------------
  |  | 1070|      1|#define EVP_aes_192_cfb EVP_aes_192_cfb128
  ------------------
  158|      1|    EVP_add_cipher(EVP_aes_192_cfb1());
  159|      1|    EVP_add_cipher(EVP_aes_192_cfb8());
  160|      1|    EVP_add_cipher(EVP_aes_192_ofb());
  161|      1|    EVP_add_cipher(EVP_aes_192_ctr());
  162|      1|    EVP_add_cipher(EVP_aes_192_gcm());
  163|      1|#ifndef OPENSSL_NO_OCB
  164|      1|    EVP_add_cipher(EVP_aes_192_ocb());
  165|      1|#endif
  166|      1|    EVP_add_cipher(EVP_aes_192_ccm());
  167|      1|    EVP_add_cipher(EVP_aes_192_wrap());
  168|      1|    EVP_add_cipher_alias(SN_id_aes192_wrap, "aes192-wrap");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  169|      1|    EVP_add_cipher(EVP_aes_192_wrap_pad());
  170|      1|    EVP_add_cipher_alias(SN_id_aes192_wrap_pad, "aes192-wrap-pad");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  171|      1|    EVP_add_cipher_alias(SN_aes_192_cbc, "AES192");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  172|      1|    EVP_add_cipher_alias(SN_aes_192_cbc, "aes192");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  173|      1|    EVP_add_cipher(EVP_aes_256_ecb());
  174|      1|    EVP_add_cipher(EVP_aes_256_cbc());
  175|      1|    EVP_add_cipher(EVP_aes_256_cfb());
  ------------------
  |  | 1085|      1|#define EVP_aes_256_cfb EVP_aes_256_cfb128
  ------------------
  176|      1|    EVP_add_cipher(EVP_aes_256_cfb1());
  177|      1|    EVP_add_cipher(EVP_aes_256_cfb8());
  178|      1|    EVP_add_cipher(EVP_aes_256_ofb());
  179|      1|    EVP_add_cipher(EVP_aes_256_ctr());
  180|      1|    EVP_add_cipher(EVP_aes_256_gcm());
  181|      1|#ifndef OPENSSL_NO_OCB
  182|      1|    EVP_add_cipher(EVP_aes_256_ocb());
  183|      1|#endif
  184|      1|    EVP_add_cipher(EVP_aes_256_xts());
  185|      1|    EVP_add_cipher(EVP_aes_256_ccm());
  186|      1|    EVP_add_cipher(EVP_aes_256_wrap());
  187|      1|    EVP_add_cipher_alias(SN_id_aes256_wrap, "aes256-wrap");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  188|      1|    EVP_add_cipher(EVP_aes_256_wrap_pad());
  189|      1|    EVP_add_cipher_alias(SN_id_aes256_wrap_pad, "aes256-wrap-pad");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  190|      1|    EVP_add_cipher_alias(SN_aes_256_cbc, "AES256");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  191|      1|    EVP_add_cipher_alias(SN_aes_256_cbc, "aes256");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  192|      1|    EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1());
  193|      1|    EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1());
  194|      1|    EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256());
  195|      1|    EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256());
  196|      1|#ifndef OPENSSL_NO_ARIA
  197|      1|    EVP_add_cipher(EVP_aria_128_ecb());
  198|      1|    EVP_add_cipher(EVP_aria_128_cbc());
  199|      1|    EVP_add_cipher(EVP_aria_128_cfb());
  ------------------
  |  | 1106|      1|#define EVP_aria_128_cfb EVP_aria_128_cfb128
  ------------------
  200|      1|    EVP_add_cipher(EVP_aria_128_cfb1());
  201|      1|    EVP_add_cipher(EVP_aria_128_cfb8());
  202|      1|    EVP_add_cipher(EVP_aria_128_ctr());
  203|      1|    EVP_add_cipher(EVP_aria_128_ofb());
  204|      1|    EVP_add_cipher(EVP_aria_128_gcm());
  205|      1|    EVP_add_cipher(EVP_aria_128_ccm());
  206|      1|    EVP_add_cipher_alias(SN_aria_128_cbc, "ARIA128");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  207|      1|    EVP_add_cipher_alias(SN_aria_128_cbc, "aria128");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  208|      1|    EVP_add_cipher(EVP_aria_192_ecb());
  209|      1|    EVP_add_cipher(EVP_aria_192_cbc());
  210|      1|    EVP_add_cipher(EVP_aria_192_cfb());
  ------------------
  |  | 1116|      1|#define EVP_aria_192_cfb EVP_aria_192_cfb128
  ------------------
  211|      1|    EVP_add_cipher(EVP_aria_192_cfb1());
  212|      1|    EVP_add_cipher(EVP_aria_192_cfb8());
  213|      1|    EVP_add_cipher(EVP_aria_192_ctr());
  214|      1|    EVP_add_cipher(EVP_aria_192_ofb());
  215|      1|    EVP_add_cipher(EVP_aria_192_gcm());
  216|      1|    EVP_add_cipher(EVP_aria_192_ccm());
  217|      1|    EVP_add_cipher_alias(SN_aria_192_cbc, "ARIA192");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  218|      1|    EVP_add_cipher_alias(SN_aria_192_cbc, "aria192");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  219|      1|    EVP_add_cipher(EVP_aria_256_ecb());
  220|      1|    EVP_add_cipher(EVP_aria_256_cbc());
  221|      1|    EVP_add_cipher(EVP_aria_256_cfb());
  ------------------
  |  | 1126|      1|#define EVP_aria_256_cfb EVP_aria_256_cfb128
  ------------------
  222|      1|    EVP_add_cipher(EVP_aria_256_cfb1());
  223|      1|    EVP_add_cipher(EVP_aria_256_cfb8());
  224|      1|    EVP_add_cipher(EVP_aria_256_ctr());
  225|      1|    EVP_add_cipher(EVP_aria_256_ofb());
  226|      1|    EVP_add_cipher(EVP_aria_256_gcm());
  227|      1|    EVP_add_cipher(EVP_aria_256_ccm());
  228|      1|    EVP_add_cipher_alias(SN_aria_256_cbc, "ARIA256");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  229|      1|    EVP_add_cipher_alias(SN_aria_256_cbc, "aria256");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  230|      1|#endif
  231|       |
  232|      1|#ifndef OPENSSL_NO_CAMELLIA
  233|      1|    EVP_add_cipher(EVP_camellia_128_ecb());
  234|      1|    EVP_add_cipher(EVP_camellia_128_cbc());
  235|      1|    EVP_add_cipher(EVP_camellia_128_cfb());
  ------------------
  |  | 1138|      1|#define EVP_camellia_128_cfb EVP_camellia_128_cfb128
  ------------------
  236|      1|    EVP_add_cipher(EVP_camellia_128_cfb1());
  237|      1|    EVP_add_cipher(EVP_camellia_128_cfb8());
  238|      1|    EVP_add_cipher(EVP_camellia_128_ofb());
  239|      1|    EVP_add_cipher_alias(SN_camellia_128_cbc, "CAMELLIA128");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  240|      1|    EVP_add_cipher_alias(SN_camellia_128_cbc, "camellia128");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  241|      1|    EVP_add_cipher(EVP_camellia_192_ecb());
  242|      1|    EVP_add_cipher(EVP_camellia_192_cbc());
  243|      1|    EVP_add_cipher(EVP_camellia_192_cfb());
  ------------------
  |  | 1146|      1|#define EVP_camellia_192_cfb EVP_camellia_192_cfb128
  ------------------
  244|      1|    EVP_add_cipher(EVP_camellia_192_cfb1());
  245|      1|    EVP_add_cipher(EVP_camellia_192_cfb8());
  246|      1|    EVP_add_cipher(EVP_camellia_192_ofb());
  247|      1|    EVP_add_cipher_alias(SN_camellia_192_cbc, "CAMELLIA192");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  248|      1|    EVP_add_cipher_alias(SN_camellia_192_cbc, "camellia192");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  249|      1|    EVP_add_cipher(EVP_camellia_256_ecb());
  250|      1|    EVP_add_cipher(EVP_camellia_256_cbc());
  251|      1|    EVP_add_cipher(EVP_camellia_256_cfb());
  ------------------
  |  | 1154|      1|#define EVP_camellia_256_cfb EVP_camellia_256_cfb128
  ------------------
  252|      1|    EVP_add_cipher(EVP_camellia_256_cfb1());
  253|      1|    EVP_add_cipher(EVP_camellia_256_cfb8());
  254|      1|    EVP_add_cipher(EVP_camellia_256_ofb());
  255|      1|    EVP_add_cipher_alias(SN_camellia_256_cbc, "CAMELLIA256");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  256|      1|    EVP_add_cipher_alias(SN_camellia_256_cbc, "camellia256");
  ------------------
  |  |  682|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  257|      1|    EVP_add_cipher(EVP_camellia_128_ctr());
  258|      1|    EVP_add_cipher(EVP_camellia_192_ctr());
  259|      1|    EVP_add_cipher(EVP_camellia_256_ctr());
  260|      1|#endif
  261|       |
  262|      1|#ifndef OPENSSL_NO_CHACHA
  263|      1|    EVP_add_cipher(EVP_chacha20());
  264|      1|#ifndef OPENSSL_NO_POLY1305
  265|      1|    EVP_add_cipher(EVP_chacha20_poly1305());
  266|      1|#endif
  267|      1|#endif
  268|      1|}

openssl_add_all_digests_int:
   18|      1|{
   19|      1|#ifndef OPENSSL_NO_MD4
   20|      1|    EVP_add_digest(EVP_md4());
   21|      1|#endif
   22|      1|#ifndef OPENSSL_NO_MD5
   23|      1|    EVP_add_digest(EVP_md5());
   24|      1|    EVP_add_digest_alias(SN_md5, "ssl3-md5");
  ------------------
  |  |  684|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   25|      1|    EVP_add_digest(EVP_md5_sha1());
   26|      1|#endif
   27|      1|    EVP_add_digest(EVP_sha1());
   28|      1|    EVP_add_digest_alias(SN_sha1, "ssl3-sha1");
  ------------------
  |  |  684|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   29|      1|    EVP_add_digest_alias(SN_sha1WithRSAEncryption, SN_sha1WithRSA);
  ------------------
  |  |  684|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   30|      1|#if !defined(OPENSSL_NO_MDC2) && !defined(OPENSSL_NO_DES)
   31|      1|    EVP_add_digest(EVP_mdc2());
   32|      1|#endif
   33|      1|#ifndef OPENSSL_NO_RMD160
   34|      1|    EVP_add_digest(EVP_ripemd160());
   35|      1|    EVP_add_digest_alias(SN_ripemd160, "ripemd");
  ------------------
  |  |  684|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   36|      1|    EVP_add_digest_alias(SN_ripemd160, "rmd160");
  ------------------
  |  |  684|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   37|      1|#endif
   38|      1|    EVP_add_digest(EVP_sha224());
   39|      1|    EVP_add_digest(EVP_sha256());
   40|      1|    EVP_add_digest(EVP_sha384());
   41|      1|    EVP_add_digest(EVP_sha512());
   42|      1|    EVP_add_digest(EVP_sha512_224());
   43|      1|    EVP_add_digest(EVP_sha512_256());
   44|      1|#ifndef OPENSSL_NO_WHIRLPOOL
   45|      1|    EVP_add_digest(EVP_whirlpool());
   46|      1|#endif
   47|      1|#ifndef OPENSSL_NO_SM3
   48|      1|    EVP_add_digest(EVP_sm3());
   49|      1|#endif
   50|      1|#ifndef OPENSSL_NO_BLAKE2
   51|      1|    EVP_add_digest(EVP_blake2b512());
   52|      1|    EVP_add_digest(EVP_blake2s256());
   53|      1|#endif
   54|      1|    EVP_add_digest(EVP_sha3_224());
   55|      1|    EVP_add_digest(EVP_sha3_256());
   56|      1|    EVP_add_digest(EVP_sha3_384());
   57|      1|    EVP_add_digest(EVP_sha3_512());
   58|      1|    EVP_add_digest(EVP_shake128());
   59|      1|    EVP_add_digest(EVP_shake256());
   60|      1|}

evp_md_ctx_clear_digest:
   29|      1|{
   30|      1|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (30:9): [True: 1, False: 0]
  ------------------
   31|      1|        if (ctx->digest != NULL && ctx->digest->freectx != NULL)
  ------------------
  |  Branch (31:13): [True: 1, False: 0]
  |  Branch (31:36): [True: 1, False: 0]
  ------------------
   32|      1|            ctx->digest->freectx(ctx->algctx);
   33|      1|        ctx->algctx = NULL;
   34|      1|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  249|      1|#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been \
  ------------------
   35|      1|    }
   36|       |
   37|       |    /* Code below to be removed when legacy support is dropped. */
   38|       |
   39|       |    /*
   40|       |     * Don't assume ctx->md_data was cleaned in EVP_Digest_Final, because
   41|       |     * sometimes only copies of the context are ever finalised.
   42|       |     */
   43|      1|    if (force)
  ------------------
  |  Branch (43:9): [True: 0, False: 1]
  ------------------
   44|      0|        ctx->digest = NULL;
   45|       |
   46|       |    /* Non legacy code, this has to be later than the ctx->digest cleaning */
   47|      1|    if (!keep_fetched) {
  ------------------
  |  Branch (47:9): [True: 1, False: 0]
  ------------------
   48|      1|        EVP_MD_free(ctx->fetched_digest);
   49|      1|        ctx->fetched_digest = NULL;
   50|       |        ctx->reqdigest = NULL;
   51|      1|    }
   52|      1|}
EVP_MD_CTX_reset:
   77|      1|{
   78|      1|    return evp_md_ctx_reset_ex(ctx, 0);
   79|      1|}
EVP_MD_CTX_new:
  108|      1|{
  109|      1|    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|      1|}
EVP_MD_CTX_free:
  113|      1|{
  114|      1|    if (ctx == NULL)
  ------------------
  |  Branch (114:9): [True: 0, False: 1]
  ------------------
  115|      0|        return;
  116|       |
  117|      1|    EVP_MD_CTX_reset(ctx);
  118|      1|    OPENSSL_free(ctx);
  ------------------
  |  |  136|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  119|      1|}
evp_md_ctx_free_algctx:
  122|      1|{
  123|      1|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (123:9): [True: 0, False: 1]
  ------------------
  124|      0|        if (!ossl_assert(ctx->digest != NULL)) {
  ------------------
  |  |   45|      0|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (124:13): [True: 0, False: 0]
  ------------------
  125|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|            return 0;
  127|      0|        }
  128|      0|        if (ctx->digest->freectx != NULL)
  ------------------
  |  Branch (128:13): [True: 0, False: 0]
  ------------------
  129|      0|            ctx->digest->freectx(ctx->algctx);
  130|      0|        ctx->algctx = NULL;
  131|      0|    }
  132|      1|    return 1;
  133|      1|}
EVP_DigestInit_ex:
  239|      1|{
  240|      1|    if (!ossl_assert(impl == NULL))
  ------------------
  |  |   45|      1|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      1|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (240:9): [True: 0, False: 1]
  ------------------
  241|      0|        return 0;
  242|      1|    return evp_md_init_internal(ctx, type, NULL);
  243|      1|}
EVP_DigestUpdate:
  246|      1|{
  247|      1|    if (ossl_unlikely(count == 0))
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  248|      0|        return 1;
  249|       |
  250|      1|    if (ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0)) {
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  251|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  252|      0|        return 0;
  253|      0|    }
  254|       |
  255|      1|    if (ossl_unlikely(ctx->pctx != NULL)
  ------------------
  |  |   24|      2|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  256|      0|        && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  474|      1|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1628|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1612|      0|#define EVP_PKEY_OP_SIGN (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1622|      0|#define EVP_PKEY_OP_SIGNMSG (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1629|      0|        | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1613|      0|#define EVP_PKEY_OP_VERIFY (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1623|      0|#define EVP_PKEY_OP_VERIFYMSG (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1630|      0|        | EVP_PKEY_OP_VERIFYRECOVER                  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1614|      0|#define EVP_PKEY_OP_VERIFYRECOVER (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1631|      0|        | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1615|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1616|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (474:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  257|      0|        && ctx->pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (257:12): [True: 0, False: 0]
  ------------------
  258|      0|#ifndef FIPS_MODULE
  259|       |        /*
  260|       |         * Prior to OpenSSL 3.0 EVP_DigestSignUpdate() and
  261|       |         * EVP_DigestVerifyUpdate() were just macros for EVP_DigestUpdate().
  262|       |         * Some code calls EVP_DigestUpdate() directly even when initialised
  263|       |         * with EVP_DigestSignInit_ex() or
  264|       |         * EVP_DigestVerifyInit_ex(), so we detect that and redirect to
  265|       |         * the correct EVP_Digest*Update() function
  266|       |         */
  267|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1615|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  ------------------
  |  Branch (267:13): [True: 0, False: 0]
  ------------------
  268|      0|            return EVP_DigestSignUpdate(ctx, data, count);
  269|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_VERIFYCTX)
  ------------------
  |  | 1616|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  ------------------
  |  Branch (269:13): [True: 0, False: 0]
  ------------------
  270|      0|            return EVP_DigestVerifyUpdate(ctx, data, count);
  271|      0|#endif
  272|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|        return 0;
  274|      0|    }
  275|       |
  276|      1|    if (ctx->digest == NULL || ctx->digest->prov == NULL) {
  ------------------
  |  Branch (276:9): [True: 0, False: 1]
  |  Branch (276:32): [True: 0, False: 1]
  ------------------
  277|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  278|      0|        return 0;
  279|      0|    }
  280|       |
  281|      1|    if (ossl_unlikely(ctx->digest->dupdate == NULL)) {
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  282|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0|        return 0;
  284|      0|    }
  285|      1|    return ctx->digest->dupdate(ctx->algctx, data, count);
  286|      1|}
EVP_DigestFinal_ex:
  299|      1|{
  300|      1|    int ret, sz;
  301|      1|    size_t size = 0;
  302|      1|    size_t mdsize = 0;
  303|       |
  304|      1|    if (ossl_unlikely(ctx->digest == NULL))
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  305|      0|        return 0;
  306|       |
  307|      1|    sz = EVP_MD_CTX_get_size(ctx);
  ------------------
  |  |  560|      1|#define EVP_MD_CTX_get_size(e) EVP_MD_CTX_get_size_ex(e)
  ------------------
  308|      1|    if (ossl_unlikely(sz < 0))
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  309|      0|        return 0;
  310|      1|    mdsize = sz;
  311|      1|    if (ossl_unlikely(ctx->digest->prov == NULL)) {
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  312|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  313|      0|        return 0;
  314|      0|    }
  315|       |
  316|      1|    if (ossl_unlikely(ctx->digest->dfinal == NULL)) {
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  317|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  318|      0|        return 0;
  319|      0|    }
  320|       |
  321|      1|    if (ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0)) {
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  322|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  323|      0|        return 0;
  324|      0|    }
  325|       |
  326|      1|    ret = ctx->digest->dfinal(ctx->algctx, md, &size, mdsize);
  327|       |
  328|      1|    ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|      1|#define EVP_MD_CTX_FLAG_FINALISED 0x0800
  ------------------
  329|       |
  330|      1|    if (isize != NULL) {
  ------------------
  |  Branch (330:9): [True: 1, False: 0]
  ------------------
  331|      1|        if (ossl_likely(size <= UINT_MAX)) {
  ------------------
  |  |   23|      1|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  332|      1|            *isize = (unsigned int)size;
  333|      1|        } else {
  334|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  335|      0|            ret = 0;
  336|      0|        }
  337|      1|    }
  338|       |
  339|      1|    return ret;
  340|      1|}
EVP_Digest:
  549|      1|{
  550|      1|    EVP_MD_CTX *ctx;
  551|      1|    int ret;
  552|       |
  553|      1|    if (!ossl_assert(impl == NULL))
  ------------------
  |  |   45|      1|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      1|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (553:9): [True: 0, False: 1]
  ------------------
  554|      0|        return 0;
  555|       |
  556|      1|    ctx = EVP_MD_CTX_new();
  557|      1|    if (ctx == NULL)
  ------------------
  |  Branch (557:9): [True: 0, False: 1]
  ------------------
  558|      0|        return 0;
  559|      1|    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);
  ------------------
  |  |  247|      1|#define EVP_MD_CTX_FLAG_ONESHOT 0x0001 /* digest update will be \
  ------------------
  560|      1|    ret = EVP_DigestInit_ex(ctx, type, NULL)
  ------------------
  |  Branch (560:11): [True: 1, False: 0]
  ------------------
  561|      1|        && EVP_DigestUpdate(ctx, data, count)
  ------------------
  |  Branch (561:12): [True: 1, False: 0]
  ------------------
  562|      1|        && EVP_DigestFinal_ex(ctx, md, size);
  ------------------
  |  Branch (562:12): [True: 1, False: 0]
  ------------------
  563|      1|    EVP_MD_CTX_free(ctx);
  564|       |
  565|      1|    return ret;
  566|      1|}
EVP_Q_digest:
  571|      1|{
  572|      1|    EVP_MD *digest = EVP_MD_fetch(libctx, name, propq);
  573|      1|    unsigned int temp = 0;
  574|      1|    int ret = 0;
  575|       |
  576|      1|    if (digest != NULL) {
  ------------------
  |  Branch (576:9): [True: 1, False: 0]
  ------------------
  577|      1|        ret = EVP_Digest(data, datalen, md, &temp, digest, NULL);
  578|      1|        EVP_MD_free(digest);
  579|      1|    }
  580|      1|    if (mdlen != NULL)
  ------------------
  |  Branch (580:9): [True: 0, False: 1]
  ------------------
  581|      0|        *mdlen = temp;
  582|      1|    return ret;
  583|      1|}
EVP_MD_CTX_gettable_params:
  687|      1|{
  688|      1|    EVP_PKEY_CTX *pctx;
  689|      1|    void *provctx;
  690|       |
  691|      1|    if (ossl_unlikely(ctx == NULL))
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  692|      0|        return NULL;
  693|       |
  694|       |    /* If we have a pctx then we should try that first */
  695|      1|    pctx = ctx->pctx;
  696|      1|    if (ossl_unlikely(pctx != NULL)
  ------------------
  |  |   24|      2|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  697|      0|        && (pctx->operation == EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1616|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  ------------------
  |  Branch (697:13): [True: 0, False: 0]
  ------------------
  698|      0|            || pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1615|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  ------------------
  |  Branch (698:16): [True: 0, False: 0]
  ------------------
  699|      0|        && pctx->op.sig.signature != NULL
  ------------------
  |  Branch (699:12): [True: 0, False: 0]
  ------------------
  700|      0|        && pctx->op.sig.signature->gettable_ctx_md_params != NULL
  ------------------
  |  Branch (700:12): [True: 0, False: 0]
  ------------------
  701|      0|        && pctx->op.sig.algctx != NULL)
  ------------------
  |  Branch (701:12): [True: 0, False: 0]
  ------------------
  702|      0|        return pctx->op.sig.signature->gettable_ctx_md_params(
  703|      0|            pctx->op.sig.algctx);
  704|       |
  705|      1|    if (ossl_unlikely(ctx->digest != NULL
  ------------------
  |  |   24|      2|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  |  Branch (24:46): [True: 1, False: 0]
  |  |  |  Branch (24:46): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  706|      1|            && ctx->digest->gettable_ctx_params != NULL)) {
  707|      0|        provctx = ossl_provider_ctx(EVP_MD_get0_provider(ctx->digest));
  708|      0|        return ctx->digest->gettable_ctx_params(ctx->algctx, provctx);
  709|      0|    }
  710|      1|    return NULL;
  711|      1|}
evp_md_new:
  760|     30|{
  761|     30|    EVP_MD *md = OPENSSL_zalloc(sizeof(*md));
  ------------------
  |  |  113|     30|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  762|       |
  763|     30|    if (md != NULL && !CRYPTO_NEW_REF(&md->refcnt, 1)) {
  ------------------
  |  Branch (763:9): [True: 30, False: 0]
  |  Branch (763:23): [True: 0, False: 30]
  ------------------
  764|      0|        OPENSSL_free(md);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  765|      0|        return NULL;
  766|      0|    }
  767|     30|    return md;
  768|     30|}
EVP_MD_fetch:
 1008|      1|{
 1009|      1|    EVP_MD *md = evp_generic_fetch(ctx, OSSL_OP_DIGEST, algorithm, properties,
  ------------------
  |  |  283|      1|#define OSSL_OP_DIGEST 1
  ------------------
 1010|      1|        evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
 1011|       |
 1012|      1|    return md;
 1013|      1|}
EVP_MD_up_ref:
 1016|      1|{
 1017|       |#ifdef OPENSSL_NO_CACHED_FETCH
 1018|       |    return evp_md_up_ref(md);
 1019|       |#else
 1020|      1|    if (md->flags & EVP_MD_FLAG_NO_STORE)
  ------------------
  |  |  230|      1|#define EVP_MD_FLAG_NO_STORE 0x0800
  ------------------
  |  Branch (1020:9): [True: 0, False: 1]
  ------------------
 1021|      0|        return evp_md_up_ref(md);
 1022|      1|    return 1;
 1023|      1|#endif
 1024|      1|}
EVP_MD_free:
 1027|      3|{
 1028|       |#ifdef OPENSSL_NO_CACHED_FETCH
 1029|       |    evp_md_free(md);
 1030|       |#else
 1031|      3|    if (md != NULL && (md->flags & EVP_MD_FLAG_NO_STORE))
  ------------------
  |  |  230|      2|#define EVP_MD_FLAG_NO_STORE 0x0800
  ------------------
  |  Branch (1031:9): [True: 2, False: 1]
  |  Branch (1031:23): [True: 0, False: 2]
  ------------------
 1032|      0|        evp_md_free(md);
 1033|      3|    return;
 1034|      3|#endif
 1035|      3|}
digest.c:evp_md_ctx_reset_ex:
   55|      1|{
   56|      1|    if (ctx == NULL)
  ------------------
  |  Branch (56:9): [True: 0, False: 1]
  ------------------
   57|      0|        return 1;
   58|       |
   59|       |    /*
   60|       |     * pctx should be freed by the user of EVP_MD_CTX
   61|       |     * if EVP_MD_CTX_FLAG_KEEP_PKEY_CTX is set
   62|       |     */
   63|      1|    if (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX)) {
  ------------------
  |  |   32|      1|#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX 0x0400
  ------------------
  |  Branch (63:9): [True: 1, False: 0]
  ------------------
   64|      1|        EVP_PKEY_CTX_free(ctx->pctx);
   65|      1|        ctx->pctx = NULL;
   66|      1|    }
   67|       |
   68|      1|    evp_md_ctx_clear_digest(ctx, 0, keep_fetched);
   69|      1|    if (!keep_fetched)
  ------------------
  |  Branch (69:9): [True: 1, False: 0]
  ------------------
   70|      1|        OPENSSL_cleanse(ctx, sizeof(*ctx));
   71|       |
   72|      1|    return 1;
   73|      1|}
digest.c:evp_md_init_internal:
  137|      1|{
  138|      1|#if !defined(FIPS_MODULE)
  139|      1|    if (ctx->pctx != NULL
  ------------------
  |  Branch (139:9): [True: 0, False: 1]
  ------------------
  140|      0|        && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  474|      1|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1628|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1612|      0|#define EVP_PKEY_OP_SIGN (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1622|      0|#define EVP_PKEY_OP_SIGNMSG (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1629|      0|        | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1613|      0|#define EVP_PKEY_OP_VERIFY (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1623|      0|#define EVP_PKEY_OP_VERIFYMSG (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1630|      0|        | EVP_PKEY_OP_VERIFYRECOVER                  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1614|      0|#define EVP_PKEY_OP_VERIFYRECOVER (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1631|      0|        | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1615|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1616|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (474:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  141|      0|        && ctx->pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (141:12): [True: 0, False: 0]
  ------------------
  142|       |        /*
  143|       |         * Prior to OpenSSL 3.0 calling EVP_DigestInit_ex() on an mdctx
  144|       |         * previously initialised with EVP_DigestSignInit() would retain
  145|       |         * information about the key, and re-initialise for another sign
  146|       |         * operation. So in that case we redirect to EVP_DigestSignInit()
  147|       |         */
  148|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1615|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  ------------------
  |  Branch (148:13): [True: 0, False: 0]
  ------------------
  149|      0|            return EVP_DigestSignInit(ctx, NULL, type, NULL, NULL);
  150|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_VERIFYCTX)
  ------------------
  |  | 1616|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  ------------------
  |  Branch (150:13): [True: 0, False: 0]
  ------------------
  151|      0|            return EVP_DigestVerifyInit(ctx, NULL, type, NULL, NULL);
  152|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  153|      0|        return 0;
  154|      0|    }
  155|      1|#endif
  156|       |
  157|      1|    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED | EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |  249|      1|#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been \
  ------------------
                  EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED | EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |   33|      1|#define EVP_MD_CTX_FLAG_FINALISED 0x0800
  ------------------
  158|       |
  159|      1|    if (type != NULL) {
  ------------------
  |  Branch (159:9): [True: 1, False: 0]
  ------------------
  160|      1|        ctx->reqdigest = type;
  161|      1|    } else {
  162|      0|        if (ossl_unlikely(ctx->digest == NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  163|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_NO_DIGEST_SET);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  164|      0|            return 0;
  165|      0|        }
  166|      0|        type = ctx->digest;
  167|      0|    }
  168|       |
  169|      1|    if (ossl_likely(ctx->digest == type)) {
  ------------------
  |  |   23|      1|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  170|      0|        if (ossl_unlikely(!ossl_assert(type->prov != NULL))) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  171|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  172|      0|            return 0;
  173|      0|        }
  174|      1|    } else {
  175|      1|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (175:13): [True: 0, False: 1]
  ------------------
  176|      0|            return 0;
  177|      1|    }
  178|       |
  179|      1|    if (ossl_unlikely(type->prov == NULL)) {
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  180|       |#ifdef FIPS_MODULE
  181|       |        /* We only do explicit fetches inside the FIPS module */
  182|       |        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  183|       |        return 0;
  184|       |#else
  185|       |        /* The NULL digest is a special case */
  186|      0|        EVP_MD *provmd = EVP_MD_fetch(NULL,
  187|      0|            type->type != NID_undef ? OBJ_nid2sn(type->type)
  ------------------
  |  |   19|      0|#define NID_undef                       0
  ------------------
  |  Branch (187:13): [True: 0, False: 0]
  ------------------
  188|      0|                                    : "NULL",
  189|      0|            "");
  190|       |
  191|      0|        if (provmd == NULL) {
  ------------------
  |  Branch (191:13): [True: 0, False: 0]
  ------------------
  192|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|            return 0;
  194|      0|        }
  195|      0|        type = provmd;
  196|      0|        EVP_MD_free(ctx->fetched_digest);
  197|      0|        ctx->fetched_digest = provmd;
  198|      0|#endif
  199|      0|    }
  200|       |
  201|      1|    if (ossl_unlikely(type->prov != NULL && ctx->fetched_digest != type)) {
  ------------------
  |  |   24|      2|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 1, False: 0]
  |  |  |  Branch (24:46): [True: 1, False: 0]
  |  |  |  Branch (24:46): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  202|      1|        if (ossl_unlikely(!EVP_MD_up_ref((EVP_MD *)type))) {
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  203|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  204|      0|            return 0;
  205|      0|        }
  206|      1|        EVP_MD_free(ctx->fetched_digest);
  207|      1|        ctx->fetched_digest = (EVP_MD *)type;
  208|      1|    }
  209|      1|    ctx->digest = type;
  210|      1|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (210:9): [True: 1, False: 0]
  ------------------
  211|      1|        ctx->algctx = ctx->digest->newctx(ossl_provider_ctx(type->prov));
  212|      1|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (212:13): [True: 0, False: 1]
  ------------------
  213|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  214|      0|            return 0;
  215|      0|        }
  216|      1|    }
  217|       |
  218|      1|    if (ctx->digest->dinit == NULL) {
  ------------------
  |  Branch (218:9): [True: 0, False: 1]
  ------------------
  219|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  220|      0|        return 0;
  221|      0|    }
  222|       |
  223|      1|    return ctx->digest->dinit(ctx->algctx, params);
  224|      1|}
digest.c:evp_md_from_algorithm:
  836|     30|{
  837|     30|    const OSSL_DISPATCH *fns = algodef->implementation;
  838|     30|    EVP_MD *md = NULL;
  839|     30|    int fncnt = 0;
  840|       |
  841|       |    /* EVP_MD_fetch() will set the legacy NID if available */
  842|     30|    if ((md = evp_md_new()) == NULL) {
  ------------------
  |  Branch (842:9): [True: 0, False: 30]
  ------------------
  843|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  844|      0|        return NULL;
  845|      0|    }
  846|       |
  847|     30|    if (no_store != 0)
  ------------------
  |  Branch (847:9): [True: 0, False: 30]
  ------------------
  848|      0|        md->flags |= EVP_MD_FLAG_NO_STORE;
  ------------------
  |  |  230|      0|#define EVP_MD_FLAG_NO_STORE 0x0800
  ------------------
  849|       |
  850|     30|#ifndef FIPS_MODULE
  851|     30|    md->type = NID_undef;
  ------------------
  |  |   19|     30|#define NID_undef                       0
  ------------------
  852|     30|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &md->type)
  ------------------
  |  Branch (852:9): [True: 0, False: 30]
  ------------------
  853|     30|        || md->type == -1) {
  ------------------
  |  Branch (853:12): [True: 0, False: 30]
  ------------------
  854|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  855|      0|        goto err;
  856|      0|    }
  857|     30|#endif
  858|       |
  859|     30|    md->name_id = name_id;
  860|     30|    if ((md->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (860:9): [True: 0, False: 30]
  ------------------
  861|      0|        goto err;
  862|       |
  863|     30|    md->description = algodef->algorithm_description;
  864|       |
  865|    381|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (865:12): [True: 351, False: 30]
  ------------------
  866|    351|        switch (fns->function_id) {
  ------------------
  |  Branch (866:17): [True: 351, False: 0]
  ------------------
  867|     30|        case OSSL_FUNC_DIGEST_NEWCTX:
  ------------------
  |  |  303|     30|#define OSSL_FUNC_DIGEST_NEWCTX 1
  ------------------
  |  Branch (867:9): [True: 30, False: 321]
  ------------------
  868|     30|            if (md->newctx == NULL) {
  ------------------
  |  Branch (868:17): [True: 30, False: 0]
  ------------------
  869|     30|                md->newctx = OSSL_FUNC_digest_newctx(fns);
  870|     30|                fncnt++;
  871|     30|            }
  872|     30|            break;
  873|     30|        case OSSL_FUNC_DIGEST_INIT:
  ------------------
  |  |  304|     30|#define OSSL_FUNC_DIGEST_INIT 2
  ------------------
  |  Branch (873:9): [True: 30, False: 321]
  ------------------
  874|     30|            if (md->dinit == NULL) {
  ------------------
  |  Branch (874:17): [True: 30, False: 0]
  ------------------
  875|     30|                md->dinit = OSSL_FUNC_digest_init(fns);
  876|     30|                fncnt++;
  877|     30|            }
  878|     30|            break;
  879|     30|        case OSSL_FUNC_DIGEST_UPDATE:
  ------------------
  |  |  305|     30|#define OSSL_FUNC_DIGEST_UPDATE 3
  ------------------
  |  Branch (879:9): [True: 30, False: 321]
  ------------------
  880|     30|            if (md->dupdate == NULL) {
  ------------------
  |  Branch (880:17): [True: 30, False: 0]
  ------------------
  881|     30|                md->dupdate = OSSL_FUNC_digest_update(fns);
  882|     30|                fncnt++;
  883|     30|            }
  884|     30|            break;
  885|     30|        case OSSL_FUNC_DIGEST_FINAL:
  ------------------
  |  |  306|     30|#define OSSL_FUNC_DIGEST_FINAL 4
  ------------------
  |  Branch (885:9): [True: 30, False: 321]
  ------------------
  886|     30|            if (md->dfinal == NULL) {
  ------------------
  |  Branch (886:17): [True: 30, False: 0]
  ------------------
  887|     30|                md->dfinal = OSSL_FUNC_digest_final(fns);
  888|     30|                fncnt++;
  889|     30|            }
  890|     30|            break;
  891|      6|        case OSSL_FUNC_DIGEST_SQUEEZE:
  ------------------
  |  |  316|      6|#define OSSL_FUNC_DIGEST_SQUEEZE 14
  ------------------
  |  Branch (891:9): [True: 6, False: 345]
  ------------------
  892|      6|            if (md->dsqueeze == NULL) {
  ------------------
  |  Branch (892:17): [True: 6, False: 0]
  ------------------
  893|      6|                md->dsqueeze = OSSL_FUNC_digest_squeeze(fns);
  894|      6|                fncnt++;
  895|      6|            }
  896|      6|            break;
  897|      0|        case OSSL_FUNC_DIGEST_DIGEST:
  ------------------
  |  |  307|      0|#define OSSL_FUNC_DIGEST_DIGEST 5
  ------------------
  |  Branch (897:9): [True: 0, False: 351]
  ------------------
  898|      0|            if (md->digest == NULL)
  ------------------
  |  Branch (898:17): [True: 0, False: 0]
  ------------------
  899|      0|                md->digest = OSSL_FUNC_digest_digest(fns);
  900|       |            /* We don't increment fnct for this as it is stand alone */
  901|      0|            break;
  902|     30|        case OSSL_FUNC_DIGEST_FREECTX:
  ------------------
  |  |  308|     30|#define OSSL_FUNC_DIGEST_FREECTX 6
  ------------------
  |  Branch (902:9): [True: 30, False: 321]
  ------------------
  903|     30|            if (md->freectx == NULL) {
  ------------------
  |  Branch (903:17): [True: 30, False: 0]
  ------------------
  904|     30|                md->freectx = OSSL_FUNC_digest_freectx(fns);
  905|     30|                fncnt++;
  906|     30|            }
  907|     30|            break;
  908|     30|        case OSSL_FUNC_DIGEST_DUPCTX:
  ------------------
  |  |  309|     30|#define OSSL_FUNC_DIGEST_DUPCTX 7
  ------------------
  |  Branch (908:9): [True: 30, False: 321]
  ------------------
  909|     30|            if (md->dupctx == NULL)
  ------------------
  |  Branch (909:17): [True: 30, False: 0]
  ------------------
  910|     30|                md->dupctx = OSSL_FUNC_digest_dupctx(fns);
  911|     30|            break;
  912|     30|        case OSSL_FUNC_DIGEST_GET_PARAMS:
  ------------------
  |  |  310|     30|#define OSSL_FUNC_DIGEST_GET_PARAMS 8
  ------------------
  |  Branch (912:9): [True: 30, False: 321]
  ------------------
  913|     30|            if (md->get_params == NULL)
  ------------------
  |  Branch (913:17): [True: 30, False: 0]
  ------------------
  914|     30|                md->get_params = OSSL_FUNC_digest_get_params(fns);
  915|     30|            break;
  916|     11|        case OSSL_FUNC_DIGEST_SET_CTX_PARAMS:
  ------------------
  |  |  311|     11|#define OSSL_FUNC_DIGEST_SET_CTX_PARAMS 9
  ------------------
  |  Branch (916:9): [True: 11, False: 340]
  ------------------
  917|     11|            if (md->set_ctx_params == NULL)
  ------------------
  |  Branch (917:17): [True: 11, False: 0]
  ------------------
  918|     11|                md->set_ctx_params = OSSL_FUNC_digest_set_ctx_params(fns);
  919|     11|            break;
  920|      9|        case OSSL_FUNC_DIGEST_GET_CTX_PARAMS:
  ------------------
  |  |  312|      9|#define OSSL_FUNC_DIGEST_GET_CTX_PARAMS 10
  ------------------
  |  Branch (920:9): [True: 9, False: 342]
  ------------------
  921|      9|            if (md->get_ctx_params == NULL)
  ------------------
  |  Branch (921:17): [True: 9, False: 0]
  ------------------
  922|      9|                md->get_ctx_params = OSSL_FUNC_digest_get_ctx_params(fns);
  923|      9|            break;
  924|     30|        case OSSL_FUNC_DIGEST_GETTABLE_PARAMS:
  ------------------
  |  |  313|     30|#define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11
  ------------------
  |  Branch (924:9): [True: 30, False: 321]
  ------------------
  925|     30|            if (md->gettable_params == NULL)
  ------------------
  |  Branch (925:17): [True: 30, False: 0]
  ------------------
  926|     30|                md->gettable_params = OSSL_FUNC_digest_gettable_params(fns);
  927|     30|            break;
  928|     11|        case OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  314|     11|#define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12
  ------------------
  |  Branch (928:9): [True: 11, False: 340]
  ------------------
  929|     11|            if (md->settable_ctx_params == NULL)
  ------------------
  |  Branch (929:17): [True: 11, False: 0]
  ------------------
  930|     11|                md->settable_ctx_params = OSSL_FUNC_digest_settable_ctx_params(fns);
  931|     11|            break;
  932|      9|        case OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  315|      9|#define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13
  ------------------
  |  Branch (932:9): [True: 9, False: 342]
  ------------------
  933|      9|            if (md->gettable_ctx_params == NULL)
  ------------------
  |  Branch (933:17): [True: 9, False: 0]
  ------------------
  934|      9|                md->gettable_ctx_params = OSSL_FUNC_digest_gettable_ctx_params(fns);
  935|      9|            break;
  936|     27|        case OSSL_FUNC_DIGEST_COPYCTX:
  ------------------
  |  |  317|     27|#define OSSL_FUNC_DIGEST_COPYCTX 15
  ------------------
  |  Branch (936:9): [True: 27, False: 324]
  ------------------
  937|     27|            if (md->copyctx == NULL)
  ------------------
  |  Branch (937:17): [True: 27, False: 0]
  ------------------
  938|     27|                md->copyctx = OSSL_FUNC_digest_copyctx(fns);
  939|     27|            break;
  940|     19|        case OSSL_FUNC_DIGEST_SERIALIZE:
  ------------------
  |  |  318|     19|#define OSSL_FUNC_DIGEST_SERIALIZE 16
  ------------------
  |  Branch (940:9): [True: 19, False: 332]
  ------------------
  941|     19|            if (md->serialize == NULL)
  ------------------
  |  Branch (941:17): [True: 19, False: 0]
  ------------------
  942|     19|                md->serialize = OSSL_FUNC_digest_serialize(fns);
  943|     19|            break;
  944|     19|        case OSSL_FUNC_DIGEST_DESERIALIZE:
  ------------------
  |  |  319|     19|#define OSSL_FUNC_DIGEST_DESERIALIZE 17
  ------------------
  |  Branch (944:9): [True: 19, False: 332]
  ------------------
  945|     19|            if (md->deserialize == NULL)
  ------------------
  |  Branch (945:17): [True: 19, False: 0]
  ------------------
  946|     19|                md->deserialize = OSSL_FUNC_digest_deserialize(fns);
  947|     19|            break;
  948|    351|        }
  949|    351|    }
  950|     30|    if ((fncnt != 0 && fncnt != 5 && fncnt != 6)
  ------------------
  |  Branch (950:10): [True: 30, False: 0]
  |  Branch (950:24): [True: 6, False: 24]
  |  Branch (950:38): [True: 0, False: 6]
  ------------------
  951|     30|        || (fncnt == 0 && md->digest == NULL)) {
  ------------------
  |  Branch (951:13): [True: 0, False: 30]
  |  Branch (951:27): [True: 0, False: 0]
  ------------------
  952|       |        /*
  953|       |         * In order to be a consistent set of functions we either need the
  954|       |         * whole set of init/update/final etc functions or none of them.
  955|       |         * The "digest" function can standalone. We at least need one way to
  956|       |         * generate digests.
  957|       |         */
  958|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  959|      0|        goto err;
  960|      0|    }
  961|     30|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (961:9): [True: 30, False: 0]
  |  Branch (961:25): [True: 0, False: 30]
  ------------------
  962|      0|        goto err;
  963|       |
  964|     30|    md->prov = prov;
  965|       |
  966|     30|    if (!evp_md_cache_constants(md)) {
  ------------------
  |  Branch (966:9): [True: 0, False: 30]
  ------------------
  967|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  968|      0|        goto err;
  969|      0|    }
  970|       |
  971|     30|    return md;
  972|       |
  973|      0|err:
  974|      0|    evp_md_free(md);
  975|       |    return NULL;
  976|     30|}
digest.c:set_legacy_nid:
  777|     78|{
  778|     78|    int nid;
  779|     78|    int *legacy_nid = vlegacy_nid;
  780|       |    /*
  781|       |     * We use lowest level function to get the associated method, because
  782|       |     * higher level functions such as EVP_get_digestbyname() have changed
  783|       |     * to look at providers too.
  784|       |     */
  785|     78|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|     78|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
  786|       |
  787|     78|    if (*legacy_nid == -1) /* We found a clash already */
  ------------------
  |  Branch (787:9): [True: 0, False: 78]
  ------------------
  788|      0|        return;
  789|       |
  790|     78|    if (legacy_method == NULL)
  ------------------
  |  Branch (790:9): [True: 55, False: 23]
  ------------------
  791|     55|        return;
  792|     23|    nid = EVP_MD_nid(legacy_method);
  ------------------
  |  |  531|     23|#define EVP_MD_nid EVP_MD_get_type
  ------------------
  793|     23|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   19|     46|#define NID_undef                       0
  ------------------
  |  Branch (793:9): [True: 4, False: 19]
  |  Branch (793:37): [True: 0, False: 4]
  ------------------
  794|      0|        *legacy_nid = -1;
  795|      0|        return;
  796|      0|    }
  797|     23|    *legacy_nid = nid;
  798|     23|}
digest.c:evp_md_cache_constants:
  802|     30|{
  803|     30|    int ok, xof = 0, algid_absent = 0;
  804|     30|    size_t blksz = 0;
  805|     30|    size_t mdsize = 0;
  806|     30|    OSSL_PARAM params[5];
  807|       |
  808|       |    /*
  809|       |     * Note that these parameters are 'constants' that are only set up
  810|       |     * during the EVP_MD_fetch(). For this reason the XOF functions set the
  811|       |     * md_size to 0, since the output size is unknown.
  812|       |     */
  813|     30|    params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  224|     30|# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  814|     30|    params[1] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &mdsize);
  ------------------
  |  |  235|     30|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  815|     30|    params[2] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_XOF, &xof);
  ------------------
  |  |  237|     30|# define OSSL_DIGEST_PARAM_XOF "xof"
  ------------------
  816|     30|    params[3] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_ALGID_ABSENT,
  ------------------
  |  |  223|     30|# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
  ------------------
  817|     30|        &algid_absent);
  818|     30|    params[4] = OSSL_PARAM_construct_end();
  819|     30|    ok = evp_do_md_getparams(md, params) > 0;
  820|     30|    if (mdsize > INT_MAX || blksz > INT_MAX)
  ------------------
  |  Branch (820:9): [True: 0, False: 30]
  |  Branch (820:29): [True: 0, False: 30]
  ------------------
  821|      0|        ok = 0;
  822|     30|    if (ok) {
  ------------------
  |  Branch (822:9): [True: 30, False: 0]
  ------------------
  823|     30|        md->block_size = (int)blksz;
  824|     30|        md->md_size = (int)mdsize;
  825|     30|        if (xof)
  ------------------
  |  Branch (825:13): [True: 6, False: 24]
  ------------------
  826|      6|            md->flags |= EVP_MD_FLAG_XOF;
  ------------------
  |  |  209|      6|#define EVP_MD_FLAG_XOF 0x0002
  ------------------
  827|     30|        if (algid_absent)
  ------------------
  |  Branch (827:13): [True: 21, False: 9]
  ------------------
  828|     21|            md->flags |= EVP_MD_FLAG_DIGALGID_ABSENT;
  ------------------
  |  |  221|     21|#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
  ------------------
  829|     30|    }
  830|     30|    return ok;
  831|     30|}
digest.c:evp_md_up_ref:
  979|     32|{
  980|     32|    EVP_MD *md = (EVP_MD *)m;
  981|     32|    int ref = 0;
  982|       |
  983|     32|    if (md->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  188|     32|#define EVP_ORIG_DYNAMIC 0
  ------------------
  |  Branch (983:9): [True: 32, False: 0]
  ------------------
  984|     32|        return CRYPTO_UP_REF(&md->refcnt, &ref);
  985|      0|    return 1;
  986|     32|}
digest.c:evp_md_free:
  989|     30|{
  990|     30|    EVP_MD *md = (EVP_MD *)m;
  991|     30|    int i;
  992|       |
  993|     30|    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  188|     30|#define EVP_ORIG_DYNAMIC 0
  ------------------
  |  Branch (993:9): [True: 0, False: 30]
  |  Branch (993:23): [True: 0, False: 30]
  ------------------
  994|      0|        return;
  995|       |
  996|     30|    CRYPTO_DOWN_REF(&md->refcnt, &i);
  997|     30|    if (i > 0)
  ------------------
  |  Branch (997:9): [True: 30, False: 0]
  ------------------
  998|     30|        return;
  999|       |
 1000|      0|    OPENSSL_free(md->type_name);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1001|      0|    ossl_provider_free(md->prov);
 1002|      0|    CRYPTO_FREE_REF(&md->refcnt);
 1003|      0|    OPENSSL_free(md);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1004|      0|}

EVP_aes_128_cbc:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_128_ecb:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_128_ofb:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_128_cfb128:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_128_cfb1:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_128_cfb8:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_128_ctr:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_192_cbc:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_192_ecb:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_192_ofb:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_192_cfb128:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_192_cfb1:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_192_cfb8:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_192_ctr:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_256_cbc:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_256_ecb:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_256_ofb:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_256_cfb128:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_256_cfb1:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_256_cfb8:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_256_ctr:
   22|      1|    {                                                                                 \
   23|      1|        return &aes_##keylen##_##mode;                                                \
   24|      1|    }
EVP_aes_128_gcm:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }
EVP_aes_192_gcm:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }
EVP_aes_256_gcm:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }
EVP_aes_128_xts:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }
EVP_aes_256_xts:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }
EVP_aes_128_ccm:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }
EVP_aes_192_ccm:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }
EVP_aes_256_ccm:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }
EVP_aes_128_wrap:
   89|      1|{
   90|      1|    return &aes_128_wrap;
   91|      1|}
EVP_aes_192_wrap:
   99|      1|{
  100|      1|    return &aes_192_wrap;
  101|      1|}
EVP_aes_256_wrap:
  109|      1|{
  110|      1|    return &aes_256_wrap;
  111|      1|}
EVP_aes_128_wrap_pad:
  119|      1|{
  120|      1|    return &aes_128_wrap_pad;
  121|      1|}
EVP_aes_192_wrap_pad:
  129|      1|{
  130|      1|    return &aes_192_wrap_pad;
  131|      1|}
EVP_aes_256_wrap_pad:
  139|      1|{
  140|      1|    return &aes_256_wrap_pad;
  141|      1|}
EVP_aes_128_ocb:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }
EVP_aes_192_ocb:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }
EVP_aes_256_ocb:
   36|      1|    {                                                                                                                      \
   37|      1|        return &aes_##keylen##_##mode;                                                                                     \
   38|      1|    }

EVP_aes_128_cbc_hmac_sha1:
   41|      1|{
   42|      1|    return (OPENSSL_ia32cap_P[1] & AESNI_CAPABLE ? &aesni_128_cbc_hmac_sha1_cipher : NULL);
  ------------------
  |  |   16|      1|#define AESNI_CAPABLE (1 << (57 - 32))
  ------------------
  |  Branch (42:13): [True: 1, False: 0]
  ------------------
   43|      1|}
EVP_aes_256_cbc_hmac_sha1:
   46|      1|{
   47|      1|    return (OPENSSL_ia32cap_P[1] & AESNI_CAPABLE ? &aesni_256_cbc_hmac_sha1_cipher : NULL);
  ------------------
  |  |   16|      1|#define AESNI_CAPABLE (1 << (57 - 32))
  ------------------
  |  Branch (47:13): [True: 1, False: 0]
  ------------------
   48|      1|}

EVP_aes_128_cbc_hmac_sha256:
   53|      1|{
   54|      1|    return ((OPENSSL_ia32cap_P[1] & AESNI_CAPABLE) && aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL) ? &aesni_128_cbc_hmac_sha256_cipher : NULL);
  ------------------
  |  |   24|      1|#define AESNI_CAPABLE (1 << (57 - 32))
  ------------------
  |  Branch (54:13): [True: 1, False: 0]
  |  Branch (54:55): [True: 1, False: 0]
  ------------------
   55|      1|}
EVP_aes_256_cbc_hmac_sha256:
   58|      1|{
   59|      1|    return ((OPENSSL_ia32cap_P[1] & AESNI_CAPABLE) && aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL) ? &aesni_256_cbc_hmac_sha256_cipher : NULL);
  ------------------
  |  |   24|      1|#define AESNI_CAPABLE (1 << (57 - 32))
  ------------------
  |  Branch (59:13): [True: 1, False: 0]
  |  Branch (59:55): [True: 1, False: 0]
  ------------------
   60|      1|}

EVP_aria_128_ctr:
   42|      1|    {                                                                                 \
   43|      1|        return &aria_##keylen##_##mode;                                               \
   44|      1|    }
EVP_aria_192_ctr:
   42|      1|    {                                                                                 \
   43|      1|        return &aria_##keylen##_##mode;                                               \
   44|      1|    }
EVP_aria_256_ctr:
   42|      1|    {                                                                                 \
   43|      1|        return &aria_##keylen##_##mode;                                               \
   44|      1|    }
EVP_aria_128_gcm:
   64|      1|    {                                                  \
   65|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
   66|      1|    }
EVP_aria_192_gcm:
   64|      1|    {                                                  \
   65|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
   66|      1|    }
EVP_aria_256_gcm:
   64|      1|    {                                                  \
   65|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
   66|      1|    }
EVP_aria_128_ccm:
   64|      1|    {                                                  \
   65|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
   66|      1|    }
EVP_aria_192_ccm:
   64|      1|    {                                                  \
   65|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
   66|      1|    }
EVP_aria_256_ccm:
   64|      1|    {                                                  \
   65|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
   66|      1|    }

EVP_camellia_128_cbc:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_128_ecb:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_128_ofb:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_128_cfb128:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_128_cfb1:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_128_cfb8:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_128_ctr:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_192_cbc:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_192_ecb:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_192_ofb:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_192_cfb128:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_192_cfb1:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_192_cfb8:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_192_ctr:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_256_cbc:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_256_ecb:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_256_ofb:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_256_cfb128:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_256_cfb1:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_256_cfb8:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }
EVP_camellia_256_ctr:
   22|      1|    {                                                                                 \
   23|      1|        return &camellia_##keylen##_##mode;                                           \
   24|      1|    }

EVP_chacha20:
   27|      1|{
   28|      1|    return &chacha20;
   29|      1|}
EVP_chacha20_poly1305:
   43|      1|{
   44|      1|    return &chacha20_poly1305;
   45|      1|}

EVP_des_ede:
   28|      1|{
   29|      1|    return &des_ede_ecb;
   30|      1|}
EVP_des_ede3:
   33|      1|{
   34|      1|    return &des_ede3_ecb;
   35|      1|}
EVP_des_ede3_wrap:
   46|      1|{
   47|      1|    return &des3_wrap;
   48|      1|}

EVP_rc2_64_cbc:
   35|      1|{
   36|      1|    return &r2_64_cbc_cipher;
   37|      1|}
EVP_rc2_40_cbc:
   40|      1|{
   41|      1|    return &r2_40_cbc_cipher;
   42|      1|}

EVP_rc4:
   30|      1|{
   31|      1|    return &r4_cipher;
   32|      1|}
EVP_rc4_40:
   35|      1|{
   36|      1|    return &r4_40_cipher;
   37|      1|}

EVP_rc4_hmac_md5:
   27|      1|{
   28|      1|    return &r4_hmac_md5_cipher;
   29|      1|}

EVP_sm4_cbc:
   24|      1|    {                                                                         \
   25|      1|        return &sm4_##mode;                                                   \
   26|      1|    }
EVP_sm4_ecb:
   24|      1|    {                                                                         \
   25|      1|        return &sm4_##mode;                                                   \
   26|      1|    }
EVP_sm4_ofb:
   24|      1|    {                                                                         \
   25|      1|        return &sm4_##mode;                                                   \
   26|      1|    }
EVP_sm4_cfb128:
   24|      1|    {                                                                         \
   25|      1|        return &sm4_##mode;                                                   \
   26|      1|    }
EVP_sm4_ctr:
   24|      1|    {                                                                         \
   25|      1|        return &sm4_##mode;                                                   \
   26|      1|    }

EVP_desx_cbc:
   23|      1|{
   24|      1|    return &d_xcbc_cipher;
   25|      1|}

EVP_CIPHER_CTX_new:
   50|      6|{
   51|      6|    EVP_CIPHER_CTX *ctx;
   52|       |
   53|      6|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |  113|      6|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   54|      6|    if (ctx == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 6]
  ------------------
   55|      0|        return NULL;
   56|       |
   57|      6|    ctx->iv_len = -1;
   58|      6|    return ctx;
   59|      6|}
EVP_CipherInit_ex:
  413|     41|{
  414|     41|    if (!ossl_assert(impl == NULL))
  ------------------
  |  |   45|     41|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|     41|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (414:9): [True: 0, False: 41]
  ------------------
  415|      0|        return 0;
  416|     41|    return evp_cipher_init_internal(ctx, cipher, key, iv, enc, 0, NULL);
  417|     41|}
EVP_CipherUpdate:
  481|     71|{
  482|     71|    if (ctx->encrypt)
  ------------------
  |  Branch (482:9): [True: 71, False: 0]
  ------------------
  483|     71|        return EVP_EncryptUpdate(ctx, out, outl, in, inl);
  484|      0|    else
  485|      0|        return EVP_DecryptUpdate(ctx, out, outl, in, inl);
  486|     71|}
EVP_EncryptUpdate:
  654|     71|{
  655|     71|    int ret;
  656|     71|    size_t soutl, inl_ = (size_t)inl;
  657|     71|    int blocksize;
  658|       |
  659|     71|    if (inl < 0) {
  ------------------
  |  Branch (659:9): [True: 0, False: 71]
  ------------------
  660|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_LENGTH);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  661|      0|        return 0;
  662|      0|    }
  663|       |
  664|     71|    if (ossl_likely(outl != NULL)) {
  ------------------
  |  |   23|     71|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 71, False: 0]
  |  |  ------------------
  ------------------
  665|     71|        *outl = 0;
  666|     71|    } else {
  667|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  668|      0|        return 0;
  669|      0|    }
  670|       |
  671|       |    /* Prevent accidental use of decryption context when encrypting */
  672|     71|    if (ossl_unlikely(!ctx->encrypt)) {
  ------------------
  |  |   24|     71|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  673|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  674|      0|        return 0;
  675|      0|    }
  676|       |
  677|     71|    if (ossl_unlikely(ctx->cipher == NULL)) {
  ------------------
  |  |   24|     71|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  678|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  679|      0|        return 0;
  680|      0|    }
  681|       |
  682|     71|    if (ossl_unlikely(ctx->cipher->prov == NULL))
  ------------------
  |  |   24|     71|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  683|      0|        return 0;
  684|       |
  685|     71|    blocksize = ctx->cipher->block_size;
  686|       |
  687|     71|    if (ossl_unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
  ------------------
  |  |   24|    142|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 71]
  |  |  |  Branch (24:46): [True: 0, False: 71]
  |  |  |  Branch (24:46): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  688|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  689|      0|        return 0;
  690|      0|    }
  691|       |
  692|     71|    ret = ctx->cipher->cupdate(ctx->algctx, out, &soutl,
  693|     71|        inl_ + (size_t)(blocksize == 1 ? 0 : blocksize),
  ------------------
  |  Branch (693:25): [True: 4, False: 67]
  ------------------
  694|     71|        in, inl_);
  695|       |
  696|     71|    if (ossl_likely(ret)) {
  ------------------
  |  |   23|     71|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 71, False: 0]
  |  |  ------------------
  ------------------
  697|     71|        if (ossl_unlikely(soutl > INT_MAX)) {
  ------------------
  |  |   24|     71|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 71]
  |  |  ------------------
  ------------------
  698|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  699|      0|            return 0;
  700|      0|        }
  701|     71|        *outl = (int)soutl;
  702|     71|    }
  703|       |
  704|     71|    return ret;
  705|     71|}
EVP_CIPHER_gettable_ctx_params:
 1196|    131|{
 1197|    131|    void *provctx;
 1198|       |
 1199|    131|    if (cipher != NULL && cipher->gettable_ctx_params != NULL) {
  ------------------
  |  Branch (1199:9): [True: 131, False: 0]
  |  Branch (1199:27): [True: 131, False: 0]
  ------------------
 1200|    131|        provctx = ossl_provider_ctx(EVP_CIPHER_get0_provider(cipher));
 1201|    131|        return cipher->gettable_ctx_params(NULL, provctx);
 1202|    131|    }
 1203|      0|    return NULL;
 1204|    131|}
evp_cipher_new:
 1310|    131|{
 1311|    131|    EVP_CIPHER *cipher = OPENSSL_zalloc(sizeof(EVP_CIPHER));
  ------------------
  |  |  113|    131|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1312|       |
 1313|    131|    if (cipher != NULL && !CRYPTO_NEW_REF(&cipher->refcnt, 1)) {
  ------------------
  |  Branch (1313:9): [True: 131, False: 0]
  |  Branch (1313:27): [True: 0, False: 131]
  ------------------
 1314|      0|        OPENSSL_free(cipher);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1315|      0|        return NULL;
 1316|      0|    }
 1317|    131|    return cipher;
 1318|    131|}
EVP_CIPHER_fetch:
 1555|      4|{
 1556|      4|    EVP_CIPHER *cipher = evp_generic_fetch(ctx, OSSL_OP_CIPHER, algorithm, properties,
  ------------------
  |  |  284|      4|#define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
  ------------------
 1557|      4|        evp_cipher_from_algorithm, evp_cipher_up_ref,
 1558|      4|        evp_cipher_free);
 1559|       |
 1560|      4|    return cipher;
 1561|      4|}
EVP_CIPHER_up_ref:
 1584|      6|{
 1585|       |#ifdef OPENSSL_NO_CACHED_FETCH
 1586|       |    return evp_cipher_up_ref(cipher);
 1587|       |#else
 1588|      6|    if (cipher->flags & EVP_CIPH_FLAG_NO_STORE)
  ------------------
  |  |  345|      6|#define EVP_CIPH_FLAG_NO_STORE 0x20000000
  ------------------
  |  Branch (1588:9): [True: 0, False: 6]
  ------------------
 1589|      0|        return evp_cipher_up_ref(cipher);
 1590|      6|    return 1;
 1591|      6|#endif
 1592|      6|}
EVP_CIPHER_free:
 1603|     10|{
 1604|       |#ifdef OPENSSL_NO_CACHED_FETCH
 1605|       |    evp_cipher_free(cipher);
 1606|       |#else
 1607|     10|    if (cipher != NULL && (cipher->flags & EVP_CIPH_FLAG_NO_STORE))
  ------------------
  |  |  345|      0|#define EVP_CIPH_FLAG_NO_STORE 0x20000000
  ------------------
  |  Branch (1607:9): [True: 0, False: 10]
  |  Branch (1607:27): [True: 0, False: 0]
  ------------------
 1608|      0|        evp_cipher_free(cipher);
 1609|     10|#endif
 1610|     10|}
evp_enc.c:evp_cipher_init_internal:
   75|     41|{
   76|       |    /*
   77|       |     * enc == 1 means we are encrypting.
   78|       |     * enc == 0 means we are decrypting.
   79|       |     * enc == -1 means, use the previously initialised value for encrypt/decrypt
   80|       |     */
   81|     41|    if (enc == -1) {
  ------------------
  |  Branch (81:9): [True: 35, False: 6]
  ------------------
   82|     35|        enc = ctx->encrypt;
   83|     35|    } else {
   84|      6|        if (enc)
  ------------------
  |  Branch (84:13): [True: 6, False: 0]
  ------------------
   85|      6|            enc = 1;
   86|      6|        ctx->encrypt = enc;
   87|      6|    }
   88|       |
   89|     41|    if (cipher == NULL && ctx->cipher == NULL) {
  ------------------
  |  Branch (89:9): [True: 35, False: 6]
  |  Branch (89:27): [True: 0, False: 35]
  ------------------
   90|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   91|      0|        return 0;
   92|      0|    }
   93|       |
   94|       |    /* Ensure a context left lying around from last time is cleared */
   95|     41|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (95:9): [True: 6, False: 35]
  |  Branch (95:27): [True: 0, False: 6]
  ------------------
   96|      0|        unsigned long flags = ctx->flags;
   97|       |
   98|      0|        EVP_CIPHER_CTX_reset(ctx);
   99|       |        /* Restore encrypt and flags */
  100|      0|        ctx->encrypt = enc;
  101|      0|        ctx->flags = flags;
  102|      0|    }
  103|       |
  104|     41|    if (cipher == NULL)
  ------------------
  |  Branch (104:9): [True: 35, False: 6]
  ------------------
  105|     35|        cipher = ctx->cipher;
  106|       |
  107|     41|    if (cipher->prov == NULL) {
  ------------------
  |  Branch (107:9): [True: 0, False: 41]
  ------------------
  108|       |#ifdef FIPS_MODULE
  109|       |        /* We only do explicit fetches inside the FIPS module */
  110|       |        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  111|       |        return 0;
  112|       |#else
  113|      0|        EVP_CIPHER *provciph = EVP_CIPHER_fetch(NULL,
  114|      0|            cipher->nid == NID_undef ? "NULL"
  ------------------
  |  |   19|      0|#define NID_undef                       0
  ------------------
  |  Branch (114:13): [True: 0, False: 0]
  ------------------
  115|      0|                                     : OBJ_nid2sn(cipher->nid),
  116|      0|            "");
  117|       |
  118|      0|        if (provciph == NULL)
  ------------------
  |  Branch (118:13): [True: 0, False: 0]
  ------------------
  119|      0|            return 0;
  120|      0|        cipher = provciph;
  121|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
  122|      0|        ctx->fetched_cipher = provciph;
  123|      0|#endif
  124|      0|    }
  125|       |
  126|     41|    if (!ossl_assert(cipher->prov != NULL)) {
  ------------------
  |  |   45|     41|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|     41|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (126:9): [True: 0, False: 41]
  ------------------
  127|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  128|      0|        return 0;
  129|      0|    }
  130|       |
  131|     41|    if (cipher != ctx->fetched_cipher) {
  ------------------
  |  Branch (131:9): [True: 6, False: 35]
  ------------------
  132|      6|        if (!EVP_CIPHER_up_ref((EVP_CIPHER *)cipher)) {
  ------------------
  |  Branch (132:13): [True: 0, False: 6]
  ------------------
  133|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  134|      0|            return 0;
  135|      0|        }
  136|      6|        EVP_CIPHER_free(ctx->fetched_cipher);
  137|       |        /* Coverity false positive, the reference counting is confusing it */
  138|       |        /* coverity[use_after_free] */
  139|      6|        ctx->fetched_cipher = (EVP_CIPHER *)cipher;
  140|      6|    }
  141|     41|    ctx->cipher = cipher;
  142|       |
  143|     41|    if (is_pipeline && !EVP_CIPHER_can_pipeline(cipher, enc)) {
  ------------------
  |  Branch (143:9): [True: 0, False: 41]
  |  Branch (143:24): [True: 0, False: 0]
  ------------------
  144|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_PIPELINE_NOT_SUPPORTED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  145|      0|        return 0;
  146|      0|    }
  147|       |
  148|     41|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (148:9): [True: 6, False: 35]
  ------------------
  149|      6|        ctx->algctx = ctx->cipher->newctx(ossl_provider_ctx(cipher->prov));
  150|      6|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (150:13): [True: 0, False: 6]
  ------------------
  151|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  152|      0|            return 0;
  153|      0|        }
  154|      6|    }
  155|       |
  156|     41|    if ((ctx->flags & EVP_CIPH_NO_PADDING) != 0) {
  ------------------
  |  |  310|     41|#define EVP_CIPH_NO_PADDING 0x100
  ------------------
  |  Branch (156:9): [True: 0, False: 41]
  ------------------
  157|       |        /*
  158|       |         * If this ctx was already set up for no padding then we need to tell
  159|       |         * the new cipher about it.
  160|       |         */
  161|      0|        if (!EVP_CIPHER_CTX_set_padding(ctx, 0))
  ------------------
  |  Branch (161:13): [True: 0, False: 0]
  ------------------
  162|      0|            return 0;
  163|      0|    }
  164|       |
  165|     41|#ifndef FIPS_MODULE
  166|       |    /*
  167|       |     * Fix for CVE-2023-5363
  168|       |     * Passing in a size as part of the init call takes effect late
  169|       |     * so, force such to occur before the initialisation.
  170|       |     *
  171|       |     * The FIPS provider's internal library context is used in a manner
  172|       |     * such that this is not an issue.
  173|       |     */
  174|     41|    if (params != NULL) {
  ------------------
  |  Branch (174:9): [True: 0, False: 41]
  ------------------
  175|      0|        OSSL_PARAM param_lens[3] = { OSSL_PARAM_END, OSSL_PARAM_END,
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM param_lens[3] = { OSSL_PARAM_END, OSSL_PARAM_END,
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  176|      0|            OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  177|      0|        OSSL_PARAM *q = param_lens;
  178|      0|        const OSSL_PARAM *p;
  179|       |
  180|      0|        p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  198|      0|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  181|      0|        if (p != NULL)
  ------------------
  |  Branch (181:13): [True: 0, False: 0]
  ------------------
  182|      0|            memcpy(q++, p, sizeof(*q));
  183|       |
  184|       |        /*
  185|       |         * Note that OSSL_CIPHER_PARAM_AEAD_IVLEN is a synonym for
  186|       |         * OSSL_CIPHER_PARAM_IVLEN so both are covered here.
  187|       |         */
  188|      0|        p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  197|      0|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  189|      0|        if (p != NULL)
  ------------------
  |  Branch (189:13): [True: 0, False: 0]
  ------------------
  190|      0|            memcpy(q++, p, sizeof(*q));
  191|       |
  192|      0|        if (q != param_lens) {
  ------------------
  |  Branch (192:13): [True: 0, False: 0]
  ------------------
  193|      0|            if (!EVP_CIPHER_CTX_set_params(ctx, param_lens)) {
  ------------------
  |  Branch (193:17): [True: 0, False: 0]
  ------------------
  194|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_LENGTH);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  195|      0|                return 0;
  196|      0|            }
  197|      0|        }
  198|      0|    }
  199|     41|#endif
  200|       |
  201|     41|    if (is_pipeline)
  ------------------
  |  Branch (201:9): [True: 0, False: 41]
  ------------------
  202|      0|        return 1;
  203|       |
  204|     41|    if (enc) {
  ------------------
  |  Branch (204:9): [True: 41, False: 0]
  ------------------
  205|     41|        if (ctx->cipher->einit == NULL) {
  ------------------
  |  Branch (205:13): [True: 0, False: 41]
  ------------------
  206|       |            /*
  207|       |             * We still should be able to set the IV using the new API
  208|       |             * if the key is not specified and old API is not available
  209|       |             */
  210|      0|            if (key == NULL && ctx->cipher->einit_skey != NULL) {
  ------------------
  |  Branch (210:17): [True: 0, False: 0]
  |  Branch (210:32): [True: 0, False: 0]
  ------------------
  211|      0|                return ctx->cipher->einit_skey(ctx->algctx, NULL,
  212|      0|                    iv,
  213|      0|                    iv == NULL ? 0
  ------------------
  |  Branch (213:21): [True: 0, False: 0]
  ------------------
  214|      0|                               : EVP_CIPHER_CTX_get_iv_length(ctx),
  215|      0|                    params);
  216|      0|            }
  217|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  218|      0|            return 0;
  219|      0|        }
  220|       |
  221|     41|        return ctx->cipher->einit(ctx->algctx,
  222|     41|            key,
  223|     41|            key == NULL ? 0
  ------------------
  |  Branch (223:13): [True: 8, False: 33]
  ------------------
  224|     41|                        : EVP_CIPHER_CTX_get_key_length(ctx),
  225|     41|            iv,
  226|     41|            iv == NULL ? 0
  ------------------
  |  Branch (226:13): [True: 37, False: 4]
  ------------------
  227|     41|                       : EVP_CIPHER_CTX_get_iv_length(ctx),
  228|     41|            params);
  229|     41|    }
  230|       |
  231|      0|    if (ctx->cipher->dinit == NULL) {
  ------------------
  |  Branch (231:9): [True: 0, False: 0]
  ------------------
  232|       |        /*
  233|       |         * We still should be able to set the IV using the new API
  234|       |         * if the key is not specified and old API is not available
  235|       |         */
  236|      0|        if (key == NULL && ctx->cipher->dinit_skey != NULL) {
  ------------------
  |  Branch (236:13): [True: 0, False: 0]
  |  Branch (236:28): [True: 0, False: 0]
  ------------------
  237|      0|            return ctx->cipher->dinit_skey(ctx->algctx, NULL,
  238|      0|                iv,
  239|      0|                iv == NULL ? 0
  ------------------
  |  Branch (239:17): [True: 0, False: 0]
  ------------------
  240|      0|                           : EVP_CIPHER_CTX_get_iv_length(ctx),
  241|      0|                params);
  242|      0|        }
  243|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  244|      0|        return 0;
  245|      0|    }
  246|       |
  247|      0|    return ctx->cipher->dinit(ctx->algctx,
  248|      0|        key,
  249|      0|        key == NULL ? 0
  ------------------
  |  Branch (249:9): [True: 0, False: 0]
  ------------------
  250|      0|                    : EVP_CIPHER_CTX_get_key_length(ctx),
  251|      0|        iv,
  252|      0|        iv == NULL ? 0
  ------------------
  |  Branch (252:9): [True: 0, False: 0]
  ------------------
  253|      0|                   : EVP_CIPHER_CTX_get_iv_length(ctx),
  254|      0|        params);
  255|      0|}
evp_enc.c:evp_cipher_from_algorithm:
 1378|    131|{
 1379|    131|    const OSSL_DISPATCH *fns = algodef->implementation;
 1380|    131|    EVP_CIPHER *cipher = NULL;
 1381|    131|    int fnciphcnt = 0, encinit = 0, decinit = 0, fnpipecnt = 0, fnctxcnt = 0;
 1382|       |
 1383|    131|    if ((cipher = evp_cipher_new()) == NULL) {
  ------------------
  |  Branch (1383:9): [True: 0, False: 131]
  ------------------
 1384|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1385|      0|        return NULL;
 1386|      0|    }
 1387|       |
 1388|    131|    if (no_store != 0)
  ------------------
  |  Branch (1388:9): [True: 0, False: 131]
  ------------------
 1389|      0|        cipher->flags |= EVP_CIPH_FLAG_NO_STORE;
  ------------------
  |  |  345|      0|#define EVP_CIPH_FLAG_NO_STORE 0x20000000
  ------------------
 1390|       |
 1391|    131|#ifndef FIPS_MODULE
 1392|    131|    cipher->nid = NID_undef;
  ------------------
  |  |   19|    131|#define NID_undef                       0
  ------------------
 1393|    131|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &cipher->nid)
  ------------------
  |  Branch (1393:9): [True: 0, False: 131]
  ------------------
 1394|    131|        || cipher->nid == -1) {
  ------------------
  |  Branch (1394:12): [True: 0, False: 131]
  ------------------
 1395|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1396|      0|        goto err;
 1397|      0|    }
 1398|    131|#endif
 1399|       |
 1400|    131|    cipher->name_id = name_id;
 1401|    131|    if ((cipher->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (1401:9): [True: 0, False: 131]
  ------------------
 1402|      0|        goto err;
 1403|       |
 1404|    131|    cipher->description = algodef->algorithm_description;
 1405|       |
 1406|  2.08k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1406:12): [True: 1.95k, False: 131]
  ------------------
 1407|  1.95k|        switch (fns->function_id) {
  ------------------
  |  Branch (1407:17): [True: 1.95k, False: 0]
  ------------------
 1408|    131|        case OSSL_FUNC_CIPHER_NEWCTX:
  ------------------
  |  |  357|    131|#define OSSL_FUNC_CIPHER_NEWCTX 1
  ------------------
  |  Branch (1408:9): [True: 131, False: 1.82k]
  ------------------
 1409|    131|            if (cipher->newctx != NULL)
  ------------------
  |  Branch (1409:17): [True: 0, False: 131]
  ------------------
 1410|      0|                break;
 1411|    131|            cipher->newctx = OSSL_FUNC_cipher_newctx(fns);
 1412|    131|            fnctxcnt++;
 1413|    131|            break;
 1414|    131|        case OSSL_FUNC_CIPHER_ENCRYPT_INIT:
  ------------------
  |  |  358|    131|#define OSSL_FUNC_CIPHER_ENCRYPT_INIT 2
  ------------------
  |  Branch (1414:9): [True: 131, False: 1.82k]
  ------------------
 1415|    131|            if (cipher->einit != NULL)
  ------------------
  |  Branch (1415:17): [True: 0, False: 131]
  ------------------
 1416|      0|                break;
 1417|    131|            cipher->einit = OSSL_FUNC_cipher_encrypt_init(fns);
 1418|    131|            encinit = 1;
 1419|    131|            break;
 1420|    131|        case OSSL_FUNC_CIPHER_DECRYPT_INIT:
  ------------------
  |  |  359|    131|#define OSSL_FUNC_CIPHER_DECRYPT_INIT 3
  ------------------
  |  Branch (1420:9): [True: 131, False: 1.82k]
  ------------------
 1421|    131|            if (cipher->dinit != NULL)
  ------------------
  |  Branch (1421:17): [True: 0, False: 131]
  ------------------
 1422|      0|                break;
 1423|    131|            cipher->dinit = OSSL_FUNC_cipher_decrypt_init(fns);
 1424|    131|            decinit = 1;
 1425|    131|            break;
 1426|     68|        case OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT:
  ------------------
  |  |  375|     68|#define OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT 19
  ------------------
  |  Branch (1426:9): [True: 68, False: 1.88k]
  ------------------
 1427|     68|            if (cipher->einit_skey != NULL)
  ------------------
  |  Branch (1427:17): [True: 0, False: 68]
  ------------------
 1428|      0|                break;
 1429|     68|            cipher->einit_skey = OSSL_FUNC_cipher_encrypt_skey_init(fns);
 1430|     68|            encinit = 1;
 1431|     68|            break;
 1432|     68|        case OSSL_FUNC_CIPHER_DECRYPT_SKEY_INIT:
  ------------------
  |  |  376|     68|#define OSSL_FUNC_CIPHER_DECRYPT_SKEY_INIT 20
  ------------------
  |  Branch (1432:9): [True: 68, False: 1.88k]
  ------------------
 1433|     68|            if (cipher->dinit_skey != NULL)
  ------------------
  |  Branch (1433:17): [True: 0, False: 68]
  ------------------
 1434|      0|                break;
 1435|     68|            cipher->dinit_skey = OSSL_FUNC_cipher_decrypt_skey_init(fns);
 1436|     68|            decinit = 1;
 1437|     68|            break;
 1438|    131|        case OSSL_FUNC_CIPHER_UPDATE:
  ------------------
  |  |  360|    131|#define OSSL_FUNC_CIPHER_UPDATE 4
  ------------------
  |  Branch (1438:9): [True: 131, False: 1.82k]
  ------------------
 1439|    131|            if (cipher->cupdate != NULL)
  ------------------
  |  Branch (1439:17): [True: 0, False: 131]
  ------------------
 1440|      0|                break;
 1441|    131|            cipher->cupdate = OSSL_FUNC_cipher_update(fns);
 1442|    131|            fnciphcnt++;
 1443|    131|            break;
 1444|    131|        case OSSL_FUNC_CIPHER_FINAL:
  ------------------
  |  |  361|    131|#define OSSL_FUNC_CIPHER_FINAL 5
  ------------------
  |  Branch (1444:9): [True: 131, False: 1.82k]
  ------------------
 1445|    131|            if (cipher->cfinal != NULL)
  ------------------
  |  Branch (1445:17): [True: 0, False: 131]
  ------------------
 1446|      0|                break;
 1447|    131|            cipher->cfinal = OSSL_FUNC_cipher_final(fns);
 1448|    131|            fnciphcnt++;
 1449|    131|            break;
 1450|    119|        case OSSL_FUNC_CIPHER_CIPHER:
  ------------------
  |  |  362|    119|#define OSSL_FUNC_CIPHER_CIPHER 6
  ------------------
  |  Branch (1450:9): [True: 119, False: 1.83k]
  ------------------
 1451|    119|            if (cipher->ccipher != NULL)
  ------------------
  |  Branch (1451:17): [True: 0, False: 119]
  ------------------
 1452|      0|                break;
 1453|    119|            cipher->ccipher = OSSL_FUNC_cipher_cipher(fns);
 1454|    119|            break;
 1455|      0|        case OSSL_FUNC_CIPHER_PIPELINE_ENCRYPT_INIT:
  ------------------
  |  |  371|      0|#define OSSL_FUNC_CIPHER_PIPELINE_ENCRYPT_INIT 15
  ------------------
  |  Branch (1455:9): [True: 0, False: 1.95k]
  ------------------
 1456|      0|            if (cipher->p_einit != NULL)
  ------------------
  |  Branch (1456:17): [True: 0, False: 0]
  ------------------
 1457|      0|                break;
 1458|      0|            cipher->p_einit = OSSL_FUNC_cipher_pipeline_encrypt_init(fns);
 1459|      0|            fnpipecnt++;
 1460|      0|            break;
 1461|      0|        case OSSL_FUNC_CIPHER_PIPELINE_DECRYPT_INIT:
  ------------------
  |  |  372|      0|#define OSSL_FUNC_CIPHER_PIPELINE_DECRYPT_INIT 16
  ------------------
  |  Branch (1461:9): [True: 0, False: 1.95k]
  ------------------
 1462|      0|            if (cipher->p_dinit != NULL)
  ------------------
  |  Branch (1462:17): [True: 0, False: 0]
  ------------------
 1463|      0|                break;
 1464|      0|            cipher->p_dinit = OSSL_FUNC_cipher_pipeline_decrypt_init(fns);
 1465|      0|            fnpipecnt++;
 1466|      0|            break;
 1467|      0|        case OSSL_FUNC_CIPHER_PIPELINE_UPDATE:
  ------------------
  |  |  373|      0|#define OSSL_FUNC_CIPHER_PIPELINE_UPDATE 17
  ------------------
  |  Branch (1467:9): [True: 0, False: 1.95k]
  ------------------
 1468|      0|            if (cipher->p_cupdate != NULL)
  ------------------
  |  Branch (1468:17): [True: 0, False: 0]
  ------------------
 1469|      0|                break;
 1470|      0|            cipher->p_cupdate = OSSL_FUNC_cipher_pipeline_update(fns);
 1471|      0|            fnpipecnt++;
 1472|      0|            break;
 1473|      0|        case OSSL_FUNC_CIPHER_PIPELINE_FINAL:
  ------------------
  |  |  374|      0|#define OSSL_FUNC_CIPHER_PIPELINE_FINAL 18
  ------------------
  |  Branch (1473:9): [True: 0, False: 1.95k]
  ------------------
 1474|      0|            if (cipher->p_cfinal != NULL)
  ------------------
  |  Branch (1474:17): [True: 0, False: 0]
  ------------------
 1475|      0|                break;
 1476|      0|            cipher->p_cfinal = OSSL_FUNC_cipher_pipeline_final(fns);
 1477|      0|            fnpipecnt++;
 1478|      0|            break;
 1479|    131|        case OSSL_FUNC_CIPHER_FREECTX:
  ------------------
  |  |  363|    131|#define OSSL_FUNC_CIPHER_FREECTX 7
  ------------------
  |  Branch (1479:9): [True: 131, False: 1.82k]
  ------------------
 1480|    131|            if (cipher->freectx != NULL)
  ------------------
  |  Branch (1480:17): [True: 0, False: 131]
  ------------------
 1481|      0|                break;
 1482|    131|            cipher->freectx = OSSL_FUNC_cipher_freectx(fns);
 1483|    131|            fnctxcnt++;
 1484|    131|            break;
 1485|    130|        case OSSL_FUNC_CIPHER_DUPCTX:
  ------------------
  |  |  364|    130|#define OSSL_FUNC_CIPHER_DUPCTX 8
  ------------------
  |  Branch (1485:9): [True: 130, False: 1.82k]
  ------------------
 1486|    130|            if (cipher->dupctx != NULL)
  ------------------
  |  Branch (1486:17): [True: 0, False: 130]
  ------------------
 1487|      0|                break;
 1488|    130|            cipher->dupctx = OSSL_FUNC_cipher_dupctx(fns);
 1489|    130|            break;
 1490|    131|        case OSSL_FUNC_CIPHER_GET_PARAMS:
  ------------------
  |  |  365|    131|#define OSSL_FUNC_CIPHER_GET_PARAMS 9
  ------------------
  |  Branch (1490:9): [True: 131, False: 1.82k]
  ------------------
 1491|    131|            if (cipher->get_params != NULL)
  ------------------
  |  Branch (1491:17): [True: 0, False: 131]
  ------------------
 1492|      0|                break;
 1493|    131|            cipher->get_params = OSSL_FUNC_cipher_get_params(fns);
 1494|    131|            break;
 1495|    131|        case OSSL_FUNC_CIPHER_GET_CTX_PARAMS:
  ------------------
  |  |  366|    131|#define OSSL_FUNC_CIPHER_GET_CTX_PARAMS 10
  ------------------
  |  Branch (1495:9): [True: 131, False: 1.82k]
  ------------------
 1496|    131|            if (cipher->get_ctx_params != NULL)
  ------------------
  |  Branch (1496:17): [True: 0, False: 131]
  ------------------
 1497|      0|                break;
 1498|    131|            cipher->get_ctx_params = OSSL_FUNC_cipher_get_ctx_params(fns);
 1499|    131|            break;
 1500|    131|        case OSSL_FUNC_CIPHER_SET_CTX_PARAMS:
  ------------------
  |  |  367|    131|#define OSSL_FUNC_CIPHER_SET_CTX_PARAMS 11
  ------------------
  |  Branch (1500:9): [True: 131, False: 1.82k]
  ------------------
 1501|    131|            if (cipher->set_ctx_params != NULL)
  ------------------
  |  Branch (1501:17): [True: 0, False: 131]
  ------------------
 1502|      0|                break;
 1503|    131|            cipher->set_ctx_params = OSSL_FUNC_cipher_set_ctx_params(fns);
 1504|    131|            break;
 1505|    131|        case OSSL_FUNC_CIPHER_GETTABLE_PARAMS:
  ------------------
  |  |  368|    131|#define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12
  ------------------
  |  Branch (1505:9): [True: 131, False: 1.82k]
  ------------------
 1506|    131|            if (cipher->gettable_params != NULL)
  ------------------
  |  Branch (1506:17): [True: 0, False: 131]
  ------------------
 1507|      0|                break;
 1508|    131|            cipher->gettable_params = OSSL_FUNC_cipher_gettable_params(fns);
 1509|    131|            break;
 1510|    131|        case OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  369|    131|#define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13
  ------------------
  |  Branch (1510:9): [True: 131, False: 1.82k]
  ------------------
 1511|    131|            if (cipher->gettable_ctx_params != NULL)
  ------------------
  |  Branch (1511:17): [True: 0, False: 131]
  ------------------
 1512|      0|                break;
 1513|    131|            cipher->gettable_ctx_params = OSSL_FUNC_cipher_gettable_ctx_params(fns);
 1514|    131|            break;
 1515|    131|        case OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  370|    131|#define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14
  ------------------
  |  Branch (1515:9): [True: 131, False: 1.82k]
  ------------------
 1516|    131|            if (cipher->settable_ctx_params != NULL)
  ------------------
  |  Branch (1516:17): [True: 0, False: 131]
  ------------------
 1517|      0|                break;
 1518|    131|            cipher->settable_ctx_params = OSSL_FUNC_cipher_settable_ctx_params(fns);
 1519|    131|            break;
 1520|  1.95k|        }
 1521|  1.95k|    }
 1522|    131|    fnciphcnt += encinit + decinit;
 1523|    131|    if ((fnciphcnt != 0 && fnciphcnt != 3 && fnciphcnt != 4)
  ------------------
  |  Branch (1523:10): [True: 131, False: 0]
  |  Branch (1523:28): [True: 131, False: 0]
  |  Branch (1523:46): [True: 0, False: 131]
  ------------------
 1524|    131|        || (fnciphcnt == 0 && cipher->ccipher == NULL && fnpipecnt == 0)
  ------------------
  |  Branch (1524:13): [True: 0, False: 131]
  |  Branch (1524:31): [True: 0, False: 0]
  |  Branch (1524:58): [True: 0, False: 0]
  ------------------
 1525|    131|        || (fnpipecnt != 0 && (fnpipecnt < 3 || cipher->p_cupdate == NULL || cipher->p_cfinal == NULL))
  ------------------
  |  Branch (1525:13): [True: 0, False: 131]
  |  Branch (1525:32): [True: 0, False: 0]
  |  Branch (1525:49): [True: 0, False: 0]
  |  Branch (1525:78): [True: 0, False: 0]
  ------------------
 1526|    131|        || fnctxcnt != 2
  ------------------
  |  Branch (1526:12): [True: 0, False: 131]
  ------------------
 1527|    131|        || cipher->get_params == NULL) {
  ------------------
  |  Branch (1527:12): [True: 0, False: 131]
  ------------------
 1528|       |        /*
 1529|       |         * In order to be a consistent set of functions we must have at least
 1530|       |         * a complete set of "encrypt" functions, or a complete set of "decrypt"
 1531|       |         * functions, or a single "cipher" function.
 1532|       |         */
 1533|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1534|      0|        goto err;
 1535|      0|    }
 1536|    131|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (1536:9): [True: 131, False: 0]
  |  Branch (1536:25): [True: 0, False: 131]
  ------------------
 1537|      0|        goto err;
 1538|       |
 1539|    131|    cipher->prov = prov;
 1540|       |
 1541|    131|    if (!evp_cipher_cache_constants(cipher)) {
  ------------------
  |  Branch (1541:9): [True: 0, False: 131]
  ------------------
 1542|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1543|      0|        goto err;
 1544|      0|    }
 1545|       |
 1546|    131|    return cipher;
 1547|       |
 1548|      0|err:
 1549|      0|    evp_cipher_free(cipher);
 1550|       |    return NULL;
 1551|    131|}
evp_enc.c:set_legacy_nid:
 1328|    244|{
 1329|    244|    int nid;
 1330|    244|    int *legacy_nid = vlegacy_nid;
 1331|       |    /*
 1332|       |     * We use lowest level function to get the associated method, because
 1333|       |     * higher level functions such as EVP_get_cipherbyname() have changed
 1334|       |     * to look at providers too.
 1335|       |     */
 1336|    244|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|    244|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  ------------------
 1337|       |
 1338|    244|    if (*legacy_nid == -1) /* We found a clash already */
  ------------------
  |  Branch (1338:9): [True: 0, False: 244]
  ------------------
 1339|      0|        return;
 1340|    244|    if (legacy_method == NULL)
  ------------------
  |  Branch (1340:9): [True: 110, False: 134]
  ------------------
 1341|    110|        return;
 1342|    134|    nid = EVP_CIPHER_get_nid(legacy_method);
 1343|    134|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   19|    268|#define NID_undef                       0
  ------------------
  |  Branch (1343:9): [True: 26, False: 108]
  |  Branch (1343:37): [True: 0, False: 26]
  ------------------
 1344|      0|        *legacy_nid = -1;
 1345|      0|        return;
 1346|      0|    }
 1347|    134|    *legacy_nid = nid;
 1348|    134|}
evp_enc.c:evp_cipher_up_ref:
 1352|    135|{
 1353|    135|    EVP_CIPHER *cipher = (EVP_CIPHER *)c;
 1354|    135|    int ref = 0;
 1355|       |
 1356|    135|    if (cipher->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  188|    135|#define EVP_ORIG_DYNAMIC 0
  ------------------
  |  Branch (1356:9): [True: 135, False: 0]
  ------------------
 1357|    135|        return CRYPTO_UP_REF(&cipher->refcnt, &ref);
 1358|      0|    return 1;
 1359|    135|}
evp_enc.c:evp_cipher_free:
 1362|    131|{
 1363|    131|    EVP_CIPHER *cipher = (EVP_CIPHER *)c;
 1364|    131|    int i;
 1365|       |
 1366|    131|    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  188|    131|#define EVP_ORIG_DYNAMIC 0
  ------------------
  |  Branch (1366:9): [True: 0, False: 131]
  |  Branch (1366:27): [True: 0, False: 131]
  ------------------
 1367|      0|        return;
 1368|       |
 1369|    131|    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
 1370|    131|    if (i > 0)
  ------------------
  |  Branch (1370:9): [True: 131, False: 0]
  ------------------
 1371|    131|        return;
 1372|      0|    evp_cipher_free_int(cipher);
 1373|      0|}

ossl_err_load_EVP_strings:
  230|      1|{
  231|      1|#ifndef OPENSSL_NO_ERR
  232|      1|    if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (232:9): [True: 1, False: 0]
  ------------------
  233|      1|        ERR_load_strings_const(EVP_str_reasons);
  234|      1|#endif
  235|      1|    return 1;
  236|      1|}

evp_generic_fetch:
  498|      8|{
  499|      8|    struct evp_method_data_st methdata;
  500|      8|    void *method;
  501|       |
  502|      8|    methdata.libctx = libctx;
  503|      8|    methdata.tmp_store = NULL;
  504|       |    method = inner_evp_generic_fetch(&methdata, NULL, operation_id,
  505|      8|        name, properties,
  506|      8|        new_method, up_ref_method, free_method);
  507|      8|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  508|      8|    return method;
  509|      8|}
evp_names_do_all:
  775|    161|{
  776|    161|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  777|    161|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  778|       |
  779|    161|    return ossl_namemap_doall_names(namemap, number, fn, data);
  780|    161|}
evp_fetch.c:inner_evp_generic_fetch:
  260|      8|{
  261|      8|    OSSL_METHOD_STORE *store = get_evp_method_store(methdata->libctx);
  262|      8|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  263|       |#ifdef FIPS_MODULE
  264|       |    /*
  265|       |     * The FIPS provider has its own internal library context where only it
  266|       |     * is loaded.  Consequently, property queries aren't relevant because
  267|       |     * there is only one fetchable algorithm and it is assumed that the
  268|       |     * FIPS-ness is handled by the using algorithm.
  269|       |     */
  270|       |    const char *const propq = "";
  271|       |#else
  272|      8|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (272:31): [True: 4, False: 4]
  ------------------
  273|      8|#endif /* FIPS_MODULE */
  274|      8|    uint32_t meth_id = 0;
  275|      8|    void *method = NULL;
  276|      8|    int unsupported, name_id;
  277|      8|    int set_in_cache = 1;
  278|      8|    void *tmp_method;
  279|      8|    const OSSL_PROVIDER *tmp_prov = prov;
  280|       |
  281|      8|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (281:9): [True: 0, False: 8]
  |  Branch (281:26): [True: 0, False: 8]
  ------------------
  282|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0|        return NULL;
  284|      0|    }
  285|       |
  286|       |    /*
  287|       |     * If there's ever an operation_id == 0 passed, we have an internal
  288|       |     * programming error.
  289|       |     */
  290|      8|    if (!ossl_assert(operation_id > 0)) {
  ------------------
  |  |   45|      8|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      8|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (290:9): [True: 0, False: 8]
  ------------------
  291|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  292|      0|        return NULL;
  293|      0|    }
  294|       |
  295|       |    /* If we haven't received a name id yet, try to get one for the name */
  296|      8|    name_id = ossl_namemap_name2num(namemap, name);
  297|       |
  298|       |    /*
  299|       |     * If we have a name id, calculate a method id with evp_method_id().
  300|       |     *
  301|       |     * evp_method_id returns 0 if we have too many operations (more than
  302|       |     * about 2^8) or too many names (more than about 2^24).  In that case,
  303|       |     * we can't create any new method.
  304|       |     * For all intents and purposes, this is an internal error.
  305|       |     */
  306|      8|    if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0) {
  ------------------
  |  Branch (306:9): [True: 6, False: 2]
  |  Branch (306:25): [True: 0, False: 6]
  ------------------
  307|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  308|      0|        return NULL;
  309|      0|    }
  310|       |
  311|       |    /*
  312|       |     * If we haven't found the name yet, chances are that the algorithm to
  313|       |     * be fetched is unsupported.
  314|       |     */
  315|      8|    unsupported = name_id == 0;
  316|       |
  317|      8|    if (meth_id == 0
  ------------------
  |  Branch (317:9): [True: 2, False: 6]
  ------------------
  318|      6|        || !ossl_method_store_cache_get(store, prov, meth_id, propq, &method)) {
  ------------------
  |  Branch (318:12): [True: 3, False: 3]
  ------------------
  319|      5|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  320|      5|            get_tmp_evp_method_store,
  321|      5|            reserve_evp_method_store,
  322|      5|            unreserve_evp_method_store,
  323|      5|            get_evp_method_from_store,
  324|      5|            put_evp_method_in_store,
  325|      5|            construct_evp_method,
  326|      5|            destruct_evp_method
  327|      5|        };
  328|       |
  329|      5|        methdata->operation_id = operation_id;
  330|      5|        methdata->name_id = name_id;
  331|      5|        methdata->names = name;
  332|      5|        methdata->propquery = propq;
  333|      5|        methdata->method_from_algorithm = new_method;
  334|      5|        methdata->refcnt_up_method = up_ref_method;
  335|      5|        methdata->destruct_method = free_method;
  336|      5|        methdata->flag_construct_error_occurred = 0;
  337|      5|        if ((method = ossl_method_construct(methdata->libctx, operation_id,
  ------------------
  |  Branch (337:13): [True: 5, False: 0]
  ------------------
  338|      5|                 &prov, 0 /* !force_cache */,
  339|      5|                 &mcm, methdata))
  340|      5|            != NULL) {
  341|       |            /*
  342|       |             * If construction did create a method for us, we know that
  343|       |             * there is a correct name_id and meth_id, since those have
  344|       |             * already been calculated in get_evp_method_from_store() and
  345|       |             * put_evp_method_in_store() above.
  346|       |             * Note that there is a corner case here, in which, if a user
  347|       |             * passes a name of the form name1:name2:..., then the construction
  348|       |             * will create a method against all names, but the lookup will fail
  349|       |             * as ossl_namemap_name2num treats the name string as a single name
  350|       |             * rather than introducing new features where in the EVP_<obj>_fetch
  351|       |             * parses the string and queries for each, return an error.
  352|       |             */
  353|      5|            if (name_id == 0)
  ------------------
  |  Branch (353:17): [True: 2, False: 3]
  ------------------
  354|      2|                name_id = ossl_namemap_name2num(namemap, name);
  355|      5|            if (name_id == 0) {
  ------------------
  |  Branch (355:17): [True: 0, False: 5]
  ------------------
  356|      0|                ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |   59|      0|#define ERR_LIB_EVP 6
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |  318|      0|#define ERR_R_FETCH_FAILED (269 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  220|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|      0|                    "Algorithm %s cannot be found", name != NULL ? name : "<null>");
  ------------------
  |  Branch (357:53): [True: 0, False: 0]
  ------------------
  358|       |#ifdef OPENSSL_NO_CACHED_FETCH
  359|       |                free_method(method);
  360|       |#endif
  361|      0|                method = NULL;
  362|      5|            } else {
  363|      5|                meth_id = evp_method_id(name_id, operation_id);
  364|       |                /*
  365|       |                 * do not insert method to method store cache when provider
  366|       |                 * did ask for not caching it. methods which are not to be
  367|       |                 * cached end up in ->tmp_store when provider asks not
  368|       |                 * to cache the result (see ossl_method_construct_reserve_store())
  369|       |                 */
  370|      5|                if (meth_id != 0) {
  ------------------
  |  Branch (370:21): [True: 5, False: 0]
  ------------------
  371|       |                    /*
  372|       |                     * If the method doesn't exist in the tmp_store, either the tmp_store doesn't exist
  373|       |                     * or the algorithm doesn't exist there, in either case, this is a cacheable entry
  374|       |                     */
  375|      5|                    if (!ossl_method_store_fetch(methdata->tmp_store, meth_id, propq, &tmp_prov, &tmp_method)) {
  ------------------
  |  Branch (375:25): [True: 5, False: 0]
  ------------------
  376|      5|                        set_in_cache = 1;
  377|      5|                    } else {
  378|       |                        /*
  379|       |                         * We found a matching method in the temp store, don't cache this entry
  380|       |                         */
  381|      0|                        if (tmp_method == method) {
  ------------------
  |  Branch (381:29): [True: 0, False: 0]
  ------------------
  382|      0|                            set_in_cache = 0;
  383|      0|                        } else {
  384|      0|                            set_in_cache = 1;
  385|      0|                        }
  386|       |
  387|       |#ifdef OPENSSL_NO_CACHED_FETCH
  388|       |                        /*
  389|       |                         * ossl_method_store_fetch takes a reference on the fetched method
  390|       |                         * when using NO_CACHED_FETCH, so we need to free it here
  391|       |                         */
  392|       |                        free_method(tmp_method);
  393|       |#endif
  394|      0|                    }
  395|      5|                }
  396|       |
  397|      5|                if (set_in_cache == 1) {
  ------------------
  |  Branch (397:21): [True: 5, False: 0]
  ------------------
  398|      5|                    ossl_method_store_cache_set(store, prov, meth_id, propq,
  399|      5|                        method, up_ref_method, free_method);
  400|      5|                } else {
  401|      0|#ifndef OPENSSL_NO_CACHED_FETCH
  402|       |                    /*
  403|       |                     * There is a corner case we need to handle here.  IF:
  404|       |                     * 1) we are fetching an algorithm and plan to return it to the caller
  405|       |                     * 2) The provider we fetched from requested no_cache
  406|       |                     * Then we are in a situation in which this method that was constructed
  407|       |                     * only lives in the tmp_store, and has a reference count of 1.
  408|       |                     * On return from this function, that tmp_store is going to be deallocated,
  409|       |                     * Which will drop the methods ref count to 0 and free it, after which the
  410|       |                     * method will be returned to the called, as an already freed object.
  411|       |                     *
  412|       |                     * That's bad.  We need to grab an extra ref count on the method before returning
  413|       |                     * so that the requestor via EVP_*_fetch has ownership.
  414|       |                     *
  415|       |                     * BUT we only want to do this in the event that the algorithm is uncached.
  416|       |                     * Unfortunately, we don't know that here, because it was the provider that
  417|       |                     * made that request.  However, each algorithm type does store that information
  418|       |                     * so we have a path forward.  Based on the operation id, call the appropriate
  419|       |                     * up_ref method.  That implementation knows how to query its algorithm type and
  420|       |                     * decide if a reference needs to be taken here
  421|       |                     */
  422|      0|                    switch (operation_id) {
  423|      0|                    case OSSL_OP_DIGEST:
  ------------------
  |  |  283|      0|#define OSSL_OP_DIGEST 1
  ------------------
  |  Branch (423:21): [True: 0, False: 0]
  ------------------
  424|      0|                        EVP_MD_up_ref((EVP_MD *)method);
  425|      0|                        break;
  426|      0|                    case OSSL_OP_CIPHER:
  ------------------
  |  |  284|      0|#define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
  ------------------
  |  Branch (426:21): [True: 0, False: 0]
  ------------------
  427|      0|                        EVP_CIPHER_up_ref((EVP_CIPHER *)method);
  428|      0|                        break;
  429|      0|                    case OSSL_OP_MAC:
  ------------------
  |  |  285|      0|#define OSSL_OP_MAC 3
  ------------------
  |  Branch (429:21): [True: 0, False: 0]
  ------------------
  430|      0|                        EVP_MAC_up_ref((EVP_MAC *)method);
  431|      0|                        break;
  432|      0|                    case OSSL_OP_KDF:
  ------------------
  |  |  286|      0|#define OSSL_OP_KDF 4
  ------------------
  |  Branch (432:21): [True: 0, False: 0]
  ------------------
  433|      0|                        EVP_KDF_up_ref((EVP_KDF *)method);
  434|      0|                        break;
  435|      0|                    case OSSL_OP_RAND:
  ------------------
  |  |  287|      0|#define OSSL_OP_RAND 5
  ------------------
  |  Branch (435:21): [True: 0, False: 0]
  ------------------
  436|      0|                        EVP_RAND_up_ref((EVP_RAND *)method);
  437|      0|                        break;
  438|      0|                    case OSSL_OP_KEYMGMT:
  ------------------
  |  |  288|      0|#define OSSL_OP_KEYMGMT 10
  ------------------
  |  Branch (438:21): [True: 0, False: 0]
  ------------------
  439|      0|                        EVP_KEYMGMT_up_ref((EVP_KEYMGMT *)method);
  440|      0|                        break;
  441|      0|                    case OSSL_OP_KEYEXCH:
  ------------------
  |  |  289|      0|#define OSSL_OP_KEYEXCH 11
  ------------------
  |  Branch (441:21): [True: 0, False: 0]
  ------------------
  442|      0|                        EVP_KEYEXCH_up_ref((EVP_KEYEXCH *)method);
  443|      0|                        break;
  444|      0|                    case OSSL_OP_SIGNATURE:
  ------------------
  |  |  290|      0|#define OSSL_OP_SIGNATURE 12
  ------------------
  |  Branch (444:21): [True: 0, False: 0]
  ------------------
  445|      0|                        EVP_SIGNATURE_up_ref((EVP_SIGNATURE *)method);
  446|      0|                        break;
  447|      0|                    case OSSL_OP_ASYM_CIPHER:
  ------------------
  |  |  291|      0|#define OSSL_OP_ASYM_CIPHER 13
  ------------------
  |  Branch (447:21): [True: 0, False: 0]
  ------------------
  448|      0|                        EVP_ASYM_CIPHER_up_ref((EVP_ASYM_CIPHER *)method);
  449|      0|                        break;
  450|      0|                    case OSSL_OP_KEM:
  ------------------
  |  |  292|      0|#define OSSL_OP_KEM 14
  ------------------
  |  Branch (450:21): [True: 0, False: 0]
  ------------------
  451|      0|                        EVP_KEM_up_ref((EVP_KEM *)method);
  452|      0|                        break;
  453|      0|                    case OSSL_OP_SKEYMGMT:
  ------------------
  |  |  293|      0|#define OSSL_OP_SKEYMGMT 15
  ------------------
  |  Branch (453:21): [True: 0, False: 0]
  ------------------
  454|      0|                        EVP_SKEYMGMT_up_ref((EVP_SKEYMGMT *)method);
  455|      0|                        break;
  456|      0|                    default:
  ------------------
  |  Branch (456:21): [True: 0, False: 0]
  ------------------
  457|      0|                        break;
  458|      0|                    }
  459|      0|#endif
  460|      0|                }
  461|      5|            }
  462|      5|        }
  463|       |
  464|       |        /*
  465|       |         * If we never were in the constructor, the algorithm to be fetched
  466|       |         * is unsupported.
  467|       |         */
  468|      5|        unsupported = !methdata->flag_construct_error_occurred;
  469|      5|    }
  470|       |
  471|      8|    if ((name_id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (471:10): [True: 8, False: 0]
  |  Branch (471:26): [True: 0, False: 0]
  |  Branch (471:43): [True: 0, False: 8]
  ------------------
  472|      0|        int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  317|      0|#define ERR_R_UNSUPPORTED (268 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  220|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  318|      0|#define ERR_R_FETCH_FAILED (269 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  220|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (472:20): [True: 0, False: 0]
  ------------------
  473|       |
  474|      0|        if (name == NULL)
  ------------------
  |  Branch (474:13): [True: 0, False: 0]
  ------------------
  475|      0|            name = ossl_namemap_num2name(namemap, name_id, 0);
  476|      0|        ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |   59|      0|#define ERR_LIB_EVP 6
  ------------------
  477|      0|            "%s, Algorithm (%s : %d), Properties (%s)",
  478|      0|            ossl_lib_ctx_get_descriptor(methdata->libctx),
  479|      0|            name == NULL ? "<null>" : name, name_id,
  ------------------
  |  Branch (479:13): [True: 0, False: 0]
  ------------------
  480|      0|            properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|      8|    } else {
  482|      8|        OSSL_TRACE4(QUERY, "%s, Algorithm (%s : %d), Properties (%s)\n",
  ------------------
  |  |  297|      8|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|      8|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  483|      8|            ossl_lib_ctx_get_descriptor(methdata->libctx),
  484|      8|            name == NULL ? "<null>" : name, name_id,
  485|      8|            properties == NULL ? "<null>" : properties);
  486|      8|    }
  487|       |
  488|      8|    return method;
  489|      8|}
evp_fetch.c:evp_method_id:
  118|    182|{
  119|    182|    if (!ossl_assert(name_id > 0 && name_id <= METHOD_ID_NAME_MAX)
  ------------------
  |  |   45|    182|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|    364|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (23:44): [True: 182, False: 0]
  |  |  |  |  |  Branch (23:44): [True: 182, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 182]
  ------------------
  120|    182|        || !ossl_assert(operation_id > 0
  ------------------
  |  |   45|    182|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|    364|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (23:44): [True: 182, False: 0]
  |  |  |  |  |  Branch (23:44): [True: 182, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (120:12): [True: 0, False: 182]
  ------------------
  121|    182|            && operation_id <= METHOD_ID_OPERATION_MAX))
  122|      0|        return 0;
  123|    182|    return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  115|    182|#define METHOD_ID_NAME_OFFSET 8
  ------------------
                  return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  114|    182|#define METHOD_ID_NAME_MASK 0x7FFFFF00
  ------------------
  124|    182|        | (operation_id & METHOD_ID_OPERATION_MASK));
  ------------------
  |  |  112|    182|#define METHOD_ID_OPERATION_MASK 0x000000FF
  ------------------
  125|    182|}
evp_fetch.c:reserve_evp_method_store:
   74|      5|{
   75|      5|    struct evp_method_data_st *methdata = data;
   76|       |
   77|      5|    if (store == NULL
  ------------------
  |  Branch (77:9): [True: 5, False: 0]
  ------------------
   78|      5|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (78:12): [True: 0, False: 5]
  ------------------
   79|      0|        return 0;
   80|       |
   81|      5|    return ossl_method_lock_store(store);
   82|      5|}
evp_fetch.c:unreserve_evp_method_store:
   85|      5|{
   86|      5|    struct evp_method_data_st *methdata = data;
   87|       |
   88|      5|    if (store == NULL
  ------------------
  |  Branch (88:9): [True: 5, False: 0]
  ------------------
   89|      5|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (89:12): [True: 0, False: 5]
  ------------------
   90|      0|        return 0;
   91|       |
   92|      5|    return ossl_method_unlock_store(store);
   93|      5|}
evp_fetch.c:get_evp_method_from_store:
  129|      5|{
  130|      5|    struct evp_method_data_st *methdata = data;
  131|      5|    void *method = NULL;
  132|      5|    int name_id;
  133|      5|    uint32_t meth_id;
  134|       |
  135|       |    /*
  136|       |     * get_evp_method_from_store() is only called to try and get the method
  137|       |     * that evp_generic_fetch() is asking for, and the operation id as well
  138|       |     * as the name or name id are passed via methdata.
  139|       |     */
  140|      5|    if ((name_id = methdata->name_id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (140:9): [True: 2, False: 3]
  |  Branch (140:47): [True: 2, False: 0]
  ------------------
  141|      2|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  142|      2|        const char *names = methdata->names;
  143|      2|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|      2|#define NAME_SEPARATOR ':'
  ------------------
  144|      2|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (144:21): [True: 2, False: 0]
  ------------------
  145|       |
  146|      2|        if (namemap == 0)
  ------------------
  |  Branch (146:13): [True: 0, False: 2]
  ------------------
  147|      0|            return NULL;
  148|      2|        name_id = ossl_namemap_name2num_n(namemap, names, l);
  149|      2|    }
  150|       |
  151|      5|    if (name_id == 0
  ------------------
  |  Branch (151:9): [True: 0, False: 5]
  ------------------
  152|      5|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (152:12): [True: 0, False: 5]
  ------------------
  153|      0|        return NULL;
  154|       |
  155|      5|    if (store == NULL
  ------------------
  |  Branch (155:9): [True: 5, False: 0]
  ------------------
  156|      5|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (156:12): [True: 0, False: 5]
  ------------------
  157|      0|        return NULL;
  158|       |
  159|      5|    if (!ossl_method_store_fetch(store, meth_id, methdata->propquery, prov,
  ------------------
  |  Branch (159:9): [True: 0, False: 5]
  ------------------
  160|      5|            &method))
  161|      0|        return NULL;
  162|      5|    return method;
  163|      5|}
evp_fetch.c:put_evp_method_in_store:
  169|    166|{
  170|    166|    struct evp_method_data_st *methdata = data;
  171|    166|    OSSL_NAMEMAP *namemap;
  172|    166|    int name_id;
  173|    166|    uint32_t meth_id;
  174|    166|    size_t l = 0;
  175|       |
  176|       |    /*
  177|       |     * put_evp_method_in_store() is only called with an EVP method that was
  178|       |     * successfully created by construct_method() below, which means that
  179|       |     * all the names should already be stored in the namemap with the same
  180|       |     * numeric identity, so just use the first to get that identity.
  181|       |     */
  182|    166|    if (names != NULL) {
  ------------------
  |  Branch (182:9): [True: 166, False: 0]
  ------------------
  183|    166|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|    166|#define NAME_SEPARATOR ':'
  ------------------
  184|       |
  185|    166|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (185:14): [True: 62, False: 104]
  ------------------
  186|    166|    }
  187|       |
  188|    166|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (188:9): [True: 0, False: 166]
  ------------------
  189|    166|        || (name_id = ossl_namemap_name2num_n(namemap, names, l)) == 0
  ------------------
  |  Branch (189:12): [True: 0, False: 166]
  ------------------
  190|    166|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (190:12): [True: 0, False: 166]
  ------------------
  191|      0|        return 0;
  192|       |
  193|    166|    OSSL_TRACE1(QUERY, "put_evp_method_in_store: original store: %p\n", store);
  ------------------
  |  |  291|    166|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|    166|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  194|    166|    if (store == NULL
  ------------------
  |  Branch (194:9): [True: 166, False: 0]
  ------------------
  195|    166|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (195:12): [True: 0, False: 166]
  ------------------
  196|      0|        return 0;
  197|       |
  198|    166|    OSSL_TRACE5(QUERY,
  ------------------
  |  |  299|    166|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5))
  |  |  ------------------
  |  |  |  |  283|    166|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  199|    166|        "put_evp_method_in_store: "
  200|    166|        "store: %p, names: %s, operation_id %d, method_id: %d, properties: %s\n",
  201|    166|        store, names, methdata->operation_id, meth_id, propdef ? propdef : "<null>");
  202|    166|    return ossl_method_store_add(store, prov, meth_id, propdef, method,
  203|    166|        methdata->refcnt_up_method,
  204|    166|        methdata->destruct_method);
  205|    166|}
evp_fetch.c:construct_evp_method:
  213|    166|{
  214|       |    /*
  215|       |     * This function is only called if get_evp_method_from_store() returned
  216|       |     * NULL, so it's safe to say that of all the spots to create a new
  217|       |     * namemap entry, this is it.  Should the name already exist there, we
  218|       |     * know that ossl_namemap_add_name() will return its corresponding
  219|       |     * number.
  220|       |     */
  221|    166|    struct evp_method_data_st *methdata = data;
  222|    166|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  223|    166|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  224|    166|    const char *names = algodef->algorithm_names;
  225|    166|    int name_id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   25|    166|#define NAME_SEPARATOR ':'
  ------------------
  226|    166|    void *method;
  227|       |
  228|    166|    if (name_id == 0)
  ------------------
  |  Branch (228:9): [True: 0, False: 166]
  ------------------
  229|      0|        return NULL;
  230|       |
  231|    166|    method = methdata->method_from_algorithm(name_id, algodef, prov, no_store);
  232|       |
  233|       |    /*
  234|       |     * Flag to indicate that there was actual construction errors.  This
  235|       |     * helps inner_evp_generic_fetch() determine what error it should
  236|       |     * record on inaccessible algorithms.
  237|       |     */
  238|    166|    if (method == NULL)
  ------------------
  |  Branch (238:9): [True: 0, False: 166]
  ------------------
  239|      0|        methdata->flag_construct_error_occurred = 1;
  240|       |
  241|    166|    return method;
  242|    166|}
evp_fetch.c:destruct_evp_method:
  245|    166|{
  246|    166|    struct evp_method_data_st *methdata = data;
  247|       |
  248|    166|    methdata->destruct_method(method);
  249|    166|}
evp_fetch.c:dealloc_tmp_evp_method_store:
   62|      8|{
   63|      8|    OSSL_TRACE1(QUERY, "Deallocating the tmp_store %p\n", store);
  ------------------
  |  |  291|      8|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|      8|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   64|      8|    if (store != NULL)
  ------------------
  |  Branch (64:9): [True: 0, False: 8]
  ------------------
   65|      0|        ossl_method_store_free(store);
   66|      8|}
evp_fetch.c:get_evp_method_store:
   69|    189|{
   70|    189|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX);
  ------------------
  |  |   96|    189|#define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX 0
  ------------------
   71|    189|}

EVP_CIPHER_get_type:
  243|    183|{
  244|    183|    int nid;
  245|    183|    nid = EVP_CIPHER_get_nid(cipher);
  246|       |
  247|    183|    switch (nid) {
  248|       |
  249|      3|    case NID_rc2_cbc:
  ------------------
  |  | 1308|      3|#define NID_rc2_cbc             37
  ------------------
  |  Branch (249:5): [True: 3, False: 180]
  ------------------
  250|      5|    case NID_rc2_64_cbc:
  ------------------
  |  | 1329|      5|#define NID_rc2_64_cbc          166
  ------------------
  |  Branch (250:5): [True: 2, False: 181]
  ------------------
  251|      7|    case NID_rc2_40_cbc:
  ------------------
  |  | 1325|      7|#define NID_rc2_40_cbc          98
  ------------------
  |  Branch (251:5): [True: 2, False: 181]
  ------------------
  252|       |
  253|      7|        return NID_rc2_cbc;
  ------------------
  |  | 1308|      7|#define NID_rc2_cbc             37
  ------------------
  254|       |
  255|      1|    case NID_rc4:
  ------------------
  |  | 1333|      1|#define NID_rc4         5
  ------------------
  |  Branch (255:5): [True: 1, False: 182]
  ------------------
  256|      2|    case NID_rc4_40:
  ------------------
  |  | 1338|      2|#define NID_rc4_40              97
  ------------------
  |  Branch (256:5): [True: 1, False: 182]
  ------------------
  257|       |
  258|      2|        return NID_rc4;
  ------------------
  |  | 1333|      2|#define NID_rc4         5
  ------------------
  259|       |
  260|      1|    case NID_aes_128_cfb128:
  ------------------
  |  | 3129|      1|#define NID_aes_128_cfb128              421
  ------------------
  |  Branch (260:5): [True: 1, False: 182]
  ------------------
  261|      2|    case NID_aes_128_cfb8:
  ------------------
  |  | 3250|      2|#define NID_aes_128_cfb8                653
  ------------------
  |  Branch (261:5): [True: 1, False: 182]
  ------------------
  262|      3|    case NID_aes_128_cfb1:
  ------------------
  |  | 3238|      3|#define NID_aes_128_cfb1                650
  ------------------
  |  Branch (262:5): [True: 1, False: 182]
  ------------------
  263|       |
  264|      3|        return NID_aes_128_cfb128;
  ------------------
  |  | 3129|      3|#define NID_aes_128_cfb128              421
  ------------------
  265|       |
  266|      1|    case NID_aes_192_cfb128:
  ------------------
  |  | 3167|      1|#define NID_aes_192_cfb128              425
  ------------------
  |  Branch (266:5): [True: 1, False: 182]
  ------------------
  267|      2|    case NID_aes_192_cfb8:
  ------------------
  |  | 3254|      2|#define NID_aes_192_cfb8                654
  ------------------
  |  Branch (267:5): [True: 1, False: 182]
  ------------------
  268|      3|    case NID_aes_192_cfb1:
  ------------------
  |  | 3242|      3|#define NID_aes_192_cfb1                651
  ------------------
  |  Branch (268:5): [True: 1, False: 182]
  ------------------
  269|       |
  270|      3|        return NID_aes_192_cfb128;
  ------------------
  |  | 3167|      3|#define NID_aes_192_cfb128              425
  ------------------
  271|       |
  272|      1|    case NID_aes_256_cfb128:
  ------------------
  |  | 3205|      1|#define NID_aes_256_cfb128              429
  ------------------
  |  Branch (272:5): [True: 1, False: 182]
  ------------------
  273|      2|    case NID_aes_256_cfb8:
  ------------------
  |  | 3258|      2|#define NID_aes_256_cfb8                655
  ------------------
  |  Branch (273:5): [True: 1, False: 182]
  ------------------
  274|      3|    case NID_aes_256_cfb1:
  ------------------
  |  | 3246|      3|#define NID_aes_256_cfb1                652
  ------------------
  |  Branch (274:5): [True: 1, False: 182]
  ------------------
  275|       |
  276|      3|        return NID_aes_256_cfb128;
  ------------------
  |  | 3205|      3|#define NID_aes_256_cfb128              429
  ------------------
  277|       |
  278|      1|    case NID_des_cfb64:
  ------------------
  |  | 2295|      1|#define NID_des_cfb64           30
  ------------------
  |  Branch (278:5): [True: 1, False: 182]
  ------------------
  279|      2|    case NID_des_cfb8:
  ------------------
  |  | 3290|      2|#define NID_des_cfb8            657
  ------------------
  |  Branch (279:5): [True: 1, False: 182]
  ------------------
  280|      3|    case NID_des_cfb1:
  ------------------
  |  | 3286|      3|#define NID_des_cfb1            656
  ------------------
  |  Branch (280:5): [True: 1, False: 182]
  ------------------
  281|       |
  282|      3|        return NID_des_cfb64;
  ------------------
  |  | 2295|      3|#define NID_des_cfb64           30
  ------------------
  283|       |
  284|      1|    case NID_des_ede3_cfb64:
  ------------------
  |  | 2336|      1|#define NID_des_ede3_cfb64              61
  ------------------
  |  Branch (284:5): [True: 1, False: 182]
  ------------------
  285|      2|    case NID_des_ede3_cfb8:
  ------------------
  |  | 3298|      2|#define NID_des_ede3_cfb8               659
  ------------------
  |  Branch (285:5): [True: 1, False: 182]
  ------------------
  286|      3|    case NID_des_ede3_cfb1:
  ------------------
  |  | 3294|      3|#define NID_des_ede3_cfb1               658
  ------------------
  |  Branch (286:5): [True: 1, False: 182]
  ------------------
  287|       |
  288|      3|        return NID_des_ede3_cfb64;
  ------------------
  |  | 2336|      3|#define NID_des_ede3_cfb64              61
  ------------------
  289|       |
  290|    159|    default:
  ------------------
  |  Branch (290:5): [True: 159, False: 24]
  ------------------
  291|       |#ifdef FIPS_MODULE
  292|       |        return NID_undef;
  293|       |#else
  294|    159|    {
  295|       |        /* Check it has an OID and it is valid */
  296|    159|        ASN1_OBJECT *otmp = OBJ_nid2obj(nid);
  297|       |
  298|    159|        if (OBJ_get0_data(otmp) == NULL)
  ------------------
  |  Branch (298:13): [True: 48, False: 111]
  ------------------
  299|     48|            nid = NID_undef;
  ------------------
  |  |   19|     48|#define NID_undef                       0
  ------------------
  300|    159|        ASN1_OBJECT_free(otmp);
  301|    159|        return nid;
  302|      2|    }
  303|    183|#endif
  304|    183|    }
  305|    183|}
evp_cipher_cache_constants:
  308|    131|{
  309|    131|    int ok, aead = 0, custom_iv = 0, cts = 0, multiblock = 0, randkey = 0;
  310|    131|    int encrypt_then_mac = 0;
  311|    131|    size_t ivlen = 0;
  312|    131|    size_t blksz = 0;
  313|    131|    size_t keylen = 0;
  314|    131|    unsigned int mode = 0;
  315|    131|    int no_store = cipher->flags & EVP_CIPH_FLAG_NO_STORE;
  ------------------
  |  |  345|    131|#define EVP_CIPH_FLAG_NO_STORE 0x20000000
  ------------------
  316|    131|    OSSL_PARAM params[11];
  317|       |
  318|    131|    params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  187|    131|# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  319|    131|    params[1] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN, &ivlen);
  ------------------
  |  |  197|    131|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  320|    131|    params[2] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &keylen);
  ------------------
  |  |  198|    131|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  321|    131|    params[3] = OSSL_PARAM_construct_uint(OSSL_CIPHER_PARAM_MODE, &mode);
  ------------------
  |  |  199|    131|# define OSSL_CIPHER_PARAM_MODE "mode"
  ------------------
  322|    131|    params[4] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_AEAD, &aead);
  ------------------
  |  |  173|    131|# define OSSL_CIPHER_PARAM_AEAD "aead"
  ------------------
  323|    131|    params[5] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CUSTOM_IV,
  ------------------
  |  |  190|    131|# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
  ------------------
  324|    131|        &custom_iv);
  325|    131|    params[6] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CTS, &cts);
  ------------------
  |  |  188|    131|# define OSSL_CIPHER_PARAM_CTS "cts"
  ------------------
  326|    131|    params[7] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK,
  ------------------
  |  |  207|    131|# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
  ------------------
  327|    131|        &multiblock);
  328|    131|    params[8] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_HAS_RAND_KEY,
  ------------------
  |  |  195|    131|# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
  ------------------
  329|    131|        &randkey);
  330|    131|    params[9] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC,
  ------------------
  |  |  192|    131|# define OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC "encrypt-then-mac"
  ------------------
  331|    131|        &encrypt_then_mac);
  332|    131|    params[10] = OSSL_PARAM_construct_end();
  333|    131|    ok = evp_do_ciph_getparams(cipher, params) > 0;
  334|    131|    if (ok) {
  ------------------
  |  Branch (334:9): [True: 131, False: 0]
  ------------------
  335|    131|        cipher->block_size = (int)blksz;
  336|    131|        cipher->iv_len = (int)ivlen;
  337|    131|        cipher->key_len = (int)keylen;
  338|    131|        cipher->flags = mode | no_store;
  339|    131|        if (aead)
  ------------------
  |  Branch (339:13): [True: 29, False: 102]
  ------------------
  340|     29|            cipher->flags |= EVP_CIPH_FLAG_AEAD_CIPHER;
  ------------------
  |  |  332|     29|#define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
  ------------------
  341|    131|        if (custom_iv)
  ------------------
  |  Branch (341:13): [True: 42, False: 89]
  ------------------
  342|     42|            cipher->flags |= EVP_CIPH_CUSTOM_IV;
  ------------------
  |  |  302|     42|#define EVP_CIPH_CUSTOM_IV 0x10
  ------------------
  343|    131|        if (cts)
  ------------------
  |  Branch (343:13): [True: 6, False: 125]
  ------------------
  344|      6|            cipher->flags |= EVP_CIPH_FLAG_CTS;
  ------------------
  |  |  330|      6|#define EVP_CIPH_FLAG_CTS 0x4000
  ------------------
  345|    131|        if (multiblock)
  ------------------
  |  Branch (345:13): [True: 4, False: 127]
  ------------------
  346|      4|            cipher->flags |= EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK;
  ------------------
  |  |  333|      4|#define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000
  ------------------
  347|    131|        if (cipher->ccipher != NULL)
  ------------------
  |  Branch (347:13): [True: 119, False: 12]
  ------------------
  348|    119|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_CIPHER;
  ------------------
  |  |  331|    119|#define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000
  ------------------
  349|    131|        if (randkey)
  ------------------
  |  Branch (349:13): [True: 11, False: 120]
  ------------------
  350|     11|            cipher->flags |= EVP_CIPH_RAND_KEY;
  ------------------
  |  |  312|     11|#define EVP_CIPH_RAND_KEY 0x200
  ------------------
  351|    131|        if (encrypt_then_mac)
  ------------------
  |  Branch (351:13): [True: 0, False: 131]
  ------------------
  352|      0|            cipher->flags |= EVP_CIPH_FLAG_ENC_THEN_MAC;
  ------------------
  |  |  343|      0|#define EVP_CIPH_FLAG_ENC_THEN_MAC 0x10000000
  ------------------
  353|    131|        if (OSSL_PARAM_locate_const(EVP_CIPHER_gettable_ctx_params(cipher),
  ------------------
  |  Branch (353:13): [True: 0, False: 131]
  ------------------
  354|    131|                OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS))
  ------------------
  |  |  185|    131|# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS
  |  |  ------------------
  |  |  |  |  126|    131|# define OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS "algorithm-id-params"
  |  |  ------------------
  ------------------
  355|      0|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_ASN1;
  ------------------
  |  |  337|      0|#define EVP_CIPH_FLAG_CUSTOM_ASN1 0x1000000
  ------------------
  356|    131|    }
  357|    131|    return ok;
  358|    131|}
EVP_CIPHER_get_iv_length:
  476|      2|{
  477|      2|    return (cipher == NULL) ? 0 : cipher->iv_len;
  ------------------
  |  Branch (477:12): [True: 0, False: 2]
  ------------------
  478|      2|}
EVP_CIPHER_CTX_get_iv_length:
  481|      4|{
  482|      4|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (482:9): [True: 0, False: 4]
  ------------------
  483|      0|        return 0;
  484|       |
  485|      4|    if (ctx->iv_len < 0) {
  ------------------
  |  Branch (485:9): [True: 2, False: 2]
  ------------------
  486|      2|        int rv, len = EVP_CIPHER_get_iv_length(ctx->cipher);
  487|      2|        size_t v = len;
  488|      2|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      2|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      2|    { NULL, 0, NULL, 0, 0 }
  ------------------
  489|       |
  490|      2|        if (ctx->cipher->get_ctx_params != NULL) {
  ------------------
  |  Branch (490:13): [True: 2, False: 0]
  ------------------
  491|      2|            params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN,
  ------------------
  |  |  197|      2|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  492|      2|                &v);
  493|      2|            rv = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  494|      2|            if (rv > 0) {
  ------------------
  |  Branch (494:17): [True: 2, False: 0]
  ------------------
  495|      2|                if (OSSL_PARAM_modified(params)
  ------------------
  |  Branch (495:21): [True: 2, False: 0]
  ------------------
  496|      2|                    && !OSSL_PARAM_get_int(params, &len))
  ------------------
  |  Branch (496:24): [True: 0, False: 2]
  ------------------
  497|      0|                    return -1;
  498|      2|            } else if (rv != EVP_CTRL_RET_UNSUPPORTED) {
  ------------------
  |  |   20|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  |  Branch (498:24): [True: 0, False: 0]
  ------------------
  499|      0|                return -1;
  500|      0|            }
  501|      2|        }
  502|       |        /* Code below to be removed when legacy support is dropped. */
  503|      0|        else if ((EVP_CIPHER_get_flags(ctx->cipher)
  ------------------
  |  Branch (503:18): [True: 0, False: 0]
  ------------------
  504|      0|                     & EVP_CIPH_CUSTOM_IV_LENGTH)
  ------------------
  |  |  316|      0|#define EVP_CIPH_CUSTOM_IV_LENGTH 0x800
  ------------------
  505|      0|            != 0) {
  506|      0|            rv = EVP_CIPHER_CTX_ctrl((EVP_CIPHER_CTX *)ctx, EVP_CTRL_GET_IVLEN,
  ------------------
  |  |  419|      0|#define EVP_CTRL_GET_IVLEN 0x25
  ------------------
  507|      0|                0, &len);
  508|      0|            if (rv <= 0)
  ------------------
  |  Branch (508:17): [True: 0, False: 0]
  ------------------
  509|      0|                return -1;
  510|      0|        }
  511|       |        /*-
  512|       |         * Casting away the const is annoying but required here.  We need to
  513|       |         * cache the result for performance reasons.
  514|       |         */
  515|      2|        ((EVP_CIPHER_CTX *)ctx)->iv_len = len;
  516|      2|    }
  517|      4|    return ctx->iv_len;
  518|      4|}
EVP_CIPHER_get_key_length:
  625|      2|{
  626|      2|    return cipher->key_len;
  627|      2|}
EVP_CIPHER_CTX_get_key_length:
  630|     33|{
  631|     33|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (631:9): [True: 0, False: 33]
  ------------------
  632|      0|        return 0;
  633|       |
  634|     33|    if (ctx->key_len <= 0 && ctx->cipher->prov != NULL) {
  ------------------
  |  Branch (634:9): [True: 6, False: 27]
  |  Branch (634:30): [True: 6, False: 0]
  ------------------
  635|      6|        int ok;
  636|      6|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      6|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      6|    { NULL, 0, NULL, 0, 0 }
  ------------------
  637|      6|        size_t len;
  638|       |
  639|      6|        params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &len);
  ------------------
  |  |  198|      6|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  640|      6|        ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  641|      6|        if (ok <= 0)
  ------------------
  |  Branch (641:13): [True: 0, False: 6]
  ------------------
  642|      0|            return EVP_CTRL_RET_UNSUPPORTED;
  ------------------
  |  |   20|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  643|       |
  644|       |        /*-
  645|       |         * The if branch should never be taken since EVP_MAX_KEY_LENGTH is
  646|       |         * less than INT_MAX but best to be safe.
  647|       |         *
  648|       |         * Casting away the const is annoying but required here.  We need to
  649|       |         * cache the result for performance reasons.
  650|       |         */
  651|      6|        if (!OSSL_PARAM_get_int(params, &((EVP_CIPHER_CTX *)ctx)->key_len))
  ------------------
  |  Branch (651:13): [True: 0, False: 6]
  ------------------
  652|      0|            return -1;
  653|      6|        ((EVP_CIPHER_CTX *)ctx)->key_len = (int)len;
  654|      6|    }
  655|     33|    return ctx->key_len;
  656|     33|}
EVP_CIPHER_get_nid:
  659|    317|{
  660|    317|    return (cipher == NULL) ? NID_undef : cipher->nid;
  ------------------
  |  |   19|      0|#define NID_undef                       0
  ------------------
  |  Branch (660:12): [True: 0, False: 317]
  ------------------
  661|    317|}
EVP_CIPHER_get0_provider:
  715|    131|{
  716|    131|    return cipher->prov;
  717|    131|}
EVP_MD_get_type:
  778|     82|{
  779|     82|    return md->type;
  780|     82|}
EVP_MD_get_size:
  797|      1|{
  798|      1|    if (md == NULL) {
  ------------------
  |  Branch (798:9): [True: 0, False: 1]
  ------------------
  799|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  800|      0|        return -1;
  801|      0|    }
  802|      1|    return md->md_size;
  803|      1|}
EVP_MD_CTX_get0_md:
  825|      1|{
  826|      1|    if (ctx == NULL)
  ------------------
  |  Branch (826:9): [True: 0, False: 1]
  ------------------
  827|      0|        return NULL;
  828|      1|    return ctx->reqdigest;
  829|      1|}
EVP_MD_CTX_get_size_ex:
  844|      1|{
  845|      1|    EVP_MD_CTX *c = (EVP_MD_CTX *)ctx;
  846|      1|    const OSSL_PARAM *gettables;
  847|       |
  848|      1|    gettables = EVP_MD_CTX_gettable_params(c);
  849|      1|    if (gettables != NULL
  ------------------
  |  Branch (849:9): [True: 0, False: 1]
  ------------------
  850|      0|        && OSSL_PARAM_locate_const(gettables,
  ------------------
  |  Branch (850:12): [True: 0, False: 0]
  ------------------
  851|      0|               OSSL_DIGEST_PARAM_SIZE)
  ------------------
  |  |  235|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  852|      0|            != NULL) {
  853|      0|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  854|      0|        size_t sz = 0;
  855|       |
  856|       |        /*
  857|       |         * For XOF's EVP_MD_get_size() returns 0
  858|       |         * So try to get the xoflen instead. This will return -1 if the
  859|       |         * xof length has not been set.
  860|       |         */
  861|      0|        params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &sz);
  ------------------
  |  |  235|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  862|      0|        if (EVP_MD_CTX_get_params(c, params) != 1
  ------------------
  |  Branch (862:13): [True: 0, False: 0]
  ------------------
  863|      0|            || sz > INT_MAX
  ------------------
  |  Branch (863:16): [True: 0, False: 0]
  ------------------
  864|      0|            || sz == 0)
  ------------------
  |  Branch (864:16): [True: 0, False: 0]
  ------------------
  865|      0|            return -1;
  866|      0|        return (int)sz;
  867|      0|    }
  868|       |    /* Normal digests have a constant fixed size output */
  869|      1|    return EVP_MD_get_size(EVP_MD_CTX_get0_md(ctx));
  870|      1|}
EVP_MD_CTX_set_flags:
  906|      2|{
  907|      2|    ctx->flags |= flags;
  908|      2|}
EVP_MD_CTX_clear_flags:
  911|      1|{
  912|      1|    ctx->flags &= ~flags;
  913|      1|}
EVP_MD_CTX_test_flags:
  916|      1|{
  917|      1|    return (ctx->flags & flags);
  918|      1|}

EVP_RAND_enable_locking:
   96|      1|{
   97|      1|    if (rand->meth->enable_locking != NULL)
  ------------------
  |  Branch (97:9): [True: 1, False: 0]
  ------------------
   98|      1|        return rand->meth->enable_locking(rand->algctx);
   99|      1|    ERR_raise(ERR_LIB_EVP, EVP_R_LOCKING_NOT_SUPPORTED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|    return 0;
  101|      1|}
EVP_RAND_fetch:
  286|      3|{
  287|      3|    return evp_generic_fetch(libctx, OSSL_OP_RAND, algorithm, properties,
  ------------------
  |  |  287|      3|#define OSSL_OP_RAND 5
  ------------------
  288|      3|        evp_rand_from_algorithm, evp_rand_up_ref,
  289|      3|        evp_rand_free);
  290|      3|}
EVP_RAND_up_ref:
  293|      3|{
  294|       |#ifdef OPENSSL_NO_CACHED_FETCH
  295|       |    return evp_rand_up_ref(rand);
  296|       |#else
  297|      3|    if (rand->no_store != 0)
  ------------------
  |  Branch (297:9): [True: 0, False: 3]
  ------------------
  298|      0|        return evp_rand_up_ref(rand);
  299|      3|    return 1;
  300|      3|#endif
  301|      3|}
EVP_RAND_free:
  304|      3|{
  305|       |#ifdef OPENSSL_NO_CACHED_FETCH
  306|       |    evp_rand_free(rand);
  307|       |#else
  308|      3|    if (rand != NULL && (rand->no_store != 0))
  ------------------
  |  Branch (308:9): [True: 3, False: 0]
  |  Branch (308:25): [True: 0, False: 3]
  ------------------
  309|      0|        evp_rand_free(rand);
  310|      3|#endif
  311|      3|}
EVP_RAND_get0_provider:
  334|      2|{
  335|      2|    return rand->prov;
  336|      2|}
EVP_RAND_CTX_up_ref:
  346|      2|{
  347|      2|    int ref = 0;
  348|       |
  349|      2|    return CRYPTO_UP_REF(&ctx->refcnt, &ref);
  350|      2|}
EVP_RAND_CTX_new:
  353|      3|{
  354|      3|    EVP_RAND_CTX *ctx;
  355|      3|    void *parent_ctx = NULL;
  356|      3|    const OSSL_DISPATCH *parent_dispatch = NULL;
  357|       |
  358|      3|    if (rand == NULL) {
  ------------------
  |  Branch (358:9): [True: 0, False: 3]
  ------------------
  359|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  360|      0|        return NULL;
  361|      0|    }
  362|       |
  363|      3|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  113|      3|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  364|      3|    if (ctx == NULL)
  ------------------
  |  Branch (364:9): [True: 0, False: 3]
  ------------------
  365|      0|        return NULL;
  366|      3|    if (!CRYPTO_NEW_REF(&ctx->refcnt, 1)) {
  ------------------
  |  Branch (366:9): [True: 0, False: 3]
  ------------------
  367|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  368|      0|        return NULL;
  369|      0|    }
  370|      3|    if (parent != NULL) {
  ------------------
  |  Branch (370:9): [True: 2, False: 1]
  ------------------
  371|      2|        if (!EVP_RAND_CTX_up_ref(parent)) {
  ------------------
  |  Branch (371:13): [True: 0, False: 2]
  ------------------
  372|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  373|      0|            CRYPTO_FREE_REF(&ctx->refcnt);
  374|      0|            OPENSSL_free(ctx);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  375|      0|            return NULL;
  376|      0|        }
  377|      2|        parent_ctx = parent->algctx;
  378|      2|        parent_dispatch = parent->meth->dispatch;
  379|      2|    }
  380|      3|    if ((ctx->algctx = rand->newctx(ossl_provider_ctx(rand->prov), parent_ctx,
  ------------------
  |  Branch (380:9): [True: 0, False: 3]
  ------------------
  381|      3|             parent_dispatch))
  382|      3|            == NULL
  383|      3|        || !EVP_RAND_up_ref(rand)) {
  ------------------
  |  Branch (383:12): [True: 0, False: 3]
  ------------------
  384|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  385|      0|        rand->freectx(ctx->algctx);
  386|      0|        CRYPTO_FREE_REF(&ctx->refcnt);
  387|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  388|      0|        EVP_RAND_CTX_free(parent);
  389|      0|        return NULL;
  390|      0|    }
  391|      3|    ctx->meth = rand;
  392|      3|    ctx->parent = parent;
  393|      3|    return ctx;
  394|      3|}
EVP_RAND_CTX_free:
  397|      1|{
  398|      1|    int ref = 0;
  399|      1|    EVP_RAND_CTX *parent;
  400|       |
  401|      1|    if (ctx == NULL)
  ------------------
  |  Branch (401:9): [True: 1, False: 0]
  ------------------
  402|      1|        return;
  403|       |
  404|      0|    CRYPTO_DOWN_REF(&ctx->refcnt, &ref);
  405|      0|    if (ref > 0)
  ------------------
  |  Branch (405:9): [True: 0, False: 0]
  ------------------
  406|      0|        return;
  407|      0|    parent = ctx->parent;
  408|      0|    ctx->meth->freectx(ctx->algctx);
  409|      0|    ctx->algctx = NULL;
  410|      0|    EVP_RAND_free(ctx->meth);
  411|      0|    CRYPTO_FREE_REF(&ctx->refcnt);
  412|      0|    OPENSSL_free(ctx);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|      0|    EVP_RAND_CTX_free(parent);
  414|      0|}
EVP_RAND_CTX_get_params:
  428|      1|{
  429|      1|    int res;
  430|       |
  431|      1|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (431:9): [True: 0, False: 1]
  ------------------
  432|      0|        return 0;
  433|      1|    res = evp_rand_get_ctx_params_locked(ctx, params);
  434|      1|    evp_rand_unlock(ctx);
  435|      1|    return res;
  436|      1|}
EVP_RAND_CTX_settable_params:
  495|      2|{
  496|      2|    void *provctx;
  497|       |
  498|      2|    if (ctx->meth->settable_ctx_params == NULL)
  ------------------
  |  Branch (498:9): [True: 0, False: 2]
  ------------------
  499|      0|        return NULL;
  500|      2|    provctx = ossl_provider_ctx(EVP_RAND_get0_provider(ctx->meth));
  501|      2|    return ctx->meth->settable_ctx_params(ctx->algctx, provctx);
  502|      2|}
EVP_RAND_instantiate:
  539|      3|{
  540|      3|    int res;
  541|       |
  542|      3|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (542:9): [True: 0, False: 3]
  ------------------
  543|      0|        return 0;
  544|      3|    res = evp_rand_instantiate_locked(ctx, strength, prediction_resistance,
  545|      3|        pstr, pstr_len, params);
  546|      3|    evp_rand_unlock(ctx);
  547|      3|    return res;
  548|      3|}
EVP_RAND_generate:
  601|      2|{
  602|      2|    int res;
  603|       |
  604|      2|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (604:9): [True: 0, False: 2]
  ------------------
  605|      0|        return 0;
  606|      2|    res = evp_rand_generate_locked(ctx, out, outlen, strength,
  607|      2|        prediction_resistance, addin, addin_len);
  608|      2|    evp_rand_unlock(ctx);
  609|      2|    return res;
  610|      2|}
EVP_RAND_reseed:
  625|      2|{
  626|      2|    int res;
  627|       |
  628|      2|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (628:9): [True: 0, False: 2]
  ------------------
  629|      0|        return 0;
  630|      2|    res = evp_rand_reseed_locked(ctx, prediction_resistance,
  631|      2|        ent, ent_len, addin, addin_len);
  632|      2|    evp_rand_unlock(ctx);
  633|      2|    return res;
  634|      2|}
EVP_RAND_get_state:
  685|      1|{
  686|      1|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      1|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      1|    { NULL, 0, NULL, 0, 0 }
  ------------------
  687|      1|    int state;
  688|       |
  689|      1|    params[0] = OSSL_PARAM_construct_int(OSSL_RAND_PARAM_STATE, &state);
  ------------------
  |  |  558|      1|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
  690|      1|    if (!EVP_RAND_CTX_get_params(ctx, params))
  ------------------
  |  Branch (690:9): [True: 0, False: 1]
  ------------------
  691|      0|        state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1332|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  692|      1|    return state;
  693|      1|}
evp_rand.c:evp_rand_from_algorithm:
  121|      5|{
  122|      5|    const OSSL_DISPATCH *fns = algodef->implementation;
  123|      5|    EVP_RAND *rand = NULL;
  124|      5|    int fnrandcnt = 0, fnctxcnt = 0, fnlockcnt = 0, fnenablelockcnt = 0;
  125|       |#ifdef FIPS_MODULE
  126|       |    int fnzeroizecnt = 0;
  127|       |#endif
  128|       |
  129|      5|    if ((rand = evp_rand_new()) == NULL) {
  ------------------
  |  Branch (129:9): [True: 0, False: 5]
  ------------------
  130|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  131|      0|        return NULL;
  132|      0|    }
  133|      5|    rand->name_id = name_id;
  134|      5|    rand->no_store = no_store;
  135|      5|    if ((rand->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (135:9): [True: 0, False: 5]
  ------------------
  136|      0|        evp_rand_free(rand);
  137|      0|        return NULL;
  138|      0|    }
  139|      5|    rand->description = algodef->algorithm_description;
  140|      5|    rand->dispatch = fns;
  141|     83|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (141:12): [True: 78, False: 5]
  ------------------
  142|     78|        switch (fns->function_id) {
  ------------------
  |  Branch (142:17): [True: 78, False: 0]
  ------------------
  143|      5|        case OSSL_FUNC_RAND_NEWCTX:
  ------------------
  |  |  549|      5|#define OSSL_FUNC_RAND_NEWCTX 1
  ------------------
  |  Branch (143:9): [True: 5, False: 73]
  ------------------
  144|      5|            if (rand->newctx != NULL)
  ------------------
  |  Branch (144:17): [True: 0, False: 5]
  ------------------
  145|      0|                break;
  146|      5|            rand->newctx = OSSL_FUNC_rand_newctx(fns);
  147|      5|            fnctxcnt++;
  148|      5|            break;
  149|      5|        case OSSL_FUNC_RAND_FREECTX:
  ------------------
  |  |  550|      5|#define OSSL_FUNC_RAND_FREECTX 2
  ------------------
  |  Branch (149:9): [True: 5, False: 73]
  ------------------
  150|      5|            if (rand->freectx != NULL)
  ------------------
  |  Branch (150:17): [True: 0, False: 5]
  ------------------
  151|      0|                break;
  152|      5|            rand->freectx = OSSL_FUNC_rand_freectx(fns);
  153|      5|            fnctxcnt++;
  154|      5|            break;
  155|      5|        case OSSL_FUNC_RAND_INSTANTIATE:
  ------------------
  |  |  551|      5|#define OSSL_FUNC_RAND_INSTANTIATE 3
  ------------------
  |  Branch (155:9): [True: 5, False: 73]
  ------------------
  156|      5|            if (rand->instantiate != NULL)
  ------------------
  |  Branch (156:17): [True: 0, False: 5]
  ------------------
  157|      0|                break;
  158|      5|            rand->instantiate = OSSL_FUNC_rand_instantiate(fns);
  159|      5|            fnrandcnt++;
  160|      5|            break;
  161|      5|        case OSSL_FUNC_RAND_UNINSTANTIATE:
  ------------------
  |  |  552|      5|#define OSSL_FUNC_RAND_UNINSTANTIATE 4
  ------------------
  |  Branch (161:9): [True: 5, False: 73]
  ------------------
  162|      5|            if (rand->uninstantiate != NULL)
  ------------------
  |  Branch (162:17): [True: 0, False: 5]
  ------------------
  163|      0|                break;
  164|      5|            rand->uninstantiate = OSSL_FUNC_rand_uninstantiate(fns);
  165|      5|            fnrandcnt++;
  166|      5|            break;
  167|      5|        case OSSL_FUNC_RAND_GENERATE:
  ------------------
  |  |  553|      5|#define OSSL_FUNC_RAND_GENERATE 5
  ------------------
  |  Branch (167:9): [True: 5, False: 73]
  ------------------
  168|      5|            if (rand->generate != NULL)
  ------------------
  |  Branch (168:17): [True: 0, False: 5]
  ------------------
  169|      0|                break;
  170|      5|            rand->generate = OSSL_FUNC_rand_generate(fns);
  171|      5|            fnrandcnt++;
  172|      5|            break;
  173|      5|        case OSSL_FUNC_RAND_RESEED:
  ------------------
  |  |  554|      5|#define OSSL_FUNC_RAND_RESEED 6
  ------------------
  |  Branch (173:9): [True: 5, False: 73]
  ------------------
  174|      5|            if (rand->reseed != NULL)
  ------------------
  |  Branch (174:17): [True: 0, False: 5]
  ------------------
  175|      0|                break;
  176|      5|            rand->reseed = OSSL_FUNC_rand_reseed(fns);
  177|      5|            break;
  178|      1|        case OSSL_FUNC_RAND_NONCE:
  ------------------
  |  |  555|      1|#define OSSL_FUNC_RAND_NONCE 7
  ------------------
  |  Branch (178:9): [True: 1, False: 77]
  ------------------
  179|      1|            if (rand->nonce != NULL)
  ------------------
  |  Branch (179:17): [True: 0, False: 1]
  ------------------
  180|      0|                break;
  181|      1|            rand->nonce = OSSL_FUNC_rand_nonce(fns);
  182|      1|            break;
  183|      5|        case OSSL_FUNC_RAND_ENABLE_LOCKING:
  ------------------
  |  |  556|      5|#define OSSL_FUNC_RAND_ENABLE_LOCKING 8
  ------------------
  |  Branch (183:9): [True: 5, False: 73]
  ------------------
  184|      5|            if (rand->enable_locking != NULL)
  ------------------
  |  Branch (184:17): [True: 0, False: 5]
  ------------------
  185|      0|                break;
  186|      5|            rand->enable_locking = OSSL_FUNC_rand_enable_locking(fns);
  187|      5|            fnenablelockcnt++;
  188|      5|            break;
  189|      5|        case OSSL_FUNC_RAND_LOCK:
  ------------------
  |  |  557|      5|#define OSSL_FUNC_RAND_LOCK 9
  ------------------
  |  Branch (189:9): [True: 5, False: 73]
  ------------------
  190|      5|            if (rand->lock != NULL)
  ------------------
  |  Branch (190:17): [True: 0, False: 5]
  ------------------
  191|      0|                break;
  192|      5|            rand->lock = OSSL_FUNC_rand_lock(fns);
  193|      5|            fnlockcnt++;
  194|      5|            break;
  195|      5|        case OSSL_FUNC_RAND_UNLOCK:
  ------------------
  |  |  558|      5|#define OSSL_FUNC_RAND_UNLOCK 10
  ------------------
  |  Branch (195:9): [True: 5, False: 73]
  ------------------
  196|      5|            if (rand->unlock != NULL)
  ------------------
  |  Branch (196:17): [True: 0, False: 5]
  ------------------
  197|      0|                break;
  198|      5|            rand->unlock = OSSL_FUNC_rand_unlock(fns);
  199|      5|            fnlockcnt++;
  200|      5|            break;
  201|      0|        case OSSL_FUNC_RAND_GETTABLE_PARAMS:
  ------------------
  |  |  559|      0|#define OSSL_FUNC_RAND_GETTABLE_PARAMS 11
  ------------------
  |  Branch (201:9): [True: 0, False: 78]
  ------------------
  202|      0|            if (rand->gettable_params != NULL)
  ------------------
  |  Branch (202:17): [True: 0, False: 0]
  ------------------
  203|      0|                break;
  204|      0|            rand->gettable_params = OSSL_FUNC_rand_gettable_params(fns);
  205|      0|            break;
  206|      5|        case OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  560|      5|#define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS 12
  ------------------
  |  Branch (206:9): [True: 5, False: 73]
  ------------------
  207|      5|            if (rand->gettable_ctx_params != NULL)
  ------------------
  |  Branch (207:17): [True: 0, False: 5]
  ------------------
  208|      0|                break;
  209|      5|            rand->gettable_ctx_params = OSSL_FUNC_rand_gettable_ctx_params(fns);
  210|      5|            break;
  211|      4|        case OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  561|      4|#define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS 13
  ------------------
  |  Branch (211:9): [True: 4, False: 74]
  ------------------
  212|      4|            if (rand->settable_ctx_params != NULL)
  ------------------
  |  Branch (212:17): [True: 0, False: 4]
  ------------------
  213|      0|                break;
  214|      4|            rand->settable_ctx_params = OSSL_FUNC_rand_settable_ctx_params(fns);
  215|      4|            break;
  216|      0|        case OSSL_FUNC_RAND_GET_PARAMS:
  ------------------
  |  |  562|      0|#define OSSL_FUNC_RAND_GET_PARAMS 14
  ------------------
  |  Branch (216:9): [True: 0, False: 78]
  ------------------
  217|      0|            if (rand->get_params != NULL)
  ------------------
  |  Branch (217:17): [True: 0, False: 0]
  ------------------
  218|      0|                break;
  219|      0|            rand->get_params = OSSL_FUNC_rand_get_params(fns);
  220|      0|            break;
  221|      5|        case OSSL_FUNC_RAND_GET_CTX_PARAMS:
  ------------------
  |  |  563|      5|#define OSSL_FUNC_RAND_GET_CTX_PARAMS 15
  ------------------
  |  Branch (221:9): [True: 5, False: 73]
  ------------------
  222|      5|            if (rand->get_ctx_params != NULL)
  ------------------
  |  Branch (222:17): [True: 0, False: 5]
  ------------------
  223|      0|                break;
  224|      5|            rand->get_ctx_params = OSSL_FUNC_rand_get_ctx_params(fns);
  225|      5|            fnctxcnt++;
  226|      5|            break;
  227|      4|        case OSSL_FUNC_RAND_SET_CTX_PARAMS:
  ------------------
  |  |  564|      4|#define OSSL_FUNC_RAND_SET_CTX_PARAMS 16
  ------------------
  |  Branch (227:9): [True: 4, False: 74]
  ------------------
  228|      4|            if (rand->set_ctx_params != NULL)
  ------------------
  |  Branch (228:17): [True: 0, False: 4]
  ------------------
  229|      0|                break;
  230|      4|            rand->set_ctx_params = OSSL_FUNC_rand_set_ctx_params(fns);
  231|      4|            break;
  232|      5|        case OSSL_FUNC_RAND_VERIFY_ZEROIZATION:
  ------------------
  |  |  565|      5|#define OSSL_FUNC_RAND_VERIFY_ZEROIZATION 17
  ------------------
  |  Branch (232:9): [True: 5, False: 73]
  ------------------
  233|      5|            if (rand->verify_zeroization != NULL)
  ------------------
  |  Branch (233:17): [True: 0, False: 5]
  ------------------
  234|      0|                break;
  235|      5|            rand->verify_zeroization = OSSL_FUNC_rand_verify_zeroization(fns);
  236|       |#ifdef FIPS_MODULE
  237|       |            fnzeroizecnt++;
  238|       |#endif
  239|      5|            break;
  240|      5|        case OSSL_FUNC_RAND_GET_SEED:
  ------------------
  |  |  566|      5|#define OSSL_FUNC_RAND_GET_SEED 18
  ------------------
  |  Branch (240:9): [True: 5, False: 73]
  ------------------
  241|      5|            if (rand->get_seed != NULL)
  ------------------
  |  Branch (241:17): [True: 0, False: 5]
  ------------------
  242|      0|                break;
  243|      5|            rand->get_seed = OSSL_FUNC_rand_get_seed(fns);
  244|      5|            break;
  245|      4|        case OSSL_FUNC_RAND_CLEAR_SEED:
  ------------------
  |  |  567|      4|#define OSSL_FUNC_RAND_CLEAR_SEED 19
  ------------------
  |  Branch (245:9): [True: 4, False: 74]
  ------------------
  246|      4|            if (rand->clear_seed != NULL)
  ------------------
  |  Branch (246:17): [True: 0, False: 4]
  ------------------
  247|      0|                break;
  248|      4|            rand->clear_seed = OSSL_FUNC_rand_clear_seed(fns);
  249|      4|            break;
  250|     78|        }
  251|     78|    }
  252|       |    /*
  253|       |     * In order to be a consistent set of functions we must have at least
  254|       |     * a complete set of "rand" functions and a complete set of context
  255|       |     * management functions.  In FIPS mode, we also require the zeroization
  256|       |     * verification function.
  257|       |     *
  258|       |     * In addition, if locking can be enabled, we need a complete set of
  259|       |     * locking functions.
  260|       |     */
  261|      5|    if (fnrandcnt != 3
  ------------------
  |  Branch (261:9): [True: 0, False: 5]
  ------------------
  262|      5|        || fnctxcnt != 3
  ------------------
  |  Branch (262:12): [True: 0, False: 5]
  ------------------
  263|      5|        || (fnenablelockcnt != 0 && fnenablelockcnt != 1)
  ------------------
  |  Branch (263:13): [True: 5, False: 0]
  |  Branch (263:37): [True: 0, False: 5]
  ------------------
  264|      5|        || (fnlockcnt != 0 && fnlockcnt != 2)
  ------------------
  |  Branch (264:13): [True: 5, False: 0]
  |  Branch (264:31): [True: 0, False: 5]
  ------------------
  265|       |#ifdef FIPS_MODULE
  266|       |        || fnzeroizecnt != 1
  267|       |#endif
  268|      5|    ) {
  269|      0|        evp_rand_free(rand);
  270|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  271|      0|        return NULL;
  272|      0|    }
  273|       |
  274|      5|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (274:9): [True: 5, False: 0]
  |  Branch (274:25): [True: 0, False: 5]
  ------------------
  275|      0|        evp_rand_free(rand);
  276|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  277|      0|        return NULL;
  278|      0|    }
  279|      5|    rand->prov = prov;
  280|       |
  281|      5|    return rand;
  282|      5|}
evp_rand.c:evp_rand_new:
   81|      5|{
   82|      5|    EVP_RAND *rand = OPENSSL_zalloc(sizeof(*rand));
  ------------------
  |  |  113|      5|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   83|       |
   84|      5|    if (rand == NULL)
  ------------------
  |  Branch (84:9): [True: 0, False: 5]
  ------------------
   85|      0|        return NULL;
   86|       |
   87|      5|    if (!CRYPTO_NEW_REF(&rand->refcnt, 1)) {
  ------------------
  |  Branch (87:9): [True: 0, False: 5]
  ------------------
   88|      0|        OPENSSL_free(rand);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   89|      0|        return NULL;
   90|      0|    }
   91|      5|    return rand;
   92|      5|}
evp_rand.c:evp_rand_up_ref:
   55|      9|{
   56|      9|    EVP_RAND *rand = (EVP_RAND *)vrand;
   57|      9|    int ref = 0;
   58|       |
   59|      9|    if (rand != NULL)
  ------------------
  |  Branch (59:9): [True: 9, False: 0]
  ------------------
   60|      9|        return CRYPTO_UP_REF(&rand->refcnt, &ref);
   61|      0|    return 1;
   62|      9|}
evp_rand.c:evp_rand_free:
   65|      5|{
   66|      5|    EVP_RAND *rand = (EVP_RAND *)vrand;
   67|      5|    int ref = 0;
   68|       |
   69|      5|    if (rand == NULL)
  ------------------
  |  Branch (69:9): [True: 0, False: 5]
  ------------------
   70|      0|        return;
   71|      5|    CRYPTO_DOWN_REF(&rand->refcnt, &ref);
   72|      5|    if (ref > 0)
  ------------------
  |  Branch (72:9): [True: 5, False: 0]
  ------------------
   73|      5|        return;
   74|      0|    OPENSSL_free(rand->type_name);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   75|      0|    ossl_provider_free(rand->prov);
   76|      0|    CRYPTO_FREE_REF(&rand->refcnt);
   77|      0|    OPENSSL_free(rand);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|      0|}
evp_rand.c:evp_rand_lock:
  105|      8|{
  106|      8|    if (rand->meth->lock != NULL)
  ------------------
  |  Branch (106:9): [True: 8, False: 0]
  ------------------
  107|      8|        return rand->meth->lock(rand->algctx);
  108|      0|    return 1;
  109|      8|}
evp_rand.c:evp_rand_get_ctx_params_locked:
  423|      3|{
  424|      3|    return ctx->meth->get_ctx_params(ctx->algctx, params);
  425|      3|}
evp_rand.c:evp_rand_unlock:
  113|      8|{
  114|      8|    if (rand->meth->unlock != NULL)
  ------------------
  |  Branch (114:9): [True: 8, False: 0]
  ------------------
  115|      8|        rand->meth->unlock(rand->algctx);
  116|      8|}
evp_rand.c:evp_rand_instantiate_locked:
  530|      3|{
  531|      3|    return ctx->meth->instantiate(ctx->algctx, strength, prediction_resistance,
  532|      3|        pstr, pstr_len, params);
  533|      3|}
evp_rand.c:evp_rand_generate_locked:
  571|      2|{
  572|      2|    size_t chunk, max_request = 0;
  573|      2|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      2|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      2|    { NULL, 0, NULL, 0, 0 }
  ------------------
  574|       |
  575|      2|    params[0] = OSSL_PARAM_construct_size_t(OSSL_RAND_PARAM_MAX_REQUEST,
  ------------------
  |  |  557|      2|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  576|      2|        &max_request);
  577|      2|    if (!evp_rand_get_ctx_params_locked(ctx, params)
  ------------------
  |  Branch (577:9): [True: 0, False: 2]
  ------------------
  578|      2|        || max_request == 0) {
  ------------------
  |  Branch (578:12): [True: 0, False: 2]
  ------------------
  579|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  580|      0|        return 0;
  581|      0|    }
  582|      4|    for (; outlen > 0; outlen -= chunk, out += chunk) {
  ------------------
  |  Branch (582:12): [True: 2, False: 2]
  ------------------
  583|      2|        chunk = outlen > max_request ? max_request : outlen;
  ------------------
  |  Branch (583:17): [True: 0, False: 2]
  ------------------
  584|      2|        if (!ctx->meth->generate(ctx->algctx, out, chunk, strength,
  ------------------
  |  Branch (584:13): [True: 0, False: 2]
  ------------------
  585|      2|                prediction_resistance, addin, addin_len)) {
  586|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_GENERATE_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  587|      0|            return 0;
  588|      0|        }
  589|       |        /*
  590|       |         * Prediction resistance is only relevant the first time around,
  591|       |         * subsequently, the DRBG has already been properly reseeded.
  592|       |         */
  593|      2|        prediction_resistance = 0;
  594|      2|    }
  595|      2|    return 1;
  596|      2|}
evp_rand.c:evp_rand_reseed_locked:
  615|      2|{
  616|      2|    if (ctx->meth->reseed != NULL)
  ------------------
  |  Branch (616:9): [True: 2, False: 0]
  ------------------
  617|      2|        return ctx->meth->reseed(ctx->algctx, prediction_resistance,
  618|      2|            ent, ent_len, addin, addin_len);
  619|      0|    return 1;
  620|      2|}

EVP_blake2b512:
   23|      1|{
   24|      1|    return &blake2b_md;
   25|      1|}
EVP_blake2s256:
   37|      1|{
   38|      1|    return &blake2s_md;
   39|      1|}

EVP_md4:
   29|      1|{
   30|      1|    return &md4_md;
   31|      1|}

EVP_md5:
   29|      1|{
   30|      1|    return &md5_md;
   31|      1|}

EVP_md5_sha1:
   30|      1|{
   31|      1|    return &md5_sha1_md;
   32|      1|}

EVP_mdc2:
   29|      1|{
   30|      1|    return &mdc2_md;
   31|      1|}

EVP_ripemd160:
   29|      1|{
   30|      1|    return &ripemd160_md;
   31|      1|}

EVP_sha1:
   30|      1|{
   31|      1|    return &sha1_md;
   32|      1|}
EVP_sha224:
   44|      1|{
   45|      1|    return &sha224_md;
   46|      1|}
EVP_sha256:
   58|      1|{
   59|      1|    return &sha256_md;
   60|      1|}
EVP_sha512_224:
   72|      1|{
   73|      1|    return &sha512_224_md;
   74|      1|}
EVP_sha512_256:
   86|      1|{
   87|      1|    return &sha512_256_md;
   88|      1|}
EVP_sha384:
  100|      1|{
  101|      1|    return &sha384_md;
  102|      1|}
EVP_sha512:
  114|      1|{
  115|      1|    return &sha512_md;
  116|      1|}
EVP_sha3_224:
  120|      1|    {                                              \
  121|      1|        static const EVP_MD sha3_##bitlen##_md = { \
  122|      1|            NID_sha3_##bitlen,                     \
  ------------------
  |  | 3334|      1|#define NID_sha3_224            1096
  ------------------
  123|      1|            NID_RSA_SHA3_##bitlen,                 \
  ------------------
  |  | 3456|      1|#define NID_RSA_SHA3_224                1116
  ------------------
  124|      1|            bitlen / 8,                            \
  125|      1|            EVP_MD_FLAG_DIGALGID_ABSENT,           \
  ------------------
  |  |  221|      1|#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
  ------------------
  126|      1|            EVP_ORIG_GLOBAL,                       \
  ------------------
  |  |  189|      1|#define EVP_ORIG_GLOBAL 1
  ------------------
  127|      1|            (KECCAK1600_WIDTH - bitlen * 2) / 8    \
  ------------------
  |  |   18|      1|#define KECCAK1600_WIDTH 1600
  ------------------
  128|      1|        };                                         \
  129|      1|        return &sha3_##bitlen##_md;                \
  130|      1|    }
EVP_sha3_256:
  120|      1|    {                                              \
  121|      1|        static const EVP_MD sha3_##bitlen##_md = { \
  122|      1|            NID_sha3_##bitlen,                     \
  ------------------
  |  | 3339|      1|#define NID_sha3_256            1097
  ------------------
  123|      1|            NID_RSA_SHA3_##bitlen,                 \
  ------------------
  |  | 3461|      1|#define NID_RSA_SHA3_256                1117
  ------------------
  124|      1|            bitlen / 8,                            \
  125|      1|            EVP_MD_FLAG_DIGALGID_ABSENT,           \
  ------------------
  |  |  221|      1|#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
  ------------------
  126|      1|            EVP_ORIG_GLOBAL,                       \
  ------------------
  |  |  189|      1|#define EVP_ORIG_GLOBAL 1
  ------------------
  127|      1|            (KECCAK1600_WIDTH - bitlen * 2) / 8    \
  ------------------
  |  |   18|      1|#define KECCAK1600_WIDTH 1600
  ------------------
  128|      1|        };                                         \
  129|      1|        return &sha3_##bitlen##_md;                \
  130|      1|    }
EVP_sha3_384:
  120|      1|    {                                              \
  121|      1|        static const EVP_MD sha3_##bitlen##_md = { \
  122|      1|            NID_sha3_##bitlen,                     \
  ------------------
  |  | 3344|      1|#define NID_sha3_384            1098
  ------------------
  123|      1|            NID_RSA_SHA3_##bitlen,                 \
  ------------------
  |  | 3466|      1|#define NID_RSA_SHA3_384                1118
  ------------------
  124|      1|            bitlen / 8,                            \
  125|      1|            EVP_MD_FLAG_DIGALGID_ABSENT,           \
  ------------------
  |  |  221|      1|#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
  ------------------
  126|      1|            EVP_ORIG_GLOBAL,                       \
  ------------------
  |  |  189|      1|#define EVP_ORIG_GLOBAL 1
  ------------------
  127|      1|            (KECCAK1600_WIDTH - bitlen * 2) / 8    \
  ------------------
  |  |   18|      1|#define KECCAK1600_WIDTH 1600
  ------------------
  128|      1|        };                                         \
  129|      1|        return &sha3_##bitlen##_md;                \
  130|      1|    }
EVP_sha3_512:
  120|      1|    {                                              \
  121|      1|        static const EVP_MD sha3_##bitlen##_md = { \
  122|      1|            NID_sha3_##bitlen,                     \
  ------------------
  |  | 3349|      1|#define NID_sha3_512            1099
  ------------------
  123|      1|            NID_RSA_SHA3_##bitlen,                 \
  ------------------
  |  | 3471|      1|#define NID_RSA_SHA3_512                1119
  ------------------
  124|      1|            bitlen / 8,                            \
  125|      1|            EVP_MD_FLAG_DIGALGID_ABSENT,           \
  ------------------
  |  |  221|      1|#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
  ------------------
  126|      1|            EVP_ORIG_GLOBAL,                       \
  ------------------
  |  |  189|      1|#define EVP_ORIG_GLOBAL 1
  ------------------
  127|      1|            (KECCAK1600_WIDTH - bitlen * 2) / 8    \
  ------------------
  |  |   18|      1|#define KECCAK1600_WIDTH 1600
  ------------------
  128|      1|        };                                         \
  129|      1|        return &sha3_##bitlen##_md;                \
  130|      1|    }
EVP_shake128:
  133|      1|    {                                                      \
  134|      1|        static const EVP_MD shake##bitlen##_md = {         \
  135|      1|            NID_shake##bitlen,                             \
  ------------------
  |  | 3354|      1|#define NID_shake128            1100
  ------------------
  136|      1|            0,                                             \
  137|      1|            bitlen / 8,                                    \
  138|      1|            EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT, \
  ------------------
  |  |  209|      1|#define EVP_MD_FLAG_XOF 0x0002
  ------------------
                          EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT, \
  ------------------
  |  |  221|      1|#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
  ------------------
  139|      1|            EVP_ORIG_GLOBAL,                               \
  ------------------
  |  |  189|      1|#define EVP_ORIG_GLOBAL 1
  ------------------
  140|      1|            (KECCAK1600_WIDTH - bitlen * 2) / 8            \
  ------------------
  |  |   18|      1|#define KECCAK1600_WIDTH 1600
  ------------------
  141|      1|        };                                                 \
  142|      1|        return &shake##bitlen##_md;                        \
  143|      1|    }
EVP_shake256:
  133|      1|    {                                                      \
  134|      1|        static const EVP_MD shake##bitlen##_md = {         \
  135|      1|            NID_shake##bitlen,                             \
  ------------------
  |  | 3359|      1|#define NID_shake256            1101
  ------------------
  136|      1|            0,                                             \
  137|      1|            bitlen / 8,                                    \
  138|      1|            EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT, \
  ------------------
  |  |  209|      1|#define EVP_MD_FLAG_XOF 0x0002
  ------------------
                          EVP_MD_FLAG_XOF | EVP_MD_FLAG_DIGALGID_ABSENT, \
  ------------------
  |  |  221|      1|#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
  ------------------
  139|      1|            EVP_ORIG_GLOBAL,                               \
  ------------------
  |  |  189|      1|#define EVP_ORIG_GLOBAL 1
  ------------------
  140|      1|            (KECCAK1600_WIDTH - bitlen * 2) / 8            \
  ------------------
  |  |   18|      1|#define KECCAK1600_WIDTH 1600
  ------------------
  141|      1|        };                                                 \
  142|      1|        return &shake##bitlen##_md;                        \
  143|      1|    }

EVP_whirlpool:
   29|      1|{
   30|      1|    return &whirlpool_md;
   31|      1|}

EVP_add_cipher:
   20|    144|{
   21|    144|    int r;
   22|       |
   23|    144|    if (c == NULL)
  ------------------
  |  Branch (23:9): [True: 0, False: 144]
  ------------------
   24|      0|        return 0;
   25|       |
   26|    144|    r = OBJ_NAME_add(OBJ_nid2sn(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  ------------------
   27|    144|        (const char *)c);
   28|    144|    if (r == 0)
  ------------------
  |  Branch (28:9): [True: 0, False: 144]
  ------------------
   29|      0|        return 0;
   30|    144|    r = OBJ_NAME_add(OBJ_nid2ln(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  ------------------
   31|    144|        (const char *)c);
   32|    144|    return r;
   33|    144|}
EVP_add_digest:
   36|     22|{
   37|     22|    int r;
   38|     22|    const char *name;
   39|       |
   40|     22|    name = OBJ_nid2sn(md->type);
   41|     22|    r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md);
  ------------------
  |  |   25|     22|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
   42|     22|    if (r == 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 22]
  ------------------
   43|      0|        return 0;
   44|     22|    r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|     22|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
   45|     22|        (const char *)md);
   46|     22|    if (r == 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 22]
  ------------------
   47|      0|        return 0;
   48|       |
   49|     22|    if (md->pkey_type && md->type != md->pkey_type) {
  ------------------
  |  Branch (49:9): [True: 17, False: 5]
  |  Branch (49:26): [True: 16, False: 1]
  ------------------
   50|     16|        r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
   51|     16|            OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
                          OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|#define OBJ_NAME_ALIAS 0x8000
  ------------------
   52|     16|        if (r == 0)
  ------------------
  |  Branch (52:13): [True: 0, False: 16]
  ------------------
   53|      0|            return 0;
   54|     16|        r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
   55|     16|            OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
                          OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|#define OBJ_NAME_ALIAS 0x8000
  ------------------
   56|     16|    }
   57|     22|    return r;
   58|     22|}

EVP_PKEY_CTX_free:
  237|      1|{
  238|      1|    if (ctx == NULL)
  ------------------
  |  Branch (238:9): [True: 1, False: 0]
  ------------------
  239|      1|        return;
  240|       |
  241|      0|    evp_pkey_ctx_free_old_ops(ctx);
  242|      0|#ifndef FIPS_MODULE
  243|      0|    evp_pkey_ctx_free_all_cached_data(ctx);
  244|      0|#endif
  245|      0|    EVP_KEYMGMT_free(ctx->keymgmt);
  246|       |
  247|      0|    OPENSSL_free(ctx->propquery);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  248|      0|    EVP_PKEY_free(ctx->pkey);
  249|      0|    EVP_PKEY_free(ctx->peerkey);
  250|      0|    BN_free(ctx->rsa_pubexp);
  251|      0|    OPENSSL_free(ctx);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  252|      0|}

ossl_do_ex_data_init:
   15|      1|{
   16|      1|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|      1|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 1]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      1|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|       |    return global->ex_data_lock != NULL;
   23|      1|}

ossl_safe_getenv:
   19|      1|{
   20|       |#if defined(_WIN32) && defined(CP_UTF8)
   21|       |    if (GetEnvironmentVariableW(L"OPENSSL_WIN32_UTF8", NULL, 0) != 0) {
   22|       |        char *val = NULL;
   23|       |        int vallen = 0;
   24|       |        WCHAR *namew = NULL;
   25|       |        WCHAR *valw = NULL;
   26|       |        DWORD envlen = 0;
   27|       |        DWORD dwFlags = MB_ERR_INVALID_CHARS;
   28|       |        int rsize, fsize;
   29|       |        UINT curacp;
   30|       |
   31|       |        curacp = GetACP();
   32|       |
   33|       |        /*
   34|       |         * For the code pages listed below, dwFlags must be set to 0.
   35|       |         * Otherwise, the function fails with ERROR_INVALID_FLAGS.
   36|       |         */
   37|       |        if (curacp == 50220 || curacp == 50221 || curacp == 50222 || curacp == 50225 || curacp == 50227 || curacp == 50229 || (57002 <= curacp && curacp <= 57011) || curacp == 65000 || curacp == 42)
   38|       |            dwFlags = 0;
   39|       |
   40|       |        /* query for buffer len */
   41|       |        rsize = MultiByteToWideChar(curacp, dwFlags, name, -1, NULL, 0);
   42|       |        /* if name is valid string and can be converted to wide string */
   43|       |        if (rsize > 0)
   44|       |            namew = _malloca(rsize * sizeof(WCHAR));
   45|       |
   46|       |        if (NULL != namew) {
   47|       |            /* convert name to wide string */
   48|       |            fsize = MultiByteToWideChar(curacp, dwFlags, name, -1, namew, rsize);
   49|       |            /* if conversion is ok, then determine value string size in wchars */
   50|       |            if (fsize > 0)
   51|       |                envlen = GetEnvironmentVariableW(namew, NULL, 0);
   52|       |        }
   53|       |
   54|       |        if (envlen > 0)
   55|       |            valw = _malloca(envlen * sizeof(WCHAR));
   56|       |
   57|       |        if (NULL != valw) {
   58|       |            /* if can get env value as wide string */
   59|       |            if (GetEnvironmentVariableW(namew, valw, envlen) < envlen) {
   60|       |                /* determine value string size in utf-8 */
   61|       |                vallen = WideCharToMultiByte(CP_UTF8, 0, valw, -1, NULL, 0,
   62|       |                    NULL, NULL);
   63|       |            }
   64|       |        }
   65|       |
   66|       |        if (vallen > 0)
   67|       |            val = OPENSSL_malloc(vallen);
   68|       |
   69|       |        if (NULL != val) {
   70|       |            /* convert value string from wide to utf-8 */
   71|       |            if (WideCharToMultiByte(CP_UTF8, 0, valw, -1, val, vallen,
   72|       |                    NULL, NULL)
   73|       |                == 0) {
   74|       |                OPENSSL_free(val);
   75|       |                val = NULL;
   76|       |            }
   77|       |        }
   78|       |
   79|       |        if (NULL != namew)
   80|       |            _freea(namew);
   81|       |
   82|       |        if (NULL != valw)
   83|       |            _freea(valw);
   84|       |
   85|       |        return val;
   86|       |    }
   87|       |#endif
   88|       |
   89|      1|#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
   90|      1|#if __GLIBC_PREREQ(2, 17)
   91|      1|#define SECURE_GETENV
   92|      1|    return secure_getenv(name);
   93|      1|#endif
   94|      1|#endif
   95|       |
   96|       |#ifndef SECURE_GETENV
   97|       |    if (OPENSSL_issetugid())
   98|       |        return NULL;
   99|       |    return getenv(name);
  100|       |#endif
  101|      1|}

ossl_fnv1a_hash:
   14|  1.88k|{
   15|  1.88k|    uint64_t hash = 0xcbf29ce484222325ULL;
   16|  1.88k|    size_t i;
   17|       |
   18|  27.4k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (18:17): [True: 25.5k, False: 1.88k]
  ------------------
   19|  25.5k|        hash ^= key[i];
   20|  25.5k|        hash *= 0x00000100000001B3ULL;
   21|  25.5k|    }
   22|  1.88k|    return hash;
   23|  1.88k|}

ossl_ht_new:
  185|      1|{
  186|      1|    HT *new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  187|       |
  188|      1|    if (new == NULL)
  ------------------
  |  Branch (188:9): [True: 0, False: 1]
  ------------------
  189|      0|        return NULL;
  190|       |
  191|      1|    if (conf->lockless_reads && conf->no_rcu)
  ------------------
  |  Branch (191:9): [True: 1, False: 0]
  |  Branch (191:33): [True: 0, False: 1]
  ------------------
  192|      0|        goto err;
  193|       |
  194|      1|    if (!conf->no_rcu) {
  ------------------
  |  Branch (194:9): [True: 1, False: 0]
  ------------------
  195|      1|        new->atomic_lock = CRYPTO_THREAD_lock_new();
  196|      1|        if (new->atomic_lock == NULL)
  ------------------
  |  Branch (196:13): [True: 0, False: 1]
  ------------------
  197|      0|            goto err;
  198|      1|    }
  199|      1|    memcpy(&new->config, conf, sizeof(*conf));
  200|       |
  201|      1|    if (new->config.init_neighborhoods != 0) {
  ------------------
  |  Branch (201:9): [True: 1, False: 0]
  ------------------
  202|      1|        new->wpd.neighborhood_len = new->config.init_neighborhoods;
  203|       |        /* round up to the next power of 2 */
  204|      1|        new->wpd.neighborhood_len--;
  205|      1|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 1;
  206|      1|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 2;
  207|      1|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 4;
  208|      1|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 8;
  209|      1|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 16;
  210|      1|        new->wpd.neighborhood_len++;
  211|      1|    } else {
  212|      0|        new->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;
  ------------------
  |  |   96|      0|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   95|      0|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  213|      0|    }
  214|       |
  215|      1|    if (new->config.ht_free_fn == NULL)
  ------------------
  |  Branch (215:9): [True: 1, False: 0]
  ------------------
  216|      1|        new->config.ht_free_fn = internal_free_nop;
  217|       |
  218|      1|    new->md = OPENSSL_zalloc(sizeof(*new->md));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|      1|    if (new->md == NULL)
  ------------------
  |  Branch (219:9): [True: 0, False: 1]
  ------------------
  220|      0|        goto err;
  221|       |
  222|      1|    new->md->neighborhoods = alloc_new_neighborhood_list(new->wpd.neighborhood_len,
  223|      1|        &new->md->neighborhood_ptr_to_free);
  224|      1|    if (new->md->neighborhoods == NULL)
  ------------------
  |  Branch (224:9): [True: 0, False: 1]
  ------------------
  225|      0|        goto err;
  226|      1|    new->md->neighborhood_mask = new->wpd.neighborhood_len - 1;
  227|       |
  228|      1|    if (!conf->no_rcu) {
  ------------------
  |  Branch (228:9): [True: 1, False: 0]
  ------------------
  229|      1|        new->lock = ossl_rcu_lock_new(1, conf->ctx);
  230|      1|        if (new->lock == NULL)
  ------------------
  |  Branch (230:13): [True: 0, False: 1]
  ------------------
  231|      0|            goto err;
  232|      1|    }
  233|      1|    if (new->config.ht_hash_fn == NULL)
  ------------------
  |  Branch (233:9): [True: 1, False: 0]
  ------------------
  234|      1|        new->config.ht_hash_fn = internal_ht_hash_fn;
  235|       |
  236|      1|    return new;
  237|       |
  238|      0|err:
  239|      0|    if (!conf->no_rcu) {
  ------------------
  |  Branch (239:9): [True: 0, False: 0]
  ------------------
  240|      0|        CRYPTO_THREAD_lock_free(new->atomic_lock);
  241|      0|        ossl_rcu_lock_free(new->lock);
  242|      0|    }
  243|      0|    if (new->md != NULL)
  ------------------
  |  Branch (243:9): [True: 0, False: 0]
  ------------------
  244|      0|        OPENSSL_free(new->md->neighborhood_ptr_to_free);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  245|      0|    OPENSSL_free(new->md);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  246|      0|    OPENSSL_free(new);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  247|       |    return NULL;
  248|      1|}
ossl_ht_insert:
  720|    402|{
  721|    402|    struct ht_internal_value_st *newval = NULL;
  722|    402|    uint64_t hash;
  723|    402|    int rc = 0;
  724|    402|    int i;
  725|       |
  726|    402|    if (data->value == NULL)
  ------------------
  |  Branch (726:9): [True: 0, False: 402]
  ------------------
  727|      0|        goto out;
  728|       |
  729|    402|    rc = -1;
  730|    402|    newval = alloc_new_value(h, key, data->value, data->type_id);
  731|    402|    if (newval == NULL)
  ------------------
  |  Branch (731:9): [True: 0, False: 402]
  ------------------
  732|      0|        goto out;
  733|       |
  734|    402|    if (key->cached_hash)
  ------------------
  |  Branch (734:9): [True: 0, False: 402]
  ------------------
  735|      0|        hash = key->cached_hash;
  736|    402|    else
  737|    402|        hash = key->cached_hash = newval->value.key.cached_hash = h->config.ht_hash_fn(key);
  738|       |
  739|       |    /*
  740|       |     * we have to take our lock here to prevent other changes
  741|       |     * to the bucket list
  742|       |     */
  743|    402|    for (i = 0;
  744|    402|        (rc = ossl_ht_insert_locked(h, hash, newval, olddata)) == -1
  ------------------
  |  Branch (744:9): [True: 0, False: 402]
  ------------------
  745|      0|        && i <= (int)NEIGHBORHOOD_LEN;
  ------------------
  |  |  104|      0|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  101|      0|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (745:12): [True: 0, False: 0]
  ------------------
  746|    402|        ++i)
  747|      0|        if (!grow_hashtable(h, h->wpd.neighborhood_len)) {
  ------------------
  |  Branch (747:13): [True: 0, False: 0]
  ------------------
  748|      0|            rc = -1;
  749|      0|            break;
  750|      0|        }
  751|       |
  752|    402|    if (rc <= 0)
  ------------------
  |  Branch (752:9): [True: 0, False: 402]
  ------------------
  753|      0|        free_value(newval);
  754|       |
  755|    402|out:
  756|    402|    return rc;
  757|    402|}
ossl_ht_get:
  760|  1.48k|{
  761|  1.48k|    struct ht_mutable_data_st *md;
  762|  1.48k|    uint64_t hash;
  763|  1.48k|    uint64_t neigh_idx_start;
  764|  1.48k|    uint64_t neigh_idx;
  765|  1.48k|    struct ht_internal_value_st *ival = NULL;
  766|  1.48k|    size_t j;
  767|  1.48k|    uint64_t ehash;
  768|  1.48k|    int lockless_reads = h->config.lockless_reads;
  769|       |
  770|  1.48k|    if (key->cached_hash)
  ------------------
  |  Branch (770:9): [True: 0, False: 1.48k]
  ------------------
  771|      0|        hash = key->cached_hash;
  772|  1.48k|    else
  773|  1.48k|        hash = key->cached_hash = h->config.ht_hash_fn(key);
  774|       |
  775|  1.48k|    if (!h->config.no_rcu)
  ------------------
  |  Branch (775:9): [True: 1.48k, False: 0]
  ------------------
  776|  1.48k|        md = ossl_rcu_deref(&h->md);
  ------------------
  |  |   35|  1.48k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  777|      0|    else
  778|      0|        md = h->md;
  779|  1.48k|    neigh_idx = neigh_idx_start = hash & md->neighborhood_mask;
  780|  1.48k|    do {
  781|  1.48k|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   82|  1.48k|#define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  782|  1.96k|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  104|  1.96k|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  101|  1.96k|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (782:21): [True: 1.96k, False: 0]
  ------------------
  783|  1.96k|            if (!h->config.no_rcu)
  ------------------
  |  Branch (783:17): [True: 1.96k, False: 0]
  ------------------
  784|  1.96k|                ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   35|  1.96k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  785|      0|            else
  786|      0|                ival = md->neighborhoods[neigh_idx].entries[j].value;
  787|  1.96k|            if (ival == NULL) {
  ------------------
  |  Branch (787:17): [True: 547, False: 1.41k]
  ------------------
  788|    547|                if (lockless_reads)
  ------------------
  |  Branch (788:21): [True: 547, False: 0]
  ------------------
  789|       |                    /* lockless_reads implies no deletion, we can break out */
  790|    547|                    return NULL;
  791|      0|                continue;
  792|    547|            }
  793|  1.41k|            if (!h->config.no_rcu) {
  ------------------
  |  Branch (793:17): [True: 1.41k, False: 0]
  ------------------
  794|  1.41k|                if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (794:21): [True: 0, False: 1.41k]
  ------------------
  795|  1.41k|                        &ehash, h->atomic_lock))
  796|      0|                    return NULL;
  797|  1.41k|            } else {
  798|      0|                ehash = md->neighborhoods[neigh_idx].entries[j].hash;
  799|      0|            }
  800|  1.41k|            if (compare_hash(hash, ehash) && match_key(&ival->value.key, key))
  ------------------
  |  Branch (800:17): [True: 936, False: 483]
  |  Branch (800:46): [True: 936, False: 0]
  ------------------
  801|    936|                return (HT_VALUE *)ival;
  802|  1.41k|        }
  803|      0|        if (!lockless_reads)
  ------------------
  |  Branch (803:13): [True: 0, False: 0]
  ------------------
  804|      0|            break;
  805|       |        /* Continue search in subsequent neighborhoods */
  806|      0|        neigh_idx = (neigh_idx + 1) & md->neighborhood_mask;
  807|      0|    } while (neigh_idx != neigh_idx_start);
  ------------------
  |  Branch (807:14): [True: 0, False: 0]
  ------------------
  808|       |
  809|      0|    return NULL;
  810|  1.48k|}
hashtable.c:alloc_new_neighborhood_list:
  155|      1|{
  156|      1|    struct ht_neighborhood_st *ret;
  157|       |
  158|      1|#if !defined(OPENSSL_SMALL_FOOTPRINT)
  159|      1|    ret = OPENSSL_aligned_alloc_array(len, sizeof(struct ht_neighborhood_st),
  ------------------
  |  |  122|      1|    CRYPTO_aligned_alloc_array(num, size, alignment, freeptr,      \
  |  |  123|      1|        OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  160|      1|        CACHE_LINE_BYTES, freeptr);
  161|       |
  162|       |    /* fall back to regular malloc */
  163|      1|    if (ret == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 1]
  ------------------
  164|      0|#endif
  165|      0|    {
  166|      0|        ret = *freeptr = OPENSSL_malloc_array(len, sizeof(struct ht_neighborhood_st));
  ------------------
  |  |  115|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  167|      0|        if (ret == NULL)
  ------------------
  |  Branch (167:13): [True: 0, False: 0]
  ------------------
  168|      0|            return NULL;
  169|      0|    }
  170|      1|    memset(ret, 0, sizeof(struct ht_neighborhood_st) * len);
  171|      1|    return ret;
  172|      1|}
hashtable.c:internal_ht_hash_fn:
  180|  1.88k|{
  181|  1.88k|    return ossl_fnv1a_hash(key->keybuf, key->keysize);
  182|  1.88k|}
hashtable.c:alloc_new_value:
  689|    402|{
  690|    402|    struct ht_internal_value_st *tmp;
  691|    402|    size_t nvsize = sizeof(*tmp);
  692|       |
  693|    402|    if (h->config.collision_check == 1)
  ------------------
  |  Branch (693:9): [True: 402, False: 0]
  ------------------
  694|    402|        nvsize += key->keysize;
  695|       |
  696|    402|    tmp = OPENSSL_malloc(nvsize);
  ------------------
  |  |  111|    402|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  697|       |
  698|    402|    if (tmp == NULL)
  ------------------
  |  Branch (698:9): [True: 0, False: 402]
  ------------------
  699|      0|        return NULL;
  700|       |
  701|    402|    tmp->ht = h;
  702|    402|    tmp->value.value = data;
  703|    402|    tmp->value.type_id = type;
  704|    402|    tmp->value.key.keybuf = NULL;
  705|    402|    if (h->config.collision_check) {
  ------------------
  |  Branch (705:9): [True: 402, False: 0]
  ------------------
  706|    402|        tmp->value.key.keybuf = (uint8_t *)(tmp + 1);
  707|    402|        tmp->value.key.keysize = key->keysize;
  708|    402|        memcpy(tmp->value.key.keybuf, key->keybuf, key->keysize);
  709|    402|    }
  710|       |
  711|    402|    return tmp;
  712|    402|}
hashtable.c:ossl_ht_insert_locked:
  602|    402|{
  603|    402|    struct ht_mutable_data_st *md = h->md;
  604|    402|    uint64_t neigh_idx_start = hash & md->neighborhood_mask;
  605|    402|    uint64_t neigh_idx = neigh_idx_start;
  606|    402|    size_t j;
  607|    402|    uint64_t ihash;
  608|    402|    HT_VALUE *ival;
  609|    402|    size_t empty_idx = SIZE_MAX;
  610|    402|    int lockless_reads = h->config.lockless_reads;
  611|       |
  612|    402|    do {
  613|    402|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   82|    402|#define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  614|       |
  615|    544|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  104|    544|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  101|    544|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (615:21): [True: 544, False: 0]
  ------------------
  616|    544|            if (!h->config.no_rcu)
  ------------------
  |  Branch (616:17): [True: 544, False: 0]
  ------------------
  617|    544|                ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   35|    544|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  618|      0|            else
  619|      0|                ival = (HT_VALUE *)md->neighborhoods[neigh_idx].entries[j].value;
  620|    544|            if (ival == NULL) {
  ------------------
  |  Branch (620:17): [True: 402, False: 142]
  ------------------
  621|    402|                empty_idx = j;
  622|       |                /* lockless_reads implies no deletion, we can break out */
  623|    402|                if (lockless_reads)
  ------------------
  |  Branch (623:21): [True: 402, False: 0]
  ------------------
  624|    402|                    goto not_found;
  625|      0|                continue;
  626|    402|            }
  627|    142|            if (!h->config.no_rcu) {
  ------------------
  |  Branch (627:17): [True: 142, False: 0]
  ------------------
  628|    142|                if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (628:21): [True: 0, False: 142]
  ------------------
  629|    142|                        &ihash, h->atomic_lock))
  630|      0|                    return 0;
  631|    142|            } else {
  632|      0|                ihash = md->neighborhoods[neigh_idx].entries[j].hash;
  633|      0|            }
  634|    142|            if (compare_hash(hash, ihash) && match_key(&newval->value.key, &ival->key)) {
  ------------------
  |  Branch (634:17): [True: 0, False: 142]
  |  Branch (634:46): [True: 0, False: 0]
  ------------------
  635|      0|                if (olddata == NULL) {
  ------------------
  |  Branch (635:21): [True: 0, False: 0]
  ------------------
  636|       |                    /* This would insert a duplicate -> fail */
  637|      0|                    return 0;
  638|      0|                }
  639|       |                /* Do a replacement */
  640|      0|                if (!h->config.no_rcu) {
  ------------------
  |  Branch (640:21): [True: 0, False: 0]
  ------------------
  641|      0|                    CRYPTO_RCU_CB_ITEM *cbi = ossl_rcu_cb_item_new();
  642|      0|                    if (cbi == NULL)
  ------------------
  |  Branch (642:25): [True: 0, False: 0]
  ------------------
  643|      0|                        return 0;
  644|      0|                    if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (644:25): [True: 0, False: 0]
  ------------------
  645|      0|                            hash, h->atomic_lock)) {
  646|      0|                        ossl_rcu_cb_item_free(cbi);
  647|      0|                        return 0;
  648|      0|                    }
  649|      0|                    *olddata = (HT_VALUE *)md->neighborhoods[neigh_idx].entries[j].value;
  650|      0|                    ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[j].value,
  ------------------
  |  |   36|      0|#define ossl_rcu_assign_ptr(p, v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  651|      0|                        &newval);
  652|      0|                    ossl_rcu_call(h->lock, cbi, free_old_ht_value, *olddata);
  653|      0|                } else {
  654|      0|                    md->neighborhoods[neigh_idx].entries[j].hash = hash;
  655|      0|                    *olddata = (HT_VALUE *)md->neighborhoods[neigh_idx].entries[j].value;
  656|      0|                    md->neighborhoods[neigh_idx].entries[j].value = newval;
  657|      0|                }
  658|      0|                h->wpd.need_sync = 1;
  659|      0|                return 1;
  660|      0|            }
  661|    142|        }
  662|      0|        if (!lockless_reads)
  ------------------
  |  Branch (662:13): [True: 0, False: 0]
  ------------------
  663|      0|            break;
  664|       |        /* Continue search in subsequent neighborhoods */
  665|      0|        neigh_idx = (neigh_idx + 1) & md->neighborhood_mask;
  666|      0|    } while (neigh_idx != neigh_idx_start);
  ------------------
  |  Branch (666:14): [True: 0, False: 0]
  ------------------
  667|       |
  668|    402|not_found:
  669|       |    /* If we get to here, its just an insert */
  670|    402|    if (empty_idx == SIZE_MAX)
  ------------------
  |  Branch (670:9): [True: 0, False: 402]
  ------------------
  671|      0|        return -1; /* out of space */
  672|    402|    if (!h->config.no_rcu) {
  ------------------
  |  Branch (672:9): [True: 402, False: 0]
  ------------------
  673|    402|        if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[empty_idx].hash,
  ------------------
  |  Branch (673:13): [True: 0, False: 402]
  ------------------
  674|    402|                hash, h->atomic_lock))
  675|      0|            return 0;
  676|    402|        ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[empty_idx].value,
  ------------------
  |  |   36|    402|#define ossl_rcu_assign_ptr(p, v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  677|    402|            &newval);
  678|    402|    } else {
  679|      0|        md->neighborhoods[neigh_idx].entries[empty_idx].hash = hash;
  680|      0|        md->neighborhoods[neigh_idx].entries[empty_idx].value = newval;
  681|      0|    }
  682|    402|    h->wpd.value_count++;
  683|    402|    return 1;
  684|    402|}
hashtable.c:compare_hash:
  459|  1.56k|{
  460|  1.56k|    return (hash1 == hash2);
  461|  1.56k|}
hashtable.c:match_key:
  586|    936|{
  587|       |    /*
  588|       |     * keys match if they are both present, the same size
  589|       |     * and compare equal in memory
  590|       |     */
  591|    936|    PREFETCH(a->keybuf);
  ------------------
  |  |   83|    936|#define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  592|    936|    PREFETCH(b->keybuf);
  ------------------
  |  |   83|    936|#define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  593|    936|    if (a->keybuf != NULL && b->keybuf != NULL && a->keysize == b->keysize)
  ------------------
  |  Branch (593:9): [True: 936, False: 0]
  |  Branch (593:30): [True: 936, False: 0]
  |  Branch (593:51): [True: 936, False: 0]
  ------------------
  594|    936|        return !memcmp(a->keybuf, b->keybuf, a->keysize);
  595|       |
  596|      0|    return 1;
  597|    936|}

ossl_err_load_HTTP_strings:
   80|      1|{
   81|      1|#ifndef OPENSSL_NO_ERR
   82|      1|    if (ERR_reason_error_string(HTTP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (82:9): [True: 1, False: 0]
  ------------------
   83|      1|        ERR_load_strings_const(HTTP_str_reasons);
   84|      1|#endif
   85|      1|    return 1;
   86|      1|}

ossl_indicator_set_callback_new:
   21|      1|{
   22|      1|    INDICATOR_CB *cb;
   23|       |
   24|      1|    cb = OPENSSL_zalloc(sizeof(*cb));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   25|      1|    return cb;
   26|      1|}

OPENSSL_init_crypto:
  349|     34|{
  350|     34|    uint64_t tmp;
  351|     34|    uint64_t optsdone_bits = opts;
  352|     34|    int aloaddone = 0;
  353|       |
  354|       |    /* Applications depend on 0 being returned when cleanup was already done */
  355|     34|    if (ossl_unlikely(stopped)) {
  ------------------
  |  |   24|     34|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 34]
  |  |  ------------------
  ------------------
  356|      0|        if (!(opts & OPENSSL_INIT_BASE_ONLY))
  ------------------
  |  |   31|      0|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  |  Branch (356:13): [True: 0, False: 0]
  ------------------
  357|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  358|      0|        return 0;
  359|      0|    }
  360|       |
  361|       |    /*
  362|       |     * We ignore failures from this function. It is probably because we are
  363|       |     * on a platform that doesn't support lockless atomic loads (we may not
  364|       |     * have created optsdone_lock yet so we can't use it). This is just an
  365|       |     * optimisation to skip the full checks in this function if we don't need
  366|       |     * to, so we carry on regardless in the event of failure.
  367|       |     *
  368|       |     * There could be a race here with other threads, so that optsdone has not
  369|       |     * been updated yet, even though the options have in fact been initialised.
  370|       |     * This doesn't matter - it just means we will run the full function
  371|       |     * unnecessarily - but all the critical code is contained in RUN_ONCE
  372|       |     * functions anyway so we are safe.
  373|       |     */
  374|     34|    if (ossl_likely(CRYPTO_atomic_load(&optsdone, &tmp, NULL))) {
  ------------------
  |  |   23|     34|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 34, False: 0]
  |  |  ------------------
  ------------------
  375|     34|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (375:13): [True: 11, False: 23]
  ------------------
  376|     11|            return 1;
  377|     23|        aloaddone = 1;
  378|     23|    }
  379|       |
  380|       |    /*
  381|       |     * At some point we should look at this function with a view to moving
  382|       |     * most/all of this into OSSL_LIB_CTX.
  383|       |     *
  384|       |     * When the caller specifies OPENSSL_INIT_BASE_ONLY, that should be the
  385|       |     * *only* option specified.  With that option we return immediately after
  386|       |     * doing the requested limited initialization.
  387|       |     *
  388|       |     * If we remain the only caller of err_shelve_state() the recursion should
  389|       |     * perhaps be removed, but if in doubt, it can be left in place.
  390|       |     */
  391|     23|    if (ossl_unlikely(!RUN_ONCE(&base, ossl_init_base)))
  ------------------
  |  |   24|     46|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 23]
  |  |  |  Branch (24:46): [True: 23, False: 0]
  |  |  ------------------
  ------------------
  392|      0|        return 0;
  393|       |
  394|     23|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|     23|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  |  Branch (394:9): [True: 20, False: 3]
  ------------------
  395|     20|        return 1;
  396|       |
  397|       |    /*
  398|       |     * optsdone_lock should definitely be set up now, so we can now repeat the
  399|       |     * same check from above but be sure that it will work even on platforms
  400|       |     * without lockless CRYPTO_atomic_load
  401|       |     */
  402|      3|    if (!aloaddone) {
  ------------------
  |  Branch (402:9): [True: 0, False: 3]
  ------------------
  403|      0|        if (!CRYPTO_atomic_load(&optsdone, &tmp, optsdone_lock))
  ------------------
  |  Branch (403:13): [True: 0, False: 0]
  ------------------
  404|      0|            return 0;
  405|      0|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (405:13): [True: 0, False: 0]
  ------------------
  406|      0|            return 1;
  407|      0|    }
  408|       |
  409|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  547|      3|#define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (409:9): [True: 0, False: 3]
  ------------------
  410|      0|        && !RUN_ONCE_ALT(&load_crypto_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (410:12): [True: 0, False: 0]
  ------------------
  411|      3|            ossl_init_no_load_crypto_strings,
  412|      3|            ossl_init_load_crypto_strings))
  413|      0|        return 0;
  414|       |
  415|      3|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  548|      3|#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
  ------------------
  |  Branch (415:9): [True: 2, False: 1]
  ------------------
  416|      2|        && !RUN_ONCE(&load_crypto_strings, ossl_init_load_crypto_strings))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (416:12): [True: 0, False: 2]
  ------------------
  417|      0|        return 0;
  418|       |
  419|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_SSL_STRINGS)
  ------------------
  |  | 2914|      3|#define OPENSSL_INIT_NO_LOAD_SSL_STRINGS 0x00100000L
  ------------------
  |  Branch (419:9): [True: 0, False: 3]
  ------------------
  420|      0|        && !RUN_ONCE_ALT(&ssl_strings, ossl_init_no_load_ssl_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (420:12): [True: 0, False: 0]
  ------------------
  421|      3|            ossl_init_load_ssl_strings))
  422|      0|        return 0;
  423|       |
  424|      3|    if ((opts & OPENSSL_INIT_LOAD_SSL_STRINGS)
  ------------------
  |  | 2915|      3|#define OPENSSL_INIT_LOAD_SSL_STRINGS 0x00200000L
  ------------------
  |  Branch (424:9): [True: 1, False: 2]
  ------------------
  425|      1|        && !RUN_ONCE(&ssl_strings, ossl_init_load_ssl_strings))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (425:12): [True: 0, False: 1]
  ------------------
  426|      0|        return 0;
  427|       |
  428|      3|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  551|      3|#define OPENSSL_INIT_NO_ADD_ALL_CIPHERS 0x00000010L
  ------------------
  |  Branch (428:9): [True: 0, False: 3]
  ------------------
  429|      0|        && !RUN_ONCE_ALT(&add_all_ciphers, ossl_init_no_add_all_ciphers,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (429:12): [True: 0, False: 0]
  ------------------
  430|      3|            ossl_init_add_all_ciphers))
  431|      0|        return 0;
  432|       |
  433|      3|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  549|      3|#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
  ------------------
  |  Branch (433:9): [True: 1, False: 2]
  ------------------
  434|      1|        && !RUN_ONCE(&add_all_ciphers, ossl_init_add_all_ciphers))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (434:12): [True: 0, False: 1]
  ------------------
  435|      0|        return 0;
  436|       |
  437|      3|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  552|      3|#define OPENSSL_INIT_NO_ADD_ALL_DIGESTS 0x00000020L
  ------------------
  |  Branch (437:9): [True: 0, False: 3]
  ------------------
  438|      0|        && !RUN_ONCE_ALT(&add_all_digests, ossl_init_no_add_all_digests,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (438:12): [True: 0, False: 0]
  ------------------
  439|      3|            ossl_init_add_all_digests))
  440|      0|        return 0;
  441|       |
  442|      3|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  550|      3|#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
  ------------------
  |  Branch (442:9): [True: 1, False: 2]
  ------------------
  443|      1|        && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (443:12): [True: 0, False: 1]
  ------------------
  444|      0|        return 0;
  445|       |
  446|      3|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  557|      3|#define OPENSSL_INIT_ATFORK 0x00020000L
  ------------------
  |  Branch (446:9): [True: 0, False: 3]
  ------------------
  447|      0|        && !openssl_init_fork_handlers())
  ------------------
  |  Branch (447:12): [True: 0, False: 0]
  ------------------
  448|      0|        return 0;
  449|       |
  450|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  554|      3|#define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000080L
  ------------------
  |  Branch (450:9): [True: 0, False: 3]
  ------------------
  451|      0|        && !RUN_ONCE_ALT(&config, ossl_init_no_config, ossl_init_config))
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (451:12): [True: 0, False: 0]
  ------------------
  452|      0|        return 0;
  453|       |
  454|      3|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  553|      3|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
  |  Branch (454:9): [True: 1, False: 2]
  ------------------
  455|      1|        int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
  456|       |
  457|       |        /* If called recursively from OBJ_ calls during config loading,
  458|       |         * we have to mask OPENSSL_INIT_LOAD_CONFIG in optsdone to not
  459|       |         * advertise that config loading is complete, otherwise other
  460|       |         * threads may proceed, e.g., to fetching from a provider that
  461|       |         * is not yet loaded.
  462|       |         */
  463|      1|        if (loading) {
  ------------------
  |  Branch (463:13): [True: 0, False: 1]
  ------------------
  464|      0|            optsdone_bits &= ~(uint64_t)OPENSSL_INIT_LOAD_CONFIG;
  ------------------
  |  |  553|      0|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
  465|      1|        } else {
  466|      1|            int ret;
  467|       |
  468|      1|            if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
  ------------------
  |  Branch (468:17): [True: 0, False: 1]
  ------------------
  469|      0|                return 0;
  470|      1|            if (settings == NULL) {
  ------------------
  |  Branch (470:17): [True: 1, False: 0]
  ------------------
  471|      1|                ret = RUN_ONCE(&config, ossl_init_config);
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  472|      1|            } else {
  473|      0|                if (!CRYPTO_THREAD_write_lock(init_lock))
  ------------------
  |  Branch (473:21): [True: 0, False: 0]
  ------------------
  474|      0|                    return 0;
  475|      0|                conf_settings = settings;
  476|      0|                ret = RUN_ONCE_ALT(&config, ossl_init_config_settings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  477|      0|                    ossl_init_config);
  478|      0|                conf_settings = NULL;
  479|      0|                CRYPTO_THREAD_unlock(init_lock);
  480|      0|            }
  481|       |
  482|      1|            if (ret <= 0)
  ------------------
  |  Branch (482:17): [True: 0, False: 1]
  ------------------
  483|      0|                return 0;
  484|      1|        }
  485|      1|    }
  486|       |
  487|      3|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  555|      3|#define OPENSSL_INIT_ASYNC 0x00000100L
  ------------------
  |  Branch (487:9): [True: 1, False: 2]
  ------------------
  488|      1|        && !RUN_ONCE(&async, ossl_init_async))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (488:12): [True: 0, False: 1]
  ------------------
  489|      0|        return 0;
  490|       |
  491|      3|    if (!CRYPTO_atomic_or(&optsdone, optsdone_bits, &tmp, optsdone_lock))
  ------------------
  |  Branch (491:9): [True: 0, False: 3]
  ------------------
  492|      0|        return 0;
  493|       |
  494|      3|    return 1;
  495|      3|}
init.c:ossl_init_base:
   53|      1|{
   54|       |    /* no need to init trace */
   55|       |
   56|      1|    OSSL_TRACE(INIT, "ossl_init_base: setting up stop handlers\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   57|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
   58|       |    ossl_malloc_setup_failures();
   59|       |#endif
   60|       |
   61|      1|    if ((optsdone_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (61:9): [True: 0, False: 1]
  ------------------
   62|      1|        || (init_lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (62:12): [True: 0, False: 1]
  ------------------
   63|      0|        goto err;
   64|       |
   65|      1|    OPENSSL_cpuid_setup();
   66|       |
   67|      1|    if (!ossl_init_thread())
  ------------------
  |  Branch (67:9): [True: 0, False: 1]
  ------------------
   68|      0|        goto err;
   69|       |
   70|      1|    if (!CRYPTO_THREAD_init_local(&in_init_config_local, NULL))
  ------------------
  |  Branch (70:9): [True: 0, False: 1]
  ------------------
   71|      0|        goto err;
   72|       |
   73|      1|    base_inited = 1;
   74|      1|    return 1;
   75|       |
   76|      0|err:
   77|      0|    OSSL_TRACE(INIT, "ossl_init_base failed!\n");
  ------------------
  |  |  288|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   78|      0|    CRYPTO_THREAD_lock_free(optsdone_lock);
   79|      0|    optsdone_lock = NULL;
   80|      0|    CRYPTO_THREAD_lock_free(init_lock);
   81|      0|    init_lock = NULL;
   82|       |
   83|      0|    return 0;
   84|      1|}
init.c:ossl_init_load_crypto_strings:
   89|      1|{
   90|      1|    int ret = 1;
   91|       |    /*
   92|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
   93|       |     * pulling in all the error strings during static linking
   94|       |     */
   95|      1|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
   96|      1|    void *err;
   97|       |
   98|      1|    if (!err_shelve_state(&err))
  ------------------
  |  Branch (98:9): [True: 0, False: 1]
  ------------------
   99|      0|        return 0;
  100|       |
  101|      1|    OSSL_TRACE(INIT, "ossl_err_load_crypto_strings()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  102|      1|    ret = ossl_err_load_crypto_strings();
  103|       |
  104|      1|    err_unshelve_state(err);
  105|      1|#endif
  106|      1|    return ret;
  107|      1|}
init.c:ossl_init_load_ssl_strings:
  119|      1|{
  120|       |    /*
  121|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  122|       |     * pulling in all the error strings during static linking
  123|       |     */
  124|      1|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  125|      1|    OSSL_TRACE(INIT, "ossl_init_load_ssl_strings: ossl_err_load_SSL_strings()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  126|      1|    ossl_err_load_SSL_strings();
  127|      1|#endif
  128|      1|    return 1;
  129|      1|}
init.c:ossl_init_add_all_ciphers:
  140|      1|{
  141|       |    /*
  142|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  143|       |     * pulling in all the ciphers during static linking
  144|       |     */
  145|      1|#ifndef OPENSSL_NO_AUTOALGINIT
  146|      1|    OSSL_TRACE(INIT, "openssl_add_all_ciphers_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  147|      1|    openssl_add_all_ciphers_int();
  148|      1|#endif
  149|      1|    return 1;
  150|      1|}
init.c:ossl_init_add_all_digests:
  161|      1|{
  162|       |    /*
  163|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  164|       |     * pulling in all the ciphers during static linking
  165|       |     */
  166|      1|#ifndef OPENSSL_NO_AUTOALGINIT
  167|      1|    OSSL_TRACE(INIT, "openssl_add_all_digests()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  168|      1|    openssl_add_all_digests_int();
  169|      1|#endif
  170|      1|    return 1;
  171|      1|}
init.c:ossl_init_config:
  183|      1|{
  184|      1|    int ret = ossl_config_int(NULL);
  185|       |
  186|      1|    return ret;
  187|      1|}
init.c:ossl_init_async:
  205|      1|{
  206|      1|    OSSL_TRACE(INIT, "async_init()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  207|      1|    if (!async_init())
  ------------------
  |  Branch (207:9): [True: 0, False: 1]
  ------------------
  208|      0|        return 0;
  209|      1|    async_inited = 1;
  210|      1|    return 1;
  211|      1|}

ossl_init_thread:
  240|      1|{
  241|      1|    if (!CRYPTO_THREAD_init_local(&destructor_key.value,
  ------------------
  |  Branch (241:9): [True: 0, False: 1]
  ------------------
  242|      1|            init_thread_destructor))
  243|      0|        return 0;
  244|       |
  245|      1|    return 1;
  246|      1|}
ossl_init_thread_start:
  392|      2|{
  393|      2|    THREAD_EVENT_HANDLER **hands;
  394|      2|    THREAD_EVENT_HANDLER *hand;
  395|      2|    OSSL_LIB_CTX *ctx = NULL;
  396|       |#ifdef FIPS_MODULE
  397|       |    /*
  398|       |     * In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination
  399|       |     * of OSSL_LIB_CTX and thread. This is because in FIPS mode each
  400|       |     * OSSL_LIB_CTX gets informed about thread stop events individually.
  401|       |     */
  402|       |
  403|       |    ctx = arg;
  404|       |#endif
  405|       |
  406|      2|    hands = alloc_thread_local(ctx);
  407|       |
  408|      2|    if (hands == NULL)
  ------------------
  |  Branch (408:9): [True: 0, False: 2]
  ------------------
  409|      0|        return 0;
  410|       |
  411|       |#ifdef FIPS_MODULE
  412|       |    if (*hands == NULL) {
  413|       |        /*
  414|       |         * We've not yet registered any handlers for this thread. We need to get
  415|       |         * libcrypto to tell us about later thread stop events. c_thread_start
  416|       |         * is a callback to libcrypto defined in fipsprov.c
  417|       |         */
  418|       |        if (!ossl_thread_register_fips(ctx))
  419|       |            return 0;
  420|       |    }
  421|       |#endif
  422|       |
  423|      2|    hand = OPENSSL_malloc(sizeof(*hand));
  ------------------
  |  |  111|      2|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  424|      2|    if (hand == NULL)
  ------------------
  |  Branch (424:9): [True: 0, False: 2]
  ------------------
  425|      0|        return 0;
  426|       |
  427|      2|    hand->handfn = handfn;
  428|      2|    hand->arg = arg;
  429|      2|#ifndef FIPS_MODULE
  430|      2|    hand->index = index;
  431|      2|#endif
  432|      2|    hand->next = *hands;
  433|      2|    *hands = hand;
  434|       |
  435|      2|    return 1;
  436|      2|}
initthread.c:manage_thread_local:
  137|      2|{
  138|      2|    THREAD_EVENT_HANDLER **hands = get_thread_event_handler(ctx);
  139|       |
  140|      2|    if (alloc) {
  ------------------
  |  Branch (140:9): [True: 2, False: 0]
  ------------------
  141|      2|        if (hands == NULL) {
  ------------------
  |  Branch (141:13): [True: 1, False: 1]
  ------------------
  142|       |
  143|      1|            if ((hands = OPENSSL_zalloc(sizeof(*hands))) == NULL)
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (143:17): [True: 0, False: 1]
  ------------------
  144|      0|                return NULL;
  145|       |
  146|      1|            if (!set_thread_event_handler(ctx, hands)) {
  ------------------
  |  Branch (146:17): [True: 0, False: 1]
  ------------------
  147|      0|                OPENSSL_free(hands);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|      0|                return NULL;
  149|      0|            }
  150|      1|#ifndef FIPS_MODULE
  151|      1|            if (!init_thread_push_handlers(hands)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 1]
  ------------------
  152|      0|                set_thread_event_handler(ctx, NULL);
  153|      0|                OPENSSL_free(hands);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|      0|                return NULL;
  155|      0|            }
  156|      1|#endif
  157|      1|        }
  158|      2|    } else if (!keep) {
  ------------------
  |  Branch (158:16): [True: 0, False: 0]
  ------------------
  159|      0|        set_thread_event_handler(ctx, NULL);
  160|      0|    }
  161|       |
  162|      2|    return hands;
  163|      2|}
initthread.c:get_thread_event_handler:
  114|      2|{
  115|       |#ifdef FIPS_MODULE
  116|       |    return CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, ctx);
  117|       |#else
  118|      2|    if (destructor_key.sane != -1)
  ------------------
  |  Branch (118:9): [True: 2, False: 0]
  ------------------
  119|      2|        return CRYPTO_THREAD_get_local(&destructor_key.value);
  120|      0|    return NULL;
  121|      2|#endif
  122|      2|}
initthread.c:set_thread_event_handler:
  125|      1|{
  126|       |#ifdef FIPS_MODULE
  127|       |    return CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, ctx, hands);
  128|       |#else
  129|      1|    if (destructor_key.sane != -1)
  ------------------
  |  Branch (129:9): [True: 1, False: 0]
  ------------------
  130|      1|        return CRYPTO_THREAD_set_local(&destructor_key.value, hands);
  131|      0|    return 0;
  132|      1|#endif
  133|      1|}
initthread.c:init_thread_push_handlers:
  192|      1|{
  193|      1|    int ret;
  194|      1|    GLOBAL_TEVENT_REGISTER *gtr;
  195|       |
  196|      1|    gtr = get_global_tevent_register();
  197|      1|    if (gtr == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 1]
  ------------------
  198|      0|        return 0;
  199|       |
  200|      1|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (200:9): [True: 0, False: 1]
  ------------------
  201|      0|        return 0;
  202|      1|    ret = (sk_THREAD_EVENT_HANDLER_PTR_push(gtr->skhands, hands) != 0);
  203|      1|    CRYPTO_THREAD_unlock(gtr->lock);
  204|       |
  205|      1|    return ret;
  206|      1|}
initthread.c:get_global_tevent_register:
   79|      1|{
   80|      1|    if (!RUN_ONCE(&tevent_register_runonce, create_global_tevent_register))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (80:9): [True: 0, False: 1]
  ------------------
   81|      0|        return NULL;
   82|      1|    return glob_tevent_reg;
   83|      1|}
initthread.c:create_global_tevent_register:
   60|      1|{
   61|      1|    glob_tevent_reg = OPENSSL_zalloc(sizeof(*glob_tevent_reg));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   62|      1|    if (glob_tevent_reg == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 1]
  ------------------
   63|      0|        return 0;
   64|       |
   65|      1|    glob_tevent_reg->skhands = sk_THREAD_EVENT_HANDLER_PTR_new_null();
   66|      1|    glob_tevent_reg->lock = CRYPTO_THREAD_lock_new();
   67|      1|    if (glob_tevent_reg->skhands == NULL || glob_tevent_reg->lock == NULL) {
  ------------------
  |  Branch (67:9): [True: 0, False: 1]
  |  Branch (67:45): [True: 0, False: 1]
  ------------------
   68|      0|        sk_THREAD_EVENT_HANDLER_PTR_free(glob_tevent_reg->skhands);
   69|      0|        CRYPTO_THREAD_lock_free(glob_tevent_reg->lock);
   70|      0|        OPENSSL_free(glob_tevent_reg);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|      0|        glob_tevent_reg = NULL;
   72|      0|        return 0;
   73|      0|    }
   74|       |
   75|      1|    return 1;
   76|      1|}
initthread.c:alloc_thread_local:
  176|      2|{
  177|      2|    return manage_thread_local(ctx, 1, 0);
  178|      2|}

OPENSSL_LH_set_thunks:
   52|      6|{
   53|       |
   54|      6|    if (lh == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 6]
  ------------------
   55|      0|        return NULL;
   56|      6|    lh->compw = cw;
   57|      6|    lh->hashw = hw;
   58|      6|    lh->daw = daw;
   59|      6|    lh->daaw = daaw;
   60|      6|    return lh;
   61|      6|}
OPENSSL_LH_new:
   64|      6|{
   65|      6|    OPENSSL_LHASH *ret;
   66|       |
   67|      6|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  113|      6|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 6]
  ------------------
   68|      0|        return NULL;
   69|      6|    if ((ret->b = OPENSSL_calloc(MIN_NODES, sizeof(*ret->b))) == NULL)
  ------------------
  |  |  117|      6|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 6]
  ------------------
   70|      0|        goto err;
   71|      6|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (71:18): [True: 0, False: 6]
  ------------------
   72|      6|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (72:18): [True: 0, False: 6]
  ------------------
   73|      6|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|      6|#define MIN_NODES 16
  ------------------
   74|      6|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|      6|#define MIN_NODES 16
  ------------------
   75|      6|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|      6|#define MIN_NODES 16
  ------------------
   76|      6|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|      6|#define UP_LOAD (2 * LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   92|      6|#define LH_LOAD_MULT 256
  |  |  ------------------
  ------------------
   77|      6|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|      6|#define DOWN_LOAD (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   92|      6|#define LH_LOAD_MULT 256
  |  |  ------------------
  ------------------
   78|      6|    return ret;
   79|       |
   80|      0|err:
   81|      0|    OPENSSL_free(ret->b);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|      0|    OPENSSL_free(ret);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   83|       |    return NULL;
   84|      6|}
OPENSSL_LH_insert:
  118|  5.19k|{
  119|  5.19k|    unsigned long hash;
  120|  5.19k|    OPENSSL_LH_NODE *nn, **rn;
  121|  5.19k|    void *ret;
  122|       |
  123|  5.19k|    lh->error = 0;
  124|  5.19k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   92|  5.19k|#define LH_LOAD_MULT 256
  ------------------
  |  Branch (124:9): [True: 1.05k, False: 4.14k]
  |  Branch (124:76): [True: 0, False: 1.05k]
  ------------------
  125|      0|        return NULL; /* 'lh->error++' already done in 'expand' */
  126|       |
  127|  5.19k|    rn = getrn(lh, data, &hash);
  128|       |
  129|  5.19k|    if (*rn == NULL) {
  ------------------
  |  Branch (129:9): [True: 2.14k, False: 3.05k]
  ------------------
  130|  2.14k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  111|  2.14k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (130:13): [True: 0, False: 2.14k]
  ------------------
  131|      0|            lh->error++;
  132|      0|            return NULL;
  133|      0|        }
  134|  2.14k|        nn->data = data;
  135|  2.14k|        nn->next = NULL;
  136|  2.14k|        nn->hash = hash;
  137|  2.14k|        *rn = nn;
  138|  2.14k|        ret = NULL;
  139|  2.14k|        lh->num_items++;
  140|  3.05k|    } else { /* replace same key */
  141|  3.05k|        ret = (*rn)->data;
  142|  3.05k|        (*rn)->data = data;
  143|  3.05k|    }
  144|  5.19k|    return ret;
  145|  5.19k|}
OPENSSL_LH_retrieve:
  173|    919|{
  174|    919|    unsigned long hash;
  175|    919|    OPENSSL_LH_NODE **rn;
  176|       |
  177|    919|    if (lh->error != 0)
  ------------------
  |  Branch (177:9): [True: 0, False: 919]
  ------------------
  178|      0|        lh->error = 0;
  179|       |
  180|    919|    rn = getrn(lh, data, &hash);
  181|       |
  182|    919|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (182:12): [True: 255, False: 664]
  ------------------
  183|    919|}
OPENSSL_LH_doall_arg_thunk:
  237|      2|{
  238|      2|    doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC_THUNK)NULL,
  239|       |        (OPENSSL_LH_DOALL_FUNC)NULL, fn, daaw, arg);
  240|      2|}
OPENSSL_LH_strhash:
  360|    200|{
  361|    200|    unsigned long ret = 0;
  362|    200|    long n;
  363|    200|    unsigned long v;
  364|    200|    int r;
  365|       |
  366|    200|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (366:9): [True: 0, False: 200]
  |  Branch (366:24): [True: 0, False: 200]
  ------------------
  367|      0|        return ret;
  368|       |
  369|    200|    n = 0x100;
  370|  3.07k|    while (*c) {
  ------------------
  |  Branch (370:12): [True: 2.87k, False: 200]
  ------------------
  371|  2.87k|        v = n | (*c);
  372|  2.87k|        n += 0x100;
  373|  2.87k|        r = (int)((v >> 2) ^ v) & 0x0f;
  374|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  375|  2.87k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  376|  2.87k|        ret &= 0xFFFFFFFFL;
  377|  2.87k|        ret ^= v * v;
  378|  2.87k|        c++;
  379|  2.87k|    }
  380|    200|    return (ret >> 16) ^ ret;
  381|    200|}
ossl_lh_strcasehash:
  398|  1.08k|{
  399|  1.08k|    unsigned long ret = 0;
  400|  1.08k|    long n;
  401|  1.08k|    unsigned long v;
  402|  1.08k|    int r;
  403|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  404|       |    const long int case_adjust = ~0x40;
  405|       |#else
  406|  1.08k|    const long int case_adjust = ~0x20;
  407|  1.08k|#endif
  408|       |
  409|  1.08k|    if (c == NULL || *c == '\0')
  ------------------
  |  Branch (409:9): [True: 0, False: 1.08k]
  |  Branch (409:22): [True: 0, False: 1.08k]
  ------------------
  410|      0|        return ret;
  411|       |
  412|  14.0k|    for (n = 0x100; *c != '\0'; n += 0x100) {
  ------------------
  |  Branch (412:21): [True: 13.0k, False: 1.08k]
  ------------------
  413|  13.0k|        v = n | (case_adjust & *c);
  414|  13.0k|        r = (int)((v >> 2) ^ v) & 0x0f;
  415|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  416|  13.0k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  417|  13.0k|        ret &= 0xFFFFFFFFL;
  418|  13.0k|        ret ^= v * v;
  419|  13.0k|        c++;
  420|  13.0k|    }
  421|  1.08k|    return (ret >> 16) ^ ret;
  422|  1.08k|}
OPENSSL_LH_error:
  440|    252|{
  441|    252|    return lh->error;
  442|    252|}
lhash.c:doall_util_fn:
  191|      2|{
  192|      2|    int i;
  193|      2|    OPENSSL_LH_NODE *a, *n;
  194|       |
  195|      2|    if (lh == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 2]
  ------------------
  196|      0|        return;
  197|       |
  198|       |    /*
  199|       |     * reverse the order so we search from 'top to bottom' We were having
  200|       |     * memory leaks otherwise
  201|       |     */
  202|    246|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (202:33): [True: 244, False: 2]
  ------------------
  203|    244|        a = lh->b[i];
  204|    728|        while (a != NULL) {
  ------------------
  |  Branch (204:16): [True: 484, False: 244]
  ------------------
  205|    484|            n = a->next;
  206|    484|            if (use_arg)
  ------------------
  |  Branch (206:17): [True: 484, False: 0]
  ------------------
  207|    484|                wfunc_arg(a->data, arg, func_arg);
  208|      0|            else
  209|      0|                wfunc(a->data, func);
  210|    484|            a = n;
  211|    484|        }
  212|    244|    }
  213|      2|}
lhash.c:expand:
  243|  1.05k|{
  244|  1.05k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  245|  1.05k|    unsigned int p, pmax, nni, j;
  246|  1.05k|    unsigned long hash;
  247|       |
  248|  1.05k|    nni = lh->num_alloc_nodes;
  249|  1.05k|    p = lh->p;
  250|  1.05k|    pmax = lh->pmax;
  251|  1.05k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (251:9): [True: 9, False: 1.04k]
  ------------------
  252|      9|        j = nni * 2;
  253|      9|        n = OPENSSL_realloc_array(lh->b, j, sizeof(OPENSSL_LH_NODE *));
  ------------------
  |  |  129|      9|    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  254|      9|        if (n == NULL) {
  ------------------
  |  Branch (254:13): [True: 0, False: 9]
  ------------------
  255|      0|            lh->error++;
  256|      0|            return 0;
  257|      0|        }
  258|      9|        lh->b = n;
  259|      9|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  260|      9|        lh->pmax = nni;
  261|      9|        lh->num_alloc_nodes = j;
  262|      9|        lh->p = 0;
  263|  1.04k|    } else {
  264|  1.04k|        lh->p++;
  265|  1.04k|    }
  266|       |
  267|  1.05k|    lh->num_nodes++;
  268|  1.05k|    n1 = &(lh->b[p]);
  269|  1.05k|    n2 = &(lh->b[p + pmax]);
  270|  1.05k|    *n2 = NULL;
  271|       |
  272|  4.24k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (272:20): [True: 3.19k, False: 1.05k]
  ------------------
  273|  3.19k|        hash = np->hash;
  274|  3.19k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (274:13): [True: 553, False: 2.64k]
  ------------------
  275|    553|            *n1 = (*n1)->next;
  276|    553|            np->next = *n2;
  277|    553|            *n2 = np;
  278|    553|        } else
  279|  2.64k|            n1 = &((*n1)->next);
  280|  3.19k|        np = *n1;
  281|  3.19k|    }
  282|       |
  283|  1.05k|    return 1;
  284|  1.05k|}
lhash.c:getrn:
  320|  6.11k|{
  321|  6.11k|    OPENSSL_LH_NODE **ret, *n1;
  322|  6.11k|    unsigned long hash, nn;
  323|       |
  324|  6.11k|    if (lh->hashw != NULL)
  ------------------
  |  Branch (324:9): [True: 6.11k, False: 0]
  ------------------
  325|  6.11k|        hash = lh->hashw(data, lh->hash);
  326|      0|    else
  327|      0|        hash = lh->hash(data);
  328|       |
  329|  6.11k|    *rhash = hash;
  330|       |
  331|  6.11k|    nn = hash % lh->pmax;
  332|  6.11k|    if (nn < lh->p)
  ------------------
  |  Branch (332:9): [True: 3.16k, False: 2.95k]
  ------------------
  333|  3.16k|        nn = hash % lh->num_alloc_nodes;
  334|       |
  335|  6.11k|    ret = &(lh->b[(int)nn]);
  336|  15.8k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (336:21): [True: 13.4k, False: 2.39k]
  ------------------
  337|  13.4k|        if (n1->hash != hash) {
  ------------------
  |  Branch (337:13): [True: 9.56k, False: 3.92k]
  ------------------
  338|  9.56k|            ret = &(n1->next);
  339|  9.56k|            continue;
  340|  9.56k|        }
  341|       |
  342|  3.92k|        if (lh->compw != NULL) {
  ------------------
  |  Branch (342:13): [True: 3.92k, False: 0]
  ------------------
  343|  3.92k|            if (lh->compw(n1->data, data, lh->comp) == 0)
  ------------------
  |  Branch (343:17): [True: 3.71k, False: 208]
  ------------------
  344|  3.71k|                break;
  345|  3.92k|        } else {
  346|      0|            if (lh->comp(n1->data, data) == 0)
  ------------------
  |  Branch (346:17): [True: 0, False: 0]
  ------------------
  347|      0|                break;
  348|      0|        }
  349|    208|        ret = &(n1->next);
  350|    208|    }
  351|  6.11k|    return ret;
  352|  6.11k|}

CRYPTO_malloc:
  207|  5.88k|{
  208|  5.88k|    void *ptr;
  209|       |
  210|  5.88k|    INCREMENT(malloc_count);
  211|  5.88k|    FAILTEST();
  212|  5.88k|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (212:9): [True: 0, False: 5.88k]
  ------------------
  213|      0|        ptr = malloc_impl(num, file, line);
  214|      0|        if (ptr != NULL || num == 0)
  ------------------
  |  Branch (214:13): [True: 0, False: 0]
  |  Branch (214:28): [True: 0, False: 0]
  ------------------
  215|      0|            return ptr;
  216|      0|        goto err;
  217|      0|    }
  218|       |
  219|  5.88k|    if (ossl_unlikely(num == 0))
  ------------------
  |  |   24|  5.88k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 5.88k]
  |  |  ------------------
  ------------------
  220|      0|        return NULL;
  221|       |
  222|  5.88k|    if (allow_customize) {
  ------------------
  |  Branch (222:9): [True: 1, False: 5.87k]
  ------------------
  223|      1|        TSAN_BENIGN(&allow_customize,
  224|      1|            "allow_customize is intentionally racy");
  225|       |        /*
  226|       |         * Disallow customization after the first allocation. We only set this
  227|       |         * if necessary to avoid a store to the same cache line on every
  228|       |         * allocation.
  229|       |         */
  230|      1|        allow_customize = 0;
  231|      1|    }
  232|       |
  233|  5.88k|    ptr = malloc(num);
  234|  5.88k|    if (ossl_likely(ptr != NULL))
  ------------------
  |  |   23|  5.88k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 5.88k, False: 0]
  |  |  ------------------
  ------------------
  235|  5.88k|        return ptr;
  236|      0|err:
  237|      0|    ossl_report_alloc_err(file, line);
  238|       |    return NULL;
  239|  5.88k|}
CRYPTO_zalloc:
  242|  1.96k|{
  243|  1.96k|    void *ret;
  244|       |
  245|  1.96k|    ret = CRYPTO_malloc(num, file, line);
  246|  1.96k|    if (ret != NULL)
  ------------------
  |  Branch (246:9): [True: 1.96k, False: 0]
  ------------------
  247|  1.96k|        memset(ret, 0, num);
  248|       |
  249|  1.96k|    return ret;
  250|  1.96k|}
CRYPTO_aligned_alloc:
  254|      1|{
  255|      1|    *freeptr = NULL;
  256|       |
  257|       |    /* Ensure that alignment is a power of two no larger than 65536 */
  258|      1|    if (alignment == 0 || (alignment & (alignment - 1)) != 0
  ------------------
  |  Branch (258:9): [True: 0, False: 1]
  |  Branch (258:27): [True: 0, False: 1]
  ------------------
  259|      1|        || alignment > 65536) {
  ------------------
  |  Branch (259:12): [True: 0, False: 1]
  ------------------
  260|      0|        ossl_report_alloc_err_inv(file, line);
  261|      0|        return NULL;
  262|      0|    }
  263|       |
  264|       |    /* Allow non-malloc() allocations as long as no malloc_impl is provided. */
  265|      1|    if (malloc_impl == CRYPTO_malloc) {
  ------------------
  |  Branch (265:9): [True: 1, False: 0]
  ------------------
  266|      1|#if defined(_BSD_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L)
  267|      1|        void *ret;
  268|       |
  269|       |        /* posix_memalign() requires alignment to be at least sizeof(void *) */
  270|      1|        if (alignment < sizeof(void *))
  ------------------
  |  Branch (270:13): [True: 0, False: 1]
  ------------------
  271|      0|            alignment = sizeof(void *);
  272|       |
  273|      1|        if (posix_memalign(&ret, alignment, num) == 0) {
  ------------------
  |  Branch (273:13): [True: 1, False: 0]
  ------------------
  274|      1|            *freeptr = ret;
  275|      1|            return ret;
  276|      1|        }
  277|      1|#endif
  278|      1|    }
  279|       |
  280|      0|    return ossl_malloc_align(num, alignment, freeptr, file, line);
  281|      1|}
CRYPTO_realloc:
  284|     26|{
  285|     26|    void *ret;
  286|       |
  287|     26|    INCREMENT(realloc_count);
  288|     26|    FAILTEST();
  289|     26|    if (realloc_impl != CRYPTO_realloc) {
  ------------------
  |  Branch (289:9): [True: 0, False: 26]
  ------------------
  290|      0|        ret = realloc_impl(str, num, file, line);
  291|       |
  292|      0|        if (num == 0 || ret != NULL)
  ------------------
  |  Branch (292:13): [True: 0, False: 0]
  |  Branch (292:25): [True: 0, False: 0]
  ------------------
  293|      0|            return ret;
  294|       |
  295|      0|        goto err;
  296|      0|    }
  297|       |
  298|     26|    if (str == NULL)
  ------------------
  |  Branch (298:9): [True: 2, False: 24]
  ------------------
  299|      2|        return CRYPTO_malloc(num, file, line);
  300|       |
  301|     24|    if (num == 0) {
  ------------------
  |  Branch (301:9): [True: 0, False: 24]
  ------------------
  302|      0|        CRYPTO_free(str, file, line);
  303|      0|        return NULL;
  304|      0|    }
  305|       |
  306|     24|    ret = realloc(str, num);
  307|       |
  308|     24|err:
  309|     24|    if (num != 0 && ret == NULL)
  ------------------
  |  Branch (309:9): [True: 24, False: 0]
  |  Branch (309:21): [True: 0, False: 24]
  ------------------
  310|      0|        ossl_report_alloc_err(file, line);
  311|       |
  312|     24|    return ret;
  313|     24|}
CRYPTO_free:
  343|    739|{
  344|    739|    INCREMENT(free_count);
  345|    739|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (345:9): [True: 0, False: 739]
  ------------------
  346|      0|        free_impl(str, file, line);
  347|      0|        return;
  348|      0|    }
  349|       |
  350|    739|    free(str);
  351|    739|}
CRYPTO_clear_free:
  354|      1|{
  355|      1|    if (str == NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 1]
  ------------------
  356|      0|        return;
  357|      1|    if (num)
  ------------------
  |  Branch (357:9): [True: 1, False: 0]
  ------------------
  358|      1|        OPENSSL_cleanse(str, num);
  359|      1|    CRYPTO_free(str, file, line);
  360|      1|}

CRYPTO_secure_malloc:
  156|      2|{
  157|      2|#ifndef OPENSSL_NO_SECURE_MEMORY
  158|      2|    void *ret = NULL;
  159|      2|    size_t actual_size;
  160|      2|    int reason = CRYPTO_R_SECURE_MALLOC_FAILURE;
  ------------------
  |  |   45|      2|#define CRYPTO_R_SECURE_MALLOC_FAILURE 111
  ------------------
  161|       |
  162|      2|    if (!secure_mem_initialized) {
  ------------------
  |  Branch (162:9): [True: 2, False: 0]
  ------------------
  163|      2|        return CRYPTO_malloc(num, file, line);
  164|      2|    }
  165|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock)) {
  ------------------
  |  Branch (165:9): [True: 0, False: 0]
  ------------------
  166|      0|        reason = ERR_R_CRYPTO_LIB;
  ------------------
  |  |  281|      0|#define ERR_R_CRYPTO_LIB (ERR_LIB_CRYPTO /* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   68|      0|#define ERR_LIB_CRYPTO 15
  |  |  ------------------
  |  |               #define ERR_R_CRYPTO_LIB (ERR_LIB_CRYPTO /* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  220|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|      0|        goto err;
  168|      0|    }
  169|      0|    ret = sh_malloc(num);
  170|      0|    actual_size = ret ? sh_actual_size(ret) : 0;
  ------------------
  |  Branch (170:19): [True: 0, False: 0]
  ------------------
  171|      0|    secure_mem_used += actual_size;
  172|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  173|      0|err:
  174|      0|    if (ret == NULL && (file != NULL || line != 0)) {
  ------------------
  |  Branch (174:9): [True: 0, False: 0]
  |  Branch (174:25): [True: 0, False: 0]
  |  Branch (174:41): [True: 0, False: 0]
  ------------------
  175|      0|        ERR_new();
  176|      0|        ERR_set_debug(file, line, NULL);
  177|      0|        ERR_set_error(ERR_LIB_CRYPTO, reason, NULL);
  ------------------
  |  |   68|      0|#define ERR_LIB_CRYPTO 15
  ------------------
  178|      0|    }
  179|      0|    return ret;
  180|       |#else
  181|       |    return CRYPTO_malloc(num, file, line);
  182|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  183|      0|}
CRYPTO_secure_zalloc:
  186|      5|{
  187|      5|#ifndef OPENSSL_NO_SECURE_MEMORY
  188|      5|    if (secure_mem_initialized)
  ------------------
  |  Branch (188:9): [True: 0, False: 5]
  ------------------
  189|       |        /* CRYPTO_secure_malloc() zeroes allocations when it is implemented */
  190|      0|        return CRYPTO_secure_malloc(num, file, line);
  191|      5|#endif
  192|      5|    return CRYPTO_zalloc(num, file, line);
  193|      5|}
CRYPTO_secure_clear_free:
  220|      8|{
  221|      8|#ifndef OPENSSL_NO_SECURE_MEMORY
  222|      8|    size_t actual_size;
  223|       |
  224|      8|    if (ptr == NULL)
  ------------------
  |  Branch (224:9): [True: 3, False: 5]
  ------------------
  225|      3|        return;
  226|      5|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (226:9): [True: 5, False: 0]
  ------------------
  227|      5|        OPENSSL_cleanse(ptr, num);
  228|      5|        CRYPTO_free(ptr, file, line);
  229|      5|        return;
  230|      5|    }
  231|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock))
  ------------------
  |  Branch (231:9): [True: 0, False: 0]
  ------------------
  232|      0|        return;
  233|      0|    actual_size = sh_actual_size(ptr);
  234|      0|    CLEAR(ptr, actual_size);
  ------------------
  |  |   83|      0|#define CLEAR(p, s) OPENSSL_cleanse(p, s)
  ------------------
  235|      0|    secure_mem_used -= actual_size;
  236|      0|    sh_free(ptr);
  237|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  238|       |#else
  239|       |    if (ptr == NULL)
  240|       |        return;
  241|       |    OPENSSL_cleanse(ptr, num);
  242|       |    CRYPTO_free(ptr, file, line);
  243|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  244|      0|}
CRYPTO_secure_allocated:
  247|      5|{
  248|      5|#ifndef OPENSSL_NO_SECURE_MEMORY
  249|      5|    if (!secure_mem_initialized)
  ------------------
  |  Branch (249:9): [True: 5, False: 0]
  ------------------
  250|      5|        return 0;
  251|       |    /*
  252|       |     * Only read accesses to the arena take place in sh_allocated() and this
  253|       |     * is only changed by the sh_init() and sh_done() calls which are not
  254|       |     * locked.  Hence, it is safe to make this check without a lock too.
  255|       |     */
  256|      0|    return sh_allocated(ptr);
  257|       |#else
  258|       |    return 0;
  259|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  260|      5|}

CRYPTO_ctr128_encrypt_ctr32:
  155|      4|{
  156|      4|    unsigned int n, ctr32;
  157|       |
  158|      4|    n = *num;
  159|       |
  160|      4|    while (n && len) {
  ------------------
  |  Branch (160:12): [True: 0, False: 4]
  |  Branch (160:17): [True: 0, False: 0]
  ------------------
  161|      0|        *(out++) = *(in++) ^ ecount_buf[n];
  162|      0|        --len;
  163|      0|        n = (n + 1) % 16;
  164|      0|    }
  165|       |
  166|      4|    ctr32 = GETU32(ivec + 12);
  ------------------
  |  |   94|      4|#define GETU32(p) BSWAP4(*(const uint32_t *)(p))
  |  |  ------------------
  |  |  |  |   39|      4|#define BSWAP4(x) ({ uint32_t ret_=(x);                   \
  |  |  |  |   40|      4|                        asm ("bswapl %0"                \
  |  |  |  |   41|      4|                        : "+r"(ret_));   ret_; })
  |  |  ------------------
  ------------------
  167|      8|    while (len >= 16) {
  ------------------
  |  Branch (167:12): [True: 4, False: 4]
  ------------------
  168|      4|        size_t blocks = len / 16;
  169|       |        /*
  170|       |         * 1<<28 is just a not-so-small yet not-so-large number...
  171|       |         * Below condition is practically never met, but it has to
  172|       |         * be checked for code correctness.
  173|       |         */
  174|      4|        if (sizeof(size_t) > sizeof(unsigned int) && blocks > (1U << 28))
  ------------------
  |  Branch (174:13): [True: 4, Folded]
  |  Branch (174:54): [True: 0, False: 4]
  ------------------
  175|      0|            blocks = (1U << 28);
  176|       |        /*
  177|       |         * As (*func) operates on 32-bit counter, caller
  178|       |         * has to handle overflow. 'if' below detects the
  179|       |         * overflow, which is then handled by limiting the
  180|       |         * amount of blocks to the exact overflow point...
  181|       |         */
  182|      4|        ctr32 += (uint32_t)blocks;
  183|      4|        if (ctr32 < blocks) {
  ------------------
  |  Branch (183:13): [True: 0, False: 4]
  ------------------
  184|      0|            blocks -= ctr32;
  185|      0|            ctr32 = 0;
  186|      0|        }
  187|      4|        (*func)(in, out, blocks, key, ivec);
  188|       |        /* (*ctr) does not update ivec, caller does: */
  189|      4|        PUTU32(ivec + 12, ctr32);
  ------------------
  |  |   95|      4|#define PUTU32(p, v) *(uint32_t *)(p) = BSWAP4(v)
  |  |  ------------------
  |  |  |  |   39|      4|#define BSWAP4(x) ({ uint32_t ret_=(x);                   \
  |  |  |  |   40|      4|                        asm ("bswapl %0"                \
  |  |  |  |   41|      4|                        : "+r"(ret_));   ret_; })
  |  |  ------------------
  ------------------
  190|       |        /* ... overflow was detected, propagate carry. */
  191|      4|        if (ctr32 == 0)
  ------------------
  |  Branch (191:13): [True: 0, False: 4]
  ------------------
  192|      0|            ctr96_inc(ivec);
  193|      4|        blocks *= 16;
  194|      4|        len -= blocks;
  195|      4|        out += blocks;
  196|      4|        in += blocks;
  197|      4|    }
  198|      4|    if (len) {
  ------------------
  |  Branch (198:9): [True: 0, False: 4]
  ------------------
  199|      0|        memset(ecount_buf, 0, 16);
  200|      0|        (*func)(ecount_buf, ecount_buf, 1, key, ivec);
  201|      0|        ++ctr32;
  202|      0|        PUTU32(ivec + 12, ctr32);
  ------------------
  |  |   95|      0|#define PUTU32(p, v) *(uint32_t *)(p) = BSWAP4(v)
  |  |  ------------------
  |  |  |  |   39|      0|#define BSWAP4(x) ({ uint32_t ret_=(x);                   \
  |  |  |  |   40|      0|                        asm ("bswapl %0"                \
  |  |  |  |   41|      0|                        : "+r"(ret_));   ret_; })
  |  |  ------------------
  ------------------
  203|      0|        if (ctr32 == 0)
  ------------------
  |  Branch (203:13): [True: 0, False: 0]
  ------------------
  204|      0|            ctr96_inc(ivec);
  205|      0|        while (len--) {
  ------------------
  |  Branch (205:16): [True: 0, False: 0]
  ------------------
  206|      0|            out[n] = in[n] ^ ecount_buf[n];
  207|      0|            ++n;
  208|      0|        }
  209|      0|    }
  210|       |
  211|      4|    *num = n;
  212|      4|}

openssl_fopen:
   39|      1|{
   40|      1|    FILE *file = NULL;
   41|       |#if defined(_WIN32) && defined(CP_UTF8)
   42|       |    int sz, len_0;
   43|       |    DWORD flags;
   44|       |#endif
   45|       |
   46|      1|    if (filename == NULL)
  ------------------
  |  Branch (46:9): [True: 0, False: 1]
  ------------------
   47|      0|        return NULL;
   48|       |#if defined(_WIN32) && defined(CP_UTF8)
   49|       |    len_0 = (int)strlen(filename) + 1;
   50|       |
   51|       |    /*
   52|       |     * Basically there are three cases to cover: a) filename is
   53|       |     * pure ASCII string; b) actual UTF-8 encoded string and
   54|       |     * c) locale-ized string, i.e. one containing 8-bit
   55|       |     * characters that are meaningful in current system locale.
   56|       |     * If filename is pure ASCII or real UTF-8 encoded string,
   57|       |     * MultiByteToWideChar succeeds and _wfopen works. If
   58|       |     * filename is locale-ized string, chances are that
   59|       |     * MultiByteToWideChar fails reporting
   60|       |     * ERROR_NO_UNICODE_TRANSLATION, in which case we fall
   61|       |     * back to fopen...
   62|       |     */
   63|       |    if ((sz = MultiByteToWideChar(CP_UTF8, (flags = MB_ERR_INVALID_CHARS),
   64|       |             filename, len_0, NULL, 0))
   65|       |            > 0
   66|       |        || (GetLastError() == ERROR_INVALID_FLAGS && (sz = MultiByteToWideChar(CP_UTF8, (flags = 0), filename, len_0, NULL, 0)) > 0)) {
   67|       |        WCHAR wmode[8];
   68|       |        WCHAR *wfilename = _alloca(sz * sizeof(WCHAR));
   69|       |
   70|       |        if (MultiByteToWideChar(CP_UTF8, flags,
   71|       |                filename, len_0, wfilename, sz)
   72|       |            && MultiByteToWideChar(CP_UTF8, 0, mode, (int)(strlen(mode) + 1),
   73|       |                wmode, OSSL_NELEM(wmode))
   74|       |            && (file = _wfopen(wfilename, wmode)) == NULL && (errno == ENOENT || errno == EBADF)) {
   75|       |            /*
   76|       |             * UTF-8 decode succeeded, but no file, filename
   77|       |             * could still have been locale-ized...
   78|       |             */
   79|       |            file = fopen(filename, mode);
   80|       |        }
   81|       |    } else if (GetLastError() == ERROR_NO_UNICODE_TRANSLATION) {
   82|       |        file = fopen(filename, mode);
   83|       |    }
   84|       |#elif defined(__DJGPP__)
   85|       |    {
   86|       |        char *newname = NULL;
   87|       |
   88|       |        if (pathconf(filename, _PC_NAME_MAX) <= 12) { /* 8.3 file system? */
   89|       |            char *iterator;
   90|       |            char lastchar;
   91|       |
   92|       |            if ((newname = OPENSSL_malloc(strlen(filename) + 1)) == NULL)
   93|       |                return NULL;
   94|       |
   95|       |            for (iterator = newname, lastchar = '\0';
   96|       |                *filename; filename++, iterator++) {
   97|       |                if (lastchar == '/' && filename[0] == '.'
   98|       |                    && filename[1] != '.' && filename[1] != '/') {
   99|       |                    /* Leading dots are not permitted in plain DOS. */
  100|       |                    *iterator = '_';
  101|       |                } else {
  102|       |                    *iterator = *filename;
  103|       |                }
  104|       |                lastchar = *filename;
  105|       |            }
  106|       |            *iterator = '\0';
  107|       |            filename = newname;
  108|       |        }
  109|       |        file = fopen(filename, mode);
  110|       |
  111|       |        OPENSSL_free(newname);
  112|       |    }
  113|       |#else
  114|      1|    file = fopen(filename, mode);
  115|      1|#endif
  116|      1|    return file;
  117|      1|}

CRYPTO_strdup:
   23|    571|{
   24|    571|    char *ret;
   25|    571|    size_t len;
   26|       |
   27|    571|    if (str == NULL)
  ------------------
  |  Branch (27:9): [True: 0, False: 571]
  ------------------
   28|      0|        return NULL;
   29|       |
   30|    571|    len = strlen(str) + 1;
   31|    571|    ret = CRYPTO_malloc(len, file, line);
   32|    571|    if (ret != NULL)
  ------------------
  |  Branch (32:9): [True: 571, False: 0]
  ------------------
   33|    571|        memcpy(ret, str, len);
   34|    571|    return ret;
   35|    571|}
CRYPTO_strndup:
   38|    168|{
   39|    168|    size_t maxlen;
   40|    168|    char *ret;
   41|       |
   42|    168|    if (str == NULL)
  ------------------
  |  Branch (42:9): [True: 0, False: 168]
  ------------------
   43|      0|        return NULL;
   44|       |
   45|    168|    maxlen = OPENSSL_strnlen(str, s);
   46|       |
   47|    168|    ret = CRYPTO_malloc(maxlen + 1, file, line);
   48|    168|    if (ret) {
  ------------------
  |  Branch (48:9): [True: 168, False: 0]
  ------------------
   49|    168|        memcpy(ret, str, maxlen);
   50|    168|        ret[maxlen] = CH_ZERO;
  ------------------
  |  |   20|    168|#define CH_ZERO '\0'
  ------------------
   51|    168|    }
   52|    168|    return ret;
   53|    168|}
OPENSSL_strnlen:
   69|    168|{
   70|    168|    const char *p;
   71|       |
   72|  2.22k|    for (p = str; maxlen-- != 0 && *p != CH_ZERO; ++p)
  ------------------
  |  |   20|  2.05k|#define CH_ZERO '\0'
  ------------------
  |  Branch (72:19): [True: 2.05k, False: 168]
  |  Branch (72:36): [True: 2.05k, False: 0]
  ------------------
   73|  2.05k|        ;
   74|       |
   75|    168|    return p - str;
   76|    168|}
OPENSSL_strlcpy:
   79|  1.36k|{
   80|  1.36k|    size_t l = 0;
   81|  5.23k|    for (; size > 1 && *src; size--) {
  ------------------
  |  Branch (81:12): [True: 5.23k, False: 0]
  |  Branch (81:24): [True: 3.86k, False: 1.36k]
  ------------------
   82|  3.86k|        *dst++ = *src++;
   83|  3.86k|        l++;
   84|  3.86k|    }
   85|  1.36k|    if (size)
  ------------------
  |  Branch (85:9): [True: 1.36k, False: 0]
  ------------------
   86|  1.36k|        *dst = CH_ZERO;
  ------------------
  |  |   20|  1.36k|#define CH_ZERO '\0'
  ------------------
   87|  1.36k|    return l + strlen(src);
   88|  1.36k|}
OPENSSL_hexchar2int:
  211|    768|{
  212|       |#ifdef CHARSET_EBCDIC
  213|       |    c = os_toebcdic[c];
  214|       |#endif
  215|       |
  216|    768|    switch (c) {
  ------------------
  |  Branch (216:13): [True: 768, False: 0]
  ------------------
  217|     33|    case '0':
  ------------------
  |  Branch (217:5): [True: 33, False: 735]
  ------------------
  218|     33|        return 0;
  219|     44|    case '1':
  ------------------
  |  Branch (219:5): [True: 44, False: 724]
  ------------------
  220|     44|        return 1;
  221|     48|    case '2':
  ------------------
  |  Branch (221:5): [True: 48, False: 720]
  ------------------
  222|     48|        return 2;
  223|     56|    case '3':
  ------------------
  |  Branch (223:5): [True: 56, False: 712]
  ------------------
  224|     56|        return 3;
  225|     44|    case '4':
  ------------------
  |  Branch (225:5): [True: 44, False: 724]
  ------------------
  226|     44|        return 4;
  227|     42|    case '5':
  ------------------
  |  Branch (227:5): [True: 42, False: 726]
  ------------------
  228|     42|        return 5;
  229|     51|    case '6':
  ------------------
  |  Branch (229:5): [True: 51, False: 717]
  ------------------
  230|     51|        return 6;
  231|     35|    case '7':
  ------------------
  |  Branch (231:5): [True: 35, False: 733]
  ------------------
  232|     35|        return 7;
  233|     43|    case '8':
  ------------------
  |  Branch (233:5): [True: 43, False: 725]
  ------------------
  234|     43|        return 8;
  235|     32|    case '9':
  ------------------
  |  Branch (235:5): [True: 32, False: 736]
  ------------------
  236|     32|        return 9;
  237|      0|    case 'a':
  ------------------
  |  Branch (237:5): [True: 0, False: 768]
  ------------------
  238|     39|    case 'A':
  ------------------
  |  Branch (238:5): [True: 39, False: 729]
  ------------------
  239|     39|        return 0x0A;
  240|      0|    case 'b':
  ------------------
  |  Branch (240:5): [True: 0, False: 768]
  ------------------
  241|     44|    case 'B':
  ------------------
  |  Branch (241:5): [True: 44, False: 724]
  ------------------
  242|     44|        return 0x0B;
  243|      0|    case 'c':
  ------------------
  |  Branch (243:5): [True: 0, False: 768]
  ------------------
  244|     46|    case 'C':
  ------------------
  |  Branch (244:5): [True: 46, False: 722]
  ------------------
  245|     46|        return 0x0C;
  246|      0|    case 'd':
  ------------------
  |  Branch (246:5): [True: 0, False: 768]
  ------------------
  247|     42|    case 'D':
  ------------------
  |  Branch (247:5): [True: 42, False: 726]
  ------------------
  248|     42|        return 0x0D;
  249|      0|    case 'e':
  ------------------
  |  Branch (249:5): [True: 0, False: 768]
  ------------------
  250|     53|    case 'E':
  ------------------
  |  Branch (250:5): [True: 53, False: 715]
  ------------------
  251|     53|        return 0x0E;
  252|      0|    case 'f':
  ------------------
  |  Branch (252:5): [True: 0, False: 768]
  ------------------
  253|    116|    case 'F':
  ------------------
  |  Branch (253:5): [True: 116, False: 652]
  ------------------
  254|    116|        return 0x0F;
  255|    768|    }
  256|      0|    return -1;
  257|    768|}
OPENSSL_strcasecmp:
  472|    679|{
  473|    679|    int t;
  474|       |
  475|  8.10k|    while ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) == 0)
  ------------------
  |  Branch (475:12): [True: 8.10k, False: 1]
  ------------------
  476|  8.10k|        if (*s1++ == '\0')
  ------------------
  |  Branch (476:13): [True: 678, False: 7.42k]
  ------------------
  477|    678|            return 0;
  478|      1|    return t;
  479|    679|}

OBJ_NAME_init:
   58|    988|{
   59|    988|    return RUN_ONCE(&init, o_names_init);
  ------------------
  |  |  130|    988|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 988, False: 0]
  |  |  ------------------
  ------------------
   60|    988|}
OBJ_NAME_get:
  147|    564|{
  148|    564|    OBJ_NAME on, *ret;
  149|    564|    int num = 0, alias;
  150|    564|    const char *value = NULL;
  151|       |
  152|    564|    if (name == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 564]
  ------------------
  153|      0|        return NULL;
  154|    564|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (154:9): [True: 0, False: 564]
  ------------------
  155|      0|        return NULL;
  156|    564|    if (!CRYPTO_THREAD_read_lock(obj_lock))
  ------------------
  |  Branch (156:9): [True: 0, False: 564]
  ------------------
  157|      0|        return NULL;
  158|       |
  159|    564|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    564|#define OBJ_NAME_ALIAS 0x8000
  ------------------
  160|    564|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    564|#define OBJ_NAME_ALIAS 0x8000
  ------------------
  161|       |
  162|    564|    on.name = name;
  163|    564|    on.type = type;
  164|       |
  165|    659|    for (;;) {
  166|    659|        ret = lh_OBJ_NAME_retrieve(names_lh, &on);
  167|    659|        if (ret == NULL)
  ------------------
  |  Branch (167:13): [True: 165, False: 494]
  ------------------
  168|    165|            break;
  169|    494|        if ((ret->alias) && !alias) {
  ------------------
  |  Branch (169:13): [True: 95, False: 399]
  |  Branch (169:29): [True: 95, False: 0]
  ------------------
  170|     95|            if (++num > 10)
  ------------------
  |  Branch (170:17): [True: 0, False: 95]
  ------------------
  171|      0|                break;
  172|     95|            on.name = ret->data;
  173|    399|        } else {
  174|    399|            value = ret->data;
  175|    399|            break;
  176|    399|        }
  177|    494|    }
  178|       |
  179|    564|    CRYPTO_THREAD_unlock(obj_lock);
  180|    564|    return value;
  181|    564|}
OBJ_NAME_add:
  184|    424|{
  185|    424|    OBJ_NAME *onp, *ret;
  186|    424|    int alias, ok = 0;
  187|       |
  188|    424|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (188:9): [True: 0, False: 424]
  ------------------
  189|      0|        return 0;
  190|       |
  191|    424|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    424|#define OBJ_NAME_ALIAS 0x8000
  ------------------
  192|    424|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    424|#define OBJ_NAME_ALIAS 0x8000
  ------------------
  193|       |
  194|    424|    onp = OPENSSL_malloc(sizeof(*onp));
  ------------------
  |  |  111|    424|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  195|    424|    if (onp == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 424]
  ------------------
  196|      0|        return 0;
  197|       |
  198|    424|    onp->name = name;
  199|    424|    onp->alias = alias;
  200|    424|    onp->type = type;
  201|    424|    onp->data = data;
  202|       |
  203|    424|    if (!CRYPTO_THREAD_write_lock(obj_lock)) {
  ------------------
  |  Branch (203:9): [True: 0, False: 424]
  ------------------
  204|      0|        OPENSSL_free(onp);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  205|      0|        return 0;
  206|      0|    }
  207|       |
  208|    424|    ret = lh_OBJ_NAME_insert(names_lh, onp);
  209|    424|    if (ret != NULL) {
  ------------------
  |  Branch (209:9): [True: 182, False: 242]
  ------------------
  210|       |        /* free things */
  211|    182|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (211:13): [True: 0, False: 182]
  ------------------
  212|      0|            && (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
  ------------------
  |  Branch (212:16): [True: 0, False: 0]
  ------------------
  213|       |            /*
  214|       |             * XXX: I'm not sure I understand why the free function should
  215|       |             * get three arguments... -- Richard Levitte
  216|       |             */
  217|      0|            sk_NAME_FUNCS_value(name_funcs_stack,
  218|      0|                ret->type)
  219|      0|                ->free_func(ret->name, ret->type,
  220|      0|                    ret->data);
  221|      0|        }
  222|    182|        OPENSSL_free(ret);
  ------------------
  |  |  136|    182|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|    242|    } else {
  224|    242|        if (lh_OBJ_NAME_error(names_lh)) {
  ------------------
  |  Branch (224:13): [True: 0, False: 242]
  ------------------
  225|       |            /* ERROR */
  226|      0|            OPENSSL_free(onp);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  227|      0|            goto unlock;
  228|      0|        }
  229|    242|    }
  230|       |
  231|    424|    ok = 1;
  232|       |
  233|    424|unlock:
  234|    424|    CRYPTO_THREAD_unlock(obj_lock);
  235|    424|    return ok;
  236|    424|}
OBJ_NAME_do_all:
  290|      2|{
  291|      2|    OBJ_DOALL d;
  292|       |
  293|      2|    d.type = type;
  294|      2|    d.fn = fn;
  295|      2|    d.arg = arg;
  296|       |
  297|      2|    lh_OBJ_NAME_doall_OBJ_DOALL(names_lh, do_all_fn, &d);
  298|      2|}
o_names.c:o_names_init:
   45|      1|{
   46|      1|    names_lh = NULL;
   47|      1|    obj_lock = CRYPTO_THREAD_lock_new();
   48|      1|    if (obj_lock != NULL)
  ------------------
  |  Branch (48:9): [True: 1, False: 0]
  ------------------
   49|      1|        names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
   50|      1|    if (names_lh == NULL) {
  ------------------
  |  Branch (50:9): [True: 0, False: 1]
  ------------------
   51|      0|        CRYPTO_THREAD_lock_free(obj_lock);
   52|      0|        obj_lock = NULL;
   53|      0|    }
   54|      1|    return names_lh != NULL && obj_lock != NULL;
  ------------------
  |  Branch (54:12): [True: 1, False: 0]
  |  Branch (54:32): [True: 1, False: 0]
  ------------------
   55|      1|}
o_names.c:obj_name_hash:
  131|  1.08k|{
  132|  1.08k|    unsigned long ret;
  133|       |
  134|  1.08k|    if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 1.08k]
  ------------------
  135|      0|        && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
  ------------------
  |  Branch (135:12): [True: 0, False: 0]
  ------------------
  136|      0|        ret = sk_NAME_FUNCS_value(name_funcs_stack,
  137|      0|            a->type)
  138|      0|                  ->hash_func(a->name);
  139|  1.08k|    } else {
  140|  1.08k|        ret = ossl_lh_strcasehash(a->name);
  141|  1.08k|    }
  142|  1.08k|    ret ^= a->type;
  143|  1.08k|    return ret;
  144|  1.08k|}
o_names.c:obj_name_cmp:
  114|    676|{
  115|    676|    int ret;
  116|       |
  117|    676|    ret = a->type - b->type;
  118|    676|    if (ret == 0) {
  ------------------
  |  Branch (118:9): [True: 676, False: 0]
  ------------------
  119|    676|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (119:13): [True: 0, False: 676]
  ------------------
  120|      0|            && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
  ------------------
  |  Branch (120:16): [True: 0, False: 0]
  ------------------
  121|      0|            ret = sk_NAME_FUNCS_value(name_funcs_stack,
  122|      0|                a->type)
  123|      0|                      ->cmp_func(a->name, b->name);
  124|      0|        } else
  125|    676|            ret = OPENSSL_strcasecmp(a->name, b->name);
  126|    676|    }
  127|    676|    return ret;
  128|    676|}
o_names.c:do_all_fn:
  281|    484|{
  282|    484|    if (name->type == d->type)
  ------------------
  |  Branch (282:9): [True: 242, False: 242]
  ------------------
  283|    242|        d->fn(name, d->arg);
  284|    484|}

OBJ_nid2obj:
  255|  1.16k|{
  256|  1.16k|    ADDED_OBJ ad, *adp = NULL;
  257|  1.16k|    ASN1_OBJECT ob;
  258|       |
  259|  1.16k|    if (n == NID_undef
  ------------------
  |  |   19|  2.32k|#define NID_undef                       0
  ------------------
  |  Branch (259:9): [True: 0, False: 1.16k]
  ------------------
  260|  1.16k|        || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  | 1372|  2.32k|#define NUM_NID 1505
  ------------------
                      || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  |   19|  1.16k|#define NID_undef                       0
  ------------------
  |  Branch (260:13): [True: 1.16k, False: 0]
  |  Branch (260:22): [True: 1.16k, False: 0]
  |  Branch (260:37): [True: 1.16k, False: 0]
  ------------------
  261|  1.16k|        return (ASN1_OBJECT *)&(nid_objs[n]);
  262|       |
  263|      0|    ad.type = ADDED_NID;
  ------------------
  |  |   34|      0|#define ADDED_NID 3
  ------------------
  264|      0|    ad.obj = &ob;
  265|      0|    ob.nid = n;
  266|      0|    if (!ossl_obj_read_lock()) {
  ------------------
  |  Branch (266:9): [True: 0, False: 0]
  ------------------
  267|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  268|      0|        return NULL;
  269|      0|    }
  270|      0|    adp = lh_ADDED_OBJ_retrieve(added, &ad);
  271|      0|    ossl_obj_unlock();
  272|      0|    if (adp != NULL)
  ------------------
  |  Branch (272:9): [True: 0, False: 0]
  ------------------
  273|      0|        return adp->obj;
  274|       |
  275|      0|    ERR_raise(ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  276|       |    return NULL;
  277|      0|}
OBJ_nid2sn:
  280|    396|{
  281|    396|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  282|       |
  283|    396|    return ob == NULL ? NULL : ob->sn;
  ------------------
  |  Branch (283:12): [True: 0, False: 396]
  ------------------
  284|    396|}
OBJ_nid2ln:
  287|    396|{
  288|    396|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  289|       |
  290|    396|    return ob == NULL ? NULL : ob->ln;
  ------------------
  |  Branch (290:12): [True: 0, False: 396]
  ------------------
  291|    396|}
OBJ_obj2txt:
  381|    210|{
  382|    210|    int i, n = 0, len, nid, first, use_bn;
  383|    210|    BIGNUM *bl;
  384|    210|    unsigned long l;
  385|    210|    const unsigned char *p;
  386|    210|    char tbuf[DECIMAL_SIZE(i) + DECIMAL_SIZE(l) + 2];
  387|    210|    const char *s;
  388|       |
  389|       |    /* Ensure that, at every state, |buf| is NUL-terminated. */
  390|    210|    if (buf != NULL && buf_len > 0)
  ------------------
  |  Branch (390:9): [True: 210, False: 0]
  |  Branch (390:24): [True: 210, False: 0]
  ------------------
  391|    210|        buf[0] = '\0';
  392|       |
  393|    210|    if (a == NULL || a->data == NULL)
  ------------------
  |  Branch (393:9): [True: 0, False: 210]
  |  Branch (393:22): [True: 4, False: 206]
  ------------------
  394|      4|        return 0;
  395|       |
  396|    206|    if (!no_name && (nid = OBJ_obj2nid(a)) != NID_undef) {
  ------------------
  |  |   19|      0|#define NID_undef                       0
  ------------------
  |  Branch (396:9): [True: 0, False: 206]
  |  Branch (396:21): [True: 0, False: 0]
  ------------------
  397|      0|        s = OBJ_nid2ln(nid);
  398|      0|        if (s == NULL)
  ------------------
  |  Branch (398:13): [True: 0, False: 0]
  ------------------
  399|      0|            s = OBJ_nid2sn(nid);
  400|      0|        if (s != NULL) {
  ------------------
  |  Branch (400:13): [True: 0, False: 0]
  ------------------
  401|      0|            if (buf != NULL)
  ------------------
  |  Branch (401:17): [True: 0, False: 0]
  ------------------
  402|      0|                return (int)OPENSSL_strlcpy(buf, s, buf_len);
  403|      0|            return (int)strlen(s);
  404|      0|        }
  405|      0|    }
  406|       |
  407|    206|    len = a->length;
  408|    206|    p = a->data;
  409|       |
  410|    206|    first = 1;
  411|    206|    bl = NULL;
  412|       |
  413|       |    /*
  414|       |     * RFC 2578 (STD 58) says this about OBJECT IDENTIFIERs:
  415|       |     *
  416|       |     * > 3.5. OBJECT IDENTIFIER values
  417|       |     * >
  418|       |     * > An OBJECT IDENTIFIER value is an ordered list of non-negative
  419|       |     * > numbers. For the SMIv2, each number in the list is referred to as a
  420|       |     * > sub-identifier, there are at most 128 sub-identifiers in a value,
  421|       |     * > and each sub-identifier has a maximum value of 2^32-1 (4294967295
  422|       |     * > decimal).
  423|       |     *
  424|       |     * So a legitimate OID according to this RFC is at most (32 * 128 / 7),
  425|       |     * i.e. 586 bytes long.
  426|       |     *
  427|       |     * Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
  428|       |     */
  429|    206|    if (len > 586)
  ------------------
  |  Branch (429:9): [True: 0, False: 206]
  ------------------
  430|      0|        goto err;
  431|       |
  432|  1.57k|    while (len > 0) {
  ------------------
  |  Branch (432:12): [True: 1.36k, False: 206]
  ------------------
  433|  1.36k|        l = 0;
  434|  1.36k|        use_bn = 0;
  435|  1.68k|        for (;;) {
  436|  1.68k|            unsigned char c = *p++;
  437|       |
  438|  1.68k|            len--;
  439|  1.68k|            if (len == 0 && (c & 0x80) != 0)
  ------------------
  |  Branch (439:17): [True: 206, False: 1.48k]
  |  Branch (439:29): [True: 0, False: 206]
  ------------------
  440|      0|                goto err;
  441|  1.68k|            if (use_bn) {
  ------------------
  |  Branch (441:17): [True: 0, False: 1.68k]
  ------------------
  442|      0|                if (!BN_add_word(bl, c & 0x7f))
  ------------------
  |  Branch (442:21): [True: 0, False: 0]
  ------------------
  443|      0|                    goto err;
  444|  1.68k|            } else {
  445|  1.68k|                l |= c & 0x7f;
  446|  1.68k|            }
  447|  1.68k|            if ((c & 0x80) == 0)
  ------------------
  |  Branch (447:17): [True: 1.36k, False: 322]
  ------------------
  448|  1.36k|                break;
  449|    322|            if (!use_bn && l > (ULONG_MAX >> 7L)) {
  ------------------
  |  Branch (449:17): [True: 322, False: 0]
  |  Branch (449:28): [True: 0, False: 322]
  ------------------
  450|      0|                if (bl == NULL && (bl = BN_new()) == NULL)
  ------------------
  |  Branch (450:21): [True: 0, False: 0]
  |  Branch (450:35): [True: 0, False: 0]
  ------------------
  451|      0|                    goto err;
  452|      0|                if (!BN_set_word(bl, l))
  ------------------
  |  Branch (452:21): [True: 0, False: 0]
  ------------------
  453|      0|                    goto err;
  454|      0|                use_bn = 1;
  455|      0|            }
  456|    322|            if (use_bn) {
  ------------------
  |  Branch (456:17): [True: 0, False: 322]
  ------------------
  457|      0|                if (!BN_lshift(bl, bl, 7))
  ------------------
  |  Branch (457:21): [True: 0, False: 0]
  ------------------
  458|      0|                    goto err;
  459|    322|            } else {
  460|    322|                l <<= 7L;
  461|    322|            }
  462|    322|        }
  463|       |
  464|  1.36k|        if (first) {
  ------------------
  |  Branch (464:13): [True: 206, False: 1.16k]
  ------------------
  465|    206|            first = 0;
  466|    206|            if (l >= 80) {
  ------------------
  |  Branch (466:17): [True: 81, False: 125]
  ------------------
  467|     81|                i = 2;
  468|     81|                if (use_bn) {
  ------------------
  |  Branch (468:21): [True: 0, False: 81]
  ------------------
  469|      0|                    if (!BN_sub_word(bl, 80))
  ------------------
  |  Branch (469:25): [True: 0, False: 0]
  ------------------
  470|      0|                        goto err;
  471|     81|                } else {
  472|     81|                    l -= 80;
  473|     81|                }
  474|    125|            } else {
  475|    125|                i = (int)(l / 40);
  476|    125|                l -= (long)(i * 40);
  477|    125|            }
  478|    206|            if (buf != NULL && buf_len > 1) {
  ------------------
  |  Branch (478:17): [True: 206, False: 0]
  |  Branch (478:32): [True: 206, False: 0]
  ------------------
  479|    206|                *buf++ = i + '0';
  480|    206|                *buf = '\0';
  481|    206|                buf_len--;
  482|    206|            }
  483|    206|            n++;
  484|    206|        }
  485|       |
  486|  1.36k|        if (use_bn) {
  ------------------
  |  Branch (486:13): [True: 0, False: 1.36k]
  ------------------
  487|      0|            char *bndec;
  488|      0|            bndec = BN_bn2dec(bl);
  489|      0|            if (!bndec)
  ------------------
  |  Branch (489:17): [True: 0, False: 0]
  ------------------
  490|      0|                goto err;
  491|      0|            i = (int)strlen(bndec);
  492|      0|            if (buf != NULL) {
  ------------------
  |  Branch (492:17): [True: 0, False: 0]
  ------------------
  493|      0|                if (buf_len > 1) {
  ------------------
  |  Branch (493:21): [True: 0, False: 0]
  ------------------
  494|      0|                    *buf++ = '.';
  495|      0|                    *buf = '\0';
  496|      0|                    buf_len--;
  497|      0|                }
  498|      0|                OPENSSL_strlcpy(buf, bndec, buf_len);
  499|      0|                if (i > buf_len) {
  ------------------
  |  Branch (499:21): [True: 0, False: 0]
  ------------------
  500|      0|                    buf += buf_len;
  501|      0|                    buf_len = 0;
  502|      0|                } else {
  503|      0|                    buf += i;
  504|      0|                    buf_len -= i;
  505|      0|                }
  506|      0|            }
  507|      0|            n++;
  508|      0|            n += i;
  509|      0|            OPENSSL_free(bndec);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  510|  1.36k|        } else {
  511|  1.36k|            snprintf(tbuf, sizeof(tbuf), ".%lu", l);
  512|  1.36k|            i = (int)strlen(tbuf);
  513|  1.36k|            if (buf && buf_len > 0) {
  ------------------
  |  Branch (513:17): [True: 1.36k, False: 0]
  |  Branch (513:24): [True: 1.36k, False: 0]
  ------------------
  514|  1.36k|                OPENSSL_strlcpy(buf, tbuf, buf_len);
  515|  1.36k|                if (i > buf_len) {
  ------------------
  |  Branch (515:21): [True: 0, False: 1.36k]
  ------------------
  516|      0|                    buf += buf_len;
  517|      0|                    buf_len = 0;
  518|  1.36k|                } else {
  519|  1.36k|                    buf += i;
  520|  1.36k|                    buf_len -= i;
  521|  1.36k|                }
  522|  1.36k|            }
  523|  1.36k|            n += i;
  524|  1.36k|            l = 0;
  525|  1.36k|        }
  526|  1.36k|    }
  527|       |
  528|    206|    BN_free(bl);
  529|    206|    return n;
  530|       |
  531|      0|err:
  532|      0|    BN_free(bl);
  533|      0|    return -1;
  534|    206|}
OBJ_get0_data:
  748|    159|{
  749|    159|    if (obj == NULL)
  ------------------
  |  Branch (749:9): [True: 0, False: 159]
  ------------------
  750|      0|        return NULL;
  751|    159|    return obj->data;
  752|    159|}

ossl_err_load_OBJ_strings:
   28|      1|{
   29|      1|#ifndef OPENSSL_NO_ERR
   30|      1|    if (ERR_reason_error_string(OBJ_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (30:9): [True: 1, False: 0]
  ------------------
   31|      1|        ERR_load_strings_const(OBJ_str_reasons);
   32|      1|#endif
   33|      1|    return 1;
   34|      1|}

ossl_err_load_OCSP_strings:
   66|      1|{
   67|      1|#ifndef OPENSSL_NO_ERR
   68|      1|    if (ERR_reason_error_string(OCSP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (68:9): [True: 1, False: 0]
  ------------------
   69|      1|        ERR_load_strings_const(OCSP_str_reasons);
   70|      1|#endif
   71|      1|    return 1;
   72|      1|}

OSSL_PARAM_locate:
   55|    137|{
   56|    137|    if (ossl_likely(p != NULL && key != NULL))
  ------------------
  |  |   23|    274|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 137, False: 0]
  |  |  |  Branch (23:44): [True: 137, False: 0]
  |  |  |  Branch (23:44): [True: 137, False: 0]
  |  |  ------------------
  ------------------
   57|  1.05k|        for (; p->key != NULL; p++)
  ------------------
  |  Branch (57:16): [True: 921, False: 133]
  ------------------
   58|    921|            if (strcmp(key, p->key) == 0)
  ------------------
  |  Branch (58:17): [True: 4, False: 917]
  ------------------
   59|      4|                return p;
   60|    133|    return NULL;
   61|    137|}
OSSL_PARAM_locate_const:
   64|    137|{
   65|    137|    return OSSL_PARAM_locate((OSSL_PARAM *)p, key);
   66|    137|}
OSSL_PARAM_modified:
   82|      2|{
   83|      2|    return p != NULL && p->return_size != OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|      2|#define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
  |  Branch (83:12): [True: 2, False: 0]
  |  Branch (83:25): [True: 2, False: 0]
  ------------------
   84|      2|}
OSSL_PARAM_get_int:
  268|     10|{
  269|     10|#ifndef OPENSSL_SMALL_FOOTPRINT
  270|     10|    switch (sizeof(int)) {
  ------------------
  |  Branch (270:13): [True: 10, Folded]
  ------------------
  271|     10|    case sizeof(int32_t):
  ------------------
  |  Branch (271:5): [True: 10, False: 0]
  ------------------
  272|     10|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
  273|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (273:5): [True: 0, False: 10]
  ------------------
  274|      0|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
  275|     10|    }
  276|      0|#endif
  277|      0|    return general_get_int(p, val, sizeof(*val));
  278|     10|}
OSSL_PARAM_set_int:
  281|    850|{
  282|    850|#ifndef OPENSSL_SMALL_FOOTPRINT
  283|    850|    switch (sizeof(int)) {
  ------------------
  |  Branch (283:13): [True: 850, Folded]
  ------------------
  284|    850|    case sizeof(int32_t):
  ------------------
  |  Branch (284:5): [True: 850, False: 0]
  ------------------
  285|    850|        return OSSL_PARAM_set_int32(p, (int32_t)val);
  286|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (286:5): [True: 0, False: 850]
  ------------------
  287|      0|        return OSSL_PARAM_set_int64(p, (int64_t)val);
  288|    850|    }
  289|      0|#endif
  290|      0|    return general_set_int(p, &val, sizeof(val));
  291|    850|}
OSSL_PARAM_construct_int:
  294|    849|{
  295|    849|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(int));
  ------------------
  |  |  106|    849|#define OSSL_PARAM_INTEGER 1
  ------------------
  296|    849|}
OSSL_PARAM_get_uint:
  299|      2|{
  300|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  301|      2|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (301:13): [True: 2, Folded]
  ------------------
  302|      2|    case sizeof(uint32_t):
  ------------------
  |  Branch (302:5): [True: 2, False: 0]
  ------------------
  303|      2|        return OSSL_PARAM_get_uint32(p, (uint32_t *)val);
  304|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (304:5): [True: 0, False: 2]
  ------------------
  305|      0|        return OSSL_PARAM_get_uint64(p, (uint64_t *)val);
  306|      2|    }
  307|      0|#endif
  308|      0|    return general_get_uint(p, val, sizeof(*val));
  309|      2|}
OSSL_PARAM_set_uint:
  312|    138|{
  313|    138|#ifndef OPENSSL_SMALL_FOOTPRINT
  314|    138|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (314:13): [True: 138, Folded]
  ------------------
  315|    138|    case sizeof(uint32_t):
  ------------------
  |  Branch (315:5): [True: 138, False: 0]
  ------------------
  316|    138|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
  317|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (317:5): [True: 0, False: 138]
  ------------------
  318|      0|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
  319|    138|    }
  320|      0|#endif
  321|      0|    return general_set_uint(p, &val, sizeof(val));
  322|    138|}
OSSL_PARAM_construct_uint:
  325|    147|{
  326|    147|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|    147|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  327|    147|        sizeof(unsigned int));
  328|    147|}
OSSL_PARAM_get_int32:
  394|     10|{
  395|     10|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (395:9): [True: 0, False: 10]
  |  Branch (395:24): [True: 0, False: 10]
  ------------------
  396|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  397|      0|        return 0;
  398|      0|    }
  399|       |
  400|     10|    if (p->data == NULL) {
  ------------------
  |  Branch (400:9): [True: 0, False: 10]
  ------------------
  401|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  402|      0|        return 0;
  403|      0|    }
  404|       |
  405|     10|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|     10|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (405:9): [True: 2, False: 8]
  ------------------
  406|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  407|      2|        int64_t i64;
  408|       |
  409|      2|        switch (p->data_size) {
  ------------------
  |  Branch (409:17): [True: 2, False: 0]
  ------------------
  410|      2|        case sizeof(int32_t):
  ------------------
  |  Branch (410:9): [True: 2, False: 0]
  ------------------
  411|      2|            *val = *(const int32_t *)p->data;
  412|      2|            return 1;
  413|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (413:9): [True: 0, False: 2]
  ------------------
  414|      0|            i64 = *(const int64_t *)p->data;
  415|      0|            if (i64 >= INT32_MIN && i64 <= INT32_MAX) {
  ------------------
  |  Branch (415:17): [True: 0, False: 0]
  |  Branch (415:37): [True: 0, False: 0]
  ------------------
  416|      0|                *val = (int32_t)i64;
  417|      0|                return 1;
  418|      0|            }
  419|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  420|      0|            return 0;
  421|      2|        }
  422|      0|#endif
  423|      0|        return general_get_int(p, val, sizeof(*val));
  424|       |
  425|      8|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      8|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (425:16): [True: 8, False: 0]
  ------------------
  426|      8|#ifndef OPENSSL_SMALL_FOOTPRINT
  427|      8|        uint32_t u32;
  428|      8|        uint64_t u64;
  429|       |
  430|      8|        switch (p->data_size) {
  ------------------
  |  Branch (430:17): [True: 8, False: 0]
  ------------------
  431|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (431:9): [True: 0, False: 8]
  ------------------
  432|      0|            u32 = *(const uint32_t *)p->data;
  433|      0|            if (u32 <= INT32_MAX) {
  ------------------
  |  Branch (433:17): [True: 0, False: 0]
  ------------------
  434|      0|                *val = (int32_t)u32;
  435|      0|                return 1;
  436|      0|            }
  437|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  438|      0|            return 0;
  439|      8|        case sizeof(uint64_t):
  ------------------
  |  Branch (439:9): [True: 8, False: 0]
  ------------------
  440|      8|            u64 = *(const uint64_t *)p->data;
  441|      8|            if (u64 <= INT32_MAX) {
  ------------------
  |  Branch (441:17): [True: 8, False: 0]
  ------------------
  442|      8|                *val = (int32_t)u64;
  443|      8|                return 1;
  444|      8|            }
  445|      0|            err_out_of_range;
  ------------------
  |  |   26|      8|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  446|      0|            return 0;
  447|      8|        }
  448|      0|#endif
  449|      0|        return general_get_int(p, val, sizeof(*val));
  450|       |
  451|      8|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (451:16): [True: 0, False: 0]
  ------------------
  452|      0|#ifndef OPENSSL_SYS_UEFI
  453|      0|        double d;
  454|       |
  455|      0|        switch (p->data_size) {
  ------------------
  |  Branch (455:17): [True: 0, False: 0]
  ------------------
  456|      0|        case sizeof(double):
  ------------------
  |  Branch (456:9): [True: 0, False: 0]
  ------------------
  457|      0|            d = *(const double *)p->data;
  458|      0|            if (d >= INT32_MIN && d <= INT32_MAX && d == (int32_t)d) {
  ------------------
  |  Branch (458:17): [True: 0, False: 0]
  |  Branch (458:35): [True: 0, False: 0]
  |  Branch (458:53): [True: 0, False: 0]
  ------------------
  459|      0|                *val = (int32_t)d;
  460|      0|                return 1;
  461|      0|            }
  462|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  463|      0|            return 0;
  464|      0|        }
  465|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|      0|        return 0;
  467|      0|#endif
  468|      0|    }
  469|      0|    err_bad_type;
  ------------------
  |  |   36|     10|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  470|      0|    return 0;
  471|     10|}
OSSL_PARAM_set_int32:
  474|    850|{
  475|    850|    if (p == NULL) {
  ------------------
  |  Branch (475:9): [True: 0, False: 850]
  ------------------
  476|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|      0|        return 0;
  478|      0|    }
  479|    850|    p->return_size = 0;
  480|    850|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|    850|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (480:9): [True: 847, False: 3]
  ------------------
  481|    847|#ifndef OPENSSL_SMALL_FOOTPRINT
  482|    847|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  483|    847|        if (p->data == NULL)
  ------------------
  |  Branch (483:13): [True: 0, False: 847]
  ------------------
  484|      0|            return 1;
  485|    847|        switch (p->data_size) {
  ------------------
  |  Branch (485:17): [True: 847, False: 0]
  ------------------
  486|    847|        case sizeof(int32_t):
  ------------------
  |  Branch (486:9): [True: 847, False: 0]
  ------------------
  487|    847|            *(int32_t *)p->data = val;
  488|    847|            return 1;
  489|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (489:9): [True: 0, False: 847]
  ------------------
  490|      0|            p->return_size = sizeof(int64_t);
  491|      0|            *(int64_t *)p->data = (int64_t)val;
  492|      0|            return 1;
  493|    847|        }
  494|      0|#endif
  495|      0|        return general_set_int(p, &val, sizeof(val));
  496|    847|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER && val >= 0) {
  ------------------
  |  |  107|      6|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (496:16): [True: 3, False: 0]
  |  Branch (496:63): [True: 3, False: 0]
  ------------------
  497|      3|#ifndef OPENSSL_SMALL_FOOTPRINT
  498|      3|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  499|      3|        if (p->data == NULL)
  ------------------
  |  Branch (499:13): [True: 0, False: 3]
  ------------------
  500|      0|            return 1;
  501|      3|        switch (p->data_size) {
  ------------------
  |  Branch (501:17): [True: 3, False: 0]
  ------------------
  502|      3|        case sizeof(uint32_t):
  ------------------
  |  Branch (502:9): [True: 3, False: 0]
  ------------------
  503|      3|            *(uint32_t *)p->data = (uint32_t)val;
  504|      3|            return 1;
  505|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (505:9): [True: 0, False: 3]
  ------------------
  506|      0|            p->return_size = sizeof(uint64_t);
  507|      0|            *(uint64_t *)p->data = (uint64_t)val;
  508|      0|            return 1;
  509|      3|        }
  510|      0|#endif
  511|      0|        return general_set_int(p, &val, sizeof(val));
  512|      3|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (512:16): [True: 0, False: 0]
  ------------------
  513|      0|#ifndef OPENSSL_SYS_UEFI
  514|      0|        uint32_t u32;
  515|      0|        unsigned int shift;
  516|       |
  517|      0|        p->return_size = sizeof(double);
  518|      0|        if (p->data == NULL)
  ------------------
  |  Branch (518:13): [True: 0, False: 0]
  ------------------
  519|      0|            return 1;
  520|      0|        switch (p->data_size) {
  ------------------
  |  Branch (520:17): [True: 0, False: 0]
  ------------------
  521|      0|        case sizeof(double):
  ------------------
  |  Branch (521:9): [True: 0, False: 0]
  ------------------
  522|      0|            shift = real_shift();
  523|      0|            if (shift < 8 * sizeof(val) - 1) {
  ------------------
  |  Branch (523:17): [True: 0, False: 0]
  ------------------
  524|      0|                u32 = val < 0 ? -val : val;
  ------------------
  |  Branch (524:23): [True: 0, False: 0]
  ------------------
  525|      0|                if ((u32 >> shift) != 0) {
  ------------------
  |  Branch (525:21): [True: 0, False: 0]
  ------------------
  526|      0|                    err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  527|      0|                    return 0;
  528|      0|                }
  529|      0|            }
  530|      0|            *(double *)p->data = (double)val;
  531|      0|            return 1;
  532|      0|        }
  533|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  534|      0|        return 0;
  535|      0|#endif
  536|      0|    }
  537|      0|    err_bad_type;
  ------------------
  |  |   36|    850|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  538|      0|    return 0;
  539|    850|}
OSSL_PARAM_get_uint32:
  548|      2|{
  549|      2|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (549:9): [True: 0, False: 2]
  |  Branch (549:24): [True: 0, False: 2]
  ------------------
  550|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  551|      0|        return 0;
  552|      0|    }
  553|       |
  554|      2|    if (p->data == NULL) {
  ------------------
  |  Branch (554:9): [True: 0, False: 2]
  ------------------
  555|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  556|      0|        return 0;
  557|      0|    }
  558|       |
  559|      2|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      2|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (559:9): [True: 2, False: 0]
  ------------------
  560|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  561|      2|        uint64_t u64;
  562|       |
  563|      2|        switch (p->data_size) {
  ------------------
  |  Branch (563:17): [True: 2, False: 0]
  ------------------
  564|      2|        case sizeof(uint32_t):
  ------------------
  |  Branch (564:9): [True: 2, False: 0]
  ------------------
  565|      2|            *val = *(const uint32_t *)p->data;
  566|      2|            return 1;
  567|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (567:9): [True: 0, False: 2]
  ------------------
  568|      0|            u64 = *(const uint64_t *)p->data;
  569|      0|            if (u64 <= UINT32_MAX) {
  ------------------
  |  Branch (569:17): [True: 0, False: 0]
  ------------------
  570|      0|                *val = (uint32_t)u64;
  571|      0|                return 1;
  572|      0|            }
  573|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  574|      0|            return 0;
  575|      2|        }
  576|      0|#endif
  577|      0|        return general_get_uint(p, val, sizeof(*val));
  578|      2|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (578:16): [True: 0, False: 0]
  ------------------
  579|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  580|      0|        int32_t i32;
  581|      0|        int64_t i64;
  582|       |
  583|      0|        switch (p->data_size) {
  ------------------
  |  Branch (583:17): [True: 0, False: 0]
  ------------------
  584|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (584:9): [True: 0, False: 0]
  ------------------
  585|      0|            i32 = *(const int32_t *)p->data;
  586|      0|            if (i32 >= 0) {
  ------------------
  |  Branch (586:17): [True: 0, False: 0]
  ------------------
  587|      0|                *val = i32;
  588|      0|                return 1;
  589|      0|            }
  590|      0|            err_unsigned_negative;
  ------------------
  |  |   23|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  591|      0|            return 0;
  592|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (592:9): [True: 0, False: 0]
  ------------------
  593|      0|            i64 = *(const int64_t *)p->data;
  594|      0|            if (i64 >= 0 && i64 <= UINT32_MAX) {
  ------------------
  |  Branch (594:17): [True: 0, False: 0]
  |  Branch (594:29): [True: 0, False: 0]
  ------------------
  595|      0|                *val = (uint32_t)i64;
  596|      0|                return 1;
  597|      0|            }
  598|      0|            if (i64 < 0)
  ------------------
  |  Branch (598:17): [True: 0, False: 0]
  ------------------
  599|      0|                err_unsigned_negative;
  ------------------
  |  |   23|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  600|      0|            else
  601|      0|                err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  602|      0|            return 0;
  603|      0|        }
  604|      0|#endif
  605|      0|        return general_get_uint(p, val, sizeof(*val));
  606|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (606:16): [True: 0, False: 0]
  ------------------
  607|      0|#ifndef OPENSSL_SYS_UEFI
  608|      0|        double d;
  609|       |
  610|      0|        switch (p->data_size) {
  ------------------
  |  Branch (610:17): [True: 0, False: 0]
  ------------------
  611|      0|        case sizeof(double):
  ------------------
  |  Branch (611:9): [True: 0, False: 0]
  ------------------
  612|      0|            d = *(const double *)p->data;
  613|      0|            if (d >= 0 && d <= UINT32_MAX && d == (uint32_t)d) {
  ------------------
  |  Branch (613:17): [True: 0, False: 0]
  |  Branch (613:27): [True: 0, False: 0]
  |  Branch (613:46): [True: 0, False: 0]
  ------------------
  614|      0|                *val = (uint32_t)d;
  615|      0|                return 1;
  616|      0|            }
  617|      0|            err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  618|      0|            return 0;
  619|      0|        }
  620|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  621|      0|        return 0;
  622|      0|#endif
  623|      0|    }
  624|      0|    err_bad_type;
  ------------------
  |  |   36|      2|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  625|      0|    return 0;
  626|      2|}
OSSL_PARAM_set_uint32:
  629|    138|{
  630|    138|    if (p == NULL) {
  ------------------
  |  Branch (630:9): [True: 0, False: 138]
  ------------------
  631|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  632|      0|        return 0;
  633|      0|    }
  634|    138|    p->return_size = 0;
  635|       |
  636|    138|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|    138|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (636:9): [True: 138, False: 0]
  ------------------
  637|    138|#ifndef OPENSSL_SMALL_FOOTPRINT
  638|    138|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  639|    138|        if (p->data == NULL)
  ------------------
  |  Branch (639:13): [True: 0, False: 138]
  ------------------
  640|      0|            return 1;
  641|    138|        switch (p->data_size) {
  ------------------
  |  Branch (641:17): [True: 138, False: 0]
  ------------------
  642|    138|        case sizeof(uint32_t):
  ------------------
  |  Branch (642:9): [True: 138, False: 0]
  ------------------
  643|    138|            *(uint32_t *)p->data = val;
  644|    138|            return 1;
  645|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (645:9): [True: 0, False: 138]
  ------------------
  646|      0|            p->return_size = sizeof(uint64_t);
  647|      0|            *(uint64_t *)p->data = val;
  648|      0|            return 1;
  649|    138|        }
  650|      0|#endif
  651|      0|        return general_set_uint(p, &val, sizeof(val));
  652|    138|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (652:16): [True: 0, False: 0]
  ------------------
  653|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  654|      0|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  655|      0|        if (p->data == NULL)
  ------------------
  |  Branch (655:13): [True: 0, False: 0]
  ------------------
  656|      0|            return 1;
  657|      0|        switch (p->data_size) {
  ------------------
  |  Branch (657:17): [True: 0, False: 0]
  ------------------
  658|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (658:9): [True: 0, False: 0]
  ------------------
  659|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (659:17): [True: 0, False: 0]
  ------------------
  660|      0|                *(int32_t *)p->data = (int32_t)val;
  661|      0|                return 1;
  662|      0|            }
  663|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  664|      0|            return 0;
  665|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (665:9): [True: 0, False: 0]
  ------------------
  666|      0|            p->return_size = sizeof(int64_t);
  667|      0|            *(int64_t *)p->data = (int64_t)val;
  668|      0|            return 1;
  669|      0|        }
  670|      0|#endif
  671|      0|        return general_set_uint(p, &val, sizeof(val));
  672|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (672:16): [True: 0, False: 0]
  ------------------
  673|      0|#ifndef OPENSSL_SYS_UEFI
  674|      0|        unsigned int shift;
  675|       |
  676|      0|        if (p->data == NULL) {
  ------------------
  |  Branch (676:13): [True: 0, False: 0]
  ------------------
  677|      0|            p->return_size = sizeof(double);
  678|      0|            return 1;
  679|      0|        }
  680|      0|        switch (p->data_size) {
  ------------------
  |  Branch (680:17): [True: 0, False: 0]
  ------------------
  681|      0|        case sizeof(double):
  ------------------
  |  Branch (681:9): [True: 0, False: 0]
  ------------------
  682|      0|            shift = real_shift();
  683|      0|            if (shift < 8 * sizeof(val) && (val >> shift) != 0) {
  ------------------
  |  Branch (683:17): [True: 0, False: 0]
  |  Branch (683:44): [True: 0, False: 0]
  ------------------
  684|      0|                err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  685|      0|                return 0;
  686|      0|            }
  687|      0|            *(double *)p->data = (double)val;
  688|      0|            p->return_size = sizeof(double);
  689|      0|            return 1;
  690|      0|        }
  691|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|      0|        return 0;
  693|      0|#endif
  694|      0|    }
  695|      0|    err_bad_type;
  ------------------
  |  |   36|    138|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|      0|    return 0;
  697|    138|}
OSSL_PARAM_get_int64:
  706|      2|{
  707|      2|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (707:9): [True: 0, False: 2]
  |  Branch (707:24): [True: 0, False: 2]
  ------------------
  708|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  709|      0|        return 0;
  710|      0|    }
  711|       |
  712|      2|    if (p->data == NULL) {
  ------------------
  |  Branch (712:9): [True: 0, False: 2]
  ------------------
  713|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  714|      0|        return 0;
  715|      0|    }
  716|       |
  717|      2|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      2|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (717:9): [True: 2, False: 0]
  ------------------
  718|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  719|      2|        switch (p->data_size) {
  ------------------
  |  Branch (719:17): [True: 2, False: 0]
  ------------------
  720|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (720:9): [True: 0, False: 2]
  ------------------
  721|      0|            *val = *(const int32_t *)p->data;
  722|      0|            return 1;
  723|      2|        case sizeof(int64_t):
  ------------------
  |  Branch (723:9): [True: 2, False: 0]
  ------------------
  724|      2|            *val = *(const int64_t *)p->data;
  725|      2|            return 1;
  726|      2|        }
  727|      0|#endif
  728|      0|        return general_get_int(p, val, sizeof(*val));
  729|      2|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      0|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (729:16): [True: 0, False: 0]
  ------------------
  730|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  731|      0|        uint64_t u64;
  732|       |
  733|      0|        switch (p->data_size) {
  ------------------
  |  Branch (733:17): [True: 0, False: 0]
  ------------------
  734|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (734:9): [True: 0, False: 0]
  ------------------
  735|      0|            *val = *(const uint32_t *)p->data;
  736|      0|            return 1;
  737|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (737:9): [True: 0, False: 0]
  ------------------
  738|      0|            u64 = *(const uint64_t *)p->data;
  739|      0|            if (u64 <= INT64_MAX) {
  ------------------
  |  Branch (739:17): [True: 0, False: 0]
  ------------------
  740|      0|                *val = (int64_t)u64;
  741|      0|                return 1;
  742|      0|            }
  743|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  744|      0|            return 0;
  745|      0|        }
  746|      0|#endif
  747|      0|        return general_get_int(p, val, sizeof(*val));
  748|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (748:16): [True: 0, False: 0]
  ------------------
  749|      0|#ifndef OPENSSL_SYS_UEFI
  750|      0|        double d;
  751|       |
  752|      0|        switch (p->data_size) {
  ------------------
  |  Branch (752:17): [True: 0, False: 0]
  ------------------
  753|      0|        case sizeof(double):
  ------------------
  |  Branch (753:9): [True: 0, False: 0]
  ------------------
  754|      0|            d = *(const double *)p->data;
  755|      0|            if (d >= INT64_MIN
  ------------------
  |  Branch (755:17): [True: 0, False: 0]
  ------------------
  756|       |                /*
  757|       |                 * By subtracting 65535 (2^16-1) we cancel the low order
  758|       |                 * 15 bits of INT64_MAX to avoid using imprecise floating
  759|       |                 * point values.
  760|       |                 */
  761|      0|                && d < (double)(INT64_MAX - 65535) + 65536.0
  ------------------
  |  Branch (761:20): [True: 0, False: 0]
  ------------------
  762|      0|                && d == (int64_t)d) {
  ------------------
  |  Branch (762:20): [True: 0, False: 0]
  ------------------
  763|      0|                *val = (int64_t)d;
  764|      0|                return 1;
  765|      0|            }
  766|      0|            err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  767|      0|            return 0;
  768|      0|        }
  769|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  770|      0|        return 0;
  771|      0|#endif
  772|      0|    }
  773|      0|    err_bad_type;
  ------------------
  |  |   36|      2|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  774|      0|    return 0;
  775|      2|}
OSSL_PARAM_set_uint64:
  939|    463|{
  940|    463|    if (p == NULL) {
  ------------------
  |  Branch (940:9): [True: 0, False: 463]
  ------------------
  941|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  942|      0|        return 0;
  943|      0|    }
  944|    463|    p->return_size = 0;
  945|       |
  946|    463|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|    463|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (946:9): [True: 463, False: 0]
  ------------------
  947|    463|#ifndef OPENSSL_SMALL_FOOTPRINT
  948|    463|        if (p->data == NULL) {
  ------------------
  |  Branch (948:13): [True: 0, False: 463]
  ------------------
  949|      0|            p->return_size = sizeof(uint64_t); /* Expected size */
  950|      0|            return 1;
  951|      0|        }
  952|    463|        switch (p->data_size) {
  ------------------
  |  Branch (952:17): [True: 463, False: 0]
  ------------------
  953|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (953:9): [True: 0, False: 463]
  ------------------
  954|      0|            if (val <= UINT32_MAX) {
  ------------------
  |  Branch (954:17): [True: 0, False: 0]
  ------------------
  955|      0|                p->return_size = sizeof(uint32_t);
  956|      0|                *(uint32_t *)p->data = (uint32_t)val;
  957|      0|                return 1;
  958|      0|            }
  959|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  960|      0|            return 0;
  961|    463|        case sizeof(uint64_t):
  ------------------
  |  Branch (961:9): [True: 463, False: 0]
  ------------------
  962|    463|            p->return_size = sizeof(uint64_t);
  963|    463|            *(uint64_t *)p->data = val;
  964|    463|            return 1;
  965|    463|        }
  966|      0|#endif
  967|      0|        return general_set_uint(p, &val, sizeof(val));
  968|    463|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (968:16): [True: 0, False: 0]
  ------------------
  969|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  970|      0|        if (p->data == NULL) {
  ------------------
  |  Branch (970:13): [True: 0, False: 0]
  ------------------
  971|      0|            p->return_size = sizeof(int64_t); /* Expected size */
  972|      0|            return 1;
  973|      0|        }
  974|      0|        switch (p->data_size) {
  ------------------
  |  Branch (974:17): [True: 0, False: 0]
  ------------------
  975|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (975:9): [True: 0, False: 0]
  ------------------
  976|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (976:17): [True: 0, False: 0]
  ------------------
  977|      0|                p->return_size = sizeof(int32_t);
  978|      0|                *(int32_t *)p->data = (int32_t)val;
  979|      0|                return 1;
  980|      0|            }
  981|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  982|      0|            return 0;
  983|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (983:9): [True: 0, False: 0]
  ------------------
  984|      0|            if (val <= INT64_MAX) {
  ------------------
  |  Branch (984:17): [True: 0, False: 0]
  ------------------
  985|      0|                p->return_size = sizeof(int64_t);
  986|      0|                *(int64_t *)p->data = (int64_t)val;
  987|      0|                return 1;
  988|      0|            }
  989|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  990|      0|            return 0;
  991|      0|        }
  992|      0|#endif
  993|      0|        return general_set_uint(p, &val, sizeof(val));
  994|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (994:16): [True: 0, False: 0]
  ------------------
  995|      0|#ifndef OPENSSL_SYS_UEFI
  996|      0|        switch (p->data_size) {
  ------------------
  |  Branch (996:17): [True: 0, False: 0]
  ------------------
  997|      0|        case sizeof(double):
  ------------------
  |  Branch (997:9): [True: 0, False: 0]
  ------------------
  998|      0|            if ((val >> real_shift()) == 0) {
  ------------------
  |  Branch (998:17): [True: 0, False: 0]
  ------------------
  999|      0|                p->return_size = sizeof(double);
 1000|      0|                *(double *)p->data = (double)val;
 1001|      0|                return 1;
 1002|      0|            }
 1003|      0|            err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
 1004|      0|            return 0;
 1005|      0|        }
 1006|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1007|      0|        return 0;
 1008|      0|#endif
 1009|      0|    }
 1010|      0|    err_bad_type;
  ------------------
  |  |   36|    463|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  361|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1011|      0|    return 0;
 1012|    463|}
OSSL_PARAM_set_size_t:
 1034|    463|{
 1035|    463|#ifndef OPENSSL_SMALL_FOOTPRINT
 1036|    463|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1036:13): [True: 463, Folded]
  ------------------
 1037|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1037:5): [True: 0, False: 463]
  ------------------
 1038|      0|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
 1039|    463|    case sizeof(uint64_t):
  ------------------
  |  Branch (1039:5): [True: 463, False: 0]
  ------------------
 1040|    463|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
 1041|    463|    }
 1042|      0|#endif
 1043|      0|    return general_set_uint(p, &val, sizeof(val));
 1044|    463|}
OSSL_PARAM_construct_size_t:
 1047|    463|{
 1048|    463|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|    463|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
 1049|    463|        sizeof(size_t));
 1050|    463|}
OSSL_PARAM_get_time_t:
 1053|      2|{
 1054|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
 1055|      2|    switch (sizeof(time_t)) {
  ------------------
  |  Branch (1055:13): [True: 2, Folded]
  ------------------
 1056|      0|    case sizeof(int32_t):
  ------------------
  |  Branch (1056:5): [True: 0, False: 2]
  ------------------
 1057|      0|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
 1058|      2|    case sizeof(int64_t):
  ------------------
  |  Branch (1058:5): [True: 2, False: 0]
  ------------------
 1059|      2|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
 1060|      2|    }
 1061|      0|#endif
 1062|      0|    return general_get_int(p, val, sizeof(*val));
 1063|      2|}
OSSL_PARAM_construct_time_t:
 1079|      2|{
 1080|      2|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(time_t));
  ------------------
  |  |  106|      2|#define OSSL_PARAM_INTEGER 1
  ------------------
 1081|      2|}
OSSL_PARAM_construct_utf8_string:
 1463|      2|{
 1464|      2|    if (buf != NULL && bsize == 0)
  ------------------
  |  Branch (1464:9): [True: 2, False: 0]
  |  Branch (1464:24): [True: 2, False: 0]
  ------------------
 1465|      2|        bsize = strlen(buf);
 1466|      2|    return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  ------------------
  |  |  117|      2|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
 1467|      2|}
OSSL_PARAM_construct_end:
 1665|    163|{
 1666|    163|    OSSL_PARAM end = OSSL_PARAM_END;
  ------------------
  |  |   25|    163|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1667|       |
 1668|    163|    return end;
 1669|    163|}
params.c:ossl_param_construct:
   70|  1.46k|{
   71|  1.46k|    OSSL_PARAM res;
   72|       |
   73|  1.46k|    res.key = key;
   74|  1.46k|    res.data_type = data_type;
   75|  1.46k|    res.data = data;
   76|  1.46k|    res.data_size = data_size;
   77|  1.46k|    res.return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  1.46k|#define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   78|  1.46k|    return res;
   79|  1.46k|}

ossl_err_load_PEM_strings:
   70|      1|{
   71|      1|#ifndef OPENSSL_NO_ERR
   72|      1|    if (ERR_reason_error_string(PEM_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (72:9): [True: 1, False: 0]
  ------------------
   73|      1|        ERR_load_strings_const(PEM_str_reasons);
   74|      1|#endif
   75|      1|    return 1;
   76|      1|}

ossl_err_load_PKCS12_strings:
   58|      1|{
   59|      1|#ifndef OPENSSL_NO_ERR
   60|      1|    if (ERR_reason_error_string(PKCS12_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (60:9): [True: 1, False: 0]
  ------------------
   61|      1|        ERR_load_strings_const(PKCS12_str_reasons);
   62|      1|#endif
   63|      1|    return 1;
   64|      1|}

ossl_err_load_PKCS7_strings:
   92|      1|{
   93|      1|#ifndef OPENSSL_NO_ERR
   94|      1|    if (ERR_reason_error_string(PKCS7_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (94:9): [True: 1, False: 0]
  ------------------
   95|      1|        ERR_load_strings_const(PKCS7_str_reasons);
   96|      1|#endif
   97|      1|    return 1;
   98|      1|}

ossl_property_defns_new:
   63|      1|{
   64|      1|    return lh_PROPERTY_DEFN_ELEM_new(&property_defn_hash, &property_defn_cmp);
   65|      1|}
ossl_prop_defn_get:
   68|    166|{
   69|    166|    PROPERTY_DEFN_ELEM elem, *r;
   70|    166|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
  ------------------
  |  |  156|    166|#define LHASH_OF(type) struct lhash_st_##type
  ------------------
   71|       |
   72|    166|    property_defns = ossl_lib_ctx_get_data(ctx,
   73|    166|        OSSL_LIB_CTX_PROPERTY_DEFN_INDEX);
  ------------------
  |  |   98|    166|#define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX 2
  ------------------
   74|    166|    if (!ossl_assert(property_defns != NULL) || !ossl_lib_ctx_read_lock(ctx))
  ------------------
  |  |   45|    166|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|    332|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (74:9): [True: 0, False: 166]
  |  Branch (74:49): [True: 0, False: 166]
  ------------------
   75|      0|        return NULL;
   76|       |
   77|    166|    elem.prop = prop;
   78|    166|    r = lh_PROPERTY_DEFN_ELEM_retrieve(property_defns, &elem);
   79|    166|    ossl_lib_ctx_unlock(ctx);
   80|    166|    if (r == NULL || !ossl_assert(r->defn != NULL))
  ------------------
  |  |   45|    165|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|    165|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (80:9): [True: 1, False: 165]
  |  Branch (80:22): [True: 0, False: 165]
  ------------------
   81|      1|        return NULL;
   82|    165|    return r->defn;
   83|    166|}
ossl_prop_defn_set:
   92|      1|{
   93|      1|    PROPERTY_DEFN_ELEM elem, *old, *p = NULL;
   94|      1|    size_t len;
   95|      1|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
  ------------------
  |  |  156|      1|#define LHASH_OF(type) struct lhash_st_##type
  ------------------
   96|      1|    int res = 1;
   97|       |
   98|      1|    property_defns = ossl_lib_ctx_get_data(ctx,
   99|      1|        OSSL_LIB_CTX_PROPERTY_DEFN_INDEX);
  ------------------
  |  |   98|      1|#define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX 2
  ------------------
  100|      1|    if (property_defns == NULL)
  ------------------
  |  Branch (100:9): [True: 0, False: 1]
  ------------------
  101|      0|        return 0;
  102|       |
  103|      1|    if (prop == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 1]
  ------------------
  104|      0|        return 1;
  105|       |
  106|      1|    if (!ossl_lib_ctx_write_lock(ctx))
  ------------------
  |  Branch (106:9): [True: 0, False: 1]
  ------------------
  107|      0|        return 0;
  108|      1|    elem.prop = prop;
  109|      1|    if (pl == NULL) {
  ------------------
  |  Branch (109:9): [True: 0, False: 1]
  ------------------
  110|      0|        lh_PROPERTY_DEFN_ELEM_delete(property_defns, &elem);
  111|      0|        goto end;
  112|      0|    }
  113|       |    /* check if property definition is in the cache already */
  114|      1|    if ((p = lh_PROPERTY_DEFN_ELEM_retrieve(property_defns, &elem)) != NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 1]
  ------------------
  115|      0|        ossl_property_free(*pl);
  116|      0|        *pl = p->defn;
  117|      0|        goto end;
  118|      0|    }
  119|      1|    len = strlen(prop);
  120|      1|    p = OPENSSL_malloc(sizeof(*p) + len);
  ------------------
  |  |  111|      1|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      1|    if (p != NULL) {
  ------------------
  |  Branch (121:9): [True: 1, False: 0]
  ------------------
  122|      1|        p->prop = p->body;
  123|      1|        p->defn = *pl;
  124|      1|        memcpy(p->body, prop, len + 1);
  125|      1|        old = lh_PROPERTY_DEFN_ELEM_insert(property_defns, p);
  126|      1|        if (!ossl_assert(old == NULL))
  ------------------
  |  |   45|      1|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      1|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (126:13): [True: 0, False: 1]
  ------------------
  127|       |            /* This should not happen. An existing entry is handled above. */
  128|      0|            goto end;
  129|      1|        if (!lh_PROPERTY_DEFN_ELEM_error(property_defns))
  ------------------
  |  Branch (129:13): [True: 1, False: 0]
  ------------------
  130|      1|            goto end;
  131|      1|    }
  132|      0|    OPENSSL_free(p);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|      0|    res = 0;
  134|      1|end:
  135|      1|    ossl_lib_ctx_unlock(ctx);
  136|      1|    return res;
  137|      0|}
defn_cache.c:property_defn_hash:
   35|    168|{
   36|    168|    return OPENSSL_LH_strhash(a->prop);
   37|    168|}
defn_cache.c:property_defn_cmp:
   41|    165|{
   42|    165|    return strcmp(a->prop, b->prop);
   43|    165|}

ossl_ctx_global_properties_new:
  163|      1|{
  164|      1|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  165|      1|}
ossl_ctx_global_properties:
  169|      5|{
  170|      5|    OSSL_GLOBAL_PROPERTIES *globp;
  171|       |
  172|      5|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  173|      5|    if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  553|      0|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
  |  Branch (173:9): [True: 0, False: 5]
  |  Branch (173:23): [True: 0, False: 0]
  ------------------
  174|      0|        return NULL;
  175|      5|#endif
  176|      5|    globp = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES);
  ------------------
  |  |  112|      5|#define OSSL_LIB_CTX_GLOBAL_PROPERTIES 14
  ------------------
  177|       |
  178|      5|    return globp != NULL ? &globp->list : NULL;
  ------------------
  |  Branch (178:12): [True: 5, False: 0]
  ------------------
  179|      5|}
ossl_method_store_new:
  326|      4|{
  327|      4|    OSSL_METHOD_STORE *res;
  328|       |
  329|      4|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  113|      4|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  330|      4|    if (res != NULL) {
  ------------------
  |  Branch (330:9): [True: 4, False: 0]
  ------------------
  331|      4|        res->ctx = ctx;
  332|      4|        if ((res->algs = stored_algs_new(ctx)) == NULL
  ------------------
  |  Branch (332:13): [True: 0, False: 4]
  ------------------
  333|      4|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (333:16): [True: 0, False: 4]
  ------------------
  334|      0|            ossl_method_store_free(res);
  335|      0|            return NULL;
  336|      0|        }
  337|      4|    }
  338|      4|    return res;
  339|      4|}
ossl_method_lock_store:
  352|      5|{
  353|      5|    return store != NULL ? CRYPTO_THREAD_write_lock(store->biglock) : 0;
  ------------------
  |  Branch (353:12): [True: 5, False: 0]
  ------------------
  354|      5|}
ossl_method_unlock_store:
  357|      5|{
  358|      5|    return store != NULL ? CRYPTO_THREAD_unlock(store->biglock) : 0;
  ------------------
  |  Branch (358:12): [True: 5, False: 0]
  ------------------
  359|      5|}
ossl_method_store_add:
  400|    166|{
  401|    166|    STORED_ALGORITHMS *sa;
  402|    166|    ALGORITHM *alg = NULL;
  403|    166|    IMPLEMENTATION *impl;
  404|    166|    int ret = 0;
  405|    166|    int i;
  406|       |
  407|    166|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (407:9): [True: 0, False: 166]
  |  Branch (407:21): [True: 0, False: 166]
  |  Branch (407:39): [True: 0, False: 166]
  ------------------
  408|      0|        return 0;
  409|       |
  410|    166|    if (properties == NULL)
  ------------------
  |  Branch (410:9): [True: 0, False: 166]
  ------------------
  411|      0|        properties = "";
  412|       |
  413|    166|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   45|    166|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|    166|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (413:9): [True: 0, False: 166]
  ------------------
  414|      0|        return 0;
  415|       |
  416|       |    /* Create new entry */
  417|    166|    impl = OPENSSL_malloc(sizeof(*impl));
  ------------------
  |  |  111|    166|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  418|    166|    if (impl == NULL)
  ------------------
  |  Branch (418:9): [True: 0, False: 166]
  ------------------
  419|      0|        return 0;
  420|    166|    impl->archived = 0;
  421|    166|    impl->method.method = method;
  422|    166|    impl->method.up_ref = method_up_ref;
  423|    166|    impl->method.free = method_destruct;
  424|    166|    if (!ossl_method_up_ref(&impl->method)) {
  ------------------
  |  Branch (424:9): [True: 0, False: 166]
  ------------------
  425|      0|        OPENSSL_free(impl);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  426|      0|        return 0;
  427|      0|    }
  428|    166|    impl->provider = prov;
  429|       |
  430|    166|    sa = stored_algs_shard(store, nid);
  ------------------
  |  |  124|    166|#define stored_algs_shard(store, nid) (&(store)->algs[(nid) & (NUM_SHARDS - 1)])
  |  |  ------------------
  |  |  |  |   38|    166|#define NUM_SHARDS (1 << NUM_SHARDS_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|    166|#define NUM_SHARDS_BITS 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  431|       |
  432|       |    /* Insert into the hash table if required */
  433|    166|    if (!ossl_property_write_lock(sa)) {
  ------------------
  |  Branch (433:9): [True: 0, False: 166]
  ------------------
  434|      0|        impl_free(impl);
  435|      0|        return 0;
  436|      0|    }
  437|       |
  438|       |    /*
  439|       |     * Flush the alg cache of any implementation that already exists
  440|       |     * for this id.
  441|       |     * This is done to ensure that on the next lookup we go through the
  442|       |     * provider comparison in ossl_method_store_fetch.  If we don't do this
  443|       |     * then this new method won't be given a chance to get selected.
  444|       |     * NOTE: This doesn't actually remove the method from the backing store
  445|       |     * It just ensures that we query the backing store when (re)-adding a
  446|       |     * method to the algorithm cache, in case the one selected by the next
  447|       |     * query selects a different implementation
  448|       |     */
  449|    166|    ossl_method_cache_flush(sa, nid);
  450|       |
  451|       |    /*
  452|       |     * Parse the properties associated with this method, and convert it to a
  453|       |     * property list stored against the implementation for later comparison
  454|       |     * during fetch operations
  455|       |     */
  456|    166|    if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) {
  ------------------
  |  Branch (456:9): [True: 1, False: 165]
  ------------------
  457|      1|        impl->properties = ossl_parse_property(store->ctx, properties);
  458|      1|        if (impl->properties == NULL)
  ------------------
  |  Branch (458:13): [True: 0, False: 1]
  ------------------
  459|      0|            goto err;
  460|      1|        if (!ossl_prop_defn_set(store->ctx, properties, &impl->properties)) {
  ------------------
  |  Branch (460:13): [True: 0, False: 1]
  ------------------
  461|      0|            ossl_property_free(impl->properties);
  462|      0|            impl->properties = NULL;
  463|      0|            goto err;
  464|      0|        }
  465|      1|    }
  466|       |
  467|       |    /*
  468|       |     * Check if we have an algorithm cache already for this nid.  If so use
  469|       |     * it, otherwise, create it, and insert it into the store
  470|       |     */
  471|    166|    alg = ossl_method_store_retrieve(sa, nid);
  472|    166|    if (alg == NULL) {
  ------------------
  |  Branch (472:9): [True: 166, False: 0]
  ------------------
  473|    166|        if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL
  ------------------
  |  |  113|    166|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (473:13): [True: 0, False: 166]
  ------------------
  474|    166|            || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL)
  ------------------
  |  Branch (474:16): [True: 0, False: 166]
  ------------------
  475|      0|            goto err;
  476|    166|        alg->nid = nid;
  477|    166|        if (!ossl_method_store_insert(sa, alg))
  ------------------
  |  Branch (477:13): [True: 0, False: 166]
  ------------------
  478|      0|            goto err;
  479|    166|        OSSL_TRACE2(QUERY, "Inserted an alg with nid %d into the stored algorithms %p\n",
  ------------------
  |  |  293|    166|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    166|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  480|    166|            nid, (void *)sa);
  481|    166|    }
  482|       |
  483|       |    /* Push onto stack if there isn't one there already */
  484|    166|    for (i = 0; i < sk_IMPLEMENTATION_num(alg->impls); i++) {
  ------------------
  |  Branch (484:17): [True: 0, False: 166]
  ------------------
  485|      0|        const IMPLEMENTATION *tmpimpl = sk_IMPLEMENTATION_value(alg->impls, i);
  486|       |
  487|      0|        if (tmpimpl->archived == 1)
  ------------------
  |  Branch (487:13): [True: 0, False: 0]
  ------------------
  488|      0|            continue;
  489|       |
  490|      0|        if (tmpimpl->provider == impl->provider
  ------------------
  |  Branch (490:13): [True: 0, False: 0]
  ------------------
  491|      0|            && tmpimpl->properties == impl->properties)
  ------------------
  |  Branch (491:16): [True: 0, False: 0]
  ------------------
  492|      0|            break;
  493|      0|    }
  494|       |
  495|    166|    if (i == sk_IMPLEMENTATION_num(alg->impls)
  ------------------
  |  Branch (495:9): [True: 166, False: 0]
  ------------------
  496|    166|        && sk_IMPLEMENTATION_push(alg->impls, impl)) {
  ------------------
  |  Branch (496:12): [True: 166, False: 0]
  ------------------
  497|    166|        ret = 1;
  498|    166|#ifndef FIPS_MODULE
  499|    166|        OSSL_TRACE_BEGIN(QUERY)
  ------------------
  |  |  219|    166|    do {                           \
  |  |  220|    166|        BIO *trc_out = NULL;       \
  |  |  221|    166|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded, False: 166]
  |  |  ------------------
  ------------------
  500|      0|        {
  501|      0|            BIO_printf(trc_out, "Adding to method store "
  502|      0|                                "nid: %d\nproperties: %s\nprovider: %s\n",
  503|      0|                nid, properties,
  504|      0|                ossl_provider_name(prov) == NULL ? "none" : ossl_provider_name(prov));
  ------------------
  |  Branch (504:17): [True: 0, False: 0]
  ------------------
  505|      0|        }
  506|    166|        OSSL_TRACE_END(QUERY);
  ------------------
  |  |  224|    166|    }                            \
  |  |  225|    166|    while (0)
  |  |  ------------------
  |  |  |  Branch (225:12): [Folded, False: 166]
  |  |  ------------------
  ------------------
  507|    166|#endif
  508|    166|    }
  509|    166|    ossl_property_unlock(sa);
  510|    166|    if (ret == 0)
  ------------------
  |  Branch (510:9): [True: 0, False: 166]
  ------------------
  511|      0|        impl_free(impl);
  512|    166|    return ret;
  513|       |
  514|      0|err:
  515|      0|    ossl_property_unlock(sa);
  516|       |    alg_cleanup(0, alg, NULL);
  517|      0|    impl_free(impl);
  518|      0|    return 0;
  519|    166|}
ossl_method_store_fetch:
  747|     10|{
  748|     10|    OSSL_PROPERTY_LIST **plp;
  749|     10|    ALGORITHM *alg;
  750|     10|    IMPLEMENTATION *impl, *best_impl = NULL;
  751|     10|    OSSL_PROPERTY_LIST *pq = NULL, *p2 = NULL;
  752|     10|    const OSSL_PROVIDER *prov = prov_rw != NULL ? *prov_rw : NULL;
  ------------------
  |  Branch (752:33): [True: 10, False: 0]
  ------------------
  753|     10|    int ret = 0;
  754|     10|    int j, best = -1, score, optional;
  755|     10|    STORED_ALGORITHMS *sa;
  756|       |
  757|     10|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (757:9): [True: 0, False: 10]
  |  Branch (757:21): [True: 0, False: 10]
  |  Branch (757:39): [True: 5, False: 5]
  ------------------
  758|      5|        return 0;
  759|       |
  760|      5|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  761|      5|    if (ossl_lib_ctx_is_default(store->ctx)
  ------------------
  |  Branch (761:9): [True: 5, False: 0]
  ------------------
  762|      5|        && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  553|      5|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
  |  Branch (762:12): [True: 0, False: 5]
  ------------------
  763|      0|        return 0;
  764|      5|#endif
  765|       |
  766|      5|    sa = stored_algs_shard(store, nid);
  ------------------
  |  |  124|      5|#define stored_algs_shard(store, nid) (&(store)->algs[(nid) & (NUM_SHARDS - 1)])
  |  |  ------------------
  |  |  |  |   38|      5|#define NUM_SHARDS (1 << NUM_SHARDS_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      5|#define NUM_SHARDS_BITS 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|       |
  768|       |    /* This only needs to be a read lock, because the query won't create anything */
  769|      5|    if (!ossl_property_read_lock(sa))
  ------------------
  |  Branch (769:9): [True: 0, False: 5]
  ------------------
  770|      0|        return 0;
  771|       |
  772|      5|    OSSL_TRACE2(QUERY, "Retrieving by nid %d from stored algorithms %p\n",
  ------------------
  |  |  293|      5|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|      5|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  773|      5|        nid, (void *)sa);
  774|      5|    alg = ossl_method_store_retrieve(sa, nid);
  775|      5|    if (alg == NULL) {
  ------------------
  |  Branch (775:9): [True: 0, False: 5]
  ------------------
  776|      0|        ossl_property_unlock(sa);
  777|      0|        OSSL_TRACE2(QUERY, "Failed to retrieve by nid %d from stored algorithms %p\n",
  ------------------
  |  |  293|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  778|      0|            nid, (void *)sa);
  779|      0|        return 0;
  780|      0|    }
  781|      5|    OSSL_TRACE2(QUERY, "Retrieved by nid %d from stored algorithms %p\n",
  ------------------
  |  |  293|      5|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|      5|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  782|      5|        nid, (void *)sa);
  783|       |
  784|       |    /*
  785|       |     * If a property query string is provided, convert it to an
  786|       |     * OSSL_PROPERTY_LIST structure
  787|       |     */
  788|      5|    if (prop_query != NULL)
  ------------------
  |  Branch (788:9): [True: 5, False: 0]
  ------------------
  789|      5|        p2 = pq = ossl_parse_query(store->ctx, prop_query, 0);
  790|       |
  791|       |    /*
  792|       |     * If the library context has default properties specified
  793|       |     * then merge those with the properties passed to this function
  794|       |     */
  795|      5|    plp = ossl_ctx_global_properties(store->ctx, 0);
  796|      5|    if (plp != NULL && *plp != NULL) {
  ------------------
  |  Branch (796:9): [True: 5, False: 0]
  |  Branch (796:24): [True: 0, False: 5]
  ------------------
  797|      0|        if (pq == NULL) {
  ------------------
  |  Branch (797:13): [True: 0, False: 0]
  ------------------
  798|      0|            pq = *plp;
  799|      0|        } else {
  800|      0|            p2 = ossl_property_merge(pq, *plp);
  801|      0|            ossl_property_free(pq);
  802|      0|            if (p2 == NULL)
  ------------------
  |  Branch (802:17): [True: 0, False: 0]
  ------------------
  803|      0|                goto fin;
  804|      0|            pq = p2;
  805|      0|        }
  806|      0|    }
  807|       |
  808|       |    /*
  809|       |     * Search for a provider that provides this implementation.
  810|       |     * If the requested provider is NULL, then any provider will do,
  811|       |     * otherwise we should try to find the one that matches the requested
  812|       |     * provider.  Note that providers are given implicit preference via the
  813|       |     * ordering of the implementation stack
  814|       |     */
  815|      5|    if (pq == NULL) {
  ------------------
  |  Branch (815:9): [True: 0, False: 5]
  ------------------
  816|      0|        for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (816:21): [True: 0, False: 0]
  ------------------
  817|      0|            impl = sk_IMPLEMENTATION_value(alg->impls, j);
  818|      0|            if (impl == NULL || impl->archived == 1)
  ------------------
  |  Branch (818:17): [True: 0, False: 0]
  |  Branch (818:33): [True: 0, False: 0]
  ------------------
  819|      0|                continue;
  820|       |
  821|      0|            if (prov == NULL || impl->provider == prov) {
  ------------------
  |  Branch (821:17): [True: 0, False: 0]
  |  Branch (821:33): [True: 0, False: 0]
  ------------------
  822|      0|                best_impl = impl;
  823|      0|                ret = 1;
  824|      0|                break;
  825|      0|            }
  826|      0|        }
  827|      0|        goto fin;
  828|      0|    }
  829|       |
  830|       |    /*
  831|       |     * If there are optional properties specified
  832|       |     * then run the search again, and select the provider that matches the
  833|       |     * most options
  834|       |     */
  835|      5|    optional = ossl_property_has_optional(pq);
  836|      5|    for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (836:17): [True: 5, False: 0]
  ------------------
  837|      5|        impl = sk_IMPLEMENTATION_value(alg->impls, j);
  838|      5|        if (impl != NULL
  ------------------
  |  Branch (838:13): [True: 5, False: 0]
  ------------------
  839|      5|            && impl->archived == 0
  ------------------
  |  Branch (839:16): [True: 5, False: 0]
  ------------------
  840|      5|            && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (840:17): [True: 5, False: 0]
  |  Branch (840:33): [True: 0, False: 0]
  ------------------
  841|      5|            score = ossl_property_match_count(pq, impl->properties);
  842|      5|            if (score > best) {
  ------------------
  |  Branch (842:17): [True: 5, False: 0]
  ------------------
  843|      5|                best_impl = impl;
  844|      5|                best = score;
  845|      5|                ret = 1;
  846|      5|                if (!optional)
  ------------------
  |  Branch (846:21): [True: 5, False: 0]
  ------------------
  847|      5|                    goto fin;
  848|      5|            }
  849|      5|        }
  850|      5|    }
  851|      5|fin:
  852|      5|    if (ret) {
  ------------------
  |  Branch (852:9): [True: 5, False: 0]
  ------------------
  853|      5|        *method = best_impl->method.method;
  854|      5|        if (prov_rw != NULL)
  ------------------
  |  Branch (854:13): [True: 5, False: 0]
  ------------------
  855|      5|            *prov_rw = best_impl->provider;
  856|       |#ifdef OPENSSL_NO_CACHED_FETCH
  857|       |        if (!ossl_method_up_ref(&best_impl->method)) {
  858|       |            ret = 0;
  859|       |            *method = NULL;
  860|       |            if (prov_rw != NULL)
  861|       |                *prov_rw = NULL;
  862|       |        }
  863|       |#endif
  864|      5|    } else {
  865|      0|        ret = 0;
  866|      0|    }
  867|       |
  868|      5|#ifndef FIPS_MODULE
  869|      5|    OSSL_TRACE_BEGIN(QUERY)
  ------------------
  |  |  219|      5|    do {                           \
  |  |  220|      5|        BIO *trc_out = NULL;       \
  |  |  221|      5|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded, False: 5]
  |  |  ------------------
  ------------------
  870|      0|    {
  871|      0|        char buf[512];
  872|      0|        size_t size;
  873|       |
  874|      0|        size = ossl_property_list_to_string(NULL, pq, buf, 512);
  875|      0|        BIO_printf(trc_out, "method store query with properties %s "
  876|      0|                            "resolves to provider %s\n",
  877|      0|            size == 0 ? "none" : buf,
  ------------------
  |  Branch (877:13): [True: 0, False: 0]
  ------------------
  878|      0|            best_impl == NULL ? "none" : ossl_provider_name(best_impl->provider));
  ------------------
  |  Branch (878:13): [True: 0, False: 0]
  ------------------
  879|      0|    }
  880|      5|    OSSL_TRACE_END(QUERY);
  ------------------
  |  |  224|      5|    }                            \
  |  |  225|      5|    while (0)
  |  |  ------------------
  |  |  |  Branch (225:12): [Folded, False: 5]
  |  |  ------------------
  ------------------
  881|      5|#endif
  882|       |
  883|      5|    ossl_property_unlock(sa);
  884|      5|    ossl_property_free(p2);
  885|      5|    return ret;
  886|      5|}
ossl_method_store_cache_get:
  984|      6|{
  985|      6|    int ret;
  986|      6|    STORED_ALGORITHMS *sa;
  987|       |
  988|      6|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (988:9): [True: 0, False: 6]
  |  Branch (988:21): [True: 0, False: 6]
  |  Branch (988:38): [True: 0, False: 6]
  ------------------
  989|      0|        return 0;
  990|       |
  991|      6|    sa = stored_algs_shard(store, nid);
  ------------------
  |  |  124|      6|#define stored_algs_shard(store, nid) (&(store)->algs[(nid) & (NUM_SHARDS - 1)])
  |  |  ------------------
  |  |  |  |   38|      6|#define NUM_SHARDS (1 << NUM_SHARDS_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      6|#define NUM_SHARDS_BITS 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  992|       |
  993|       |    /*
  994|       |     * Do an atomic linked list walk to search for our entry
  995|       |     */
  996|      6|    ret = ossl_method_store_cache_get_atomic(store, prov, nid, prop_query, sa,
  997|      6|        method);
  998|       |
  999|      6|    return ret;
 1000|      6|}
ossl_method_store_cache_set:
 1302|      5|{
 1303|      5|    STORED_ALGORITHMS *sa;
 1304|      5|    int res = 1;
 1305|       |
 1306|      5|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (1306:9): [True: 0, False: 5]
  |  Branch (1306:21): [True: 0, False: 5]
  |  Branch (1306:38): [True: 0, False: 5]
  ------------------
 1307|      0|        return 0;
 1308|       |
 1309|      5|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   45|      5|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      5|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (1309:9): [True: 0, False: 5]
  ------------------
 1310|      0|        return 0;
 1311|       |
 1312|      5|    sa = stored_algs_shard(store, nid);
  ------------------
  |  |  124|      5|#define stored_algs_shard(store, nid) (&(store)->algs[(nid) & (NUM_SHARDS - 1)])
  |  |  ------------------
  |  |  |  |   38|      5|#define NUM_SHARDS (1 << NUM_SHARDS_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      5|#define NUM_SHARDS_BITS 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1313|       |
 1314|       |    /*
 1315|       |     * Do an atomic insert into the appropriate cache linked list
 1316|       |     */
 1317|      5|    res = ossl_method_store_cache_set_atomic(store, prov, nid, prop_query, sa, method,
 1318|      5|        method_up_ref, method_destruct);
 1319|       |
 1320|      5|    return res;
 1321|      5|}
property.c:stored_algs_new:
  293|      4|{
  294|      4|    STORED_ALGORITHMS *ret;
  295|       |
  296|      4|    ret = OPENSSL_calloc(NUM_SHARDS, sizeof(STORED_ALGORITHMS));
  ------------------
  |  |  117|      4|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  297|      4|    if (ret == NULL)
  ------------------
  |  Branch (297:9): [True: 0, False: 4]
  ------------------
  298|      0|        return NULL;
  299|       |
  300|     20|    for (int i = 0; i < NUM_SHARDS; ++i) {
  ------------------
  |  |   38|     20|#define NUM_SHARDS (1 << NUM_SHARDS_BITS)
  |  |  ------------------
  |  |  |  |   36|     20|#define NUM_SHARDS_BITS 2
  |  |  ------------------
  ------------------
  |  Branch (300:21): [True: 16, False: 4]
  ------------------
  301|     16|        ret[i].algs = ossl_sa_ALGORITHM_new();
  302|     16|        if (ret[i].algs == NULL)
  ------------------
  |  Branch (302:13): [True: 0, False: 16]
  ------------------
  303|      0|            goto err;
  304|       |
  305|     16|        ret[i].lock = CRYPTO_THREAD_lock_new();
  306|     16|        if (ret[i].lock == NULL)
  ------------------
  |  Branch (306:13): [True: 0, False: 16]
  ------------------
  307|      0|            goto err;
  308|     16|        ret[i].alock = CRYPTO_THREAD_lock_new();
  309|     16|        if (ret[i].alock == NULL)
  ------------------
  |  Branch (309:13): [True: 0, False: 16]
  ------------------
  310|      0|            goto err;
  311|     16|    }
  312|       |
  313|      4|    return ret;
  314|       |
  315|      0|err:
  316|      0|    stored_algs_free(ret);
  317|       |
  318|       |    return NULL;
  319|      4|}
property.c:ossl_method_up_ref:
  201|    176|{
  202|    176|    return (*method->up_ref)(method->method);
  203|    176|}
property.c:ossl_property_write_lock:
  216|    166|{
  217|    166|    return p != NULL ? CRYPTO_THREAD_write_lock(p->lock) : 0;
  ------------------
  |  Branch (217:12): [True: 166, False: 0]
  ------------------
  218|    166|}
property.c:ossl_method_store_retrieve:
  362|    337|{
  363|    337|    return ossl_sa_ALGORITHM_get(sa->algs, nid);
  364|    337|}
property.c:ossl_method_store_insert:
  367|    166|{
  368|    166|    return ossl_sa_ALGORITHM_set(sa->algs, alg->nid, alg);
  369|    166|}
property.c:ossl_property_unlock:
  221|    171|{
  222|    171|    return p != 0 ? CRYPTO_THREAD_unlock(p->lock) : 0;
  ------------------
  |  Branch (222:12): [True: 171, False: 0]
  ------------------
  223|    171|}
property.c:ossl_property_read_lock:
  211|      5|{
  212|      5|    return p != NULL ? CRYPTO_THREAD_read_lock(p->lock) : 0;
  ------------------
  |  Branch (212:12): [True: 5, False: 0]
  ------------------
  213|      5|}
property.c:ossl_method_cache_flush:
  895|    166|{
  896|    166|    ALGORITHM *alg = ossl_method_store_retrieve(sa, nid);
  897|       |
  898|    166|    if (alg != NULL)
  ------------------
  |  Branch (898:9): [True: 0, False: 166]
  ------------------
  899|      0|        ossl_method_cache_flush_alg(sa, alg);
  900|    166|}
property.c:ossl_method_store_cache_get_atomic:
  962|      6|{
  963|      6|    QUERY *r = NULL;
  964|      6|    int res = 0;
  965|       |
  966|      6|    r = ossl_method_store_atomic_find_in_list(sa, nid, prov, prop_query);
  967|       |
  968|      6|    if (r != NULL) {
  ------------------
  |  Branch (968:9): [True: 3, False: 3]
  ------------------
  969|      3|        *method = r->method.method;
  970|      3|        res = 1;
  971|       |#ifdef OPENSSL_NO_CACHED_FETCH
  972|       |        if (!ossl_method_up_ref(&r->method)) {
  973|       |            *method = NULL;
  974|       |            res = 0;
  975|       |        }
  976|       |#endif
  977|      3|    }
  978|       |
  979|      6|    return res;
  980|      6|}
property.c:ossl_method_store_atomic_find_in_list:
 1172|     16|{
 1173|     16|    int nididx = (nid >> NUM_SHARDS_BITS) & (MAX_CACHE_LINES - 1);
  ------------------
  |  |   36|     16|#define NUM_SHARDS_BITS 2
  ------------------
                  int nididx = (nid >> NUM_SHARDS_BITS) & (MAX_CACHE_LINES - 1);
  ------------------
  |  |   43|     16|#define MAX_CACHE_LINES (1 << MAX_CACHE_LINES_BITS)
  |  |  ------------------
  |  |  |  |   41|     16|#define MAX_CACHE_LINES_BITS 3
  |  |  ------------------
  ------------------
 1174|     16|    int archived;
 1175|     16|    QUERY *idx;
 1176|     16|    QUERY *ret = NULL;
 1177|       |
 1178|     16|    if (!CRYPTO_atomic_load_ptr((void **)&sa->cache_lists[nididx], (void **)&idx, sa->alock))
  ------------------
  |  Branch (1178:9): [True: 0, False: 16]
  ------------------
 1179|      0|        goto out;
 1180|       |
 1181|     35|    while (idx != NULL) {
  ------------------
  |  Branch (1181:12): [True: 22, False: 13]
  ------------------
 1182|     22|        if (!CRYPTO_atomic_load_int(&idx->archived, &archived, sa->alock))
  ------------------
  |  Branch (1182:13): [True: 0, False: 22]
  ------------------
 1183|      0|            goto out;
 1184|     22|        if (archived == 0 && idx->nid == nid && idx->prov == prov
  ------------------
  |  Branch (1184:13): [True: 22, False: 0]
  |  Branch (1184:30): [True: 8, False: 14]
  |  Branch (1184:49): [True: 3, False: 5]
  ------------------
 1185|      3|            && (strcmp(idx->prop_query, prop_query) == 0)) {
  ------------------
  |  Branch (1185:16): [True: 3, False: 0]
  ------------------
 1186|      3|            ret = idx;
 1187|      3|            break;
 1188|      3|        }
 1189|     19|        if (!CRYPTO_atomic_load_ptr((void **)&idx->next, (void **)&idx, sa->alock))
  ------------------
  |  Branch (1189:13): [True: 0, False: 19]
  ------------------
 1190|      0|            goto out;
 1191|     19|    }
 1192|     16|out:
 1193|     16|    return ret;
 1194|     16|}
property.c:ossl_method_store_cache_set_atomic:
 1223|      5|{
 1224|      5|    QUERY *p = NULL;
 1225|      5|    int res = 1;
 1226|       |
 1227|      5|    if (method == NULL) {
  ------------------
  |  Branch (1227:9): [True: 0, False: 5]
  ------------------
 1228|      0|        p = ossl_method_store_atomic_find_in_list(sa, nid, prov, prop_query);
 1229|      0|        if (p != NULL)
  ------------------
  |  Branch (1229:13): [True: 0, False: 0]
  ------------------
 1230|      0|            ossl_method_store_atomic_archive(sa, p);
 1231|      0|        goto end;
 1232|      0|    }
 1233|       |
 1234|      5|    p = ossl_method_store_atomic_find_in_list(sa, nid, prov, prop_query);
 1235|      5|    if (p != NULL)
  ------------------
  |  Branch (1235:9): [True: 0, False: 5]
  ------------------
 1236|      0|        ossl_method_store_atomic_archive(sa, p);
 1237|       |
 1238|      5|    p = QUERY_new(strlen(prop_query));
 1239|      5|    if (p != NULL) {
  ------------------
  |  Branch (1239:9): [True: 5, False: 0]
  ------------------
 1240|      5|        TSAN_BENIGN(p, "Unpublished value is safe on subsequent read");
 1241|      5|        p->saptr = sa;
 1242|      5|        p->nid = nid;
 1243|      5|        p->prov = prov;
 1244|      5|        p->archived = 0;
 1245|      5|        strcpy(p->prop_query, prop_query);
 1246|      5|        p->method.method = method;
 1247|      5|        p->method.up_ref = method_up_ref;
 1248|      5|        p->method.free = method_destruct;
 1249|      5|        if (!ossl_method_up_ref(&p->method))
  ------------------
  |  Branch (1249:13): [True: 0, False: 5]
  ------------------
 1250|      0|            goto err;
 1251|       |
 1252|      5|        if (!ossl_method_store_atomic_insert_to_list(sa, p)) {
  ------------------
  |  Branch (1252:13): [True: 0, False: 5]
  ------------------
 1253|      0|            ossl_method_free(&p->method);
 1254|      0|            goto err;
 1255|      0|        }
 1256|       |
 1257|       |        /*
 1258|       |         * We also want to add this method into the cache against a key computed
 1259|       |         * _only_ from nid and property query.  This lets us match in the event
 1260|       |         * someone does a lookup against a NULL provider (i.e. the "any provided
 1261|       |         * alg will do" match).
 1262|       |         *
 1263|       |         * Only insert it if no NULL-provider entry exists yet for this nid and
 1264|       |         * property query.  The first provider to cache this nid owns that
 1265|       |         * entry, which is the provider ossl_method_store_fetch picks by
 1266|       |         * implementation order.
 1267|       |         */
 1268|      5|        if (ossl_method_store_atomic_find_in_list(sa, nid, NULL, prop_query) == NULL) {
  ------------------
  |  Branch (1268:13): [True: 5, False: 0]
  ------------------
 1269|      5|            p = QUERY_new(strlen(prop_query));
 1270|      5|            if (p == NULL)
  ------------------
  |  Branch (1270:17): [True: 0, False: 5]
  ------------------
 1271|      0|                goto err;
 1272|      5|            TSAN_BENIGN(p, "Unpublished value is safe on subsequent read");
 1273|      5|            p->saptr = sa;
 1274|      5|            p->nid = nid;
 1275|      5|            p->prov = NULL;
 1276|      5|            p->archived = 0;
 1277|      5|            strcpy(p->prop_query, prop_query);
 1278|      5|            p->method.method = method;
 1279|      5|            p->method.up_ref = method_up_ref;
 1280|      5|            p->method.free = method_destruct;
 1281|      5|            if (!ossl_method_up_ref(&p->method))
  ------------------
  |  Branch (1281:17): [True: 0, False: 5]
  ------------------
 1282|      0|                goto err;
 1283|      5|            if (!ossl_method_store_atomic_insert_to_list(sa, p)) {
  ------------------
  |  Branch (1283:17): [True: 0, False: 5]
  ------------------
 1284|      0|                ossl_method_free(&p->method);
 1285|      0|                goto err;
 1286|      0|            }
 1287|      5|        }
 1288|       |
 1289|      5|        goto end;
 1290|      5|    }
 1291|      0|err:
 1292|      0|    res = 0;
 1293|      0|    QUERY_free(p);
 1294|      5|end:
 1295|      5|    return res;
 1296|      0|}
property.c:QUERY_new:
  131|     10|{
  132|       |    /*
  133|       |     * allocate a new QUERY with the associated property query buffer
  134|       |     * immediately following it
  135|       |     */
  136|     10|    QUERY *new = OPENSSL_malloc(sizeof(QUERY) + prop_query_len + 1);
  ------------------
  |  |  111|     10|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|     10|    if (new != NULL)
  ------------------
  |  Branch (137:9): [True: 10, False: 0]
  ------------------
  138|     10|        new->prop_query = (char *)(new + 1);
  139|     10|    return new;
  140|     10|}
property.c:ossl_method_store_atomic_insert_to_list:
 1197|     10|{
 1198|     10|    int nid = (new->nid >> NUM_SHARDS_BITS) & (MAX_CACHE_LINES - 1);
  ------------------
  |  |   36|     10|#define NUM_SHARDS_BITS 2
  ------------------
                  int nid = (new->nid >> NUM_SHARDS_BITS) & (MAX_CACHE_LINES - 1);
  ------------------
  |  |   43|     10|#define MAX_CACHE_LINES (1 << MAX_CACHE_LINES_BITS)
  |  |  ------------------
  |  |  |  |   41|     10|#define MAX_CACHE_LINES_BITS 3
  |  |  ------------------
  ------------------
 1199|     10|    QUERY *headptr;
 1200|     10|    int ret = 0;
 1201|     10|    int lock_failed;
 1202|       |
 1203|     10|    if (!CRYPTO_atomic_load_ptr((void **)&sa->cache_lists[nid], (void **)&headptr, sa->alock))
  ------------------
  |  Branch (1203:9): [True: 0, False: 10]
  ------------------
 1204|      0|        goto out;
 1205|     10|try_again:
 1206|     10|    if (!CRYPTO_atomic_store_ptr((void **)&new->next, (void **)&headptr, sa->alock))
  ------------------
  |  Branch (1206:9): [True: 0, False: 10]
  ------------------
 1207|      0|        goto out;
 1208|     10|    if (!CRYPTO_atomic_cmp_exch_ptr((void **)&sa->cache_lists[nid], (void **)&headptr, new, sa->alock,
  ------------------
  |  Branch (1208:9): [True: 0, False: 10]
  ------------------
 1209|     10|            &lock_failed)) {
 1210|      0|        if (lock_failed == 1)
  ------------------
  |  Branch (1210:13): [True: 0, False: 0]
  ------------------
 1211|      0|            goto out;
 1212|      0|        goto try_again;
 1213|      0|    }
 1214|     10|    ret = 1;
 1215|     10|out:
 1216|     10|    return ret;
 1217|     10|}

ossl_err_load_PROP_strings:
   40|      1|{
   41|      1|#ifndef OPENSSL_NO_ERR
   42|      1|    if (ERR_reason_error_string(PROP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (42:9): [True: 1, False: 0]
  ------------------
   43|      1|        ERR_load_strings_const(PROP_str_reasons);
   44|      1|#endif
   45|      1|    return 1;
   46|      1|}

ossl_parse_property:
  346|      1|{
  347|      1|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  348|      1|    OSSL_PROPERTY_LIST *res = NULL;
  349|      1|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   33|      1|#define STACK_OF(type) struct stack_st_##type
  ------------------
  350|      1|    const char *s = defn;
  351|      1|    int done;
  352|       |
  353|      1|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (353:9): [True: 0, False: 1]
  |  Branch (353:22): [True: 0, False: 1]
  ------------------
  354|      0|        return NULL;
  355|       |
  356|      1|    s = skip_space(s);
  357|      1|    done = *s == '\0';
  358|      2|    while (!done) {
  ------------------
  |  Branch (358:12): [True: 1, False: 1]
  ------------------
  359|      1|        const char *start = s;
  360|       |
  361|      1|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  111|      1|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|      1|        if (prop == NULL)
  ------------------
  |  Branch (362:13): [True: 0, False: 1]
  ------------------
  363|      0|            goto err;
  364|      1|        memset(&prop->v, 0, sizeof(prop->v));
  365|      1|        prop->optional = 0;
  366|      1|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (366:13): [True: 0, False: 1]
  ------------------
  367|      0|            goto err;
  368|      1|        prop->oper = OSSL_PROPERTY_OPER_EQ;
  369|      1|        if (prop->name_idx == 0) {
  ------------------
  |  Branch (369:13): [True: 0, False: 1]
  ------------------
  370|      0|            ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   99|      0|#define ERR_LIB_PROP 55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|      0|#define PROP_R_PARSE_FAILED 108
  ------------------
  371|      0|                "Unknown name HERE-->%s", start);
  372|      0|            goto err;
  373|      0|        }
  374|      1|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (374:13): [True: 1, False: 0]
  ------------------
  375|      1|            if (!parse_value(ctx, &s, prop, 1)) {
  ------------------
  |  Branch (375:17): [True: 0, False: 1]
  ------------------
  376|      0|                ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |   99|      0|#define ERR_LIB_PROP 55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |   34|      0|#define PROP_R_NO_VALUE 107
  ------------------
  377|      0|                    "HERE-->%s", start);
  378|      0|                goto err;
  379|      0|            }
  380|      1|        } else {
  381|       |            /* A name alone means a true Boolean */
  382|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  383|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   42|      0|#define OSSL_PROPERTY_TRUE 1
  ------------------
  384|      0|        }
  385|       |
  386|      1|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (386:13): [True: 0, False: 1]
  ------------------
  387|      0|            goto err;
  388|      1|        prop = NULL;
  389|      1|        done = !match_ch(&s, ',');
  390|      1|    }
  391|      1|    if (*s != '\0') {
  ------------------
  |  Branch (391:9): [True: 0, False: 1]
  ------------------
  392|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   99|      0|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   37|      0|#define PROP_R_TRAILING_CHARACTERS 110
  ------------------
  393|      0|            "HERE-->%s", s);
  394|      0|        goto err;
  395|      0|    }
  396|      1|    res = stack_to_property_list(ctx, sk);
  397|       |
  398|      1|err:
  399|      1|    OPENSSL_free(prop);
  ------------------
  |  |  136|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  400|      1|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  401|      1|    return res;
  402|      1|}
ossl_parse_query:
  406|      5|{
  407|      5|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   33|      5|#define STACK_OF(type) struct stack_st_##type
  ------------------
  408|      5|    OSSL_PROPERTY_LIST *res = NULL;
  409|      5|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  410|      5|    int done;
  411|       |
  412|      5|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 5]
  |  Branch (412:22): [True: 0, False: 5]
  ------------------
  413|      0|        return NULL;
  414|       |
  415|      5|    s = skip_space(s);
  416|      5|    done = *s == '\0';
  417|      7|    while (!done) {
  ------------------
  |  Branch (417:12): [True: 2, False: 5]
  ------------------
  418|      2|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  111|      2|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|      2|        if (prop == NULL)
  ------------------
  |  Branch (419:13): [True: 0, False: 2]
  ------------------
  420|      0|            goto err;
  421|      2|        memset(&prop->v, 0, sizeof(prop->v));
  422|       |
  423|      2|        if (match_ch(&s, '-')) {
  ------------------
  |  Branch (423:13): [True: 0, False: 2]
  ------------------
  424|      0|            prop->oper = OSSL_PROPERTY_OVERRIDE;
  425|      0|            prop->optional = 0;
  426|      0|            if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (426:17): [True: 0, False: 0]
  ------------------
  427|      0|                goto err;
  428|      0|            goto skip_value;
  429|      0|        }
  430|      2|        prop->optional = match_ch(&s, '?');
  431|      2|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (431:13): [True: 0, False: 2]
  ------------------
  432|      0|            goto err;
  433|       |
  434|      2|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (434:13): [True: 2, False: 0]
  ------------------
  435|      2|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  436|      2|        } else if (MATCH(&s, "!=")) {
  ------------------
  |  |   43|      0|#define MATCH(s, m) match(s, m, sizeof(m) - 1)
  |  |  ------------------
  |  |  |  Branch (43:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  437|      0|            prop->oper = OSSL_PROPERTY_OPER_NE;
  438|      0|        } else {
  439|       |            /* A name alone is a Boolean comparison for true */
  440|      0|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  441|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  442|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   42|      0|#define OSSL_PROPERTY_TRUE 1
  ------------------
  443|      0|            goto skip_value;
  444|      0|        }
  445|      2|        if (!parse_value(ctx, &s, prop, create_values))
  ------------------
  |  Branch (445:13): [True: 0, False: 2]
  ------------------
  446|      0|            prop->type = OSSL_PROPERTY_TYPE_VALUE_UNDEFINED;
  447|       |
  448|      2|    skip_value:
  449|      2|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (449:13): [True: 0, False: 2]
  ------------------
  450|      0|            goto err;
  451|      2|        prop = NULL;
  452|      2|        done = !match_ch(&s, ',');
  453|      2|    }
  454|      5|    if (*s != '\0') {
  ------------------
  |  Branch (454:9): [True: 0, False: 5]
  ------------------
  455|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   99|      0|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   37|      0|#define PROP_R_TRAILING_CHARACTERS 110
  ------------------
  456|      0|            "HERE-->%s", s);
  457|      0|        goto err;
  458|      0|    }
  459|      5|    res = stack_to_property_list(ctx, sk);
  460|       |
  461|      5|err:
  462|      5|    OPENSSL_free(prop);
  ------------------
  |  |  136|      5|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|      5|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  464|      5|    return res;
  465|      5|}
ossl_property_match_count:
  473|      5|{
  474|      5|    const OSSL_PROPERTY_DEFINITION *const q = query->properties;
  475|      5|    const OSSL_PROPERTY_DEFINITION *const d = defn->properties;
  476|      5|    int i = 0, j = 0, matches = 0;
  477|      5|    OSSL_PROPERTY_OPER oper;
  478|       |
  479|      7|    while (i < query->num_properties) {
  ------------------
  |  Branch (479:12): [True: 2, False: 5]
  ------------------
  480|      2|        if ((oper = q[i].oper) == OSSL_PROPERTY_OVERRIDE) {
  ------------------
  |  Branch (480:13): [True: 0, False: 2]
  ------------------
  481|      0|            i++;
  482|      0|            continue;
  483|      0|        }
  484|      2|        if (j < defn->num_properties) {
  ------------------
  |  Branch (484:13): [True: 2, False: 0]
  ------------------
  485|      2|            if (q[i].name_idx > d[j].name_idx) { /* skip defn, not in query */
  ------------------
  |  Branch (485:17): [True: 0, False: 2]
  ------------------
  486|      0|                j++;
  487|      0|                continue;
  488|      0|            }
  489|      2|            if (q[i].name_idx == d[j].name_idx) { /* both in defn and query */
  ------------------
  |  Branch (489:17): [True: 2, False: 0]
  ------------------
  490|      2|                const int eq = q[i].type == d[j].type
  ------------------
  |  Branch (490:32): [True: 2, False: 0]
  ------------------
  491|      2|                    && memcmp(&q[i].v, &d[j].v, sizeof(q[i].v)) == 0;
  ------------------
  |  Branch (491:24): [True: 2, False: 0]
  ------------------
  492|       |
  493|      2|                if ((eq && oper == OSSL_PROPERTY_OPER_EQ)
  ------------------
  |  Branch (493:22): [True: 2, False: 0]
  |  Branch (493:28): [True: 2, False: 0]
  ------------------
  494|      0|                    || (!eq && oper == OSSL_PROPERTY_OPER_NE))
  ------------------
  |  Branch (494:25): [True: 0, False: 0]
  |  Branch (494:32): [True: 0, False: 0]
  ------------------
  495|      2|                    matches++;
  496|      0|                else if (!q[i].optional)
  ------------------
  |  Branch (496:26): [True: 0, False: 0]
  ------------------
  497|      0|                    return -1;
  498|      2|                i++;
  499|      2|                j++;
  500|      2|                continue;
  501|      2|            }
  502|      2|        }
  503|       |
  504|       |        /*
  505|       |         * Handle the cases of a missing value and a query with no corresponding
  506|       |         * definition.  The former fails for any comparison except inequality,
  507|       |         * the latter is treated as a comparison against the Boolean false.
  508|       |         */
  509|      0|        if (q[i].type == OSSL_PROPERTY_TYPE_VALUE_UNDEFINED) {
  ------------------
  |  Branch (509:13): [True: 0, False: 0]
  ------------------
  510|      0|            if (oper == OSSL_PROPERTY_OPER_NE)
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|                matches++;
  512|      0|            else if (!q[i].optional)
  ------------------
  |  Branch (512:22): [True: 0, False: 0]
  ------------------
  513|      0|                return -1;
  514|      0|        } else if (q[i].type != OSSL_PROPERTY_TYPE_STRING
  ------------------
  |  Branch (514:20): [True: 0, False: 0]
  ------------------
  515|      0|            || (oper == OSSL_PROPERTY_OPER_EQ
  ------------------
  |  Branch (515:17): [True: 0, False: 0]
  ------------------
  516|      0|                && q[i].v.str_val != OSSL_PROPERTY_FALSE)
  ------------------
  |  |   43|      0|#define OSSL_PROPERTY_FALSE 2
  ------------------
  |  Branch (516:20): [True: 0, False: 0]
  ------------------
  517|      0|            || (oper == OSSL_PROPERTY_OPER_NE
  ------------------
  |  Branch (517:17): [True: 0, False: 0]
  ------------------
  518|      0|                && q[i].v.str_val == OSSL_PROPERTY_FALSE)) {
  ------------------
  |  |   43|      0|#define OSSL_PROPERTY_FALSE 2
  ------------------
  |  Branch (518:20): [True: 0, False: 0]
  ------------------
  519|      0|            if (!q[i].optional)
  ------------------
  |  Branch (519:17): [True: 0, False: 0]
  ------------------
  520|      0|                return -1;
  521|      0|        } else {
  522|      0|            matches++;
  523|      0|        }
  524|      0|        i++;
  525|      0|    }
  526|      5|    return matches;
  527|      5|}
ossl_property_free:
  530|      5|{
  531|      5|    OPENSSL_free(p);
  ------------------
  |  |  136|      5|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|      5|}
ossl_property_parse_init:
  575|      1|{
  576|      1|    static const char *const predefined_names[] = {
  577|      1|        "provider", /* Name of provider (default, legacy, fips) */
  578|      1|        "version", /* Version number of this provider */
  579|      1|        "fips", /* FIPS validated or FIPS supporting algorithm */
  580|      1|        "output", /* Output type for encoders */
  581|      1|        "input", /* Input type for decoders */
  582|      1|        "structure", /* Structure name for encoders and decoders */
  583|      1|    };
  584|      1|    size_t i;
  585|       |
  586|      7|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|      7|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (586:17): [True: 6, False: 1]
  ------------------
  587|      6|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (587:13): [True: 0, False: 6]
  ------------------
  588|      0|            goto err;
  589|       |
  590|       |    /*
  591|       |     * Pre-populate the two Boolean values. We must do them before any other
  592|       |     * values and in this order so that we get the same index as the global
  593|       |     * OSSL_PROPERTY_TRUE and OSSL_PROPERTY_FALSE values
  594|       |     */
  595|      1|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   42|      1|#define OSSL_PROPERTY_TRUE 1
  ------------------
  |  Branch (595:9): [True: 0, False: 1]
  ------------------
  596|      1|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   43|      1|#define OSSL_PROPERTY_FALSE 2
  ------------------
  |  Branch (596:12): [True: 0, False: 1]
  ------------------
  597|      0|        goto err;
  598|       |
  599|      1|    return 1;
  600|      0|err:
  601|      0|    return 0;
  602|      1|}
property_parse.c:skip_space:
   26|     15|{
   27|     15|    while (ossl_isspace(*s))
  ------------------
  |  |   82|     15|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|     15|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  |  |  |  Branch (82:25): [True: 0, False: 15]
  |  |  ------------------
  ------------------
   28|      0|        s++;
   29|     15|    return s;
   30|     15|}
property_parse.c:parse_name:
   58|      3|{
   59|      3|    char name[100];
   60|      3|    int err = 0;
   61|      3|    size_t i = 0;
   62|      3|    const char *s = *t;
   63|      3|    int user_name = 0;
   64|       |
   65|      3|    for (;;) {
   66|      3|        if (!ossl_isalpha(*s)) {
  ------------------
  |  |   71|      3|#define ossl_isalpha(c) (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|      3|#define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      3|#define CTYPE_MASK_lower 0x1
  |  |  |  |  ------------------
  |  |  |  |               #define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      3|#define CTYPE_MASK_upper 0x2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:13): [True: 0, False: 3]
  ------------------
   67|      0|            ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |   99|      0|#define ERR_LIB_PROP 55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |   30|      0|#define PROP_R_NOT_AN_IDENTIFIER 103
  ------------------
   68|      0|                "HERE-->%s", *t);
   69|      0|            return 0;
   70|      0|        }
   71|     24|        do {
   72|     24|            if (i < sizeof(name) - 1)
  ------------------
  |  Branch (72:17): [True: 24, False: 0]
  ------------------
   73|     24|                name[i++] = ossl_tolower(*s);
   74|      0|            else
   75|      0|                err = 1;
   76|     24|        } while (*++s == '_' || ossl_isalnum(*s));
  ------------------
  |  |   70|     24|#define ossl_isalnum(c) (ossl_ctype_check((c), CTYPE_MASK_alnum))
  |  |  ------------------
  |  |  |  |   41|     24|#define CTYPE_MASK_alnum (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|     24|#define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|     24|#define CTYPE_MASK_lower 0x1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   28|     24|#define CTYPE_MASK_upper 0x2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CTYPE_MASK_alnum (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|     24|#define CTYPE_MASK_digit 0x4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (70:25): [True: 21, False: 3]
  |  |  ------------------
  ------------------
  |  Branch (76:18): [True: 0, False: 24]
  ------------------
   77|      3|        if (*s != '.')
  ------------------
  |  Branch (77:13): [True: 3, False: 0]
  ------------------
   78|      3|            break;
   79|      0|        user_name = 1;
   80|      0|        if (i < sizeof(name) - 1)
  ------------------
  |  Branch (80:13): [True: 0, False: 0]
  ------------------
   81|      0|            name[i++] = *s;
   82|      0|        else
   83|      0|            err = 1;
   84|      0|        s++;
   85|      0|    }
   86|      3|    name[i] = '\0';
   87|      3|    if (err) {
  ------------------
  |  Branch (87:9): [True: 0, False: 3]
  ------------------
   88|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   99|      0|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   27|      0|#define PROP_R_NAME_TOO_LONG 100
  ------------------
   89|      0|        return 0;
   90|      0|    }
   91|      3|    *t = skip_space(s);
   92|      3|    *idx = ossl_property_name(ctx, name, user_name && create);
  ------------------
  |  Branch (92:42): [True: 0, False: 3]
  |  Branch (92:55): [True: 0, False: 0]
  ------------------
   93|      3|    return 1;
   94|      3|}
property_parse.c:match_ch:
   33|     10|{
   34|     10|    const char *s = *t;
   35|       |
   36|     10|    if (*s == m) {
  ------------------
  |  Branch (36:9): [True: 3, False: 7]
  ------------------
   37|      3|        *t = skip_space(s + 1);
   38|      3|        return 1;
   39|      3|    }
   40|      7|    return 0;
   41|     10|}
property_parse.c:parse_value:
  258|      3|{
  259|      3|    const char *s = *t;
  260|      3|    int r = 0;
  261|       |
  262|      3|    if (*s == '"' || *s == '\'') {
  ------------------
  |  Branch (262:9): [True: 0, False: 3]
  |  Branch (262:22): [True: 0, False: 3]
  ------------------
  263|      0|        s++;
  264|      0|        r = parse_string(ctx, &s, s[-1], res, create);
  265|      3|    } else if (*s == '+') {
  ------------------
  |  Branch (265:16): [True: 0, False: 3]
  ------------------
  266|      0|        s++;
  267|      0|        r = parse_number(&s, res);
  268|      3|    } else if (*s == '-') {
  ------------------
  |  Branch (268:16): [True: 0, False: 3]
  ------------------
  269|      0|        s++;
  270|      0|        r = parse_number(&s, res);
  271|      0|        res->v.int_val = -res->v.int_val;
  272|      3|    } else if (*s == '0' && s[1] == 'x') {
  ------------------
  |  Branch (272:16): [True: 0, False: 3]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|      0|        s += 2;
  274|      0|        r = parse_hex(&s, res);
  275|      3|    } else if (*s == '0' && ossl_isdigit(s[1])) {
  ------------------
  |  Branch (275:16): [True: 0, False: 3]
  |  Branch (275:29): [True: 0, False: 0]
  ------------------
  276|      0|        s++;
  277|      0|        r = parse_oct(&s, res);
  278|      3|    } else if (ossl_isdigit(*s)) {
  ------------------
  |  Branch (278:16): [True: 0, False: 3]
  ------------------
  279|      0|        return parse_number(t, res);
  280|      3|    } else if (ossl_isalpha(*s))
  ------------------
  |  |   71|      3|#define ossl_isalpha(c) (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|      3|#define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      3|#define CTYPE_MASK_lower 0x1
  |  |  |  |  ------------------
  |  |  |  |               #define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      3|#define CTYPE_MASK_upper 0x2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:25): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  281|      3|        return parse_unquoted(ctx, t, res, create);
  282|      0|    if (r)
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|        *t = s;
  284|      0|    return r;
  285|      3|}
property_parse.c:parse_unquoted:
  226|      3|{
  227|      3|    char v[1000];
  228|      3|    const char *s = *t;
  229|      3|    size_t i = 0;
  230|      3|    int err = 0;
  231|       |
  232|      3|    if (*s == '\0' || *s == ',')
  ------------------
  |  Branch (232:9): [True: 0, False: 3]
  |  Branch (232:23): [True: 0, False: 3]
  ------------------
  233|      0|        return 0;
  234|     24|    while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   80|     48|#define ossl_isprint(c) (ossl_ctype_check((c), CTYPE_MASK_print))
  |  |  ------------------
  |  |  |  |   35|     24|#define CTYPE_MASK_print 0x100
  |  |  ------------------
  |  |  |  Branch (80:25): [True: 21, False: 3]
  |  |  ------------------
  ------------------
                  while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   82|     45|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|     21|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  ------------------
  |  Branch (234:32): [True: 21, False: 0]
  |  Branch (234:53): [True: 21, False: 0]
  ------------------
  235|     21|        if (i < sizeof(v) - 1)
  ------------------
  |  Branch (235:13): [True: 21, False: 0]
  ------------------
  236|     21|            v[i++] = ossl_tolower(*s);
  237|      0|        else
  238|      0|            err = 1;
  239|     21|        s++;
  240|     21|    }
  241|      3|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|      6|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|      3|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  ------------------
  |  Branch (241:9): [True: 3, False: 0]
  |  Branch (241:30): [True: 0, False: 3]
  |  Branch (241:44): [True: 0, False: 0]
  ------------------
  242|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |   99|      0|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |   28|      0|#define PROP_R_NOT_AN_ASCII_CHARACTER 101
  ------------------
  243|      0|            "HERE-->%s", s);
  244|      0|        return 0;
  245|      0|    }
  246|      3|    v[i] = 0;
  247|      3|    if (err)
  ------------------
  |  Branch (247:9): [True: 0, False: 3]
  ------------------
  248|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   99|      0|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   36|      0|#define PROP_R_STRING_TOO_LONG 109
  ------------------
  249|      3|    else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0)
  ------------------
  |  Branch (249:14): [True: 0, False: 3]
  ------------------
  250|      0|        err = 1;
  251|      3|    *t = skip_space(s);
  252|      3|    res->type = OSSL_PROPERTY_TYPE_STRING;
  253|      3|    return !err;
  254|      3|}
property_parse.c:stack_to_property_list:
  314|      6|{
  315|      6|    const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk);
  316|      6|    OSSL_PROPERTY_LIST *r;
  317|      6|    OSSL_PROPERTY_IDX prev_name_idx = 0;
  318|      6|    int i;
  319|       |
  320|      6|    r = OPENSSL_malloc(sizeof(*r)
  ------------------
  |  |  111|     12|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (111:19): [True: 3, False: 3]
  |  |  ------------------
  ------------------
  321|      6|        + (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
  322|      6|    if (r != NULL) {
  ------------------
  |  Branch (322:9): [True: 6, False: 0]
  ------------------
  323|      6|        sk_OSSL_PROPERTY_DEFINITION_sort(sk);
  324|       |
  325|      6|        r->has_optional = 0;
  326|      9|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (326:21): [True: 3, False: 6]
  ------------------
  327|      3|            r->properties[i] = *sk_OSSL_PROPERTY_DEFINITION_value(sk, i);
  328|      3|            r->has_optional |= r->properties[i].optional;
  329|       |
  330|       |            /* Check for duplicated names */
  331|      3|            if (i > 0 && r->properties[i].name_idx == prev_name_idx) {
  ------------------
  |  Branch (331:17): [True: 0, False: 3]
  |  Branch (331:26): [True: 0, False: 0]
  ------------------
  332|      0|                OPENSSL_free(r);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  333|      0|                ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   99|      0|#define ERR_LIB_PROP 55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|      0|#define PROP_R_PARSE_FAILED 108
  ------------------
  334|      0|                    "Duplicated name `%s'",
  335|      0|                    ossl_property_name_str(ctx, prev_name_idx));
  336|      0|                return NULL;
  337|      0|            }
  338|      3|            prev_name_idx = r->properties[i].name_idx;
  339|      3|        }
  340|      6|        r->num_properties = n;
  341|      6|    }
  342|      6|    return r;
  343|      6|}
property_parse.c:pd_free:
  301|      3|{
  302|      3|    OPENSSL_free(pd);
  ------------------
  |  |  136|      3|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  303|      3|}

ossl_property_has_optional:
   62|      5|{
   63|      5|    return query->has_optional ? 1 : 0;
  ------------------
  |  Branch (63:12): [True: 0, False: 5]
  ------------------
   64|      5|}

ossl_property_string_data_new:
   97|      1|{
   98|      1|    PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   99|       |
  100|      1|    if (propdata == NULL)
  ------------------
  |  Branch (100:9): [True: 0, False: 1]
  ------------------
  101|      0|        return NULL;
  102|       |
  103|      1|    propdata->lock = CRYPTO_THREAD_lock_new();
  104|      1|    propdata->prop_names = lh_PROPERTY_STRING_new(&property_hash,
  105|      1|        &property_cmp);
  106|      1|    propdata->prop_values = lh_PROPERTY_STRING_new(&property_hash,
  107|      1|        &property_cmp);
  108|      1|#ifndef OPENSSL_SMALL_FOOTPRINT
  109|      1|    propdata->prop_namelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  356|      1|    ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_set_thunks( \
  |  |  357|      1|        OPENSSL_sk_set_copy_thunks( \
  |  |  358|      1|            OPENSSL_sk_set_cmp_thunks( \
  |  |  359|      1|                OPENSSL_sk_new_null(), \
  |  |  360|      1|                sk_OPENSSL_CSTRING_cmpfunc_thunk), \
  |  |  361|      1|            sk_OPENSSL_CSTRING_copyfunc_thunk), \
  |  |  362|      1|        sk_OPENSSL_CSTRING_freefunc_thunk))
  ------------------
  110|      1|    propdata->prop_valuelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  356|      1|    ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_set_thunks( \
  |  |  357|      1|        OPENSSL_sk_set_copy_thunks( \
  |  |  358|      1|            OPENSSL_sk_set_cmp_thunks( \
  |  |  359|      1|                OPENSSL_sk_new_null(), \
  |  |  360|      1|                sk_OPENSSL_CSTRING_cmpfunc_thunk), \
  |  |  361|      1|            sk_OPENSSL_CSTRING_copyfunc_thunk), \
  |  |  362|      1|        sk_OPENSSL_CSTRING_freefunc_thunk))
  ------------------
  111|      1|#endif
  112|      1|    if (propdata->lock == NULL
  ------------------
  |  Branch (112:9): [True: 0, False: 1]
  ------------------
  113|      1|#ifndef OPENSSL_SMALL_FOOTPRINT
  114|      1|        || propdata->prop_namelist == NULL
  ------------------
  |  Branch (114:12): [True: 0, False: 1]
  ------------------
  115|      1|        || propdata->prop_valuelist == NULL
  ------------------
  |  Branch (115:12): [True: 0, False: 1]
  ------------------
  116|      1|#endif
  117|      1|        || propdata->prop_names == NULL
  ------------------
  |  Branch (117:12): [True: 0, False: 1]
  ------------------
  118|      1|        || propdata->prop_values == NULL) {
  ------------------
  |  Branch (118:12): [True: 0, False: 1]
  ------------------
  119|      0|        ossl_property_string_data_free(propdata);
  120|      0|        return NULL;
  121|      0|    }
  122|      1|    return propdata;
  123|      1|}
ossl_property_name:
  255|      9|{
  256|      9|    return ossl_property_string(ctx, 1, create, s);
  257|      9|}
ossl_property_value:
  266|      5|{
  267|      5|    return ossl_property_string(ctx, 0, create, s);
  268|      5|}
property_string.c:property_hash:
   51|     32|{
   52|     32|    return OPENSSL_LH_strhash(a->s);
   53|     32|}
property_string.c:property_cmp:
   56|      5|{
   57|      5|    return strcmp(a->s, b->s);
   58|      5|}
property_string.c:ossl_property_string:
  145|     14|{
  146|     14|    PROPERTY_STRING p, *ps, *ps_new;
  147|     14|    PROP_TABLE *t;
  148|     14|    OSSL_PROPERTY_IDX *pidx;
  149|     14|    PROPERTY_STRING_DATA *propdata
  150|     14|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |   99|     14|#define OSSL_LIB_CTX_PROPERTY_STRING_INDEX 3
  ------------------
  151|       |
  152|     14|    if (propdata == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 14]
  ------------------
  153|      0|        return 0;
  154|       |
  155|     14|    t = name ? propdata->prop_names : propdata->prop_values;
  ------------------
  |  Branch (155:9): [True: 9, False: 5]
  ------------------
  156|     14|    p.s = s;
  157|     14|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 14]
  ------------------
  158|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  159|      0|        return 0;
  160|      0|    }
  161|     14|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  162|     14|    if (ps == NULL && create) {
  ------------------
  |  Branch (162:9): [True: 9, False: 5]
  |  Branch (162:23): [True: 9, False: 0]
  ------------------
  163|      9|        CRYPTO_THREAD_unlock(propdata->lock);
  164|      9|        if (!CRYPTO_THREAD_write_lock(propdata->lock)) {
  ------------------
  |  Branch (164:13): [True: 0, False: 9]
  ------------------
  165|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|            return 0;
  167|      0|        }
  168|      9|        pidx = name ? &propdata->prop_name_idx : &propdata->prop_value_idx;
  ------------------
  |  Branch (168:16): [True: 6, False: 3]
  ------------------
  169|      9|        ps = lh_PROPERTY_STRING_retrieve(t, &p);
  170|      9|        if (ps == NULL && (ps_new = new_property_string(s, pidx)) != NULL) {
  ------------------
  |  Branch (170:13): [True: 9, False: 0]
  |  Branch (170:27): [True: 9, False: 0]
  ------------------
  171|      9|#ifndef OPENSSL_SMALL_FOOTPRINT
  172|      9|            STACK_OF(OPENSSL_CSTRING) *slist;
  ------------------
  |  |   33|      9|#define STACK_OF(type) struct stack_st_##type
  ------------------
  173|       |
  174|      9|            slist = name ? propdata->prop_namelist : propdata->prop_valuelist;
  ------------------
  |  Branch (174:21): [True: 6, False: 3]
  ------------------
  175|      9|            if (sk_OPENSSL_CSTRING_push(slist, ps_new->s) <= 0) {
  ------------------
  |  |  376|      9|#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
  ------------------
  |  Branch (175:17): [True: 0, False: 9]
  ------------------
  176|      0|                property_free(ps_new);
  177|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  178|      0|                return 0;
  179|      0|            }
  180|      9|#endif
  181|      9|            lh_PROPERTY_STRING_insert(t, ps_new);
  182|      9|            if (lh_PROPERTY_STRING_error(t)) {
  ------------------
  |  Branch (182:17): [True: 0, False: 9]
  ------------------
  183|       |                /*-
  184|       |                 * Undo the previous push which means also decrementing the
  185|       |                 * index and freeing the allocated storage.
  186|       |                 */
  187|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  188|      0|                sk_OPENSSL_CSTRING_pop(slist);
  ------------------
  |  |  378|      0|#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
  ------------------
  189|      0|#endif
  190|      0|                property_free(ps_new);
  191|      0|                --*pidx;
  192|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  193|      0|                return 0;
  194|      0|            }
  195|      9|            ps = ps_new;
  196|      9|        }
  197|      9|    }
  198|     14|    CRYPTO_THREAD_unlock(propdata->lock);
  199|     14|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (199:12): [True: 14, False: 0]
  ------------------
  200|     14|}
property_string.c:new_property_string:
  127|      9|{
  128|      9|    const size_t l = strlen(s);
  129|      9|    PROPERTY_STRING *ps = OPENSSL_malloc(sizeof(*ps) + l);
  ------------------
  |  |  111|      9|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|       |
  131|      9|    if (ps != NULL) {
  ------------------
  |  Branch (131:9): [True: 9, False: 0]
  ------------------
  132|      9|        memcpy(ps->body, s, l + 1);
  133|      9|        ps->s = ps->body;
  134|      9|        ps->idx = ++*pidx;
  135|      9|        if (ps->idx == 0) {
  ------------------
  |  Branch (135:13): [True: 0, False: 9]
  ------------------
  136|      0|            OPENSSL_free(ps);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|      0|            return NULL;
  138|      0|        }
  139|      9|    }
  140|      9|    return ps;
  141|      9|}

ossl_child_prov_ctx_new:
   38|      1|{
   39|      1|    return OPENSSL_zalloc(sizeof(struct child_prov_globals));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      1|}

ossl_prov_conf_ctx_new:
   32|      1|{
   33|      1|    PROVIDER_CONF_GLOBAL *pcgbl = OPENSSL_zalloc(sizeof(*pcgbl));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   34|       |
   35|      1|    if (pcgbl == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 1]
  ------------------
   36|      0|        return NULL;
   37|       |
   38|      1|    pcgbl->lock = CRYPTO_THREAD_lock_new();
   39|      1|    if (pcgbl->lock == NULL) {
  ------------------
  |  Branch (39:9): [True: 0, False: 1]
  ------------------
   40|      0|        OPENSSL_free(pcgbl);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   41|      0|        return NULL;
   42|      0|    }
   43|       |
   44|      1|    return pcgbl;
   45|      1|}

ossl_provider_store_new:
  311|      1|{
  312|      1|    struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  313|       |
  314|      1|    if (store == NULL
  ------------------
  |  Branch (314:9): [True: 0, False: 1]
  ------------------
  315|      1|        || (store->providers = sk_OSSL_PROVIDER_new(ossl_provider_cmp)) == NULL
  ------------------
  |  Branch (315:12): [True: 0, False: 1]
  ------------------
  316|      1|        || (store->default_path_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (316:12): [True: 0, False: 1]
  ------------------
  317|      1|#ifndef FIPS_MODULE
  318|      1|        || (store->child_cbs = sk_OSSL_PROVIDER_CHILD_CB_new_null()) == NULL
  ------------------
  |  Branch (318:12): [True: 0, False: 1]
  ------------------
  319|      1|#endif
  320|      1|        || (store->lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (320:12): [True: 0, False: 1]
  ------------------
  321|      0|        ossl_provider_store_free(store);
  322|      0|        return NULL;
  323|      0|    }
  324|      1|    store->libctx = ctx;
  325|      1|    store->use_fallbacks = 1;
  326|       |
  327|      1|    return store;
  328|      1|}
ossl_provider_up_ref:
  487|    166|{
  488|    166|    int ref = 0;
  489|       |
  490|    166|    if (!CRYPTO_UP_REF(&prov->refcnt, &ref))
  ------------------
  |  Branch (490:9): [True: 0, False: 166]
  ------------------
  491|      0|        return 0;
  492|       |
  493|    166|#ifndef FIPS_MODULE
  494|    166|    if (prov->ischild) {
  ------------------
  |  Branch (494:9): [True: 0, False: 166]
  ------------------
  495|      0|        if (!ossl_provider_up_ref_parent(prov, 0)) {
  ------------------
  |  Branch (495:13): [True: 0, False: 0]
  ------------------
  496|      0|            ossl_provider_free(prov);
  497|      0|            return 0;
  498|      0|        }
  499|      0|    }
  500|    166|#endif
  501|       |
  502|    166|    return ref;
  503|    166|}
ossl_provider_ctx:
 1433|    143|{
 1434|    143|    return prov != NULL ? prov->provctx : NULL;
  ------------------
  |  Branch (1434:12): [True: 143, False: 0]
  ------------------
 1435|    143|}
ossl_provider_doall_activated:
 1534|      5|{
 1535|      5|    int ret = 0, curr, max, ref = 0;
 1536|      5|    struct provider_store_st *store = get_provider_store(ctx);
 1537|      5|    STACK_OF(OSSL_PROVIDER) *provs = NULL;
  ------------------
  |  |   33|      5|#define STACK_OF(type) struct stack_st_##type
  ------------------
 1538|       |
 1539|      5|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
 1540|       |    /*
 1541|       |     * Make sure any providers are loaded from config before we try to use
 1542|       |     * them.
 1543|       |     */
 1544|      5|    if (ossl_lib_ctx_is_default(ctx))
  ------------------
  |  Branch (1544:9): [True: 5, False: 0]
  ------------------
 1545|      5|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  553|      5|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
 1546|      5|#endif
 1547|       |
 1548|      5|    if (store == NULL)
  ------------------
  |  Branch (1548:9): [True: 0, False: 5]
  ------------------
 1549|      0|        return 1;
 1550|      5|    if (!provider_activate_fallbacks(store))
  ------------------
  |  Branch (1550:9): [True: 0, False: 5]
  ------------------
 1551|      0|        return 0;
 1552|       |
 1553|       |    /*
 1554|       |     * Under lock, grab a copy of the provider list and up_ref each
 1555|       |     * provider so that they don't disappear underneath us.
 1556|       |     */
 1557|      5|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1557:9): [True: 0, False: 5]
  ------------------
 1558|      0|        return 0;
 1559|      5|    provs = sk_OSSL_PROVIDER_dup(store->providers);
 1560|      5|    if (provs == NULL) {
  ------------------
  |  Branch (1560:9): [True: 0, False: 5]
  ------------------
 1561|      0|        CRYPTO_THREAD_unlock(store->lock);
 1562|      0|        return 0;
 1563|      0|    }
 1564|      5|    max = sk_OSSL_PROVIDER_num(provs);
 1565|       |    /*
 1566|       |     * We work backwards through the stack so that we can safely delete items
 1567|       |     * as we go.
 1568|       |     */
 1569|     10|    for (curr = max - 1; curr >= 0; curr--) {
  ------------------
  |  Branch (1569:26): [True: 5, False: 5]
  ------------------
 1570|      5|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1571|       |
 1572|      5|        if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
  ------------------
  |  Branch (1572:13): [True: 0, False: 5]
  ------------------
 1573|      0|            goto err_unlock;
 1574|      5|        if (prov->flag_activated) {
  ------------------
  |  Branch (1574:13): [True: 5, False: 0]
  ------------------
 1575|       |            /*
 1576|       |             * We call CRYPTO_UP_REF directly rather than ossl_provider_up_ref
 1577|       |             * to avoid upping the ref count on the parent provider, which we
 1578|       |             * must not do while holding locks.
 1579|       |             */
 1580|      5|            if (!CRYPTO_UP_REF(&prov->refcnt, &ref)) {
  ------------------
  |  Branch (1580:17): [True: 0, False: 5]
  ------------------
 1581|      0|                CRYPTO_THREAD_unlock(prov->flag_lock);
 1582|      0|                goto err_unlock;
 1583|      0|            }
 1584|       |            /*
 1585|       |             * It's already activated, but we up the activated count to ensure
 1586|       |             * it remains activated until after we've called the user callback.
 1587|       |             * In theory this could mean the parent provider goes inactive,
 1588|       |             * whilst still activated in the child for a short period. That's ok.
 1589|       |             */
 1590|      5|            if (!CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1590:17): [True: 0, False: 5]
  ------------------
 1591|      5|                    prov->activatecnt_lock)) {
 1592|      0|                CRYPTO_DOWN_REF(&prov->refcnt, &ref);
 1593|      0|                CRYPTO_THREAD_unlock(prov->flag_lock);
 1594|      0|                goto err_unlock;
 1595|      0|            }
 1596|      5|        } else {
 1597|      0|            sk_OSSL_PROVIDER_delete(provs, curr);
 1598|      0|            max--;
 1599|      0|        }
 1600|      5|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1601|      5|    }
 1602|      5|    CRYPTO_THREAD_unlock(store->lock);
 1603|       |
 1604|       |    /*
 1605|       |     * Now, we sweep through all providers not under lock
 1606|       |     */
 1607|     10|    for (curr = 0; curr < max; curr++) {
  ------------------
  |  Branch (1607:20): [True: 5, False: 5]
  ------------------
 1608|      5|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1609|       |
 1610|      5|        if (!cb(prov, cbdata)) {
  ------------------
  |  Branch (1610:13): [True: 0, False: 5]
  ------------------
 1611|      0|            curr = -1;
 1612|      0|            goto finish;
 1613|      0|        }
 1614|      5|    }
 1615|      5|    curr = -1;
 1616|       |
 1617|      5|    ret = 1;
 1618|      5|    goto finish;
 1619|       |
 1620|      0|err_unlock:
 1621|      0|    CRYPTO_THREAD_unlock(store->lock);
 1622|      5|finish:
 1623|       |    /*
 1624|       |     * The pop_free call doesn't do what we want on an error condition. We
 1625|       |     * either start from the first item in the stack, or part way through if
 1626|       |     * we only processed some of the items.
 1627|       |     */
 1628|     10|    for (curr++; curr < max; curr++) {
  ------------------
  |  Branch (1628:18): [True: 5, False: 5]
  ------------------
 1629|      5|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1630|       |
 1631|      5|        if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &ref,
  ------------------
  |  Branch (1631:13): [True: 0, False: 5]
  ------------------
 1632|      5|                prov->activatecnt_lock)) {
 1633|      0|            ret = 0;
 1634|      0|            continue;
 1635|      0|        }
 1636|      5|        if (ref < 1) {
  ------------------
  |  Branch (1636:13): [True: 0, False: 5]
  ------------------
 1637|       |            /*
 1638|       |             * Looks like we need to deactivate properly. We could just have
 1639|       |             * done this originally, but it involves taking a write lock so
 1640|       |             * we avoid it. We up the count again and do a full deactivation
 1641|       |             */
 1642|      0|            if (CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1642:17): [True: 0, False: 0]
  ------------------
 1643|      0|                    prov->activatecnt_lock))
 1644|      0|                provider_deactivate(prov, 0, 1);
 1645|      0|            else
 1646|      0|                ret = 0;
 1647|      0|        }
 1648|       |        /*
 1649|       |         * As above where we did the up-ref, we don't call ossl_provider_free
 1650|       |         * to avoid making upcalls. There should always be at least one ref
 1651|       |         * to the provider in the store, so this should never drop to 0.
 1652|       |         */
 1653|      5|        if (!CRYPTO_DOWN_REF(&prov->refcnt, &ref)) {
  ------------------
  |  Branch (1653:13): [True: 0, False: 5]
  ------------------
 1654|      0|            ret = 0;
 1655|      0|            continue;
 1656|      0|        }
 1657|       |        /*
 1658|       |         * Not much we can do if this assert ever fails. So we don't use
 1659|       |         * ossl_assert here.
 1660|       |         */
 1661|      5|        assert(ref > 0);
 1662|      5|    }
 1663|      5|    sk_OSSL_PROVIDER_free(provs);
 1664|      5|    return ret;
 1665|      0|}
ossl_provider_libctx:
 1726|    327|{
 1727|    327|    return prov != NULL ? prov->libctx : NULL;
  ------------------
  |  Branch (1727:12): [True: 327, False: 0]
  ------------------
 1728|    327|}
ossl_provider_query_operation:
 1953|      5|{
 1954|      5|    const OSSL_ALGORITHM *res;
 1955|       |
 1956|      5|    if (prov->query_operation == NULL) {
  ------------------
  |  Branch (1956:9): [True: 0, False: 5]
  ------------------
 1957|      0|#ifndef FIPS_MODULE
 1958|      0|        OSSL_TRACE_BEGIN(PROVIDER)
  ------------------
  |  |  219|      0|    do {                           \
  |  |  220|      0|        BIO *trc_out = NULL;       \
  |  |  221|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1959|      0|        {
 1960|      0|            BIO_printf(trc_out, "provider %s lacks query operation!\n",
 1961|      0|                prov->name);
 1962|      0|        }
 1963|      0|        OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  224|      0|    }                            \
  |  |  225|      0|    while (0)
  |  |  ------------------
  |  |  |  Branch (225:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1964|      0|#endif
 1965|      0|        return NULL;
 1966|      0|    }
 1967|       |
 1968|      5|    res = prov->query_operation(prov->provctx, operation_id, no_cache);
 1969|      5|#ifndef FIPS_MODULE
 1970|      5|    OSSL_TRACE_BEGIN(PROVIDER)
  ------------------
  |  |  219|      5|    do {                           \
  |  |  220|      5|        BIO *trc_out = NULL;       \
  |  |  221|      5|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1971|      0|    {
 1972|      0|        const OSSL_ALGORITHM *idx;
 1973|      0|        if (res != NULL) {
  ------------------
  |  Branch (1973:13): [True: 0, False: 0]
  ------------------
 1974|      0|            BIO_printf(trc_out,
 1975|      0|                "(provider %s) Calling query, available algs are:\n", prov->name);
 1976|       |
 1977|      0|            for (idx = res; idx->algorithm_names != NULL; idx++) {
  ------------------
  |  Branch (1977:29): [True: 0, False: 0]
  ------------------
 1978|      0|                BIO_printf(trc_out,
 1979|      0|                    "(provider %s) names %s, prop_def %s, desc %s\n",
 1980|      0|                    prov->name,
 1981|      0|                    idx->algorithm_names == NULL ? "none" : idx->algorithm_names,
  ------------------
  |  Branch (1981:21): [True: 0, False: 0]
  ------------------
 1982|      0|                    idx->property_definition == NULL ? "none" : idx->property_definition,
  ------------------
  |  Branch (1982:21): [True: 0, False: 0]
  ------------------
 1983|      0|                    idx->algorithm_description == NULL ? "none" : idx->algorithm_description);
  ------------------
  |  Branch (1983:21): [True: 0, False: 0]
  ------------------
 1984|      0|            }
 1985|      0|        } else {
 1986|      0|            BIO_printf(trc_out, "(provider %s) query_operation failed\n", prov->name);
 1987|      0|        }
 1988|      0|    }
 1989|      5|    OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  224|      5|    }                            \
  |  |  225|      5|    while (0)
  |  |  ------------------
  |  |  |  Branch (225:12): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1990|      5|#endif
 1991|       |
 1992|       |#if defined(OPENSSL_NO_CACHED_FETCH)
 1993|       |    /* Forcing the non-caching of queries */
 1994|       |    if (no_cache != NULL)
 1995|       |        *no_cache = 1;
 1996|       |#endif
 1997|      5|    return res;
 1998|      5|}
ossl_provider_unquery_operation:
 2017|      5|{
 2018|      5|    if (prov->unquery_operation != NULL) {
  ------------------
  |  Branch (2018:9): [True: 0, False: 5]
  ------------------
 2019|      0|#ifndef FIPS_MODULE
 2020|      0|        OSSL_TRACE_BEGIN(PROVIDER)
  ------------------
  |  |  219|      0|    do {                           \
  |  |  220|      0|        BIO *trc_out = NULL;       \
  |  |  221|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2021|      0|        {
 2022|      0|            BIO_printf(trc_out,
 2023|      0|                "(provider %s) Calling unquery"
 2024|      0|                " with operation %d\n",
 2025|      0|                prov->name,
 2026|      0|                operation_id);
 2027|      0|        }
 2028|      0|        OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  224|      0|    }                            \
  |  |  225|      0|    while (0)
  |  |  ------------------
  |  |  |  Branch (225:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2029|      0|#endif
 2030|      0|        prov->unquery_operation(prov->provctx, operation_id, algs);
 2031|      0|    }
 2032|      5|}
ossl_provider_set_operation_bit:
 2035|      3|{
 2036|      3|    size_t byte = bitnum / 8;
 2037|      3|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2038|       |
 2039|      3|    if (!CRYPTO_THREAD_write_lock(provider->opbits_lock))
  ------------------
  |  Branch (2039:9): [True: 0, False: 3]
  ------------------
 2040|      0|        return 0;
 2041|      3|    if (provider->operation_bits_sz <= byte) {
  ------------------
  |  Branch (2041:9): [True: 1, False: 2]
  ------------------
 2042|      1|        unsigned char *tmp = OPENSSL_realloc(provider->operation_bits,
  ------------------
  |  |  125|      1|    CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2043|      1|            byte + 1);
 2044|       |
 2045|      1|        if (tmp == NULL) {
  ------------------
  |  Branch (2045:13): [True: 0, False: 1]
  ------------------
 2046|      0|            CRYPTO_THREAD_unlock(provider->opbits_lock);
 2047|      0|            return 0;
 2048|      0|        }
 2049|      1|        provider->operation_bits = tmp;
 2050|      1|        memset(provider->operation_bits + provider->operation_bits_sz,
 2051|      1|            '\0', byte + 1 - provider->operation_bits_sz);
 2052|      1|        provider->operation_bits_sz = byte + 1;
 2053|      1|    }
 2054|      3|    provider->operation_bits[byte] |= bit;
 2055|      3|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2056|      3|    return 1;
 2057|      3|}
ossl_provider_test_operation_bit:
 2061|      5|{
 2062|      5|    size_t byte = bitnum / 8;
 2063|      5|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2064|       |
 2065|      5|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   45|      5|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      5|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (2065:9): [True: 0, False: 5]
  ------------------
 2066|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 2067|      0|        return 0;
 2068|      0|    }
 2069|       |
 2070|      5|    *result = 0;
 2071|      5|    if (!CRYPTO_THREAD_read_lock(provider->opbits_lock))
  ------------------
  |  Branch (2071:9): [True: 0, False: 5]
  ------------------
 2072|      0|        return 0;
 2073|      5|    if (provider->operation_bits_sz > byte)
  ------------------
  |  Branch (2073:9): [True: 4, False: 1]
  ------------------
 2074|      4|        *result = ((provider->operation_bits[byte] & bit) != 0);
 2075|      5|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2076|      5|    return 1;
 2077|      5|}
provider_core.c:get_provider_store:
  331|      5|{
  332|      5|    struct provider_store_st *store = NULL;
  333|       |
  334|      5|    store = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_PROVIDER_STORE_INDEX);
  ------------------
  |  |   97|      5|#define OSSL_LIB_CTX_PROVIDER_STORE_INDEX 1
  ------------------
  335|      5|    if (store == NULL)
  ------------------
  |  Branch (335:9): [True: 0, False: 5]
  ------------------
  336|       |        ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  337|      5|    return store;
  338|      5|}
provider_core.c:provider_new:
  451|      1|{
  452|      1|    OSSL_PROVIDER *prov = NULL;
  453|       |
  454|      1|    if ((prov = OPENSSL_zalloc(sizeof(*prov))) == NULL)
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (454:9): [True: 0, False: 1]
  ------------------
  455|      0|        return NULL;
  456|      1|    if (!CRYPTO_NEW_REF(&prov->refcnt, 1)) {
  ------------------
  |  Branch (456:9): [True: 0, False: 1]
  ------------------
  457|      0|        OPENSSL_free(prov);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|      0|        return NULL;
  459|      0|    }
  460|      1|    if ((prov->activatecnt_lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (460:9): [True: 0, False: 1]
  ------------------
  461|      0|        ossl_provider_free(prov);
  462|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  463|      0|        return NULL;
  464|      0|    }
  465|       |
  466|      1|    if ((prov->opbits_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (466:9): [True: 0, False: 1]
  ------------------
  467|      1|        || (prov->flag_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (467:12): [True: 0, False: 1]
  ------------------
  468|      1|        || (prov->parameters = sk_INFOPAIR_deep_copy(parameters,
  ------------------
  |  Branch (468:12): [True: 0, False: 1]
  ------------------
  469|      1|                infopair_copy,
  470|      1|                infopair_free))
  471|      1|            == NULL) {
  472|      0|        ossl_provider_free(prov);
  473|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  474|      0|        return NULL;
  475|      0|    }
  476|      1|    if ((prov->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  140|      1|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (476:9): [True: 0, False: 1]
  ------------------
  477|      0|        ossl_provider_free(prov);
  478|      0|        return NULL;
  479|      0|    }
  480|       |
  481|      1|    prov->init_function = init_function;
  482|       |
  483|      1|    return prov;
  484|      1|}
provider_core.c:provider_activate:
 1263|      1|{
 1264|      1|    int count = -1;
 1265|      1|    struct provider_store_st *store;
 1266|      1|    int ret = 1;
 1267|       |
 1268|      1|    store = prov->store;
 1269|       |    /*
 1270|       |     * If the provider hasn't been added to the store, then we don't need
 1271|       |     * any locks because we've not shared it with other threads.
 1272|       |     */
 1273|      1|    if (store == NULL) {
  ------------------
  |  Branch (1273:9): [True: 1, False: 0]
  ------------------
 1274|      1|        lock = 0;
 1275|      1|        if (!provider_init(prov))
  ------------------
  |  Branch (1275:13): [True: 0, False: 1]
  ------------------
 1276|      0|            return -1;
 1277|      1|    }
 1278|       |
 1279|      1|#ifndef FIPS_MODULE
 1280|      1|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1280:9): [True: 0, False: 1]
  ------------------
 1281|      0|        && !ossl_rand_check_random_provider_on_load(prov->libctx, prov))
  ------------------
  |  Branch (1281:12): [True: 0, False: 0]
  ------------------
 1282|      0|        return -1;
 1283|       |
 1284|      1|    if (prov->ischild && upcalls && !ossl_provider_up_ref_parent(prov, 1))
  ------------------
  |  Branch (1284:9): [True: 0, False: 1]
  |  Branch (1284:26): [True: 0, False: 0]
  |  Branch (1284:37): [True: 0, False: 0]
  ------------------
 1285|      0|        return -1;
 1286|      1|#endif
 1287|       |
 1288|      1|    if (lock && !CRYPTO_THREAD_read_lock(store->lock)) {
  ------------------
  |  Branch (1288:9): [True: 0, False: 1]
  |  Branch (1288:17): [True: 0, False: 0]
  ------------------
 1289|      0|#ifndef FIPS_MODULE
 1290|      0|        if (prov->ischild && upcalls)
  ------------------
  |  Branch (1290:13): [True: 0, False: 0]
  |  Branch (1290:30): [True: 0, False: 0]
  ------------------
 1291|      0|            ossl_provider_free_parent(prov, 1);
 1292|      0|#endif
 1293|      0|        return -1;
 1294|      0|    }
 1295|       |
 1296|      1|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1296:9): [True: 0, False: 1]
  |  Branch (1296:17): [True: 0, False: 0]
  ------------------
 1297|      0|        CRYPTO_THREAD_unlock(store->lock);
 1298|      0|#ifndef FIPS_MODULE
 1299|      0|        if (prov->ischild && upcalls)
  ------------------
  |  Branch (1299:13): [True: 0, False: 0]
  |  Branch (1299:30): [True: 0, False: 0]
  ------------------
 1300|      0|            ossl_provider_free_parent(prov, 1);
 1301|      0|#endif
 1302|      0|        return -1;
 1303|      0|    }
 1304|      1|    if (CRYPTO_atomic_add(&prov->activatecnt, 1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1304:9): [True: 1, False: 0]
  ------------------
 1305|      1|        prov->flag_activated = 1;
 1306|       |
 1307|      1|        if (count == 1 && store != NULL) {
  ------------------
  |  Branch (1307:13): [True: 1, False: 0]
  |  Branch (1307:27): [True: 0, False: 1]
  ------------------
 1308|      0|            ret = create_provider_children(prov);
 1309|      0|        }
 1310|      1|    }
 1311|      1|    if (lock) {
  ------------------
  |  Branch (1311:9): [True: 0, False: 1]
  ------------------
 1312|      0|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1313|      0|        CRYPTO_THREAD_unlock(store->lock);
 1314|       |        /*
 1315|       |         * This can be done outside the lock. We tolerate other threads getting
 1316|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
 1317|       |         */
 1318|      0|#ifndef FIPS_MODULE
 1319|      0|        if (count == 1)
  ------------------
  |  Branch (1319:13): [True: 0, False: 0]
  ------------------
 1320|      0|            ossl_decoder_cache_flush(prov->libctx);
 1321|      0|#endif
 1322|      0|    }
 1323|       |
 1324|      1|    if (!ret)
  ------------------
  |  Branch (1324:9): [True: 0, False: 1]
  ------------------
 1325|      0|        return -1;
 1326|       |
 1327|      1|    return count;
 1328|      1|}
provider_core.c:provider_init:
  955|      1|{
  956|      1|    const OSSL_DISPATCH *provider_dispatch = NULL;
  957|      1|    void *tmp_provctx = NULL; /* safety measure */
  958|      1|#ifndef OPENSSL_NO_ERR
  959|      1|#ifndef FIPS_MODULE
  960|      1|    OSSL_FUNC_provider_get_reason_strings_fn *p_get_reason_strings = NULL;
  961|      1|#endif
  962|      1|#endif
  963|      1|    int ok = 0;
  964|       |
  965|      1|    if (!ossl_assert(!prov->flag_initialized)) {
  ------------------
  |  |   45|      1|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      1|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (965:9): [True: 0, False: 1]
  ------------------
  966|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  967|      0|        goto end;
  968|      0|    }
  969|       |
  970|       |    /*
  971|       |     * If the init function isn't set, it indicates that this provider is
  972|       |     * a loadable module.
  973|       |     */
  974|      1|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (974:9): [True: 0, False: 1]
  ------------------
  975|       |#ifdef FIPS_MODULE
  976|       |        goto end;
  977|       |#else
  978|      0|        if (prov->module == NULL) {
  ------------------
  |  Branch (978:13): [True: 0, False: 0]
  ------------------
  979|      0|            char *allocated_path = NULL;
  980|      0|            const char *module_path = NULL;
  981|      0|            char *merged_path = NULL;
  982|      0|            const char *load_dir = NULL;
  983|      0|            char *allocated_load_dir = NULL;
  984|      0|            struct provider_store_st *store;
  985|       |
  986|      0|            if ((prov->module = DSO_new()) == NULL) {
  ------------------
  |  Branch (986:17): [True: 0, False: 0]
  ------------------
  987|       |                /* DSO_new() generates an error already */
  988|      0|                goto end;
  989|      0|            }
  990|       |
  991|      0|            if ((store = get_provider_store(prov->libctx)) == NULL
  ------------------
  |  Branch (991:17): [True: 0, False: 0]
  ------------------
  992|      0|                || !CRYPTO_THREAD_read_lock(store->default_path_lock))
  ------------------
  |  Branch (992:20): [True: 0, False: 0]
  ------------------
  993|      0|                goto end;
  994|       |
  995|      0|            if (store->default_path != NULL) {
  ------------------
  |  Branch (995:17): [True: 0, False: 0]
  ------------------
  996|      0|                allocated_load_dir = OPENSSL_strdup(store->default_path);
  ------------------
  |  |  140|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  997|      0|                CRYPTO_THREAD_unlock(store->default_path_lock);
  998|      0|                if (allocated_load_dir == NULL)
  ------------------
  |  Branch (998:21): [True: 0, False: 0]
  ------------------
  999|      0|                    goto end;
 1000|      0|                load_dir = allocated_load_dir;
 1001|      0|            } else {
 1002|      0|                CRYPTO_THREAD_unlock(store->default_path_lock);
 1003|      0|            }
 1004|       |
 1005|      0|            if (load_dir == NULL) {
  ------------------
  |  Branch (1005:17): [True: 0, False: 0]
  ------------------
 1006|      0|                load_dir = ossl_safe_getenv("OPENSSL_MODULES");
 1007|      0|                if (load_dir == NULL)
  ------------------
  |  Branch (1007:21): [True: 0, False: 0]
  ------------------
 1008|      0|                    load_dir = ossl_get_modulesdir();
 1009|      0|            }
 1010|       |
 1011|      0|            DSO_ctrl(prov->module, DSO_CTRL_SET_FLAGS,
  ------------------
  |  |   19|      0|#define DSO_CTRL_SET_FLAGS 2
  ------------------
 1012|      0|                DSO_FLAG_NAME_TRANSLATION_EXT_ONLY, NULL);
  ------------------
  |  |   41|      0|#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02
  ------------------
 1013|       |
 1014|      0|            module_path = prov->path;
 1015|      0|            if (module_path == NULL)
  ------------------
  |  Branch (1015:17): [True: 0, False: 0]
  ------------------
 1016|      0|                module_path = allocated_path = DSO_convert_filename(prov->module, prov->name);
 1017|      0|            if (module_path != NULL)
  ------------------
  |  Branch (1017:17): [True: 0, False: 0]
  ------------------
 1018|      0|                merged_path = DSO_merge(prov->module, module_path, load_dir);
 1019|       |
 1020|      0|            if (merged_path == NULL
  ------------------
  |  Branch (1020:17): [True: 0, False: 0]
  ------------------
 1021|      0|                || (DSO_load(prov->module, merged_path, NULL, 0)) == NULL) {
  ------------------
  |  Branch (1021:20): [True: 0, False: 0]
  ------------------
 1022|      0|                DSO_free(prov->module);
 1023|      0|                prov->module = NULL;
 1024|      0|            }
 1025|       |
 1026|      0|            OPENSSL_free(merged_path);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1027|      0|            OPENSSL_free(allocated_path);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1028|      0|            OPENSSL_free(allocated_load_dir);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1029|      0|        }
 1030|       |
 1031|      0|        if (prov->module == NULL) {
  ------------------
  |  Branch (1031:13): [True: 0, False: 0]
  ------------------
 1032|       |            /* DSO has already recorded errors, this is just a tracepoint */
 1033|      0|            ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |   68|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |  289|      0|#define ERR_R_DSO_LIB (ERR_LIB_DSO /* 37 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   81|      0|#define ERR_LIB_DSO 37
  |  |  ------------------
  |  |               #define ERR_R_DSO_LIB (ERR_LIB_DSO /* 37 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  220|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1034|      0|                "name=%s", prov->name);
 1035|      0|            goto end;
 1036|      0|        }
 1037|       |
 1038|      0|        prov->init_function = (OSSL_provider_init_fn *)
 1039|      0|            DSO_bind_func(prov->module, "OSSL_provider_init");
 1040|      0|#endif
 1041|      0|    }
 1042|       |
 1043|       |    /* Check for and call the initialise function for the provider. */
 1044|      1|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (1044:9): [True: 0, False: 1]
  ------------------
 1045|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |   68|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |  317|      0|#define ERR_R_UNSUPPORTED (268 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  220|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1046|      0|            "name=%s, provider has no provider init function",
 1047|      0|            prov->name);
 1048|      0|        goto end;
 1049|      0|    }
 1050|      1|#ifndef FIPS_MODULE
 1051|      1|    OSSL_TRACE_BEGIN(PROVIDER)
  ------------------
  |  |  219|      1|    do {                           \
  |  |  220|      1|        BIO *trc_out = NULL;       \
  |  |  221|      1|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1052|      0|    {
 1053|      0|        BIO_printf(trc_out,
 1054|      0|            "(provider %s) initializing\n", prov->name);
 1055|      0|    }
 1056|      1|    OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  224|      1|    }                            \
  |  |  225|      1|    while (0)
  |  |  ------------------
  |  |  |  Branch (225:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1057|      1|#endif
 1058|       |
 1059|      1|    if (!prov->init_function((OSSL_CORE_HANDLE *)prov, core_dispatch,
  ------------------
  |  Branch (1059:9): [True: 0, False: 1]
  ------------------
 1060|      1|            &provider_dispatch, &tmp_provctx)) {
 1061|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |   68|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |  310|      0|#define ERR_R_INIT_FAIL (261 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  304|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  211|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  211|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1062|      0|            "name=%s", prov->name);
 1063|      0|        goto end;
 1064|      0|    }
 1065|      1|    prov->provctx = tmp_provctx;
 1066|      1|    prov->dispatch = provider_dispatch;
 1067|       |
 1068|      1|    if (provider_dispatch != NULL) {
  ------------------
  |  Branch (1068:9): [True: 1, False: 0]
  ------------------
 1069|      6|        for (; provider_dispatch->function_id != 0; provider_dispatch++) {
  ------------------
  |  Branch (1069:16): [True: 5, False: 1]
  ------------------
 1070|      5|            switch (provider_dispatch->function_id) {
  ------------------
  |  Branch (1070:21): [True: 5, False: 0]
  ------------------
 1071|      1|            case OSSL_FUNC_PROVIDER_TEARDOWN:
  ------------------
  |  |  234|      1|#define OSSL_FUNC_PROVIDER_TEARDOWN 1024
  ------------------
  |  Branch (1071:13): [True: 1, False: 4]
  ------------------
 1072|      1|                prov->teardown = OSSL_FUNC_provider_teardown(provider_dispatch);
 1073|      1|                break;
 1074|      1|            case OSSL_FUNC_PROVIDER_GETTABLE_PARAMS:
  ------------------
  |  |  236|      1|#define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS 1025
  ------------------
  |  Branch (1074:13): [True: 1, False: 4]
  ------------------
 1075|      1|                prov->gettable_params = OSSL_FUNC_provider_gettable_params(provider_dispatch);
 1076|      1|                break;
 1077|      1|            case OSSL_FUNC_PROVIDER_GET_PARAMS:
  ------------------
  |  |  239|      1|#define OSSL_FUNC_PROVIDER_GET_PARAMS 1026
  ------------------
  |  Branch (1077:13): [True: 1, False: 4]
  ------------------
 1078|      1|                prov->get_params = OSSL_FUNC_provider_get_params(provider_dispatch);
 1079|      1|                break;
 1080|      0|            case OSSL_FUNC_PROVIDER_SELF_TEST:
  ------------------
  |  |  252|      0|#define OSSL_FUNC_PROVIDER_SELF_TEST 1031
  ------------------
  |  Branch (1080:13): [True: 0, False: 5]
  ------------------
 1081|      0|                prov->self_test = OSSL_FUNC_provider_self_test(provider_dispatch);
 1082|      0|                break;
 1083|      0|            case OSSL_FUNC_PROVIDER_RANDOM_BYTES:
  ------------------
  |  |  254|      0|#define OSSL_FUNC_PROVIDER_RANDOM_BYTES 1032
  ------------------
  |  Branch (1083:13): [True: 0, False: 5]
  ------------------
 1084|      0|                prov->random_bytes = OSSL_FUNC_provider_random_bytes(provider_dispatch);
 1085|      0|                break;
 1086|      1|            case OSSL_FUNC_PROVIDER_GET_CAPABILITIES:
  ------------------
  |  |  250|      1|#define OSSL_FUNC_PROVIDER_GET_CAPABILITIES 1030
  ------------------
  |  Branch (1086:13): [True: 1, False: 4]
  ------------------
 1087|      1|                prov->get_capabilities = OSSL_FUNC_provider_get_capabilities(provider_dispatch);
 1088|      1|                break;
 1089|      1|            case OSSL_FUNC_PROVIDER_QUERY_OPERATION:
  ------------------
  |  |  241|      1|#define OSSL_FUNC_PROVIDER_QUERY_OPERATION 1027
  ------------------
  |  Branch (1089:13): [True: 1, False: 4]
  ------------------
 1090|      1|                prov->query_operation = OSSL_FUNC_provider_query_operation(provider_dispatch);
 1091|      1|                break;
 1092|      0|            case OSSL_FUNC_PROVIDER_UNQUERY_OPERATION:
  ------------------
  |  |  244|      0|#define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION 1028
  ------------------
  |  Branch (1092:13): [True: 0, False: 5]
  ------------------
 1093|      0|                prov->unquery_operation = OSSL_FUNC_provider_unquery_operation(provider_dispatch);
 1094|      0|                break;
 1095|      0|#ifndef OPENSSL_NO_ERR
 1096|      0|#ifndef FIPS_MODULE
 1097|      0|            case OSSL_FUNC_PROVIDER_GET_REASON_STRINGS:
  ------------------
  |  |  247|      0|#define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1029
  ------------------
  |  Branch (1097:13): [True: 0, False: 5]
  ------------------
 1098|      0|                p_get_reason_strings = OSSL_FUNC_provider_get_reason_strings(provider_dispatch);
 1099|      0|                break;
 1100|      5|#endif
 1101|      5|#endif
 1102|      5|            }
 1103|      5|        }
 1104|      1|    }
 1105|       |
 1106|      1|#ifndef OPENSSL_NO_ERR
 1107|      1|#ifndef FIPS_MODULE
 1108|      1|    if (p_get_reason_strings != NULL) {
  ------------------
  |  Branch (1108:9): [True: 0, False: 1]
  ------------------
 1109|      0|        const OSSL_ITEM *reasonstrings = p_get_reason_strings(prov->provctx);
 1110|      0|        size_t cnt, cnt2;
 1111|       |
 1112|       |        /*
 1113|       |         * ERR_load_strings() handles ERR_STRING_DATA rather than OSSL_ITEM,
 1114|       |         * although they are essentially the same type.
 1115|       |         * Furthermore, ERR_load_strings() patches the array's error number
 1116|       |         * with the error library number, so we need to make a copy of that
 1117|       |         * array either way.
 1118|       |         */
 1119|      0|        cnt = 0;
 1120|      0|        while (reasonstrings[cnt].id != 0) {
  ------------------
  |  Branch (1120:16): [True: 0, False: 0]
  ------------------
 1121|      0|            if (ERR_GET_LIB(reasonstrings[cnt].id) != 0)
  ------------------
  |  Branch (1121:17): [True: 0, False: 0]
  ------------------
 1122|      0|                goto end;
 1123|      0|            cnt++;
 1124|      0|        }
 1125|      0|        cnt++; /* One for the terminating item */
 1126|       |
 1127|       |        /* Allocate one extra item for the "library" name */
 1128|      0|        prov->error_strings = OPENSSL_calloc(cnt + 1, sizeof(ERR_STRING_DATA));
  ------------------
  |  |  117|      0|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1129|      0|        if (prov->error_strings == NULL)
  ------------------
  |  Branch (1129:13): [True: 0, False: 0]
  ------------------
 1130|      0|            goto end;
 1131|       |
 1132|       |        /*
 1133|       |         * Set the "library" name.
 1134|       |         */
 1135|      0|        prov->error_strings[0].error = ERR_PACK(prov->error_lib, 0, 0);
  ------------------
  |  |  262|      0|    ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  210|      0|#define ERR_LIB_MASK 0xFF
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  209|      0|#define ERR_LIB_OFFSET 23L
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  213|      0|#define ERR_REASON_MASK 0X7FFFFF
  |  |  ------------------
  ------------------
 1136|      0|        prov->error_strings[0].string = prov->name;
 1137|       |        /*
 1138|       |         * Copy reasonstrings item 0..cnt-1 to prov->error_strings positions
 1139|       |         * 1..cnt.
 1140|       |         */
 1141|      0|        for (cnt2 = 1; cnt2 <= cnt; cnt2++) {
  ------------------
  |  Branch (1141:24): [True: 0, False: 0]
  ------------------
 1142|      0|            prov->error_strings[cnt2].error = (int)reasonstrings[cnt2 - 1].id;
 1143|      0|            prov->error_strings[cnt2].string = reasonstrings[cnt2 - 1].ptr;
 1144|      0|        }
 1145|       |
 1146|      0|        ERR_load_strings(prov->error_lib, prov->error_strings);
 1147|      0|    }
 1148|      1|#endif
 1149|      1|#endif
 1150|       |
 1151|       |    /* With this flag set, this provider has become fully "loaded". */
 1152|      1|    prov->flag_initialized = 1;
 1153|      1|    ok = 1;
 1154|       |
 1155|      1|end:
 1156|      1|    return ok;
 1157|      1|}
provider_core.c:core_get_libctx:
 2355|      1|{
 2356|       |    /*
 2357|       |     * We created this object originally and we know it is actually an
 2358|       |     * OSSL_PROVIDER *, so the cast is safe
 2359|       |     */
 2360|      1|    OSSL_PROVIDER *prov = (OSSL_PROVIDER *)handle;
 2361|       |
 2362|       |    /*
 2363|       |     * Using ossl_provider_libctx would be wrong as that returns
 2364|       |     * NULL for |prov| == NULL and NULL libctx has a special meaning
 2365|       |     * that does not apply here. Here |prov| == NULL can happen only in
 2366|       |     * case of a coding error.
 2367|       |     */
 2368|       |    assert(prov != NULL);
 2369|      1|    return (OPENSSL_CORE_CTX *)prov->libctx;
 2370|      1|}
provider_core.c:provider_activate_fallbacks:
 1443|      5|{
 1444|      5|    int use_fallbacks;
 1445|      5|    int activated_fallback_count = 0;
 1446|      5|    int ret = 0;
 1447|      5|    const OSSL_PROVIDER_INFO *p;
 1448|       |
 1449|      5|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1449:9): [True: 0, False: 5]
  ------------------
 1450|      0|        return 0;
 1451|      5|    use_fallbacks = store->use_fallbacks;
 1452|      5|    CRYPTO_THREAD_unlock(store->lock);
 1453|      5|    if (!use_fallbacks)
  ------------------
  |  Branch (1453:9): [True: 4, False: 1]
  ------------------
 1454|      4|        return 1;
 1455|       |
 1456|      1|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (1456:9): [True: 0, False: 1]
  ------------------
 1457|      0|        return 0;
 1458|       |    /* Check again, just in case another thread changed it */
 1459|      1|    use_fallbacks = store->use_fallbacks;
 1460|      1|    if (!use_fallbacks) {
  ------------------
  |  Branch (1460:9): [True: 0, False: 1]
  ------------------
 1461|      0|        CRYPTO_THREAD_unlock(store->lock);
 1462|      0|        return 1;
 1463|      0|    }
 1464|       |
 1465|      4|    for (p = ossl_predefined_providers; p->name != NULL; p++) {
  ------------------
  |  Branch (1465:41): [True: 3, False: 1]
  ------------------
 1466|      3|        OSSL_PROVIDER *prov = NULL;
 1467|      3|        OSSL_PROVIDER_INFO *info = store->provinfo;
 1468|      3|        STACK_OF(INFOPAIR) *params = NULL;
  ------------------
  |  |   33|      3|#define STACK_OF(type) struct stack_st_##type
  ------------------
 1469|      3|        size_t i;
 1470|       |
 1471|      3|        if (!p->is_fallback)
  ------------------
  |  Branch (1471:13): [True: 2, False: 1]
  ------------------
 1472|      2|            continue;
 1473|       |
 1474|      1|        for (i = 0; i < store->numprovinfo; info++, i++) {
  ------------------
  |  Branch (1474:21): [True: 0, False: 1]
  ------------------
 1475|      0|            if (strcmp(info->name, p->name) != 0)
  ------------------
  |  Branch (1475:17): [True: 0, False: 0]
  ------------------
 1476|      0|                continue;
 1477|      0|            params = info->parameters;
 1478|      0|            break;
 1479|      0|        }
 1480|       |
 1481|       |        /*
 1482|       |         * We use the internal constructor directly here,
 1483|       |         * otherwise we get a call loop
 1484|       |         */
 1485|      1|        prov = provider_new(p->name, p->init, params);
 1486|      1|        if (prov == NULL)
  ------------------
  |  Branch (1486:13): [True: 0, False: 1]
  ------------------
 1487|      0|            goto err;
 1488|      1|        prov->libctx = store->libctx;
 1489|      1|#ifndef FIPS_MODULE
 1490|      1|        prov->error_lib = ERR_get_next_error_library();
 1491|      1|#endif
 1492|       |
 1493|       |        /*
 1494|       |         * We are calling provider_activate while holding the store lock. This
 1495|       |         * means the init function will be called while holding a lock. Normally
 1496|       |         * we try to avoid calling a user callback while holding a lock.
 1497|       |         * However, fallbacks are never third party providers so we accept this.
 1498|       |         */
 1499|      1|        if (provider_activate(prov, 0, 0) < 0) {
  ------------------
  |  Branch (1499:13): [True: 0, False: 1]
  ------------------
 1500|      0|            ossl_provider_free(prov);
 1501|      0|            goto err;
 1502|      0|        }
 1503|      1|        prov->store = store;
 1504|      1|        if (sk_OSSL_PROVIDER_push(store->providers, prov) == 0) {
  ------------------
  |  Branch (1504:13): [True: 0, False: 1]
  ------------------
 1505|      0|            ossl_provider_free(prov);
 1506|      0|            goto err;
 1507|      0|        }
 1508|      1|        activated_fallback_count++;
 1509|      1|    }
 1510|       |
 1511|      1|    if (activated_fallback_count > 0) {
  ------------------
  |  Branch (1511:9): [True: 1, False: 0]
  ------------------
 1512|      1|        store->use_fallbacks = 0;
 1513|      1|        ret = 1;
 1514|      1|    }
 1515|      1|err:
 1516|      1|    CRYPTO_THREAD_unlock(store->lock);
 1517|      1|    return ret;
 1518|      1|}

ossl_err_load_RAND_strings:
  105|      1|{
  106|      1|#ifndef OPENSSL_NO_ERR
  107|      1|    if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (107:9): [True: 1, False: 0]
  ------------------
  108|      1|        ERR_load_strings_const(RAND_str_reasons);
  109|      1|#endif
  110|      1|    return 1;
  111|      1|}

RAND_poll:
  191|      1|{
  192|      1|    static const char salt[] = "polling";
  193|       |
  194|      1|#ifndef OPENSSL_NO_DEPRECATED_3_0
  195|      1|    const RAND_METHOD *meth = RAND_get_rand_method();
  196|      1|    int ret = meth == RAND_OpenSSL();
  197|       |
  198|      1|    if (meth == NULL)
  ------------------
  |  Branch (198:9): [True: 0, False: 1]
  ------------------
  199|      0|        return 0;
  200|       |
  201|      1|    if (!ret) {
  ------------------
  |  Branch (201:9): [True: 0, False: 1]
  ------------------
  202|       |        /* fill random pool and seed the current legacy RNG */
  203|      0|        RAND_POOL *pool = ossl_rand_pool_new(RAND_DRBG_STRENGTH, 1,
  ------------------
  |  |   37|      0|#define RAND_DRBG_STRENGTH 256
  ------------------
  204|      0|            (RAND_DRBG_STRENGTH + 7) / 8,
  ------------------
  |  |   37|      0|#define RAND_DRBG_STRENGTH 256
  ------------------
  205|      0|            RAND_POOL_MAX_LENGTH);
  ------------------
  |  |   36|      0|#define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * 3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   35|      0|#define RAND_POOL_FACTOR 256
  |  |  ------------------
  |  |               #define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * 3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   37|      0|#define RAND_DRBG_STRENGTH 256
  |  |  ------------------
  ------------------
  206|       |
  207|      0|        if (pool == NULL)
  ------------------
  |  Branch (207:13): [True: 0, False: 0]
  ------------------
  208|      0|            return 0;
  209|       |
  210|      0|        if (ossl_pool_acquire_entropy(pool) == 0)
  ------------------
  |  Branch (210:13): [True: 0, False: 0]
  ------------------
  211|      0|            goto err;
  212|       |
  213|      0|        if (meth->add == NULL
  ------------------
  |  Branch (213:13): [True: 0, False: 0]
  ------------------
  214|      0|            || meth->add(ossl_rand_pool_buffer(pool),
  ------------------
  |  Branch (214:16): [True: 0, False: 0]
  ------------------
  215|      0|                   (int)ossl_rand_pool_length(pool),
  216|      0|                   (ossl_rand_pool_entropy(pool) / 8.0))
  217|      0|                == 0)
  218|      0|            goto err;
  219|       |
  220|      0|        ret = 1;
  221|      0|    err:
  222|      0|        ossl_rand_pool_free(pool);
  223|      0|        return ret;
  224|      0|    }
  225|      1|#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  226|       |
  227|      1|    RAND_seed(salt, sizeof(salt));
  228|      1|    return 1;
  229|      1|}
RAND_get_rand_method:
  251|      8|{
  252|      8|    const RAND_METHOD *tmp_meth = NULL;
  253|      8|    int lock_failed;
  254|       |
  255|      8|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|      8|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 8, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (255:9): [True: 0, False: 8]
  ------------------
  256|      0|        goto end;
  257|       |
  258|      8|    if (CRYPTO_atomic_load_ptr((void **)&default_RAND_meth, (void **)&tmp_meth,
  ------------------
  |  Branch (258:9): [True: 8, False: 0]
  ------------------
  259|      8|            rand_meth_lock)) {
  260|      8|        if (tmp_meth != NULL)
  ------------------
  |  Branch (260:13): [True: 7, False: 1]
  ------------------
  261|      7|            return tmp_meth;
  262|      8|    } else {
  263|      0|        return NULL;
  264|      0|    }
  265|       |
  266|       |    /*
  267|       |     * We atomically compare and exchange default_RAND_meth
  268|       |     * if default_RAND_meth is NULL, we assign ossl_rand_meth to it
  269|       |     * If this returns 1, then the exchange was successful, and we can just
  270|       |     * return &ossl_rand_meth
  271|       |     * If it fails, then the contents of default_RAND_meth are written to tmp_meth
  272|       |     * which we can just return as is
  273|       |     */
  274|      1|    if (CRYPTO_atomic_cmp_exch_ptr((void **)&default_RAND_meth, (void **)&tmp_meth,
  ------------------
  |  Branch (274:9): [True: 1, False: 0]
  ------------------
  275|      1|            (void *)&ossl_rand_meth, rand_meth_lock, &lock_failed)) {
  276|      1|        tmp_meth = &ossl_rand_meth;
  277|      1|    } else {
  278|      0|        if (lock_failed == 1)
  ------------------
  |  Branch (278:13): [True: 0, False: 0]
  ------------------
  279|      0|            return NULL;
  280|      0|    }
  281|      1|end:
  282|      1|    return tmp_meth;
  283|      1|}
RAND_seed:
  287|      2|{
  288|      2|    EVP_RAND_CTX *drbg;
  289|      2|#ifndef OPENSSL_NO_DEPRECATED_3_0
  290|      2|    const RAND_METHOD *meth = RAND_get_rand_method();
  291|       |
  292|      2|    if (meth != NULL && meth->seed != NULL) {
  ------------------
  |  Branch (292:9): [True: 2, False: 0]
  |  Branch (292:25): [True: 2, False: 0]
  ------------------
  293|      2|        meth->seed(buf, num);
  294|      2|        return;
  295|      2|    }
  296|      0|#endif
  297|       |
  298|      0|    drbg = RAND_get0_primary(NULL);
  299|      0|    if (drbg != NULL && num > 0)
  ------------------
  |  Branch (299:9): [True: 0, False: 0]
  |  Branch (299:25): [True: 0, False: 0]
  ------------------
  300|      0|        EVP_RAND_reseed(drbg, 0, NULL, 0, buf, num);
  301|      0|}
RAND_status:
  338|      1|{
  339|      1|    EVP_RAND_CTX *rand;
  340|      1|#ifndef OPENSSL_NO_DEPRECATED_3_0
  341|      1|    const RAND_METHOD *meth = RAND_get_rand_method();
  342|       |
  343|      1|    if (meth != NULL && meth != RAND_OpenSSL())
  ------------------
  |  Branch (343:9): [True: 1, False: 0]
  |  Branch (343:25): [True: 0, False: 1]
  ------------------
  344|      0|        return meth->status != NULL ? meth->status() : 0;
  ------------------
  |  Branch (344:16): [True: 0, False: 0]
  ------------------
  345|      1|#endif
  346|       |
  347|      1|    if ((rand = RAND_get0_primary(NULL)) == NULL)
  ------------------
  |  Branch (347:9): [True: 0, False: 1]
  ------------------
  348|      0|        return 0;
  349|      1|    return EVP_RAND_get_state(rand) == EVP_RAND_STATE_READY;
  ------------------
  |  | 1331|      1|#define EVP_RAND_STATE_READY 1
  ------------------
  350|      1|}
RAND_bytes_ex:
  411|      2|{
  412|      2|    RAND_GLOBAL *dgbl;
  413|      2|    EVP_RAND_CTX *rand;
  414|      2|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  415|      2|    const RAND_METHOD *meth = RAND_get_rand_method();
  416|       |
  417|      2|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (417:9): [True: 2, False: 0]
  |  Branch (417:25): [True: 0, False: 2]
  ------------------
  418|      0|        if (num > INT_MAX) {
  ------------------
  |  Branch (418:13): [True: 0, False: 0]
  ------------------
  419|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  420|      0|            return -1;
  421|      0|        }
  422|      0|        if (meth->bytes != NULL)
  ------------------
  |  Branch (422:13): [True: 0, False: 0]
  ------------------
  423|      0|            return meth->bytes(buf, (int)num);
  424|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  425|      0|        return -1;
  426|      0|    }
  427|      2|#endif
  428|       |
  429|      2|    dgbl = rand_get_global(ctx);
  430|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (430:9): [True: 0, False: 2]
  ------------------
  431|      0|        return 0;
  432|      2|#ifndef FIPS_MODULE
  433|      2|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (433:9): [True: 0, False: 2]
  ------------------
  434|      0|        return ossl_provider_random_bytes(dgbl->random_provider,
  435|      0|            OSSL_PROV_RANDOM_PUBLIC,
  ------------------
  |  |  123|      0|#define OSSL_PROV_RANDOM_PUBLIC 0
  ------------------
  436|      0|            buf, num, strength);
  437|      2|#endif /* !FIPS_MODULE */
  438|       |
  439|      2|    rand = rand_get0_public(ctx, dgbl);
  440|      2|    if (rand != NULL)
  ------------------
  |  Branch (440:9): [True: 2, False: 0]
  ------------------
  441|      2|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  442|       |
  443|      0|    return 0;
  444|      2|}
RAND_bytes:
  447|      2|{
  448|      2|    if (num < 0)
  ------------------
  |  Branch (448:9): [True: 0, False: 2]
  ------------------
  449|      0|        return 0;
  450|      2|    return RAND_bytes_ex(NULL, buf, (size_t)num, 0);
  451|      2|}
ossl_rand_ctx_new:
  458|      1|{
  459|      1|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  460|       |
  461|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (461:9): [True: 0, False: 1]
  ------------------
  462|      0|        return NULL;
  463|       |
  464|      1|    dgbl->seed_strict = -1;
  465|       |
  466|      1|#ifndef FIPS_MODULE
  467|       |    /*
  468|       |     * We need to ensure that base libcrypto thread handling has been
  469|       |     * initialised.
  470|       |     */
  471|      1|    OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      1|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  472|       |
  473|       |    /* Prepopulate the random provider name */
  474|      1|    dgbl->random_provider_name = OPENSSL_strdup(random_provider_fips_name);
  ------------------
  |  |  140|      1|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  475|      1|    if (dgbl->random_provider_name == NULL)
  ------------------
  |  Branch (475:9): [True: 0, False: 1]
  ------------------
  476|      0|        goto err0;
  477|      1|#endif
  478|       |
  479|      1|    dgbl->lock = CRYPTO_THREAD_lock_new();
  480|      1|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (480:9): [True: 0, False: 1]
  ------------------
  481|      0|        goto err1;
  482|       |
  483|      1|    return dgbl;
  484|       |
  485|      0|err1:
  486|      0|    CRYPTO_THREAD_lock_free(dgbl->lock);
  487|      0|#ifndef FIPS_MODULE
  488|      0|err0:
  489|      0|    OPENSSL_free(dgbl->random_provider_name);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  490|      0|#endif
  491|      0|    OPENSSL_free(dgbl);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  492|       |    return NULL;
  493|      0|}
RAND_get0_primary:
  914|      3|{
  915|      3|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  916|       |
  917|      3|    return dgbl == NULL ? NULL : rand_get0_primary(ctx, dgbl);
  ------------------
  |  Branch (917:12): [True: 0, False: 3]
  ------------------
  918|      3|}
rand_lib.c:do_rand_init:
  130|      1|{
  131|      1|#ifndef OPENSSL_NO_DEPRECATED_3_0
  132|      1|    rand_meth_lock = CRYPTO_THREAD_lock_new();
  133|      1|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 1]
  ------------------
  134|      0|        goto err;
  135|      1|#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  136|       |
  137|      1|    if (!ossl_rand_pool_init())
  ------------------
  |  Branch (137:9): [True: 0, False: 1]
  ------------------
  138|      0|        goto err;
  139|       |
  140|      1|    rand_inited = 1;
  141|      1|    return 1;
  142|       |
  143|      0|err:
  144|      0|#ifndef OPENSSL_NO_DEPRECATED_3_0
  145|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
  146|       |    rand_meth_lock = NULL;
  147|      0|#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  148|      0|    return 0;
  149|      1|}
rand_lib.c:rand_get_global:
   87|      8|{
   88|      8|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX);
  ------------------
  |  |  101|      8|#define OSSL_LIB_CTX_DRBG_INDEX 5
  ------------------
   89|      8|}
rand_lib.c:rand_get0_seed:
  679|      1|{
  680|      1|    EVP_RAND_CTX *ret, *seed;
  681|      1|    RAND_SEED_CONSTRUCTION marker;
  682|       |
  683|      1|    if (!CRYPTO_THREAD_read_lock(dgbl->lock))
  ------------------
  |  Branch (683:9): [True: 0, False: 1]
  ------------------
  684|      0|        return NULL;
  685|      1|    ret = dgbl->seed;
  686|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  687|      1|    if (ret != NULL)
  ------------------
  |  Branch (687:9): [True: 0, False: 1]
  ------------------
  688|      0|        return ret;
  689|       |
  690|       |    /*
  691|       |     * Mark before fetching so recursion through provider lookup is covered
  692|       |     * as well as recursion during context creation or instantiation.
  693|       |     */
  694|      1|    if (!rand_seed_construction_begin(ctx, &marker))
  ------------------
  |  Branch (694:9): [True: 0, False: 1]
  ------------------
  695|      0|        return NULL;
  696|       |
  697|      1|    seed = rand_new_seed(ctx);
  698|      1|    if (!rand_seed_construction_end(ctx, &marker)) {
  ------------------
  |  Branch (698:9): [True: 0, False: 1]
  ------------------
  699|      0|        EVP_RAND_CTX_free(seed);
  700|      0|        return NULL;
  701|      0|    }
  702|      1|    if (seed == NULL)
  ------------------
  |  Branch (702:9): [True: 0, False: 1]
  ------------------
  703|      0|        return NULL;
  704|       |
  705|      1|    if (!CRYPTO_THREAD_write_lock(dgbl->lock)) {
  ------------------
  |  Branch (705:9): [True: 0, False: 1]
  ------------------
  706|      0|        EVP_RAND_CTX_free(seed);
  707|      0|        return NULL;
  708|      0|    }
  709|      1|    if (dgbl->seed == NULL) {
  ------------------
  |  Branch (709:9): [True: 1, False: 0]
  ------------------
  710|      1|        dgbl->seed = seed;
  711|      1|        seed = NULL;
  712|      1|    }
  713|      1|    ret = dgbl->seed;
  714|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  715|       |    /* Free the instance that lost a creation race */
  716|      1|    EVP_RAND_CTX_free(seed);
  717|      1|    return ret;
  718|      1|}
rand_lib.c:rand_seed_construction_begin:
  619|      1|{
  620|      1|    RAND_SEED_CONSTRUCTION *current, *head;
  621|      1|#ifndef FIPS_MODULE
  622|      1|    ASYNC_JOB *job = ASYNC_get_current_job();
  623|      1|#endif
  624|       |
  625|      1|    head = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_RAND_SEED_KEY, ctx);
  626|      1|    for (current = head; current != NULL; current = current->next) {
  ------------------
  |  Branch (626:26): [True: 0, False: 1]
  ------------------
  627|      0|#ifndef FIPS_MODULE
  628|      0|        if (current->job != job)
  ------------------
  |  Branch (628:13): [True: 0, False: 0]
  ------------------
  629|      0|            continue;
  630|      0|#endif
  631|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  632|      0|        return 0;
  633|      0|    }
  634|       |
  635|      1|#ifndef FIPS_MODULE
  636|      1|    marker->job = job;
  637|      1|#endif
  638|      1|    marker->next = head;
  639|      1|    if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_RAND_SEED_KEY, ctx,
  ------------------
  |  Branch (639:9): [True: 0, False: 1]
  ------------------
  640|      1|            marker)) {
  641|      0|        ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  642|      0|        return 0;
  643|      0|    }
  644|      1|    return 1;
  645|      1|}
rand_lib.c:rand_new_seed:
  559|      1|{
  560|      1|    EVP_RAND *rand;
  561|      1|    const char *propq;
  562|      1|    char *name;
  563|      1|    EVP_RAND_CTX *ctx = NULL;
  564|      1|    int fallback = 0;
  565|      1|#ifdef OPENSSL_NO_FIPS_JITTER
  566|      1|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  567|       |
  568|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (568:9): [True: 0, False: 1]
  ------------------
  569|      0|        return NULL;
  570|      1|    propq = dgbl->seed_propq;
  571|       |#ifdef OPENSSL_DEFAULT_SEED_PROPQ
  572|       |    if (propq == NULL)
  573|       |        propq = OPENSSL_MSTR(OPENSSL_DEFAULT_SEED_PROPQ);
  574|       |#endif /* OPENSSL_DEFAULT_SEED_PROPQ */
  575|      1|    if (dgbl->seed_name != NULL) {
  ------------------
  |  Branch (575:9): [True: 0, False: 1]
  ------------------
  576|      0|        name = dgbl->seed_name;
  577|      1|    } else {
  578|      1|        fallback = !rand_seed_source_strict(dgbl);
  579|      1|        name = OPENSSL_SEED_SRC_NAME;
  ------------------
  |  |   49|      1|#define OPENSSL_SEED_SRC_NAME "SEED-SRC"
  ------------------
  580|      1|    }
  581|       |#else /* !OPENSSL_NO_FIPS_JITTER */
  582|       |    name = OPENSSL_SEED_SRC_NAME;
  583|       |    propq = "";
  584|       |#endif /* OPENSSL_NO_FIPS_JITTER */
  585|       |
  586|      1|    ERR_set_mark();
  587|      1|    rand = EVP_RAND_fetch(libctx, name, propq);
  588|      1|    ERR_pop_to_mark();
  589|      1|    if (rand == NULL) {
  ------------------
  |  Branch (589:9): [True: 0, False: 1]
  ------------------
  590|      0|        if (!fallback)
  ------------------
  |  Branch (590:13): [True: 0, False: 0]
  ------------------
  591|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  592|      0|        goto err;
  593|      0|    }
  594|      1|    ctx = EVP_RAND_CTX_new(rand, NULL);
  595|      1|    EVP_RAND_free(rand);
  596|      1|    if (ctx == NULL) {
  ------------------
  |  Branch (596:9): [True: 0, False: 1]
  ------------------
  597|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  598|      0|        goto err;
  599|      0|    }
  600|      1|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, NULL)) {
  ------------------
  |  Branch (600:9): [True: 0, False: 1]
  ------------------
  601|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  602|      0|        goto err;
  603|      0|    }
  604|      1|    return ctx;
  605|      0|err:
  606|      0|    EVP_RAND_CTX_free(ctx);
  607|       |    return NULL;
  608|      1|}
rand_lib.c:rand_seed_construction_end:
  649|      1|{
  650|      1|    RAND_SEED_CONSTRUCTION *current, *head;
  651|       |
  652|      1|    head = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_RAND_SEED_KEY, ctx);
  653|      1|    if (head == marker) {
  ------------------
  |  Branch (653:9): [True: 1, False: 0]
  ------------------
  654|      1|        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_RAND_SEED_KEY,
  ------------------
  |  Branch (654:13): [True: 0, False: 1]
  ------------------
  655|      1|                ctx, marker->next)) {
  656|      0|            ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  657|      0|            return 0;
  658|      0|        }
  659|      1|        return 1;
  660|      1|    }
  661|       |
  662|      0|    for (current = head; current != NULL; current = current->next) {
  ------------------
  |  Branch (662:26): [True: 0, False: 0]
  ------------------
  663|      0|        if (current->next == marker) {
  ------------------
  |  Branch (663:13): [True: 0, False: 0]
  ------------------
  664|      0|            current->next = marker->next;
  665|      0|            return 1;
  666|      0|        }
  667|      0|    }
  668|       |
  669|      0|    ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  670|      0|    return 0;
  671|      0|}
rand_lib.c:rand_seed_source_strict:
  545|      1|{
  546|      1|#ifdef OPENSSL_NO_FIPS_JITTER
  547|      1|    const char *name;
  548|       |
  549|      1|    if (dgbl->seed_strict >= 0)
  ------------------
  |  Branch (549:9): [True: 0, False: 1]
  ------------------
  550|      0|        return dgbl->seed_strict;
  551|      1|    name = dgbl->seed_name != NULL ? dgbl->seed_name : OPENSSL_SEED_SRC_NAME;
  ------------------
  |  |   49|      2|#define OPENSSL_SEED_SRC_NAME "SEED-SRC"
  ------------------
  |  Branch (551:12): [True: 0, False: 1]
  ------------------
  552|      1|    return OPENSSL_strcasecmp(name, "JITTER") == 0;
  553|       |#else /* !OPENSSL_NO_FIPS_JITTER */
  554|       |    return 1;
  555|       |#endif /* OPENSSL_NO_FIPS_JITTER */
  556|      1|}
rand_lib.c:rand_get0_primary:
  844|      4|{
  845|      4|    EVP_RAND_CTX *ret, *seed = NULL, *primary;
  846|       |
  847|      4|    if (dgbl == NULL)
  ------------------
  |  Branch (847:9): [True: 0, False: 4]
  ------------------
  848|      0|        return NULL;
  849|       |
  850|      4|    if (!CRYPTO_THREAD_read_lock(dgbl->lock))
  ------------------
  |  Branch (850:9): [True: 0, False: 4]
  ------------------
  851|      0|        return NULL;
  852|       |
  853|      4|    ret = dgbl->primary;
  854|      4|    CRYPTO_THREAD_unlock(dgbl->lock);
  855|       |
  856|      4|    if (ret != NULL)
  ------------------
  |  Branch (856:9): [True: 3, False: 1]
  ------------------
  857|      3|        return ret;
  858|       |
  859|      1|#if !defined(FIPS_MODULE) || !defined(OPENSSL_NO_FIPS_JITTER)
  860|       |    /* Create a seed source for libcrypto or jitter enabled FIPS provider */
  861|      1|    ERR_set_mark();
  862|      1|    seed = rand_get0_seed(ctx, dgbl);
  863|      1|    if (seed == NULL && ERR_count_to_mark() > 0) {
  ------------------
  |  Branch (863:9): [True: 0, False: 1]
  |  Branch (863:25): [True: 0, False: 0]
  ------------------
  864|      0|        ERR_clear_last_mark();
  865|      0|        return NULL;
  866|      0|    }
  867|      1|    ERR_pop_to_mark();
  868|      1|#endif /* !FIPS_MODULE || !OPENSSL_NO_FIPS_JITTER */
  869|       |
  870|       |#if defined(FIPS_MODULE)
  871|       |    /* The FIPS provider has entropy health tests instead of the primary */
  872|       |    ret = rand_new_crngt(ctx, seed);
  873|       |#else /* FIPS_MODULE */
  874|      1|    ret = rand_new_drbg(ctx, seed, PRIMARY_RESEED_INTERVAL,
  ------------------
  |  |   23|      1|#define PRIMARY_RESEED_INTERVAL (1 << 8)
  ------------------
  875|      1|        PRIMARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   25|      1|#define PRIMARY_RESEED_TIME_INTERVAL (60 * 60) /* 1 hour */
  ------------------
  876|      1|#endif /* FIPS_MODULE */
  877|       |
  878|      1|    if (ret == NULL)
  ------------------
  |  Branch (878:9): [True: 0, False: 1]
  ------------------
  879|      0|        return NULL;
  880|       |
  881|       |    /*
  882|       |     * The primary DRBG may be shared between multiple threads so we must
  883|       |     * enable locking.
  884|       |     */
  885|      1|    if (!EVP_RAND_enable_locking(ret)) {
  ------------------
  |  Branch (885:9): [True: 0, False: 1]
  ------------------
  886|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_ENABLE_LOCKING);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  887|      0|        EVP_RAND_CTX_free(ret);
  888|      0|        return NULL;
  889|      0|    }
  890|       |
  891|      1|    if (!CRYPTO_THREAD_write_lock(dgbl->lock)) {
  ------------------
  |  Branch (891:9): [True: 0, False: 1]
  ------------------
  892|      0|        EVP_RAND_CTX_free(ret);
  893|      0|        return NULL;
  894|      0|    }
  895|       |
  896|      1|    primary = dgbl->primary;
  897|      1|    if (primary != NULL) {
  ------------------
  |  Branch (897:9): [True: 0, False: 1]
  ------------------
  898|      0|        CRYPTO_THREAD_unlock(dgbl->lock);
  899|      0|        EVP_RAND_CTX_free(ret);
  900|      0|        return primary;
  901|      0|    }
  902|      1|    dgbl->primary = ret;
  903|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  904|       |
  905|      1|    return ret;
  906|      1|}
rand_lib.c:rand_new_drbg:
  757|      2|{
  758|      2|    EVP_RAND *rand;
  759|      2|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  760|      2|    EVP_RAND_CTX *ctx;
  761|      2|    OSSL_PARAM params[9], *p = params;
  762|      2|    const OSSL_PARAM *settables;
  763|      2|    char *name, *cipher;
  764|      2|    int use_df = 1;
  765|       |
  766|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (766:9): [True: 0, False: 2]
  ------------------
  767|      0|        return NULL;
  768|      2|    name = dgbl->rng_name != NULL ? dgbl->rng_name : "CTR-DRBG";
  ------------------
  |  Branch (768:12): [True: 0, False: 2]
  ------------------
  769|      2|    rand = EVP_RAND_fetch(libctx, name, dgbl->rng_propq);
  770|      2|    if (rand == NULL) {
  ------------------
  |  Branch (770:9): [True: 0, False: 2]
  ------------------
  771|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  772|      0|        return NULL;
  773|      0|    }
  774|      2|    ctx = EVP_RAND_CTX_new(rand, parent);
  775|      2|    EVP_RAND_free(rand);
  776|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (776:9): [True: 0, False: 2]
  ------------------
  777|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  778|      0|        return NULL;
  779|      0|    }
  780|       |
  781|      2|    settables = EVP_RAND_CTX_settable_params(ctx);
  782|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_CIPHER)) {
  ------------------
  |  |  239|      2|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  127|      2|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (782:9): [True: 2, False: 0]
  ------------------
  783|      2|        cipher = dgbl->rng_cipher != NULL ? dgbl->rng_cipher : "AES-256-CTR";
  ------------------
  |  Branch (783:18): [True: 0, False: 2]
  ------------------
  784|      2|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
  ------------------
  |  |  239|      2|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  127|      2|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  785|      2|            cipher, 0);
  786|      2|    }
  787|      2|    if (dgbl->rng_digest != NULL
  ------------------
  |  Branch (787:9): [True: 0, False: 2]
  ------------------
  788|      0|        && OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_DIGEST))
  ------------------
  |  |  240|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  128|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  |  Branch (788:12): [True: 0, False: 0]
  ------------------
  789|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_DIGEST,
  ------------------
  |  |  240|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  128|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  790|      0|            dgbl->rng_digest, 0);
  791|      2|    if (dgbl->rng_propq != NULL)
  ------------------
  |  Branch (791:9): [True: 0, False: 2]
  ------------------
  792|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_PROPERTIES,
  ------------------
  |  |  254|      0|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  131|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  793|      0|            dgbl->rng_propq, 0);
  794|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_ALG_PARAM_MAC))
  ------------------
  |  |  130|      2|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  |  Branch (794:9): [True: 0, False: 2]
  ------------------
  795|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_MAC, "HMAC", 0);
  ------------------
  |  |  130|      0|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  796|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_USE_DF))
  ------------------
  |  |  261|      2|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (796:9): [True: 2, False: 0]
  ------------------
  797|      2|        *p++ = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_USE_DF, &use_df);
  ------------------
  |  |  261|      2|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  798|      2|    *p++ = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS,
  ------------------
  |  |  257|      2|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  799|      2|        &reseed_interval);
  800|      2|    *p++ = OSSL_PARAM_construct_time_t(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL,
  ------------------
  |  |  259|      2|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  801|      2|        &reseed_time_interval);
  802|      2|    *p = OSSL_PARAM_construct_end();
  803|      2|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, params)) {
  ------------------
  |  Branch (803:9): [True: 0, False: 2]
  ------------------
  804|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  805|      0|        EVP_RAND_CTX_free(ctx);
  806|      0|        return NULL;
  807|      0|    }
  808|      2|    return ctx;
  809|      2|}
rand_lib.c:rand_get0_public:
  921|      2|{
  922|      2|    EVP_RAND_CTX *rand, *primary;
  923|      2|    OSSL_LIB_CTX *origctx = ctx;
  924|       |
  925|      2|    ctx = ossl_lib_ctx_get_concrete(ctx);
  926|       |
  927|      2|    if (ctx == NULL)
  ------------------
  |  Branch (927:9): [True: 0, False: 2]
  ------------------
  928|      0|        return NULL;
  929|       |
  930|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (930:9): [True: 0, False: 2]
  ------------------
  931|      0|        return NULL;
  932|       |
  933|      2|    rand = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx);
  934|      2|    if (rand == NULL) {
  ------------------
  |  Branch (934:9): [True: 1, False: 1]
  ------------------
  935|      1|        primary = rand_get0_primary(origctx, dgbl);
  936|      1|        if (primary == NULL)
  ------------------
  |  Branch (936:13): [True: 0, False: 1]
  ------------------
  937|      0|            return NULL;
  938|       |
  939|       |        /*
  940|       |         * If the private is also NULL then this is the first time we've
  941|       |         * used this thread.
  942|       |         */
  943|      1|        if (CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx) == NULL
  ------------------
  |  Branch (943:13): [True: 1, False: 0]
  ------------------
  944|      1|            && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
  ------------------
  |  Branch (944:16): [True: 0, False: 1]
  ------------------
  945|      0|            return NULL;
  946|      1|        rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
  ------------------
  |  |   24|      1|#define SECONDARY_RESEED_INTERVAL (1 << 16)
  ------------------
  947|      1|            SECONDARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   26|      1|#define SECONDARY_RESEED_TIME_INTERVAL (7 * 60) /* 7 minutes */
  ------------------
  948|      1|        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx, rand)) {
  ------------------
  |  Branch (948:13): [True: 0, False: 1]
  ------------------
  949|      0|            EVP_RAND_CTX_free(rand);
  950|      0|            rand = NULL;
  951|      0|        }
  952|      1|    }
  953|      2|    return rand;
  954|      2|}

RAND_OpenSSL:
   63|      6|{
   64|      6|    return &ossl_rand_meth;
   65|      6|}
rand_meth.c:drbg_seed:
   27|      2|{
   28|      2|    return drbg_add(buf, num, num);
   29|      2|}
rand_meth.c:drbg_add:
   16|      2|{
   17|      2|    EVP_RAND_CTX *drbg = RAND_get0_primary(NULL);
   18|       |
   19|      2|    if (drbg == NULL || num <= 0)
  ------------------
  |  Branch (19:9): [True: 0, False: 2]
  |  Branch (19:25): [True: 0, False: 2]
  ------------------
   20|      0|        return 0;
   21|       |
   22|      2|    return EVP_RAND_reseed(drbg, 0, NULL, 0, buf, num);
   23|      2|}

ossl_rand_pool_new:
   23|      3|{
   24|      3|    RAND_POOL *pool = OPENSSL_zalloc(sizeof(*pool));
  ------------------
  |  |  113|      3|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   25|      3|    size_t min_alloc_size = RAND_POOL_MIN_ALLOCATION(secure);
  ------------------
  |  |   59|      3|#define RAND_POOL_MIN_ALLOCATION(secure) ((secure) ? 16 : 48)
  |  |  ------------------
  |  |  |  Branch (59:43): [True: 3, False: 0]
  |  |  ------------------
  ------------------
   26|       |
   27|      3|    if (pool == NULL)
  ------------------
  |  Branch (27:9): [True: 0, False: 3]
  ------------------
   28|      0|        return NULL;
   29|       |
   30|      3|    pool->min_len = min_len;
   31|      3|    pool->max_len = (max_len > RAND_POOL_MAX_LENGTH) ? RAND_POOL_MAX_LENGTH : max_len;
  ------------------
  |  |   36|      3|#define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * 3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   35|      3|#define RAND_POOL_FACTOR 256
  |  |  ------------------
  |  |               #define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * 3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   37|      3|#define RAND_DRBG_STRENGTH 256
  |  |  ------------------
  ------------------
                  pool->max_len = (max_len > RAND_POOL_MAX_LENGTH) ? RAND_POOL_MAX_LENGTH : max_len;
  ------------------
  |  |   36|      3|#define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * 3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   35|      3|#define RAND_POOL_FACTOR 256
  |  |  ------------------
  |  |               #define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * 3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   37|      3|#define RAND_DRBG_STRENGTH 256
  |  |  ------------------
  ------------------
  |  Branch (31:21): [True: 3, False: 0]
  ------------------
   32|      3|    pool->alloc_len = min_len < min_alloc_size ? min_alloc_size : min_len;
  ------------------
  |  Branch (32:23): [True: 0, False: 3]
  ------------------
   33|      3|    if (pool->alloc_len > pool->max_len)
  ------------------
  |  Branch (33:9): [True: 0, False: 3]
  ------------------
   34|      0|        pool->alloc_len = pool->max_len;
   35|       |
   36|      3|    if (secure)
  ------------------
  |  Branch (36:9): [True: 3, False: 0]
  ------------------
   37|      3|        pool->buffer = OPENSSL_secure_zalloc(pool->alloc_len);
  ------------------
  |  |  146|      3|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|      0|    else
   39|      0|        pool->buffer = OPENSSL_zalloc(pool->alloc_len);
  ------------------
  |  |  113|      0|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|       |
   41|      3|    if (pool->buffer == NULL)
  ------------------
  |  Branch (41:9): [True: 0, False: 3]
  ------------------
   42|      0|        goto err;
   43|       |
   44|      3|    pool->entropy_requested = entropy_requested;
   45|      3|    pool->secure = secure;
   46|      3|    return pool;
   47|       |
   48|      0|err:
   49|      0|    OPENSSL_free(pool);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|       |    return NULL;
   51|      3|}
ossl_rand_pool_free:
   87|      3|{
   88|      3|    if (pool == NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 3]
  ------------------
   89|      0|        return;
   90|       |
   91|       |    /*
   92|       |     * Although it would be advisable from a cryptographical viewpoint,
   93|       |     * we are not allowed to clear attached buffers, since they are passed
   94|       |     * to ossl_rand_pool_attach() as `const unsigned char*`.
   95|       |     * (see corresponding comment in ossl_rand_pool_attach()).
   96|       |     */
   97|      3|    if (!pool->attached) {
  ------------------
  |  Branch (97:9): [True: 3, False: 0]
  ------------------
   98|      3|        if (pool->secure)
  ------------------
  |  Branch (98:13): [True: 3, False: 0]
  ------------------
   99|      3|            OPENSSL_secure_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  154|      3|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  100|      0|        else
  101|      0|            OPENSSL_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  134|      0|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|      3|    }
  103|       |
  104|      3|    OPENSSL_free(pool);
  ------------------
  |  |  136|      3|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  105|      3|}
ossl_rand_pool_length:
  127|      3|{
  128|      3|    return pool->len;
  129|      3|}
ossl_rand_pool_detach:
  138|      3|{
  139|      3|    unsigned char *ret = pool->buffer;
  140|       |    pool->buffer = NULL;
  141|      3|    pool->entropy = 0;
  142|      3|    return ret;
  143|      3|}
ossl_rand_pool_entropy_available:
  172|      3|{
  173|      3|    if (pool->entropy < pool->entropy_requested)
  ------------------
  |  Branch (173:9): [True: 0, False: 3]
  ------------------
  174|      0|        return 0;
  175|       |
  176|      3|    if (pool->len < pool->min_len)
  ------------------
  |  Branch (176:9): [True: 0, False: 3]
  ------------------
  177|      0|        return 0;
  178|       |
  179|      3|    return pool->entropy;
  180|      3|}
ossl_rand_pool_entropy_needed:
  188|      3|{
  189|      3|    if (pool->entropy < pool->entropy_requested)
  ------------------
  |  Branch (189:9): [True: 3, False: 0]
  ------------------
  190|      3|        return pool->entropy_requested - pool->entropy;
  191|       |
  192|      0|    return 0;
  193|      3|}
ossl_rand_pool_bytes_needed:
  236|      3|{
  237|      3|    size_t bytes_needed;
  238|      3|    size_t entropy_needed = ossl_rand_pool_entropy_needed(pool);
  239|       |
  240|      3|    if (entropy_factor < 1) {
  ------------------
  |  Branch (240:9): [True: 0, False: 3]
  ------------------
  241|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  242|      0|        return 0;
  243|      0|    }
  244|       |
  245|      3|    bytes_needed = ENTROPY_TO_BYTES(entropy_needed, entropy_factor);
  ------------------
  |  |  161|      3|    (((bits) * (entropy_factor) + 7) / 8)
  ------------------
  246|       |
  247|      3|    if (bytes_needed > pool->max_len - pool->len) {
  ------------------
  |  Branch (247:9): [True: 0, False: 3]
  ------------------
  248|       |        /* not enough space left */
  249|      0|        ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |   80|      0|#define ERR_LIB_RAND 36
  ------------------
                      ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |   53|      0|#define RAND_R_RANDOM_POOL_OVERFLOW 125
  ------------------
  250|      0|            "entropy_factor=%u, entropy_needed=%zu, bytes_needed=%zu,"
  251|      0|            "pool->max_len=%zu, pool->len=%zu",
  252|      0|            entropy_factor, entropy_needed, bytes_needed,
  253|      0|            pool->max_len, pool->len);
  254|      0|        return 0;
  255|      0|    }
  256|       |
  257|      3|    if (pool->len < pool->min_len && bytes_needed < pool->min_len - pool->len)
  ------------------
  |  Branch (257:9): [True: 3, False: 0]
  |  Branch (257:38): [True: 0, False: 3]
  ------------------
  258|       |        /* to meet the min_len requirement */
  259|      0|        bytes_needed = pool->min_len - pool->len;
  260|       |
  261|       |    /*
  262|       |     * Make sure the buffer is large enough for the requested amount
  263|       |     * of data. This guarantees that existing code patterns where
  264|       |     * ossl_rand_pool_add_begin, ossl_rand_pool_add_end or ossl_rand_pool_add
  265|       |     * are used to collect entropy data without any error handling
  266|       |     * whatsoever, continue to be valid.
  267|       |     * Furthermore if the allocation here fails once, make sure that
  268|       |     * we don't fall back to a less secure or even blocking random source,
  269|       |     * as that could happen by the existing code patterns.
  270|       |     * This is not a concern for additional data, therefore that
  271|       |     * is not needed if rand_pool_grow fails in other places.
  272|       |     */
  273|      3|    if (!rand_pool_grow(pool, bytes_needed)) {
  ------------------
  |  Branch (273:9): [True: 0, False: 3]
  ------------------
  274|       |        /* persistent error for this pool */
  275|      0|        pool->max_len = pool->len = 0;
  276|      0|        return 0;
  277|      0|    }
  278|       |
  279|      3|    return bytes_needed;
  280|      3|}
ossl_rand_pool_add_begin:
  353|      3|{
  354|      3|    if (len == 0)
  ------------------
  |  Branch (354:9): [True: 0, False: 3]
  ------------------
  355|      0|        return NULL;
  356|       |
  357|      3|    if (len > pool->max_len - pool->len) {
  ------------------
  |  Branch (357:9): [True: 0, False: 3]
  ------------------
  358|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  359|      0|        return NULL;
  360|      0|    }
  361|       |
  362|      3|    if (pool->buffer == NULL) {
  ------------------
  |  Branch (362:9): [True: 0, False: 3]
  ------------------
  363|      0|        ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  364|      0|        return NULL;
  365|      0|    }
  366|       |
  367|       |    /*
  368|       |     * As long as the allocation request stays within the limits given
  369|       |     * by ossl_rand_pool_bytes_needed this rand_pool_grow below is guaranteed
  370|       |     * to succeed, thus no allocation happens.
  371|       |     * We have that only for cases when a pool is used to collect
  372|       |     * additional data. Then the buffer might need to grow here,
  373|       |     * and of course the caller is responsible to check the return
  374|       |     * value of this function.
  375|       |     */
  376|      3|    if (!rand_pool_grow(pool, len))
  ------------------
  |  Branch (376:9): [True: 0, False: 3]
  ------------------
  377|      0|        return NULL;
  378|       |
  379|      3|    return pool->buffer + pool->len;
  380|      3|}
ossl_rand_pool_add_end:
  392|      3|{
  393|      3|    if (len > pool->alloc_len - pool->len) {
  ------------------
  |  Branch (393:9): [True: 0, False: 3]
  ------------------
  394|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  395|      0|        return 0;
  396|      0|    }
  397|       |
  398|      3|    if (len > 0) {
  ------------------
  |  Branch (398:9): [True: 3, False: 0]
  ------------------
  399|      3|        pool->len += len;
  400|      3|        pool->entropy += entropy;
  401|      3|    }
  402|       |
  403|      3|    return 1;
  404|      3|}
ossl_rand_pool_adin_mix_in:
  419|      3|{
  420|      3|    if (adin == NULL || adin_len == 0)
  ------------------
  |  Branch (420:9): [True: 0, False: 3]
  |  Branch (420:25): [True: 0, False: 3]
  ------------------
  421|       |        /* Nothing to mix in -> success */
  422|      0|        return 1;
  423|       |
  424|      3|    if (pool->buffer == NULL) {
  ------------------
  |  Branch (424:9): [True: 0, False: 3]
  ------------------
  425|      0|        ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  426|      0|        return 0;
  427|      0|    }
  428|       |
  429|      3|    if (pool->len == 0) {
  ------------------
  |  Branch (429:9): [True: 0, False: 3]
  ------------------
  430|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_IS_EMPTY);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  431|      0|        return 0;
  432|      0|    }
  433|       |
  434|      3|    if (adin != NULL && adin_len > 0) {
  ------------------
  |  Branch (434:9): [True: 3, False: 0]
  |  Branch (434:25): [True: 3, False: 0]
  ------------------
  435|      3|        size_t i;
  436|       |
  437|       |        /* xor the additional data into the pool */
  438|     27|        for (i = 0; i < adin_len; ++i)
  ------------------
  |  Branch (438:21): [True: 24, False: 3]
  ------------------
  439|     24|            pool->buffer[i % pool->len] ^= adin[i];
  440|      3|    }
  441|       |
  442|      3|    return 1;
  443|      3|}
rand_pool.c:rand_pool_grow:
  197|      6|{
  198|      6|    if (len > pool->alloc_len - pool->len) {
  ------------------
  |  Branch (198:9): [True: 0, False: 6]
  ------------------
  199|      0|        unsigned char *p;
  200|      0|        const size_t limit = pool->max_len / 2;
  201|      0|        size_t newlen = pool->alloc_len;
  202|       |
  203|      0|        if (pool->attached || len > pool->max_len - pool->len) {
  ------------------
  |  Branch (203:13): [True: 0, False: 0]
  |  Branch (203:31): [True: 0, False: 0]
  ------------------
  204|      0|            ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  205|      0|            return 0;
  206|      0|        }
  207|       |
  208|      0|        do
  209|      0|            newlen = newlen < limit ? newlen * 2 : pool->max_len;
  ------------------
  |  Branch (209:22): [True: 0, False: 0]
  ------------------
  210|      0|        while (len > newlen - pool->len);
  ------------------
  |  Branch (210:16): [True: 0, False: 0]
  ------------------
  211|       |
  212|      0|        if (pool->secure)
  ------------------
  |  Branch (212:13): [True: 0, False: 0]
  ------------------
  213|      0|            p = OPENSSL_secure_zalloc(newlen);
  ------------------
  |  |  146|      0|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  214|      0|        else
  215|      0|            p = OPENSSL_zalloc(newlen);
  ------------------
  |  |  113|      0|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|      0|        if (p == NULL)
  ------------------
  |  Branch (216:13): [True: 0, False: 0]
  ------------------
  217|      0|            return 0;
  218|      0|        memcpy(p, pool->buffer, pool->len);
  219|      0|        if (pool->secure)
  ------------------
  |  Branch (219:13): [True: 0, False: 0]
  ------------------
  220|      0|            OPENSSL_secure_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  154|      0|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  221|      0|        else
  222|      0|            OPENSSL_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  134|      0|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|      0|        pool->buffer = p;
  224|      0|        pool->alloc_len = newlen;
  225|      0|    }
  226|      6|    return 1;
  227|      6|}

ossl_err_load_RSA_strings:
  158|      1|{
  159|      1|#ifndef OPENSSL_NO_ERR
  160|      1|    if (ERR_reason_error_string(RSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (160:9): [True: 1, False: 0]
  ------------------
  161|      1|        ERR_load_strings_const(RSA_str_reasons);
  162|      1|#endif
  163|      1|    return 1;
  164|      1|}

ossl_self_test_set_callback_new:
   35|      1|{
   36|      1|    SELF_TEST_CB *stcb;
   37|       |
   38|      1|    stcb = OPENSSL_zalloc(sizeof(*stcb));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      1|    return stcb;
   40|      1|}

SHA512:
   75|      1|{
   76|      1|    static unsigned char m[SHA512_DIGEST_LENGTH];
   77|       |
   78|      1|    if (md == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 1]
  ------------------
   79|      0|        md = m;
   80|      1|    return EVP_Q_digest(NULL, "SHA512", NULL, d, n, md, NULL) ? md : NULL;
  ------------------
  |  Branch (80:12): [True: 1, False: 0]
  ------------------
   81|      1|}

SHA512_Init:
  132|      4|{
  133|      4|    c->h[0] = U64(0x6a09e667f3bcc908);
  ------------------
  |  |   72|      4|#define U64(C) C##ULL
  ------------------
  134|      4|    c->h[1] = U64(0xbb67ae8584caa73b);
  ------------------
  |  |   72|      4|#define U64(C) C##ULL
  ------------------
  135|      4|    c->h[2] = U64(0x3c6ef372fe94f82b);
  ------------------
  |  |   72|      4|#define U64(C) C##ULL
  ------------------
  136|      4|    c->h[3] = U64(0xa54ff53a5f1d36f1);
  ------------------
  |  |   72|      4|#define U64(C) C##ULL
  ------------------
  137|      4|    c->h[4] = U64(0x510e527fade682d1);
  ------------------
  |  |   72|      4|#define U64(C) C##ULL
  ------------------
  138|      4|    c->h[5] = U64(0x9b05688c2b3e6c1f);
  ------------------
  |  |   72|      4|#define U64(C) C##ULL
  ------------------
  139|      4|    c->h[6] = U64(0x1f83d9abfb41bd6b);
  ------------------
  |  |   72|      4|#define U64(C) C##ULL
  ------------------
  140|      4|    c->h[7] = U64(0x5be0cd19137e2179);
  ------------------
  |  |   72|      4|#define U64(C) C##ULL
  ------------------
  141|       |
  142|      4|    c->Nl = 0;
  143|      4|    c->Nh = 0;
  144|      4|    c->num = 0;
  145|      4|    c->md_len = SHA512_DIGEST_LENGTH;
  ------------------
  |  |   89|      4|#define SHA512_DIGEST_LENGTH 64
  ------------------
  146|      4|    return 1;
  147|      4|}
SHA512_Final:
  163|      4|{
  164|      4|    unsigned char *p = (unsigned char *)c->u.p;
  165|      4|    size_t n = c->num;
  166|       |
  167|      4|    p[n] = 0x80; /* There always is a room for one */
  168|      4|    n++;
  169|      4|    if (n > (sizeof(c->u) - 16)) {
  ------------------
  |  Branch (169:9): [True: 0, False: 4]
  ------------------
  170|      0|        memset(p + n, 0, sizeof(c->u) - n);
  171|      0|        n = 0;
  172|      0|        sha512_block_data_order(c, p, 1);
  173|      0|    }
  174|       |
  175|      4|    memset(p + n, 0, sizeof(c->u) - 16 - n);
  176|       |#ifdef B_ENDIAN
  177|       |    c->u.d[SHA_LBLOCK - 2] = c->Nh;
  178|       |    c->u.d[SHA_LBLOCK - 1] = c->Nl;
  179|       |#else
  180|      4|    uint8_t *cu = p + sizeof(c->u) - 16;
  181|       |
  182|      4|    cu = OPENSSL_store_u64_be(cu, (uint64_t)c->Nh);
  183|      4|    cu = OPENSSL_store_u64_be(cu, (uint64_t)c->Nl);
  184|      4|#endif
  185|       |
  186|      4|    sha512_block_data_order(c, p, 1);
  187|       |
  188|      4|    if (out == NULL)
  ------------------
  |  Branch (188:9): [True: 0, False: 4]
  ------------------
  189|      0|        return 0;
  190|       |
  191|       |    /* Let compiler decide if it's appropriate to unroll... */
  192|      4|    switch (c->md_len) {
  193|      0|    case SHA256_192_DIGEST_LENGTH:
  ------------------
  |  |   85|      0|#define SHA256_192_DIGEST_LENGTH 24
  ------------------
  |  Branch (193:5): [True: 0, False: 4]
  ------------------
  194|      0|        OUTPUT_RESULT(out, SHA256_192_DIGEST_LENGTH);
  ------------------
  |  |  159|      0|    for (n = 0; n < (len / 8); n++) \
  |  |  ------------------
  |  |  |  Branch (159:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  160|      0|    md = OPENSSL_store_u64_be(md, (uint64_t)c->h[n])
  ------------------
  195|      0|        break;
  196|      0|    case SHA256_DIGEST_LENGTH:
  ------------------
  |  |   87|      0|#define SHA256_DIGEST_LENGTH 32
  ------------------
  |  Branch (196:5): [True: 0, False: 4]
  ------------------
  197|      0|        OUTPUT_RESULT(out, SHA256_DIGEST_LENGTH);
  ------------------
  |  |  159|      0|    for (n = 0; n < (len / 8); n++) \
  |  |  ------------------
  |  |  |  Branch (159:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  160|      0|    md = OPENSSL_store_u64_be(md, (uint64_t)c->h[n])
  ------------------
  198|      0|        break;
  199|      0|    case SHA384_DIGEST_LENGTH:
  ------------------
  |  |   88|      0|#define SHA384_DIGEST_LENGTH 48
  ------------------
  |  Branch (199:5): [True: 0, False: 4]
  ------------------
  200|      0|        OUTPUT_RESULT(out, SHA384_DIGEST_LENGTH);
  ------------------
  |  |  159|      0|    for (n = 0; n < (len / 8); n++) \
  |  |  ------------------
  |  |  |  Branch (159:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  160|      0|    md = OPENSSL_store_u64_be(md, (uint64_t)c->h[n])
  ------------------
  201|      0|        break;
  202|      4|    case SHA512_DIGEST_LENGTH:
  ------------------
  |  |   89|      4|#define SHA512_DIGEST_LENGTH 64
  ------------------
  |  Branch (202:5): [True: 4, False: 0]
  ------------------
  203|      4|        OUTPUT_RESULT(out, SHA512_DIGEST_LENGTH);
  ------------------
  |  |  159|     36|    for (n = 0; n < (len / 8); n++) \
  |  |  ------------------
  |  |  |  Branch (159:17): [True: 32, False: 4]
  |  |  ------------------
  |  |  160|     32|    md = OPENSSL_store_u64_be(md, (uint64_t)c->h[n])
  ------------------
  204|      4|        break;
  205|      0|    case SHA224_DIGEST_LENGTH: {
  ------------------
  |  |   86|      0|#define SHA224_DIGEST_LENGTH 28
  ------------------
  |  Branch (205:5): [True: 0, False: 4]
  ------------------
  206|      0|        OUTPUT_RESULT(out, SHA224_DIGEST_LENGTH);
  ------------------
  |  |  159|      0|    for (n = 0; n < (len / 8); n++) \
  |  |  ------------------
  |  |  |  Branch (159:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  160|      0|    md = OPENSSL_store_u64_be(md, (uint64_t)c->h[n])
  ------------------
  207|       |        /*
  208|       |         * For 224 bits, there are four bytes left over that have to be
  209|       |         * processed separately.
  210|       |         */
  211|      0|        {
  212|      0|            SHA_LONG64 t = c->h[SHA224_DIGEST_LENGTH / 8];
  ------------------
  |  |   86|      0|#define SHA224_DIGEST_LENGTH 28
  ------------------
  213|       |
  214|      0|            *(out++) = (unsigned char)(t >> 56);
  215|      0|            *(out++) = (unsigned char)(t >> 48);
  216|      0|            *(out++) = (unsigned char)(t >> 40);
  217|      0|            *(out++) = (unsigned char)(t >> 32);
  218|      0|        }
  219|      0|        break;
  220|      0|    }
  221|       |    /* ... as well as make sure md_len is not abused. */
  222|      0|    default:
  ------------------
  |  Branch (222:5): [True: 0, False: 4]
  ------------------
  223|      0|        return 0;
  224|      4|    }
  225|       |
  226|      4|    return 1;
  227|      4|}
SHA512_Update_thunk:
  235|      9|{
  236|      9|    SHA512_CTX *c = (SHA512_CTX *)cp;
  237|      9|    SHA_LONG64 l;
  238|      9|    unsigned char *p = c->u.p;
  239|       |
  240|      9|    if (len == 0)
  ------------------
  |  Branch (240:9): [True: 0, False: 9]
  ------------------
  241|      0|        return 1;
  242|       |
  243|      9|    l = (c->Nl + (((SHA_LONG64)len) << 3)) & U64(0xffffffffffffffff);
  ------------------
  |  |   72|      9|#define U64(C) C##ULL
  ------------------
  244|      9|    if (l < c->Nl)
  ------------------
  |  Branch (244:9): [True: 0, False: 9]
  ------------------
  245|      0|        c->Nh++;
  246|      9|    if (sizeof(len) >= 8)
  ------------------
  |  Branch (246:9): [True: 9, Folded]
  ------------------
  247|      9|        c->Nh += (((SHA_LONG64)len) >> 61);
  248|      9|    c->Nl = l;
  249|       |
  250|      9|    if (c->num != 0) {
  ------------------
  |  Branch (250:9): [True: 5, False: 4]
  ------------------
  251|      5|        size_t n = sizeof(c->u) - c->num;
  252|       |
  253|      5|        if (len < n) {
  ------------------
  |  Branch (253:13): [True: 5, False: 0]
  ------------------
  254|      5|            memcpy(p + c->num, data, len), c->num += (unsigned int)len;
  255|      5|            return 1;
  256|      5|        } else {
  257|      0|            memcpy(p + c->num, data, n), c->num = 0;
  258|      0|            len -= n, data += n;
  259|      0|            sha512_block_data_order(c, p, 1);
  260|      0|        }
  261|      5|    }
  262|       |
  263|      4|    if (len >= sizeof(c->u)) {
  ------------------
  |  Branch (263:9): [True: 0, False: 4]
  ------------------
  264|       |#ifndef SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
  265|       |        if ((size_t)data % sizeof(c->u.d[0]) != 0)
  266|       |            while (len >= sizeof(c->u))
  267|       |                memcpy(p, data, sizeof(c->u)),
  268|       |                    sha512_block_data_order(c, p, 1),
  269|       |                    len -= sizeof(c->u), data += sizeof(c->u);
  270|       |        else
  271|       |#endif
  272|      0|            sha512_block_data_order(c, data, len / sizeof(c->u)),
  273|      0|                data += len, len %= sizeof(c->u), data -= len;
  274|      0|    }
  275|       |
  276|      4|    if (len != 0)
  ------------------
  |  Branch (276:9): [True: 4, False: 0]
  ------------------
  277|      4|        memcpy(p, data, len), c->num = (int)len;
  278|       |
  279|      4|    return 1;
  280|      9|}
SHA512_Update:
  283|      8|{
  284|      8|    return SHA512_Update_thunk((void *)c, (const unsigned char *)_data, len);
  285|      8|}

ossl_err_load_SM2_strings:
   41|      1|{
   42|      1|#ifndef OPENSSL_NO_ERR
   43|      1|    if (ERR_reason_error_string(SM2_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (43:9): [True: 1, False: 0]
  ------------------
   44|      1|        ERR_load_strings_const(SM2_str_reasons);
   45|      1|#endif
   46|      1|    return 1;
   47|      1|}

EVP_sm3:
   24|      1|{
   25|      1|    return &sm3_md;
   26|      1|}

ossl_sa_new:
   59|     19|{
   60|     19|    OPENSSL_SA *res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  113|     19|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|       |
   62|     19|    return res;
   63|     19|}
ossl_sa_get:
  157|    356|{
  158|    356|    int level;
  159|    356|    void **p, *r = NULL;
  160|       |
  161|    356|    if (sa == NULL || sa->nelem == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 356]
  |  Branch (161:23): [True: 5, False: 351]
  ------------------
  162|      5|        return NULL;
  163|       |
  164|    351|    if (n <= sa->top) {
  ------------------
  |  Branch (164:9): [True: 205, False: 146]
  ------------------
  165|    205|        p = sa->nodes;
  166|    592|        for (level = sa->levels - 1; p != NULL && level > 0; level--)
  ------------------
  |  Branch (166:38): [True: 410, False: 182]
  |  Branch (166:51): [True: 387, False: 23]
  ------------------
  167|    387|            p = (void **)p[(n >> (OPENSSL_SA_BLOCK_BITS * level))
  ------------------
  |  |   34|    387|#define OPENSSL_SA_BLOCK_BITS 4
  ------------------
  168|    387|                & SA_BLOCK_MASK];
  ------------------
  |  |   46|    387|#define SA_BLOCK_MASK (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    387|#define SA_BLOCK_MAX (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    387|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|    205|        r = p == NULL ? NULL : p[n & SA_BLOCK_MASK];
  ------------------
  |  |   46|     23|#define SA_BLOCK_MASK (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|     23|#define SA_BLOCK_MAX (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|     23|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (169:13): [True: 182, False: 23]
  ------------------
  170|    205|    }
  171|    351|    return r;
  172|    356|}
ossl_sa_set:
  180|    173|{
  181|    173|    int i, level = 1;
  182|    173|    ossl_uintmax_t n = posn;
  183|    173|    void **p;
  184|       |
  185|    173|    if (sa == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 173]
  ------------------
  186|      0|        return 0;
  187|       |
  188|    691|    for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++)
  ------------------
  |  |   47|    691|#define SA_BLOCK_MAX_LEVELS (((int)sizeof(ossl_uintmax_t) * 8 \
  |  |   48|    691|                                 + OPENSSL_SA_BLOCK_BITS - 1) \
  |  |  ------------------
  |  |  |  |   34|    691|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  ------------------
  |  |   49|    691|    / OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|    691|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (188:21): [True: 691, False: 0]
  ------------------
  189|    691|        if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0)
  ------------------
  |  |   34|    691|#define OPENSSL_SA_BLOCK_BITS 4
  ------------------
  |  Branch (189:13): [True: 173, False: 518]
  ------------------
  190|    173|            break;
  191|       |
  192|    206|    for (; sa->levels < level; sa->levels++) {
  ------------------
  |  Branch (192:12): [True: 33, False: 173]
  ------------------
  193|     33|        p = alloc_node();
  194|     33|        if (p == NULL)
  ------------------
  |  Branch (194:13): [True: 0, False: 33]
  ------------------
  195|      0|            return 0;
  196|     33|        p[0] = sa->nodes;
  197|     33|        sa->nodes = p;
  198|     33|    }
  199|    173|    if (sa->top < posn)
  ------------------
  |  Branch (199:9): [True: 77, False: 96]
  ------------------
  200|     77|        sa->top = posn;
  201|       |
  202|    173|    p = sa->nodes;
  203|    704|    for (level = sa->levels - 1; level > 0; level--) {
  ------------------
  |  Branch (203:34): [True: 531, False: 173]
  ------------------
  204|    531|        i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   34|    531|#define OPENSSL_SA_BLOCK_BITS 4
  ------------------
                      i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   46|    531|#define SA_BLOCK_MASK (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    531|#define SA_BLOCK_MAX (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    531|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|    531|        if (p[i] == NULL && (p[i] = alloc_node()) == NULL)
  ------------------
  |  Branch (205:13): [True: 369, False: 162]
  |  Branch (205:29): [True: 0, False: 369]
  ------------------
  206|      0|            return 0;
  207|    531|        p = p[i];
  208|    531|    }
  209|    173|    p += posn & SA_BLOCK_MASK;
  ------------------
  |  |   46|    173|#define SA_BLOCK_MASK (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    173|#define SA_BLOCK_MAX (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    173|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|    173|    if (val == NULL && *p != NULL)
  ------------------
  |  Branch (210:9): [True: 2, False: 171]
  |  Branch (210:24): [True: 2, False: 0]
  ------------------
  211|      2|        sa->nelem--;
  212|    171|    else if (val != NULL && *p == NULL)
  ------------------
  |  Branch (212:14): [True: 171, False: 0]
  |  Branch (212:29): [True: 170, False: 1]
  ------------------
  213|    170|        sa->nelem++;
  214|    173|    *p = val;
  215|    173|    return 1;
  216|    173|}
sparse_array.c:alloc_node:
  175|    402|{
  176|    402|    return OPENSSL_calloc(SA_BLOCK_MAX, sizeof(void *));
  ------------------
  |  |  117|    402|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|    402|}

ossl_err_load_SSL_strings:
  629|      1|{
  630|      1|#ifndef OPENSSL_NO_ERR
  631|      1|    if (ERR_reason_error_string(SSL_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (631:9): [True: 1, False: 0]
  ------------------
  632|      1|        ERR_load_strings_const(SSL_str_reasons);
  633|      1|#endif
  634|      1|    return 1;
  635|      1|}

OPENSSL_sk_deep_copy:
  116|      1|{
  117|      1|    return internal_copy(sk, copy_func, free_func);
  118|      1|}
OPENSSL_sk_dup:
  121|    166|{
  122|    166|    return internal_copy(sk, NULL, NULL);
  123|    166|}
OPENSSL_sk_new_null:
  126|    532|{
  127|       |    return OPENSSL_sk_new_reserve(NULL, 0);
  128|    532|}
OPENSSL_sk_new:
  131|      8|{
  132|      8|    return OPENSSL_sk_new_reserve(c, 0);
  133|      8|}
OPENSSL_sk_new_reserve:
  227|    540|{
  228|    540|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  113|    540|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  229|       |
  230|    540|    if (st == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 540]
  ------------------
  231|      0|        return NULL;
  232|       |
  233|    540|    st->comp = c;
  234|    540|    st->sorted = 1; /* empty or single-element stack is considered sorted */
  235|       |
  236|    540|    if (n <= 0)
  ------------------
  |  Branch (236:9): [True: 540, False: 0]
  ------------------
  237|    540|        return st;
  238|       |
  239|      0|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (239:9): [True: 0, False: 0]
  ------------------
  240|      0|        OPENSSL_sk_free(st);
  241|      0|        return NULL;
  242|      0|    }
  243|       |
  244|      0|    return st;
  245|      0|}
OPENSSL_sk_set_thunks:
  260|    546|{
  261|    546|    if (st != NULL)
  ------------------
  |  Branch (261:9): [True: 546, False: 0]
  ------------------
  262|    546|        st->free_thunk = f_thunk;
  263|       |
  264|    546|    return st;
  265|    546|}
OPENSSL_sk_set_cmp_thunks:
  268|    540|{
  269|    540|    if (st != NULL)
  ------------------
  |  Branch (269:9): [True: 540, False: 0]
  ------------------
  270|    540|        st->cmp_thunk = c_thunk;
  271|       |
  272|    540|    return st;
  273|    540|}
OPENSSL_sk_set_copy_thunks:
  276|    540|{
  277|    540|    if (st != NULL)
  ------------------
  |  Branch (277:9): [True: 540, False: 0]
  ------------------
  278|    540|        st->copy_thunk = cp_thunk;
  279|       |
  280|    540|    return st;
  281|    540|}
OPENSSL_sk_insert:
  284|    776|{
  285|    776|    int cmp_ret;
  286|       |
  287|    776|    if (st == NULL) {
  ------------------
  |  Branch (287:9): [True: 0, False: 776]
  ------------------
  288|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  289|      0|        return 0;
  290|      0|    }
  291|    776|    if (st->num == max_nodes) {
  ------------------
  |  Branch (291:9): [True: 0, False: 776]
  ------------------
  292|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  293|      0|        return 0;
  294|      0|    }
  295|       |
  296|    776|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (296:9): [True: 0, False: 776]
  ------------------
  297|      0|        return 0;
  298|       |
  299|    776|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (299:9): [True: 776, False: 0]
  |  Branch (299:29): [True: 0, False: 0]
  ------------------
  300|    776|        loc = st->num;
  301|    776|        st->data[loc] = data;
  302|    776|    } else {
  303|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  304|      0|            sizeof(st->data[0]) * (st->num - loc));
  305|      0|        st->data[loc] = data;
  306|      0|    }
  307|    776|    st->num++;
  308|    776|    if (st->sorted && st->num > 1) {
  ------------------
  |  Branch (308:9): [True: 503, False: 273]
  |  Branch (308:23): [True: 135, False: 368]
  ------------------
  309|    135|        if (st->comp != NULL) {
  ------------------
  |  Branch (309:13): [True: 0, False: 135]
  ------------------
  310|      0|            if (loc > 0) {
  ------------------
  |  Branch (310:17): [True: 0, False: 0]
  ------------------
  311|      0|                cmp_ret = cmp_with_thunk(st, &st->data[loc - 1], &st->data[loc]);
  312|      0|                if (cmp_ret > 0)
  ------------------
  |  Branch (312:21): [True: 0, False: 0]
  ------------------
  313|      0|                    st->sorted = 0;
  314|      0|            }
  315|      0|            if (loc < st->num - 1) {
  ------------------
  |  Branch (315:17): [True: 0, False: 0]
  ------------------
  316|      0|                cmp_ret = cmp_with_thunk(st, &st->data[loc + 1], &st->data[loc]);
  317|      0|                if (cmp_ret < 0)
  ------------------
  |  Branch (317:21): [True: 0, False: 0]
  ------------------
  318|      0|                    st->sorted = 0;
  319|      0|            }
  320|    135|        } else {
  321|    135|            st->sorted = 0;
  322|    135|        }
  323|    135|    }
  324|    776|    return st->num;
  325|    776|}
OPENSSL_sk_push:
  446|    776|{
  447|    776|    if (st == NULL)
  ------------------
  |  Branch (447:9): [True: 0, False: 776]
  ------------------
  448|      0|        return 0;
  449|    776|    return OPENSSL_sk_insert(st, data, st->num);
  450|    776|}
OPENSSL_sk_pop_free:
  480|      6|{
  481|      6|    int i;
  482|       |
  483|      6|    if (st == NULL)
  ------------------
  |  Branch (483:9): [True: 0, False: 6]
  ------------------
  484|      0|        return;
  485|       |
  486|      9|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (486:17): [True: 3, False: 6]
  ------------------
  487|      3|        free_with_thunk(st, func, st->data[i]);
  488|       |
  489|      6|    OPENSSL_sk_free(st);
  490|      6|}
OPENSSL_sk_free:
  493|    172|{
  494|    172|    if (st == NULL)
  ------------------
  |  Branch (494:9): [True: 0, False: 172]
  ------------------
  495|      0|        return;
  496|    172|    OPENSSL_free(st->data);
  ------------------
  |  |  136|    172|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  497|    172|    OPENSSL_free(st);
  ------------------
  |  |  136|    172|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  498|    172|}
OPENSSL_sk_num:
  501|  1.02k|{
  502|  1.02k|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (502:12): [True: 0, False: 1.02k]
  ------------------
  503|  1.02k|}
OPENSSL_sk_value:
  506|    714|{
  507|    714|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (507:9): [True: 0, False: 714]
  |  Branch (507:23): [True: 0, False: 714]
  |  Branch (507:32): [True: 0, False: 714]
  ------------------
  508|      0|        return NULL;
  509|    714|    return (void *)st->data[i];
  510|    714|}
OPENSSL_sk_sort:
  529|      6|{
  530|      6|    if (st != NULL && !st->sorted && st->comp != NULL) {
  ------------------
  |  Branch (530:9): [True: 6, False: 0]
  |  Branch (530:23): [True: 0, False: 6]
  |  Branch (530:38): [True: 0, False: 0]
  ------------------
  531|      0|        if (st->num > 1)
  ------------------
  |  Branch (531:13): [True: 0, False: 0]
  ------------------
  532|      0|            qsort(st->data, st->num, sizeof(void *), st->comp);
  533|      0|        st->sorted = 1; /* empty or single-element stack is considered sorted */
  534|      0|    }
  535|      6|}
stack.c:internal_copy:
   64|    167|{
   65|    167|    OPENSSL_STACK *ret;
   66|    167|    int i;
   67|       |
   68|    167|    if ((ret = OPENSSL_sk_new_null()) == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 167]
  ------------------
   69|      0|        goto err;
   70|       |
   71|    167|    if (sk == NULL)
  ------------------
  |  Branch (71:9): [True: 1, False: 166]
  ------------------
   72|      1|        goto done;
   73|       |
   74|       |    /* direct structure assignment */
   75|    166|    *ret = *sk;
   76|    166|    ret->data = NULL;
   77|    166|    ret->num_alloc = 0;
   78|       |
   79|    166|    if (ret->num == 0)
  ------------------
  |  Branch (79:9): [True: 0, False: 166]
  ------------------
   80|      0|        goto done; /* nothing to copy */
   81|       |
   82|    166|    ret->num_alloc = ret->num > min_nodes ? ret->num : min_nodes;
  ------------------
  |  Branch (82:22): [True: 1, False: 165]
  ------------------
   83|    166|    ret->data = OPENSSL_calloc(ret->num_alloc, sizeof(*ret->data));
  ------------------
  |  |  117|    166|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|    166|    if (ret->data == NULL)
  ------------------
  |  Branch (84:9): [True: 0, False: 166]
  ------------------
   85|      0|        goto err;
   86|    166|    if (copy_func == NULL) {
  ------------------
  |  Branch (86:9): [True: 166, False: 0]
  ------------------
   87|    166|        memcpy(ret->data, sk->data, sizeof(*ret->data) * ret->num);
   88|    166|    } else {
   89|      0|        for (i = 0; i < ret->num; ++i) {
  ------------------
  |  Branch (89:21): [True: 0, False: 0]
  ------------------
   90|      0|            if (sk->data[i] == NULL)
  ------------------
  |  Branch (90:17): [True: 0, False: 0]
  ------------------
   91|      0|                continue;
   92|      0|            if (ret->copy_thunk != NULL)
  ------------------
  |  Branch (92:17): [True: 0, False: 0]
  ------------------
   93|      0|                ret->data[i] = ret->copy_thunk(copy_func, sk->data[i]);
   94|      0|            else
   95|      0|                ret->data[i] = copy_func(sk->data[i]);
   96|       |
   97|      0|            if (ret->data[i] == NULL) {
  ------------------
  |  Branch (97:17): [True: 0, False: 0]
  ------------------
   98|      0|                while (--i >= 0)
  ------------------
  |  Branch (98:24): [True: 0, False: 0]
  ------------------
   99|      0|                    free_with_thunk(ret, free_func, ret->data[i]);
  100|      0|                goto err;
  101|      0|            }
  102|      0|        }
  103|      0|    }
  104|       |
  105|    167|done:
  106|    167|    return ret;
  107|       |
  108|      0|err:
  109|      0|    OPENSSL_sk_free(ret);
  110|       |    return NULL;
  111|    166|}
stack.c:sk_reserve:
  173|    776|{
  174|    776|    const void **tmpdata;
  175|    776|    int num_alloc;
  176|       |
  177|       |    /* Check to see the reservation isn't exceeding the hard limit */
  178|    776|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (178:9): [True: 0, False: 776]
  ------------------
  179|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|        return 0;
  181|      0|    }
  182|       |
  183|       |    /* Figure out the new size */
  184|    776|    num_alloc = st->num + n;
  185|    776|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (185:9): [True: 556, False: 220]
  ------------------
  186|    556|        num_alloc = min_nodes;
  187|       |
  188|       |    /* If |st->data| allocation was postponed */
  189|    776|    if (st->data == NULL) {
  ------------------
  |  Branch (189:9): [True: 368, False: 408]
  ------------------
  190|       |        /*
  191|       |         * At this point, |st->num_alloc| and |st->num| are 0;
  192|       |         * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
  193|       |         */
  194|    368|        if ((st->data = OPENSSL_calloc(num_alloc, sizeof(void *))) == NULL)
  ------------------
  |  |  117|    368|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (194:13): [True: 0, False: 368]
  ------------------
  195|      0|            return 0;
  196|    368|        st->num_alloc = num_alloc;
  197|    368|        return 1;
  198|    368|    }
  199|       |
  200|    408|    if (!exact) {
  ------------------
  |  Branch (200:9): [True: 408, False: 0]
  ------------------
  201|    408|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (201:13): [True: 394, False: 14]
  ------------------
  202|    394|            return 1;
  203|     14|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  204|     14|        if (num_alloc == 0) {
  ------------------
  |  Branch (204:13): [True: 0, False: 14]
  ------------------
  205|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  206|      0|            return 0;
  207|      0|        }
  208|     14|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (208:16): [True: 0, False: 0]
  ------------------
  209|      0|        return 1;
  210|      0|    }
  211|       |
  212|     14|    tmpdata = OPENSSL_realloc_array((void *)st->data, num_alloc, sizeof(void *));
  ------------------
  |  |  129|     14|    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  213|     14|    if (tmpdata == NULL)
  ------------------
  |  Branch (213:9): [True: 0, False: 14]
  ------------------
  214|      0|        return 0;
  215|       |
  216|     14|    st->data = tmpdata;
  217|     14|    st->num_alloc = num_alloc;
  218|     14|    return 1;
  219|     14|}
stack.c:compute_growth:
  155|     14|{
  156|     14|    int err = 0;
  157|       |
  158|     28|    while (current < target) {
  ------------------
  |  Branch (158:12): [True: 14, False: 14]
  ------------------
  159|     14|        if (current >= max_nodes)
  ------------------
  |  Branch (159:13): [True: 0, False: 14]
  ------------------
  160|      0|            return 0;
  161|       |
  162|     14|        current = safe_muldiv_int(current, 8, 5, &err);
  163|     14|        if (err != 0)
  ------------------
  |  Branch (163:13): [True: 0, False: 14]
  ------------------
  164|      0|            return 0;
  165|     14|        if (current >= max_nodes)
  ------------------
  |  Branch (165:13): [True: 0, False: 14]
  ------------------
  166|      0|            current = max_nodes;
  167|     14|    }
  168|     14|    return current;
  169|     14|}
stack.c:free_with_thunk:
   52|      3|{
   53|      3|    if (data == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 3]
  ------------------
   54|      0|        return;
   55|      3|    if (sk->free_thunk != NULL)
  ------------------
  |  Branch (55:9): [True: 3, False: 0]
  ------------------
   56|      3|        sk->free_thunk(free_func, (void *)data);
   57|      0|    else
   58|      0|        free_func((void *)data);
   59|      3|}

ossl_err_load_OSSL_STORE_strings:
   71|      1|{
   72|      1|#ifndef OPENSSL_NO_ERR
   73|      1|    if (ERR_reason_error_string(OSSL_STORE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (73:9): [True: 1, False: 0]
  ------------------
   74|      1|        ERR_load_strings_const(OSSL_STORE_str_reasons);
   75|      1|#endif
   76|      1|    return 1;
   77|      1|}

ossl_crypto_mutex_new:
   97|      1|{
   98|      1|    pthread_mutex_t *mutex;
   99|       |
  100|      1|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == NULL)
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (100:9): [True: 0, False: 1]
  ------------------
  101|      0|        return NULL;
  102|      1|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1]
  ------------------
  103|      0|        OPENSSL_free(mutex);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|      0|        return NULL;
  105|      0|    }
  106|      1|    return (CRYPTO_MUTEX *)mutex;
  107|      1|}
ossl_crypto_condvar_new:
  156|      1|{
  157|      1|    pthread_cond_t *cv_p;
  158|       |
  159|      1|    if ((cv_p = OPENSSL_zalloc(sizeof(*cv_p))) == NULL)
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (159:9): [True: 0, False: 1]
  ------------------
  160|      0|        return NULL;
  161|      1|    if (pthread_cond_init(cv_p, NULL) != 0) {
  ------------------
  |  Branch (161:9): [True: 0, False: 1]
  ------------------
  162|      0|        OPENSSL_free(cv_p);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      0|        return NULL;
  164|      0|    }
  165|      1|    return (CRYPTO_CONDVAR *)cv_p;
  166|      1|}

ossl_threads_ctx_new:
  128|      1|{
  129|      1|    struct openssl_threads_st *t = OPENSSL_zalloc(sizeof(*t));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|       |
  131|      1|    if (t == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 1]
  ------------------
  132|      0|        return NULL;
  133|       |
  134|      1|    t->lock = ossl_crypto_mutex_new();
  135|      1|    t->cond_finished = ossl_crypto_condvar_new();
  136|       |
  137|      1|    if (t->lock == NULL || t->cond_finished == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 1]
  |  Branch (137:28): [True: 0, False: 1]
  ------------------
  138|      0|        goto fail;
  139|       |
  140|      1|    return t;
  141|       |
  142|      0|fail:
  143|      0|    ossl_threads_ctx_free((void *)t);
  144|       |    return NULL;
  145|      1|}

CRYPTO_THREAD_get_local_ex:
  259|     24|{
  260|     24|    MASTER_KEY_ENTRY *mkey;
  261|     24|    CTX_TABLE_ENTRY ctxd;
  262|       |
  263|     24|    ctx = (ctx == CRYPTO_THREAD_NO_CONTEXT) ? NULL : ossl_lib_ctx_get_concrete(ctx);
  ------------------
  |  |   47|     24|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  |  Branch (263:11): [True: 19, False: 5]
  ------------------
  264|       |    /*
  265|       |     * Make sure the master key has been initialized
  266|       |     * NOTE: We use CRYPTO_THREAD_run_once here, rather than the
  267|       |     * RUN_ONCE macros.  We do this because this code is included both in
  268|       |     * libcrypto, and in fips.[dll|dylib|so].  FIPS attempts to avoid doing
  269|       |     * one time initialization of global data, and so suppresses the definition
  270|       |     * of RUN_ONCE, etc, meaning the build breaks if we were to use that with
  271|       |     * fips-enabled.  However, this is a special case in which we want/need
  272|       |     * this one bit of global data to be initialized in both the fips provider
  273|       |     * and in libcrypto, so we use CRYPTO_THREAD_run_one directly, which is
  274|       |     * always defined.
  275|       |     */
  276|     24|    if (!CRYPTO_THREAD_run_once(&master_once, init_master_key))
  ------------------
  |  Branch (276:9): [True: 0, False: 24]
  ------------------
  277|      0|        return NULL;
  278|       |
  279|     24|    if (!ossl_assert(id < CRYPTO_THREAD_LOCAL_KEY_MAX))
  ------------------
  |  |   45|     24|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|     24|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (279:9): [True: 0, False: 24]
  ------------------
  280|      0|        return NULL;
  281|       |
  282|       |    /*
  283|       |     * Get our master table sparse array, indexed by key id
  284|       |     */
  285|     24|    mkey = CRYPTO_THREAD_get_local(&master_key);
  286|     24|    if (mkey == NULL)
  ------------------
  |  Branch (286:9): [True: 1, False: 23]
  ------------------
  287|      1|        return NULL;
  288|       |
  289|       |    /*
  290|       |     * Get the specific data entry in the master key
  291|       |     * table for the key id we are searching for
  292|       |     */
  293|     23|    if (mkey[id].ctx_table == NULL)
  ------------------
  |  Branch (293:9): [True: 4, False: 19]
  ------------------
  294|      4|        return NULL;
  295|       |
  296|       |    /*
  297|       |     * If we find an entry above, that will be a sparse array,
  298|       |     * indexed by OSSL_LIB_CTX.
  299|       |     * Note: Because we're using sparse arrays here, we can do an easy
  300|       |     * trick, since we know all OSSL_LIB_CTX pointers are unique.  By casting
  301|       |     * the pointer to a unitptr_t, we can use that as an ordinal index into
  302|       |     * the sparse array.
  303|       |     */
  304|     19|    ctxd = ossl_sa_CTX_TABLE_ENTRY_get(mkey[id].ctx_table, (uintptr_t)ctx);
  305|       |
  306|       |    /*
  307|       |     * If we find an entry for the passed in context, return its data pointer
  308|       |     */
  309|     19|    return ctxd;
  310|     23|}
CRYPTO_THREAD_set_local_ex:
  338|      7|{
  339|      7|    MASTER_KEY_ENTRY *mkey;
  340|       |
  341|      7|    ctx = (ctx == CRYPTO_THREAD_NO_CONTEXT) ? NULL : ossl_lib_ctx_get_concrete(ctx);
  ------------------
  |  |   47|      7|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  |  Branch (341:11): [True: 4, False: 3]
  ------------------
  342|       |    /*
  343|       |     * Make sure our master key is initialized
  344|       |     * See notes above on the use of CRYPTO_THREAD_run_once here
  345|       |     */
  346|      7|    if (!CRYPTO_THREAD_run_once(&master_once, init_master_key))
  ------------------
  |  Branch (346:9): [True: 0, False: 7]
  ------------------
  347|      0|        return 0;
  348|       |
  349|      7|    if (!ossl_assert(id < CRYPTO_THREAD_LOCAL_KEY_MAX))
  ------------------
  |  |   45|      7|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      7|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (349:9): [True: 0, False: 7]
  ------------------
  350|      0|        return 0;
  351|       |
  352|       |    /*
  353|       |     * Get our local master key data, which will be
  354|       |     * a sparse array indexed by the id parameter
  355|       |     */
  356|      7|    mkey = CRYPTO_THREAD_get_local(&master_key);
  357|      7|    if (mkey == NULL) {
  ------------------
  |  Branch (357:9): [True: 1, False: 6]
  ------------------
  358|       |        /*
  359|       |         * we didn't find one, but that's ok, just initialize it now
  360|       |         */
  361|      1|        mkey = OPENSSL_calloc(CRYPTO_THREAD_LOCAL_KEY_MAX,
  ------------------
  |  |  117|      1|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|      1|            sizeof(MASTER_KEY_ENTRY));
  363|      1|        if (mkey == NULL)
  ------------------
  |  Branch (363:13): [True: 0, False: 1]
  ------------------
  364|      0|            return 0;
  365|       |        /*
  366|       |         * make sure to assign it to our master key thread-local storage
  367|       |         */
  368|      1|        if (!CRYPTO_THREAD_set_local(&master_key, mkey)) {
  ------------------
  |  Branch (368:13): [True: 0, False: 1]
  ------------------
  369|      0|            OPENSSL_free(mkey);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|      0|            return 0;
  371|      0|        }
  372|      1|    }
  373|       |
  374|       |    /*
  375|       |     * Find the entry that we are looking for using our id index
  376|       |     */
  377|      7|    if (mkey[id].ctx_table == NULL) {
  ------------------
  |  Branch (377:9): [True: 3, False: 4]
  ------------------
  378|       |
  379|       |        /*
  380|       |         * Didn't find it, that's ok, just add it now
  381|       |         */
  382|      3|        mkey[id].ctx_table = ossl_sa_CTX_TABLE_ENTRY_new();
  383|      3|        if (mkey[id].ctx_table == NULL)
  ------------------
  |  Branch (383:13): [True: 0, False: 3]
  ------------------
  384|      0|            return 0;
  385|      3|    }
  386|       |
  387|       |    /*
  388|       |     * Now go look up our per context entry, using the OSSL_LIB_CTX pointer
  389|       |     * that we've been provided.  Note we cast the pointer to a uintptr_t so
  390|       |     * as to use it as an index in the sparse array
  391|       |     *
  392|       |     * Assign to the entry in the table so that we can find it later
  393|       |     */
  394|      7|    return ossl_sa_CTX_TABLE_ENTRY_set(mkey[id].ctx_table,
  395|      7|        (uintptr_t)ctx, data);
  396|      7|}
threads_common.c:init_master_key:
  216|      1|{
  217|       |    /*
  218|       |     * Note: We assign a cleanup function here, which is atypical for
  219|       |     * uses of CRYPTO_THREAD_init_local.  This is because, nominally
  220|       |     * we expect that the use of ossl_init_thread_start will be used
  221|       |     * to notify openssl of exiting threads.  However, in this case
  222|       |     * we want the metadata for this interface (the sparse arrays) to
  223|       |     * stay valid until the thread actually exits, which is what the
  224|       |     * clean_master_key function does.  Data held in the sparse arrays
  225|       |     * (that is assigned via CRYPTO_THREAD_set_local_ex), are still expected
  226|       |     * to be cleaned via the ossl_init_thread_start/stop api.
  227|       |     */
  228|      1|    if (!CRYPTO_THREAD_init_local(&master_key, clean_master_key))
  ------------------
  |  Branch (228:9): [True: 0, False: 1]
  ------------------
  229|      0|        return;
  230|       |
  231|       |    /*
  232|       |     * Indicate that the key has been set up.
  233|       |     */
  234|      1|    master_key_init = 1;
  235|      1|}

ossl_rcu_uptr_deref:
  551|  3.99k|{
  552|  3.99k|    return ATOMIC_LOAD_N(pvoid, p, __ATOMIC_ACQUIRE);
  ------------------
  |  |  116|  3.99k|#define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  553|  3.99k|}
ossl_rcu_assign_uptr:
  556|    402|{
  557|    402|    ATOMIC_STORE(pvoid, p, v, __ATOMIC_RELEASE);
  ------------------
  |  |  118|    402|#define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
  ------------------
  558|    402|}
ossl_rcu_lock_new:
  561|      1|{
  562|      1|    struct rcu_lock_st *new;
  563|      1|    pthread_mutex_t *mutexes[3] = { NULL };
  564|      1|    pthread_cond_t *conds[2] = { NULL };
  565|      1|    int i;
  566|       |
  567|       |    /*
  568|       |     * We need a minimum of 2 qp's
  569|       |     */
  570|      1|    if (num_writers < 2)
  ------------------
  |  Branch (570:9): [True: 1, False: 0]
  ------------------
  571|      1|        num_writers = 2;
  572|       |
  573|      1|    ctx = ossl_lib_ctx_get_concrete(ctx);
  574|      1|    if (ctx == NULL)
  ------------------
  |  Branch (574:9): [True: 0, False: 1]
  ------------------
  575|      0|        return 0;
  576|       |
  577|      1|    new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  578|      1|    if (new == NULL)
  ------------------
  |  Branch (578:9): [True: 0, False: 1]
  ------------------
  579|      0|        return NULL;
  580|       |
  581|      1|    new->ctx = ctx;
  582|      1|    i = 0;
  583|      1|    mutexes[i] = pthread_mutex_init(&new->write_lock, NULL) == 0 ? &new->write_lock : NULL;
  ------------------
  |  Branch (583:18): [True: 1, False: 0]
  ------------------
  584|      1|    if (mutexes[i++] == NULL)
  ------------------
  |  Branch (584:9): [True: 0, False: 1]
  ------------------
  585|      0|        goto err;
  586|      1|    mutexes[i] = pthread_mutex_init(&new->prior_lock, NULL) == 0 ? &new->prior_lock : NULL;
  ------------------
  |  Branch (586:18): [True: 1, False: 0]
  ------------------
  587|      1|    if (mutexes[i++] == NULL)
  ------------------
  |  Branch (587:9): [True: 0, False: 1]
  ------------------
  588|      0|        goto err;
  589|      1|    mutexes[i] = pthread_mutex_init(&new->alloc_lock, NULL) == 0 ? &new->alloc_lock : NULL;
  ------------------
  |  Branch (589:18): [True: 1, False: 0]
  ------------------
  590|      1|    if (mutexes[i++] == NULL)
  ------------------
  |  Branch (590:9): [True: 0, False: 1]
  ------------------
  591|      0|        goto err;
  592|      1|    conds[i - 3] = pthread_cond_init(&new->prior_signal, NULL) == 0 ? &new->prior_signal : NULL;
  ------------------
  |  Branch (592:20): [True: 1, False: 0]
  ------------------
  593|      1|    if (conds[i - 3] == NULL)
  ------------------
  |  Branch (593:9): [True: 0, False: 1]
  ------------------
  594|      0|        goto err;
  595|      1|    i++;
  596|      1|    conds[i - 3] = pthread_cond_init(&new->alloc_signal, NULL) == 0 ? &new->alloc_signal : NULL;
  ------------------
  |  Branch (596:20): [True: 1, False: 0]
  ------------------
  597|      1|    if (conds[i - 3] == NULL)
  ------------------
  |  Branch (597:9): [True: 0, False: 1]
  ------------------
  598|      0|        goto err;
  599|      1|    i++;
  600|      1|    new->qp_group = allocate_new_qp_group(new, num_writers);
  601|      1|    if (new->qp_group == NULL)
  ------------------
  |  Branch (601:9): [True: 0, False: 1]
  ------------------
  602|      0|        goto err;
  603|       |
  604|      1|    return new;
  605|       |
  606|      0|err:
  607|      0|    for (i = 0; i < 3; i++)
  ------------------
  |  Branch (607:17): [True: 0, False: 0]
  ------------------
  608|      0|        if (mutexes[i] != NULL)
  ------------------
  |  Branch (608:13): [True: 0, False: 0]
  ------------------
  609|      0|            pthread_mutex_destroy(mutexes[i]);
  610|      0|    for (i = 0; i < 2; i++)
  ------------------
  |  Branch (610:17): [True: 0, False: 0]
  ------------------
  611|      0|        if (conds[i] != NULL)
  ------------------
  |  Branch (611:13): [True: 0, False: 0]
  ------------------
  612|      0|            pthread_cond_destroy(conds[i]);
  613|      0|    OPENSSL_free(new->qp_group);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  614|      0|    OPENSSL_free(new);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  615|       |    return NULL;
  616|      1|}
CRYPTO_THREAD_lock_new:
  907|     58|{
  908|     58|#ifdef USE_RWLOCK
  909|     58|    CRYPTO_RWLOCK *lock;
  910|       |
  911|     58|    ossl_init_rwlock_contention_data();
  912|       |
  913|     58|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  113|     58|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (913:9): [True: 0, False: 58]
  ------------------
  914|       |        /* Don't set error, to avoid recursion blowup. */
  915|      0|        return NULL;
  916|       |
  917|     58|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (917:9): [True: 0, False: 58]
  ------------------
  918|      0|        OPENSSL_free(lock);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  919|      0|        return NULL;
  920|      0|    }
  921|       |#else
  922|       |    pthread_mutexattr_t attr;
  923|       |    CRYPTO_RWLOCK *lock;
  924|       |
  925|       |    if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL)
  926|       |        /* Don't set error, to avoid recursion blowup. */
  927|       |        return NULL;
  928|       |
  929|       |    /*
  930|       |     * We don't use recursive mutexes, but try to catch errors if we do.
  931|       |     */
  932|       |    pthread_mutexattr_init(&attr);
  933|       |#if !defined(__TANDEM) && !defined(_SPT_MODEL_)
  934|       |#if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
  935|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
  936|       |#endif
  937|       |#else
  938|       |    /* The SPT Thread Library does not define MUTEX attributes. */
  939|       |#endif
  940|       |
  941|       |    if (pthread_mutex_init(lock, &attr) != 0) {
  942|       |        pthread_mutexattr_destroy(&attr);
  943|       |        OPENSSL_free(lock);
  944|       |        return NULL;
  945|       |    }
  946|       |
  947|       |    pthread_mutexattr_destroy(&attr);
  948|       |#endif
  949|       |
  950|     58|    return lock;
  951|     58|}
CRYPTO_THREAD_read_lock:
  954|  1.00k|{
  955|  1.00k|#ifdef USE_RWLOCK
  956|  1.00k|    if (!ossl_assert(ossl_rwlock_rdlock(lock) == 0))
  ------------------
  |  |   45|  1.00k|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|  1.00k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (956:9): [True: 0, False: 1.00k]
  ------------------
  957|      0|        return 0;
  958|       |#else
  959|       |    if (pthread_mutex_lock(lock) != 0) {
  960|       |        assert(errno != EDEADLK && errno != EBUSY);
  961|       |        return 0;
  962|       |    }
  963|       |#endif
  964|       |
  965|  1.00k|    return 1;
  966|  1.00k|}
CRYPTO_THREAD_write_lock:
  969|  1.53k|{
  970|  1.53k|#ifdef USE_RWLOCK
  971|  1.53k|    if (!ossl_assert(ossl_rwlock_wrlock(lock) == 0))
  ------------------
  |  |   45|  1.53k|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|  1.53k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (971:9): [True: 0, False: 1.53k]
  ------------------
  972|      0|        return 0;
  973|       |#else
  974|       |    if (pthread_mutex_lock(lock) != 0) {
  975|       |        assert(errno != EDEADLK && errno != EBUSY);
  976|       |        return 0;
  977|       |    }
  978|       |#endif
  979|       |
  980|  1.53k|    return 1;
  981|  1.53k|}
CRYPTO_THREAD_unlock:
  984|  2.54k|{
  985|  2.54k|#ifdef USE_RWLOCK
  986|  2.54k|    if (ossl_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (986:9): [True: 0, False: 2.54k]
  ------------------
  987|      0|        return 0;
  988|       |#else
  989|       |    if (pthread_mutex_unlock(lock) != 0) {
  990|       |        assert(errno != EPERM);
  991|       |        return 0;
  992|       |    }
  993|       |#endif
  994|       |
  995|  2.54k|    return 1;
  996|  2.54k|}
CRYPTO_THREAD_run_once:
 1014|  1.35k|{
 1015|  1.35k|    if (ossl_unlikely(pthread_once(once, init) != 0))
  ------------------
  |  |   24|  1.35k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1.35k]
  |  |  ------------------
  ------------------
 1016|      0|        return 0;
 1017|       |
 1018|  1.35k|    return 1;
 1019|  1.35k|}
CRYPTO_THREAD_init_local:
 1022|      4|{
 1023|      4|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (1023:9): [True: 0, False: 4]
  ------------------
 1024|      0|        return 0;
 1025|       |
 1026|      4|    return 1;
 1027|      4|}
CRYPTO_THREAD_get_local:
 1030|    144|{
 1031|    144|    return pthread_getspecific(*key);
 1032|    144|}
CRYPTO_THREAD_set_local:
 1035|      3|{
 1036|      3|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (1036:9): [True: 0, False: 3]
  ------------------
 1037|      0|        return 0;
 1038|       |
 1039|      3|    return 1;
 1040|      3|}
CRYPTO_atomic_add:
 1061|     11|{
 1062|     11|#if defined(OSSL_USE_GCC_ATOMICS)
 1063|     11|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (1063:9): [True: 11, Folded]
  ------------------
 1064|     11|        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
 1065|     11|        return 1;
 1066|     11|    }
 1067|       |#elif defined(OSSL_USE_SOLARIS_ATOMICS)
 1068|       |    /* This will work for all future Solaris versions. */
 1069|       |    if (ret != NULL) {
 1070|       |        *ret = atomic_add_int_nv((volatile unsigned int *)val, amount);
 1071|       |        return 1;
 1072|       |    }
 1073|       |#endif
 1074|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (1074:9): [True: 0, False: 0]
  |  Branch (1074:25): [True: 0, False: 0]
  ------------------
 1075|      0|        return 0;
 1076|       |
 1077|      0|    *val += amount;
 1078|      0|    *ret = *val;
 1079|       |
 1080|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (1080:9): [True: 0, False: 0]
  ------------------
 1081|      0|        return 0;
 1082|       |
 1083|      0|    return 1;
 1084|      0|}
CRYPTO_atomic_or:
 1140|      3|{
 1141|      3|#if defined(OSSL_USE_GCC_ATOMICS)
 1142|      3|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (1142:9): [True: 3, Folded]
  ------------------
 1143|      3|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
 1144|      3|        return 1;
 1145|      3|    }
 1146|       |#elif defined(OSSL_USE_SOLARIS_ATOMICS)
 1147|       |    /* This will work for all future Solaris versions. */
 1148|       |    if (ret != NULL) {
 1149|       |        *ret = atomic_or_64_nv(val, op);
 1150|       |        return 1;
 1151|       |    }
 1152|       |#endif
 1153|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (1153:9): [True: 0, False: 0]
  |  Branch (1153:25): [True: 0, False: 0]
  ------------------
 1154|      0|        return 0;
 1155|      0|    *val |= op;
 1156|      0|    *ret = *val;
 1157|       |
 1158|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (1158:9): [True: 0, False: 0]
  ------------------
 1159|      0|        return 0;
 1160|       |
 1161|      0|    return 1;
 1162|      0|}
CRYPTO_atomic_load:
 1165|  1.59k|{
 1166|  1.59k|#if defined(OSSL_USE_GCC_ATOMICS)
 1167|  1.59k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (1167:9): [True: 1.59k, Folded]
  ------------------
 1168|  1.59k|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
 1169|  1.59k|        return 1;
 1170|  1.59k|    }
 1171|       |#elif defined(OSSL_USE_SOLARIS_ATOMICS)
 1172|       |    /* This will work for all future Solaris versions. */
 1173|       |    if (ret != NULL) {
 1174|       |        *ret = atomic_or_64_nv(val, 0);
 1175|       |        return 1;
 1176|       |    }
 1177|       |#endif
 1178|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (1178:9): [True: 0, False: 0]
  |  Branch (1178:25): [True: 0, False: 0]
  ------------------
 1179|      0|        return 0;
 1180|      0|    *ret = *val;
 1181|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (1181:9): [True: 0, False: 0]
  ------------------
 1182|      0|        return 0;
 1183|       |
 1184|      0|    return 1;
 1185|      0|}
CRYPTO_atomic_store:
 1188|    402|{
 1189|    402|#if defined(OSSL_USE_GCC_ATOMICS)
 1190|    402|    if (__atomic_is_lock_free(sizeof(*dst), dst)) {
  ------------------
  |  Branch (1190:9): [True: 402, Folded]
  ------------------
 1191|    402|        __atomic_store(dst, &val, __ATOMIC_RELEASE);
 1192|    402|        return 1;
 1193|    402|    }
 1194|       |#elif defined(OSSL_USE_SOLARIS_ATOMICS)
 1195|       |    /* This will work for all future Solaris versions. */
 1196|       |    if (dst != NULL) {
 1197|       |        atomic_swap_64(dst, val);
 1198|       |        return 1;
 1199|       |    }
 1200|       |#endif
 1201|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (1201:9): [True: 0, False: 0]
  |  Branch (1201:25): [True: 0, False: 0]
  ------------------
 1202|      0|        return 0;
 1203|      0|    *dst = val;
 1204|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (1204:9): [True: 0, False: 0]
  ------------------
 1205|      0|        return 0;
 1206|       |
 1207|      0|    return 1;
 1208|      0|}
CRYPTO_atomic_load_int:
 1211|     22|{
 1212|     22|#if defined(OSSL_USE_GCC_ATOMICS)
 1213|     22|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (1213:9): [True: 22, Folded]
  ------------------
 1214|     22|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
 1215|     22|        return 1;
 1216|     22|    }
 1217|       |#elif defined(OSSL_USE_SOLARIS_ATOMICS)
 1218|       |    /* This will work for all future Solaris versions. */
 1219|       |    if (ret != NULL) {
 1220|       |        *ret = (int)atomic_or_uint_nv((unsigned int *)val, 0);
 1221|       |        return 1;
 1222|       |    }
 1223|       |#endif
 1224|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (1224:9): [True: 0, False: 0]
  |  Branch (1224:25): [True: 0, False: 0]
  ------------------
 1225|      0|        return 0;
 1226|      0|    *ret = *val;
 1227|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (1227:9): [True: 0, False: 0]
  ------------------
 1228|      0|        return 0;
 1229|       |
 1230|      0|    return 1;
 1231|      0|}
CRYPTO_atomic_load_ptr:
 1257|     53|{
 1258|     53|#if defined(__GNUC__) && defined(__ATOMIC_RELAXED) && !defined(BROKEN_CLANG_ATOMICS)
 1259|     53|    *ret = __atomic_load_n(ptr, TSAN_LOAD_MEM_ORDER);
  ------------------
  |  |   64|     53|#define TSAN_LOAD_MEM_ORDER __ATOMIC_RELAXED
  ------------------
 1260|     53|    return 1;
 1261|       |#else
 1262|       |    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
 1263|       |        return 0;
 1264|       |    *ret = *ptr;
 1265|       |    if (!CRYPTO_THREAD_unlock(lock))
 1266|       |        return 0;
 1267|       |    return 1;
 1268|       |#endif
 1269|     53|}
CRYPTO_atomic_store_ptr:
 1272|     10|{
 1273|     10|#if defined(__GNUC__) && defined(__ATOMIC_RELAXED) && !defined(BROKEN_CLANG_ATOMICS)
 1274|     10|    __atomic_store(dst, val, TSAN_STORE_MEM_ORDER);
  ------------------
  |  |   65|     10|#define TSAN_STORE_MEM_ORDER __ATOMIC_RELAXED
  ------------------
 1275|     10|    return 1;
 1276|       |#else
 1277|       |    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
 1278|       |        return 0;
 1279|       |    *dst = *val;
 1280|       |    if (!CRYPTO_THREAD_unlock(lock))
 1281|       |        return 0;
 1282|       |    return 1;
 1283|       |#endif
 1284|     10|}
CRYPTO_atomic_cmp_exch_ptr:
 1287|     11|{
 1288|     11|#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
 1289|     11|    if (lock_failed != NULL)
  ------------------
  |  Branch (1289:9): [True: 11, False: 0]
  ------------------
 1290|     11|        *lock_failed = 0;
 1291|     11|    return __atomic_compare_exchange_n(ptr, expect, desire, 0, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE) ? 1 : 0;
  ------------------
  |  Branch (1291:12): [True: 11, False: 0]
  ------------------
 1292|       |#else
 1293|       |    int lock_sink;
 1294|       |    int ret = 0;
 1295|       |
 1296|       |    if (lock_failed == NULL)
 1297|       |        lock_failed = &lock_sink;
 1298|       |
 1299|       |    *lock_failed = 0;
 1300|       |    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock)) {
 1301|       |        *lock_failed = 1;
 1302|       |        return 0;
 1303|       |    }
 1304|       |    if (*ptr == *expect) {
 1305|       |        ret = 1;
 1306|       |        *ptr = desire;
 1307|       |    } else {
 1308|       |        *expect = *ptr;
 1309|       |    }
 1310|       |    if (!CRYPTO_THREAD_unlock(lock))
 1311|       |        *lock_failed = 1;
 1312|       |    return ret;
 1313|       |#endif
 1314|     11|}
openssl_get_fork_id:
 1324|      6|{
 1325|      6|    return getpid();
 1326|      6|}
threads_pthread.c:allocate_new_qp_group:
  461|      1|{
  462|      1|    struct rcu_qp *new = OPENSSL_calloc(count, sizeof(*new));
  ------------------
  |  |  117|      1|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|       |
  464|      1|    lock->group_count = count;
  465|      1|    return new;
  466|      1|}
threads_pthread.c:ossl_init_rwlock_contention_data:
  886|     58|{
  887|     58|}
threads_pthread.c:ossl_rwlock_rdlock:
  890|  1.00k|{
  891|  1.00k|    return pthread_rwlock_rdlock(rwlock);
  892|  1.00k|}
threads_pthread.c:ossl_rwlock_wrlock:
  895|  1.53k|{
  896|  1.53k|    return pthread_rwlock_wrlock(rwlock);
  897|  1.53k|}
threads_pthread.c:ossl_rwlock_unlock:
  900|  2.54k|{
  901|  2.54k|    return pthread_rwlock_unlock(rwlock);
  902|  2.54k|}

ossl_err_load_TS_strings:
   82|      1|{
   83|      1|#ifndef OPENSSL_NO_ERR
   84|      1|    if (ERR_reason_error_string(TS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (84:9): [True: 1, False: 0]
  ------------------
   85|      1|        ERR_load_strings_const(TS_str_reasons);
   86|      1|#endif
   87|      1|    return 1;
   88|      1|}

ossl_err_load_UI_strings:
   41|      1|{
   42|      1|#ifndef OPENSSL_NO_ERR
   43|      1|    if (ERR_reason_error_string(UI_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (43:9): [True: 1, False: 0]
  ------------------
   44|      1|        ERR_load_strings_const(UI_str_reasons);
   45|      1|#endif
   46|      1|    return 1;
   47|      1|}

ossl_err_load_X509V3_strings:
  149|      1|{
  150|      1|#ifndef OPENSSL_NO_ERR
  151|      1|    if (ERR_reason_error_string(X509V3_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (151:9): [True: 1, False: 0]
  ------------------
  152|      1|        ERR_load_strings_const(X509V3_str_reasons);
  153|      1|#endif
  154|      1|    return 1;
  155|      1|}

X509_get_default_cert_area:
   79|      1|{
   80|       |#if defined(_WIN32)
   81|       |    RUN_ONCE(&openssldir_setup_init, do_openssldir_setup);
   82|       |    return x509_cert_areaptr;
   83|       |#else
   84|      1|    return X509_CERT_AREA;
  ------------------
  |  |   94|      1|#define X509_CERT_AREA OPENSSLDIR
  ------------------
   85|      1|#endif
   86|      1|}

ossl_err_load_X509_strings:
   95|      1|{
   96|      1|#ifndef OPENSSL_NO_ERR
   97|      1|    if (ERR_reason_error_string(X509_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (97:9): [True: 1, False: 0]
  ------------------
   98|      1|        ERR_load_strings_const(X509_str_reasons);
   99|      1|#endif
  100|      1|    return 1;
  101|      1|}

EVP_aria_128_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb128:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_ecb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb128:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_ecb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb128:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_ecb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb1:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb1:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb1:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb8:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb8:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb8:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_cfb64:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_ecb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_cfb64:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_ecb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb64:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ecb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb1:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb8:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_cfb64:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb64:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb1:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb8:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_cfb64:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_ecb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_cfb64:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_ecb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_cfb64:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_ecb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_cbc:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_cfb128:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_ofb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_ecb:
  274|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }

threads_common.c:ossl_sa_CTX_TABLE_ENTRY_get:
   82|     19|    {                                                                                                             \
   83|     19|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n);                                                          \
   84|     19|    }                                                                                                             \
threads_common.c:ossl_sa_CTX_TABLE_ENTRY_new:
   28|      3|    {                                                                                                             \
   29|      3|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new();                                                            \
   30|      3|    }                                                                                                             \
threads_common.c:ossl_sa_CTX_TABLE_ENTRY_set:
   88|      7|    {                                                                                                             \
   89|      7|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val);                                                     \
   90|      7|    }                                                                                                             \
property.c:ossl_sa_ALGORITHM_new:
   28|     16|    {                                                                                                             \
   29|     16|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new();                                                            \
   30|     16|    }                                                                                                             \
property.c:ossl_sa_ALGORITHM_get:
   82|    337|    {                                                                                                             \
   83|    337|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n);                                                          \
   84|    337|    }                                                                                                             \
property.c:ossl_sa_ALGORITHM_set:
   88|    166|    {                                                                                                             \
   89|    166|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val);                                                     \
   90|    166|    }                                                                                                             \

core_namemap.c:ossl_ht_strcase:
  341|  1.88k|{
  342|  1.88k|    size_t i;
  343|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  344|       |    const long int case_adjust = ~0x40;
  345|       |#else
  346|  1.88k|    const long int case_adjust = ~0x20;
  347|  1.88k|#endif
  348|       |
  349|  1.88k|    if (src == NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 1.88k]
  ------------------
  350|      0|        return;
  351|       |
  352|       |    /*
  353|       |     * If we're passed a key, we're doing raw key copies
  354|       |     * so check that we don't overflow here, and truncate if
  355|       |     * we copy more space than we have available
  356|       |     */
  357|  1.88k|    if (key != NULL && key->keysize + len > key->bufsize)
  ------------------
  |  Branch (357:9): [True: 1.88k, False: 0]
  |  Branch (357:24): [True: 0, False: 1.88k]
  ------------------
  358|      0|        len = (size_t)(key->bufsize - key->keysize);
  359|       |
  360|  27.4k|    for (i = 0; i < len && src[i] != '\0'; i++)
  ------------------
  |  Branch (360:17): [True: 25.5k, False: 1.88k]
  |  Branch (360:28): [True: 25.5k, False: 0]
  ------------------
  361|  25.5k|        tgt[i] = case_adjust & src[i];
  362|  1.88k|}

array_alloc.c:ossl_size_mul:
   88|    975|{
   89|    975|    int err = 0;
   90|    975|    *bytes = safe_mul_size_t(num, size, &err);
   91|       |
   92|    975|    if (ossl_unlikely(err != 0)) {
  ------------------
  |  |   24|    975|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 975]
  |  |  ------------------
  ------------------
   93|      0|        ossl_report_alloc_err_of(file, line);
   94|       |
   95|      0|        return false;
   96|      0|    }
   97|       |
   98|    975|    return true;
   99|    975|}

digest.c:CRYPTO_NEW_REF:
  230|     30|{
  231|     30|    refcnt->val = n;
  232|     30|    return 1;
  233|     30|}
digest.c:CRYPTO_UP_REF:
   42|     32|{
   43|     32|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   44|       |    return true;
   45|     32|}
digest.c:CRYPTO_DOWN_REF:
   58|     30|{
   59|       |#ifdef OSSL_TSAN_BUILD
   60|       |    /*
   61|       |     * TSAN requires acq_rel as it indicates a false positive error when
   62|       |     * the object that contains the refcount is freed otherwise.
   63|       |     */
   64|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   65|       |#else
   66|     30|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   67|     30|    if (*ret == 0)
  ------------------
  |  Branch (67:9): [True: 0, False: 30]
  ------------------
   68|       |        atomic_thread_fence(memory_order_acquire);
   69|     30|#endif
   70|     30|    return 1;
   71|     30|}
evp_enc.c:CRYPTO_NEW_REF:
  230|    131|{
  231|    131|    refcnt->val = n;
  232|    131|    return 1;
  233|    131|}
evp_enc.c:CRYPTO_UP_REF:
   42|    135|{
   43|    135|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   44|       |    return true;
   45|    135|}
evp_enc.c:CRYPTO_DOWN_REF:
   58|    131|{
   59|       |#ifdef OSSL_TSAN_BUILD
   60|       |    /*
   61|       |     * TSAN requires acq_rel as it indicates a false positive error when
   62|       |     * the object that contains the refcount is freed otherwise.
   63|       |     */
   64|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   65|       |#else
   66|    131|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   67|    131|    if (*ret == 0)
  ------------------
  |  Branch (67:9): [True: 0, False: 131]
  ------------------
   68|       |        atomic_thread_fence(memory_order_acquire);
   69|    131|#endif
   70|    131|    return 1;
   71|    131|}
evp_rand.c:CRYPTO_UP_REF:
   42|     11|{
   43|     11|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   44|       |    return true;
   45|     11|}
evp_rand.c:CRYPTO_NEW_REF:
  230|      8|{
  231|      8|    refcnt->val = n;
  232|      8|    return 1;
  233|      8|}
evp_rand.c:CRYPTO_DOWN_REF:
   58|      5|{
   59|       |#ifdef OSSL_TSAN_BUILD
   60|       |    /*
   61|       |     * TSAN requires acq_rel as it indicates a false positive error when
   62|       |     * the object that contains the refcount is freed otherwise.
   63|       |     */
   64|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   65|       |#else
   66|      5|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   67|      5|    if (*ret == 0)
  ------------------
  |  Branch (67:9): [True: 0, False: 5]
  ------------------
   68|       |        atomic_thread_fence(memory_order_acquire);
   69|      5|#endif
   70|      5|    return 1;
   71|      5|}
provider_core.c:CRYPTO_UP_REF:
   42|    171|{
   43|    171|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   44|       |    return true;
   45|    171|}
provider_core.c:CRYPTO_NEW_REF:
  230|      1|{
  231|      1|    refcnt->val = n;
  232|      1|    return 1;
  233|      1|}
provider_core.c:CRYPTO_DOWN_REF:
   58|      5|{
   59|       |#ifdef OSSL_TSAN_BUILD
   60|       |    /*
   61|       |     * TSAN requires acq_rel as it indicates a false positive error when
   62|       |     * the object that contains the refcount is freed otherwise.
   63|       |     */
   64|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   65|       |#else
   66|      5|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   67|      5|    if (*ret == 0)
  ------------------
  |  Branch (67:9): [True: 0, False: 5]
  ------------------
   68|       |        atomic_thread_fence(memory_order_acquire);
   69|      5|#endif
   70|      5|    return 1;
   71|      5|}

array_alloc.c:safe_mul_size_t:
  151|    975|    {                                                                \
  152|    975|        type r;                                                      \
  153|    975|                                                                     \
  154|    975|        if (!__builtin_mul_overflow(a, b, &r))                       \
  ------------------
  |  Branch (154:13): [True: 975, False: 0]
  ------------------
  155|    975|            return r;                                                \
  156|    975|        *err |= 1;                                                   \
  157|      0|        return a * b;                                                \
  158|    975|    }
stack.c:safe_muldiv_int:
  324|     14|    {                                                                   \
  325|     14|        int e2 = 0;                                                     \
  326|     14|        type q, r, x, y;                                                \
  327|     14|                                                                        \
  328|     14|        if (c == 0) {                                                   \
  ------------------
  |  Branch (328:13): [True: 0, False: 14]
  ------------------
  329|      0|            *err |= 1;                                                  \
  330|      0|            return a == 0 || b == 0 ? 0 : max;                          \
  ------------------
  |  Branch (330:20): [True: 0, False: 0]
  |  Branch (330:30): [True: 0, False: 0]
  ------------------
  331|      0|        }                                                               \
  332|     14|        x = safe_mul_##type_name(a, b, &e2);                            \
  333|     14|        if (!e2)                                                        \
  ------------------
  |  Branch (333:13): [True: 14, False: 0]
  ------------------
  334|     14|            return safe_div_##type_name(x, c, err);                     \
  335|     14|        if (b > a) {                                                    \
  ------------------
  |  Branch (335:13): [True: 0, False: 0]
  ------------------
  336|      0|            x = b;                                                      \
  337|      0|            b = a;                                                      \
  338|      0|            a = x;                                                      \
  339|      0|        }                                                               \
  340|      0|        q = safe_div_##type_name(a, c, err);                            \
  341|      0|        r = safe_mod_##type_name(a, c, err);                            \
  342|      0|        x = safe_mul_##type_name(r, b, err);                            \
  343|      0|        y = safe_mul_##type_name(q, b, err);                            \
  344|      0|        q = safe_div_##type_name(x, c, err);                            \
  345|      0|        return safe_add_##type_name(y, q, err);                         \
  346|     14|    }
stack.c:safe_mul_int:
  138|     14|    {                                                                \
  139|     14|        type r;                                                      \
  140|     14|                                                                     \
  141|     14|        if (!__builtin_mul_overflow(a, b, &r))                       \
  ------------------
  |  Branch (141:13): [True: 14, False: 0]
  ------------------
  142|     14|            return r;                                                \
  143|     14|        *err |= 1;                                                   \
  144|      0|        return (a < 0) ^ (b < 0) ? min : max;                        \
  ------------------
  |  Branch (144:16): [True: 0, False: 0]
  ------------------
  145|     14|    }
stack.c:safe_div_int:
  201|     14|    {                                                                \
  202|     14|        if (b == 0) {                                                \
  ------------------
  |  Branch (202:13): [True: 0, False: 14]
  ------------------
  203|      0|            *err |= 1;                                               \
  204|      0|            return a < 0 ? min : max;                                \
  ------------------
  |  Branch (204:20): [True: 0, False: 0]
  ------------------
  205|      0|        }                                                            \
  206|     14|        if (b == -1 && a == min) {                                   \
  ------------------
  |  Branch (206:13): [True: 0, False: 14]
  |  Branch (206:24): [True: 0, False: 0]
  ------------------
  207|      0|            *err |= 1;                                               \
  208|      0|            return max;                                              \
  209|      0|        }                                                            \
  210|     14|        return a / b;                                                \
  211|     14|    }

ssl_init.c:ossl_init_ssl_base_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
err.c:do_err_strings_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
context.c:default_context_do_thread_key_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
context.c:default_context_do_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_base_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_load_crypto_strings_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_load_ssl_strings_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_add_all_ciphers_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_add_all_digests_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_config_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_async_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
initthread.c:create_global_tevent_register_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
o_names.c:o_names_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
rand_lib.c:do_rand_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \

sha512.c:OPENSSL_store_u64_be:
  181|     40|{
  182|     40|#ifdef OSSL_HTOLE64
  183|     40|    uint64_t t = OSSL_HTOBE64(val);
  ------------------
  |  |   46|     40|#define OSSL_HTOBE64(x) htobe64(x)
  ------------------
  184|       |
  185|     40|    memcpy(out, (unsigned char *)&t, 8);
  186|     40|    return out + 8;
  187|       |#else
  188|       |    *out++ = (val >> 56) & 0xff;
  189|       |    *out++ = (val >> 48) & 0xff;
  190|       |    *out++ = (val >> 40) & 0xff;
  191|       |    *out++ = (val >> 32) & 0xff;
  192|       |    *out++ = (val >> 24) & 0xff;
  193|       |    *out++ = (val >> 16) & 0xff;
  194|       |    *out++ = (val >> 8) & 0xff;
  195|       |    *out++ = (val & 0xff);
  196|       |    return out;
  197|       |#endif
  198|     40|}

digest.c:OSSL_FUNC_digest_newctx:
   60|     30|    {                                                  \
   61|     30|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     30|    }
digest.c:OSSL_FUNC_digest_init:
   60|     30|    {                                                  \
   61|     30|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     30|    }
digest.c:OSSL_FUNC_digest_update:
   60|     30|    {                                                  \
   61|     30|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     30|    }
digest.c:OSSL_FUNC_digest_final:
   60|     30|    {                                                  \
   61|     30|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     30|    }
digest.c:OSSL_FUNC_digest_squeeze:
   60|      6|    {                                                  \
   61|      6|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      6|    }
digest.c:OSSL_FUNC_digest_freectx:
   60|     30|    {                                                  \
   61|     30|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     30|    }
digest.c:OSSL_FUNC_digest_dupctx:
   60|     30|    {                                                  \
   61|     30|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     30|    }
digest.c:OSSL_FUNC_digest_get_params:
   60|     30|    {                                                  \
   61|     30|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     30|    }
digest.c:OSSL_FUNC_digest_set_ctx_params:
   60|     11|    {                                                  \
   61|     11|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     11|    }
digest.c:OSSL_FUNC_digest_get_ctx_params:
   60|      9|    {                                                  \
   61|      9|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      9|    }
digest.c:OSSL_FUNC_digest_gettable_params:
   60|     30|    {                                                  \
   61|     30|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     30|    }
digest.c:OSSL_FUNC_digest_settable_ctx_params:
   60|     11|    {                                                  \
   61|     11|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     11|    }
digest.c:OSSL_FUNC_digest_gettable_ctx_params:
   60|      9|    {                                                  \
   61|      9|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      9|    }
digest.c:OSSL_FUNC_digest_copyctx:
   60|     27|    {                                                  \
   61|     27|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     27|    }
digest.c:OSSL_FUNC_digest_serialize:
   60|     19|    {                                                  \
   61|     19|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     19|    }
digest.c:OSSL_FUNC_digest_deserialize:
   60|     19|    {                                                  \
   61|     19|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     19|    }
evp_enc.c:OSSL_FUNC_cipher_newctx:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_init:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_init:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_skey_init:
   60|     68|    {                                                  \
   61|     68|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     68|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_skey_init:
   60|     68|    {                                                  \
   61|     68|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     68|    }
evp_enc.c:OSSL_FUNC_cipher_update:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_final:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_cipher:
   60|    119|    {                                                  \
   61|    119|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    119|    }
evp_enc.c:OSSL_FUNC_cipher_freectx:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_dupctx:
   60|    130|    {                                                  \
   61|    130|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    130|    }
evp_enc.c:OSSL_FUNC_cipher_get_params:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_get_ctx_params:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_set_ctx_params:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_params:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_ctx_params:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_enc.c:OSSL_FUNC_cipher_settable_ctx_params:
   60|    131|    {                                                  \
   61|    131|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    131|    }
evp_rand.c:OSSL_FUNC_rand_newctx:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_freectx:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_instantiate:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_uninstantiate:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_generate:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_reseed:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_nonce:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
evp_rand.c:OSSL_FUNC_rand_enable_locking:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_lock:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_unlock:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_gettable_ctx_params:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_settable_ctx_params:
   60|      4|    {                                                  \
   61|      4|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      4|    }
evp_rand.c:OSSL_FUNC_rand_get_ctx_params:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_set_ctx_params:
   60|      4|    {                                                  \
   61|      4|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      4|    }
evp_rand.c:OSSL_FUNC_rand_verify_zeroization:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_get_seed:
   60|      5|    {                                                  \
   61|      5|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      5|    }
evp_rand.c:OSSL_FUNC_rand_clear_seed:
   60|      4|    {                                                  \
   61|      4|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      4|    }
provider_core.c:OSSL_FUNC_provider_teardown:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_core.c:OSSL_FUNC_provider_gettable_params:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_core.c:OSSL_FUNC_provider_get_params:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_core.c:OSSL_FUNC_provider_get_capabilities:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_core.c:OSSL_FUNC_provider_query_operation:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
defltprov.c:OSSL_FUNC_core_get_params:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
defltprov.c:OSSL_FUNC_core_get_libctx:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_file:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_membuf:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_read_ex:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_write_ex:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_gets:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_puts:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_ctrl:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_up_ref:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_free:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_vprintf:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_seeding.c:OSSL_FUNC_get_entropy:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_seeding.c:OSSL_FUNC_get_user_entropy:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_entropy:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_user_entropy:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_seeding.c:OSSL_FUNC_get_nonce:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_seeding.c:OSSL_FUNC_get_user_nonce:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_nonce:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_user_nonce:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
drbg.c:OSSL_FUNC_rand_enable_locking:
   60|      2|    {                                                  \
   61|      2|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      2|    }
drbg.c:OSSL_FUNC_rand_lock:
   60|      2|    {                                                  \
   61|      2|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      2|    }
drbg.c:OSSL_FUNC_rand_unlock:
   60|      2|    {                                                  \
   61|      2|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      2|    }
drbg.c:OSSL_FUNC_rand_get_ctx_params:
   60|      2|    {                                                  \
   61|      2|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      2|    }
drbg.c:OSSL_FUNC_rand_get_seed:
   60|      2|    {                                                  \
   61|      2|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      2|    }
drbg.c:OSSL_FUNC_rand_clear_seed:
   60|      2|    {                                                  \
   61|      2|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      2|    }

conf_mod.c:ERR_GET_REASON:
  239|      1|{
  240|      1|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  222|      1|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  201|      1|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (222:35): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  241|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  202|      0|#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
  ------------------
  242|      1|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  213|      1|#define ERR_REASON_MASK 0X7FFFFF
  ------------------
  243|      1|}
err.c:ERR_GET_LIB:
  225|  4.86k|{
  226|  4.86k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  222|  4.86k|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  201|  4.86k|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (222:35): [True: 0, False: 4.86k]
  |  |  ------------------
  ------------------
  227|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   55|      0|#define ERR_LIB_SYS 2
  ------------------
  228|  4.86k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  209|  4.86k|#define ERR_LIB_OFFSET 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  210|  4.86k|#define ERR_LIB_MASK 0xFF
  ------------------
  229|  4.86k|}
err.c:ERR_GET_REASON:
  239|     35|{
  240|     35|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  222|     35|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  201|     35|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (222:35): [True: 0, False: 35]
  |  |  ------------------
  ------------------
  241|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  202|      0|#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
  ------------------
  242|     35|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  213|     35|#define ERR_REASON_MASK 0X7FFFFF
  ------------------
  243|     35|}
conf_def.c:ERR_GET_REASON:
  239|      1|{
  240|      1|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  222|      1|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  201|      1|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (222:35): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  241|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  202|      0|#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
  ------------------
  242|      1|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  213|      1|#define ERR_REASON_MASK 0X7FFFFF
  ------------------
  243|      1|}

decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  334|      1|    {                                                                                                                      \
  335|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|      1|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|      1|            lh_##type##_doall_thunk,                                                                                       \
  338|      1|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|      1|    }                                                                                                                      \
err.c:ossl_check_ERR_STRING_DATA_lh_type:
  208|  4.82k|    {                                                                                                          \
  209|  4.82k|        return (OPENSSL_LHASH *)lh;                                                                            \
  210|  4.82k|    }                                                                                                          \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  218|      1|    {                                                                                                          \
  219|      1|        return (OPENSSL_LH_HASHFUNC)hfn;                                                                       \
  220|      1|    }                                                                                                          \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  213|      1|    {                                                                                                          \
  214|      1|        return (OPENSSL_LH_COMPFUNC)cmp;                                                                       \
  215|      1|    }                                                                                                          \
err.c:lh_ERR_STRING_DATA_hash_thunk:
  172|  4.82k|    {                                                                                                          \
  173|  4.82k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                        \
  174|  4.82k|        return hfn_conv((const type *)data);                                                                   \
  175|  4.82k|    }                                                                                                          \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  177|  3.07k|    {                                                                                                          \
  178|  3.07k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                \
  179|  3.07k|        return cfn_conv((const type *)da, (const type *)db);                                                   \
  180|  3.07k|    }                                                                                                          \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  193|  4.75k|    {                                                                                                          \
  194|  4.75k|        return ptr;                                                                                            \
  195|  4.75k|    }                                                                                                          \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  198|     70|    {                                                                                                          \
  199|     70|        return ptr;                                                                                            \
  200|     70|    }                                                                                                          \
o_names.c:lh_OBJ_NAME_new:
  334|      1|    {                                                                                                                      \
  335|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|      1|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|      1|            lh_##type##_doall_thunk,                                                                                       \
  338|      1|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|      1|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_hfn_thunk:
  260|  1.08k|    {                                                                                                                      \
  261|  1.08k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|  1.08k|        return hfn_conv((const type *)data);                                                                               \
  263|  1.08k|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_cfn_thunk:
  265|    676|    {                                                                                                                      \
  266|    676|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                            \
  267|    676|        return cfn_conv((const type *)da, (const type *)db);                                                               \
  268|    676|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_retrieve:
  291|    659|    {                                                                                                                      \
  292|    659|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|    659|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_insert:
  281|    424|    {                                                                                                                      \
  282|    424|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d);                                                          \
  283|    424|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_error:
  296|    242|    {                                                                                                                      \
  297|    242|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh);                                                                      \
  298|    242|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL:
  371|      2|    {                                                                                       \
  372|      2|        OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh,                                     \
  373|      2|            lh_##type##_doall_##argtype##_thunk,                                            \
  374|      2|            (OPENSSL_LH_DOALL_FUNCARG)fn,                                                   \
  375|      2|            (void *)arg);                                                                   \
  376|      2|    }                                                                                       \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL_thunk:
  363|    484|    {                                                                                       \
  364|    484|        void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn;     \
  365|    484|        fn_conv((cbargtype *)node, (argtype *)arg);                                         \
  366|    484|    }                                                                                       \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  334|      1|    {                                                                                                                      \
  335|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|      1|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|      1|            lh_##type##_doall_thunk,                                                                                       \
  338|      1|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|      1|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_hfn_thunk:
  260|    168|    {                                                                                                                      \
  261|    168|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|    168|        return hfn_conv((const type *)data);                                                                               \
  263|    168|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_cfn_thunk:
  265|    165|    {                                                                                                                      \
  266|    165|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                            \
  267|    165|        return cfn_conv((const type *)da, (const type *)db);                                                               \
  268|    165|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_retrieve:
  291|    167|    {                                                                                                                      \
  292|    167|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|    167|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_insert:
  281|      1|    {                                                                                                                      \
  282|      1|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d);                                                          \
  283|      1|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_error:
  296|      1|    {                                                                                                                      \
  297|      1|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh);                                                                      \
  298|      1|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_new:
  334|      2|    {                                                                                                                      \
  335|      2|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|      2|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|      2|            lh_##type##_doall_thunk,                                                                                       \
  338|      2|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|      2|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_hfn_thunk:
  260|     32|    {                                                                                                                      \
  261|     32|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|     32|        return hfn_conv((const type *)data);                                                                               \
  263|     32|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_cfn_thunk:
  265|      5|    {                                                                                                                      \
  266|      5|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                            \
  267|      5|        return cfn_conv((const type *)da, (const type *)db);                                                               \
  268|      5|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_retrieve:
  291|     23|    {                                                                                                                      \
  292|     23|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|     23|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_insert:
  281|      9|    {                                                                                                                      \
  282|      9|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d);                                                          \
  283|      9|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_error:
  296|      9|    {                                                                                                                      \
  297|      9|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh);                                                                      \
  298|      9|    }                                                                                                                      \

core_namemap.c:sk_NAMES_value:
  112|    369|    {                                                                                                                      \
  113|    369|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
  114|    369|    }                                                                                                                      \
core_namemap.c:ossl_check_const_OPENSSL_STRING_sk_type:
   64|    966|    {                                                                                                                    \
   65|    966|        return (const OPENSSL_STACK *)sk;                                                                                \
   66|    966|    }                                                                                                                    \
core_namemap.c:ossl_check_OPENSSL_STRING_sk_type:
   68|    563|    {                                                                                                                    \
   69|    563|        return (OPENSSL_STACK *)sk;                                                                                      \
   70|    563|    }                                                                                                                    \
core_namemap.c:ossl_check_OPENSSL_STRING_type:
   60|    402|    {                                                                                                                    \
   61|    402|        return ptr;                                                                                                      \
   62|    402|    }                                                                                                                    \
core_namemap.c:sk_NAMES_push:
  167|    194|    {                                                                                                                      \
  168|    194|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  169|    194|    }                                                                                                                      \
core_namemap.c:sk_NAMES_num:
  108|    194|    {                                                                                                                      \
  109|    194|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
  110|    194|    }                                                                                                                      \
core_namemap.c:sk_NAMES_new_null:
  126|      1|    {                                                                                                                      \
  127|      1|        OPENSSL_STACK *ret = OPENSSL_sk_new_null();                                                                        \
  128|      1|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  129|      1|                                                                                                                           \
  130|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  131|      1|        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
  132|      1|        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
  133|      1|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
  134|      1|    }                                                                                                                      \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
  126|      1|    {                                                                                                                      \
  127|      1|        OPENSSL_STACK *ret = OPENSSL_sk_new_null();                                                                        \
  128|      1|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  129|      1|                                                                                                                           \
  130|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  131|      1|        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
  132|      1|        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
  133|      1|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
  134|      1|    }                                                                                                                      \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  167|      1|    {                                                                                                                      \
  168|      1|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  169|      1|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_new:
  116|      1|    {                                                                                                                      \
  117|      1|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare);                                                 \
  118|      1|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  119|      1|                                                                                                                           \
  120|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  121|      1|        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
  122|      1|        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
  123|      1|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
  124|      1|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
  126|      1|    {                                                                                                                      \
  127|      1|        OPENSSL_STACK *ret = OPENSSL_sk_new_null();                                                                        \
  128|      1|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  129|      1|                                                                                                                           \
  130|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  131|      1|        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
  132|      1|        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
  133|      1|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
  134|      1|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_value:
  112|     15|    {                                                                                                                      \
  113|     15|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
  114|     15|    }                                                                                                                      \
provider_core.c:sk_INFOPAIR_deep_copy:
  233|      1|    {                                                                                                                      \
  234|      1|        OPENSSL_STACK *ret = OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk,                                               \
  235|      1|            (OPENSSL_sk_copyfunc)copyfunc,                                                                                 \
  236|      1|            (OPENSSL_sk_freefunc)freefunc);                                                                                \
  237|      1|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  238|      1|                                                                                                                           \
  239|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  240|      1|        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
  241|      1|        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
  242|      1|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
  243|      1|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_push:
  167|      1|    {                                                                                                                      \
  168|      1|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  169|      1|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_dup:
  221|      5|    {                                                                                                                      \
  222|      5|        OPENSSL_STACK *ret = OPENSSL_sk_dup((const OPENSSL_STACK *)sk);                                                    \
  223|      5|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  224|      5|                                                                                                                           \
  225|      5|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  226|      5|        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
  227|      5|        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
  228|      5|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
  229|      5|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_num:
  108|      5|    {                                                                                                                      \
  109|      5|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
  110|      5|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_free:
  150|      5|    {                                                                                                                      \
  151|      5|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  152|      5|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_new_null:
  126|    166|    {                                                                                                                      \
  127|    166|        OPENSSL_STACK *ret = OPENSSL_sk_new_null();                                                                        \
  128|    166|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  129|    166|                                                                                                                           \
  130|    166|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  131|    166|        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
  132|    166|        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
  133|    166|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
  134|    166|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_num:
  108|    337|    {                                                                                                                      \
  109|    337|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
  110|    337|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_value:
  112|      5|    {                                                                                                                      \
  113|      5|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
  114|      5|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_push:
  167|    166|    {                                                                                                                      \
  168|    166|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  169|    166|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_new:
  116|      6|    {                                                                                                                      \
  117|      6|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare);                                                 \
  118|      6|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  119|      6|                                                                                                                           \
  120|      6|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  121|      6|        OPENSSL_sk_set_cmp_thunks(ret, sk_##t1##_cmpfunc_thunk);                                                           \
  122|      6|        OPENSSL_sk_set_copy_thunks(ret, sk_##t1##_copyfunc_thunk);                                                         \
  123|      6|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
  124|      6|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_freefunc_thunk:
   90|      3|    {                                                                                                                      \
   91|      3|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   92|      3|        freefunc((t3 *)ptr);                                                                                               \
   93|      3|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_push:
  167|      3|    {                                                                                                                      \
  168|      3|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  169|      3|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_num:
  108|      6|    {                                                                                                                      \
  109|      6|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
  110|      6|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_sort:
  213|      6|    {                                                                                                                      \
  214|      6|        OPENSSL_sk_sort((OPENSSL_STACK *)sk);                                                                              \
  215|      6|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_value:
  112|      3|    {                                                                                                                      \
  113|      3|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
  114|      3|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_pop_free:
  183|      6|    {                                                                                                                      \
  184|      6|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  185|      6|                                                                                                                           \
  186|      6|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  187|      6|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  188|      6|                                                                                                                           \
  189|      6|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  190|      6|    }                                                                                                                      \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   68|      9|    {                                                                                                                    \
   69|      9|        return (OPENSSL_STACK *)sk;                                                                                      \
   70|      9|    }                                                                                                                    \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   60|      9|    {                                                                                                                    \
   61|      9|        return ptr;                                                                                                      \
   62|      9|    }                                                                                                                    \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   72|      1|    {                                                                                                                    \
   73|      1|        return (OPENSSL_sk_compfunc)cmp;                                                                                 \
   74|      1|    }                                                                                                                    \

ossl_prov_bio_from_dispatch:
   27|      1|{
   28|     54|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (28:12): [True: 53, False: 1]
  ------------------
   29|     53|        switch (fns->function_id) {
  ------------------
  |  Branch (29:17): [True: 10, False: 43]
  ------------------
   30|      1|        case OSSL_FUNC_BIO_NEW_FILE:
  ------------------
  |  |  151|      1|#define OSSL_FUNC_BIO_NEW_FILE 40
  ------------------
  |  Branch (30:9): [True: 1, False: 52]
  ------------------
   31|      1|            if (c_bio_new_file == NULL)
  ------------------
  |  Branch (31:17): [True: 1, False: 0]
  ------------------
   32|      1|                c_bio_new_file = OSSL_FUNC_BIO_new_file(fns);
   33|      1|            break;
   34|      1|        case OSSL_FUNC_BIO_NEW_MEMBUF:
  ------------------
  |  |  152|      1|#define OSSL_FUNC_BIO_NEW_MEMBUF 41
  ------------------
  |  Branch (34:9): [True: 1, False: 52]
  ------------------
   35|      1|            if (c_bio_new_membuf == NULL)
  ------------------
  |  Branch (35:17): [True: 1, False: 0]
  ------------------
   36|      1|                c_bio_new_membuf = OSSL_FUNC_BIO_new_membuf(fns);
   37|      1|            break;
   38|      1|        case OSSL_FUNC_BIO_READ_EX:
  ------------------
  |  |  153|      1|#define OSSL_FUNC_BIO_READ_EX 42
  ------------------
  |  Branch (38:9): [True: 1, False: 52]
  ------------------
   39|      1|            if (c_bio_read_ex == NULL)
  ------------------
  |  Branch (39:17): [True: 1, False: 0]
  ------------------
   40|      1|                c_bio_read_ex = OSSL_FUNC_BIO_read_ex(fns);
   41|      1|            break;
   42|      1|        case OSSL_FUNC_BIO_WRITE_EX:
  ------------------
  |  |  154|      1|#define OSSL_FUNC_BIO_WRITE_EX 43
  ------------------
  |  Branch (42:9): [True: 1, False: 52]
  ------------------
   43|      1|            if (c_bio_write_ex == NULL)
  ------------------
  |  Branch (43:17): [True: 1, False: 0]
  ------------------
   44|      1|                c_bio_write_ex = OSSL_FUNC_BIO_write_ex(fns);
   45|      1|            break;
   46|      1|        case OSSL_FUNC_BIO_GETS:
  ------------------
  |  |  160|      1|#define OSSL_FUNC_BIO_GETS 49
  ------------------
  |  Branch (46:9): [True: 1, False: 52]
  ------------------
   47|      1|            if (c_bio_gets == NULL)
  ------------------
  |  Branch (47:17): [True: 1, False: 0]
  ------------------
   48|      1|                c_bio_gets = OSSL_FUNC_BIO_gets(fns);
   49|      1|            break;
   50|      1|        case OSSL_FUNC_BIO_PUTS:
  ------------------
  |  |  159|      1|#define OSSL_FUNC_BIO_PUTS 48
  ------------------
  |  Branch (50:9): [True: 1, False: 52]
  ------------------
   51|      1|            if (c_bio_puts == NULL)
  ------------------
  |  Branch (51:17): [True: 1, False: 0]
  ------------------
   52|      1|                c_bio_puts = OSSL_FUNC_BIO_puts(fns);
   53|      1|            break;
   54|      1|        case OSSL_FUNC_BIO_CTRL:
  ------------------
  |  |  161|      1|#define OSSL_FUNC_BIO_CTRL 50
  ------------------
  |  Branch (54:9): [True: 1, False: 52]
  ------------------
   55|      1|            if (c_bio_ctrl == NULL)
  ------------------
  |  Branch (55:17): [True: 1, False: 0]
  ------------------
   56|      1|                c_bio_ctrl = OSSL_FUNC_BIO_ctrl(fns);
   57|      1|            break;
   58|      1|        case OSSL_FUNC_BIO_UP_REF:
  ------------------
  |  |  155|      1|#define OSSL_FUNC_BIO_UP_REF 44
  ------------------
  |  Branch (58:9): [True: 1, False: 52]
  ------------------
   59|      1|            if (c_bio_up_ref == NULL)
  ------------------
  |  Branch (59:17): [True: 1, False: 0]
  ------------------
   60|      1|                c_bio_up_ref = OSSL_FUNC_BIO_up_ref(fns);
   61|      1|            break;
   62|      1|        case OSSL_FUNC_BIO_FREE:
  ------------------
  |  |  156|      1|#define OSSL_FUNC_BIO_FREE 45
  ------------------
  |  Branch (62:9): [True: 1, False: 52]
  ------------------
   63|      1|            if (c_bio_free == NULL)
  ------------------
  |  Branch (63:17): [True: 1, False: 0]
  ------------------
   64|      1|                c_bio_free = OSSL_FUNC_BIO_free(fns);
   65|      1|            break;
   66|      1|        case OSSL_FUNC_BIO_VPRINTF:
  ------------------
  |  |  157|      1|#define OSSL_FUNC_BIO_VPRINTF 46
  ------------------
  |  Branch (66:9): [True: 1, False: 52]
  ------------------
   67|      1|            if (c_bio_vprintf == NULL)
  ------------------
  |  Branch (67:17): [True: 1, False: 0]
  ------------------
   68|      1|                c_bio_vprintf = OSSL_FUNC_BIO_vprintf(fns);
   69|      1|            break;
   70|     53|        }
   71|     53|    }
   72|       |
   73|      1|    return 1;
   74|      1|}
ossl_bio_prov_init_bio_method:
  207|      1|{
  208|      1|    BIO_METHOD *corebiometh = NULL;
  209|       |
  210|      1|    corebiometh = BIO_meth_new(BIO_TYPE_CORE_TO_PROV, "BIO to Core filter");
  ------------------
  |  |   71|      1|#define BIO_TYPE_CORE_TO_PROV (25 | BIO_TYPE_SOURCE_SINK)
  |  |  ------------------
  |  |  |  |   43|      1|#define BIO_TYPE_SOURCE_SINK 0x0400
  |  |  ------------------
  ------------------
  211|      1|    if (corebiometh == NULL
  ------------------
  |  Branch (211:9): [True: 0, False: 1]
  ------------------
  212|      1|        || !BIO_meth_set_write_ex(corebiometh, bio_core_write_ex)
  ------------------
  |  Branch (212:12): [True: 0, False: 1]
  ------------------
  213|      1|        || !BIO_meth_set_read_ex(corebiometh, bio_core_read_ex)
  ------------------
  |  Branch (213:12): [True: 0, False: 1]
  ------------------
  214|      1|        || !BIO_meth_set_puts(corebiometh, bio_core_puts)
  ------------------
  |  Branch (214:12): [True: 0, False: 1]
  ------------------
  215|      1|        || !BIO_meth_set_gets(corebiometh, bio_core_gets)
  ------------------
  |  Branch (215:12): [True: 0, False: 1]
  ------------------
  216|      1|        || !BIO_meth_set_ctrl(corebiometh, bio_core_ctrl)
  ------------------
  |  Branch (216:12): [True: 0, False: 1]
  ------------------
  217|      1|        || !BIO_meth_set_create(corebiometh, bio_core_new)
  ------------------
  |  Branch (217:12): [True: 0, False: 1]
  ------------------
  218|      1|        || !BIO_meth_set_destroy(corebiometh, bio_core_free)) {
  ------------------
  |  Branch (218:12): [True: 0, False: 1]
  ------------------
  219|      0|        BIO_meth_free(corebiometh);
  220|      0|        return NULL;
  221|      0|    }
  222|       |
  223|      1|    return corebiometh;
  224|      1|}

ciphercommon.c:ossl_param_is_empty:
   33|     41|{
   34|     41|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (34:12): [True: 41, False: 0]
  |  Branch (34:30): [True: 0, False: 0]
  ------------------
   35|     41|}

ossl_prov_ctx_new:
   16|      1|{
   17|      1|    return OPENSSL_zalloc(sizeof(PROV_CTX));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   18|      1|}
ossl_prov_ctx_set0_libctx:
   26|      1|{
   27|      1|    if (ctx != NULL)
  ------------------
  |  Branch (27:9): [True: 1, False: 0]
  ------------------
   28|      1|        ctx->libctx = libctx;
   29|      1|}
ossl_prov_ctx_set0_handle:
   32|      1|{
   33|      1|    if (ctx != NULL)
  ------------------
  |  Branch (33:9): [True: 1, False: 0]
  ------------------
   34|      1|        ctx->handle = handle;
   35|      1|}
ossl_prov_ctx_set0_core_bio_method:
   38|      1|{
   39|      1|    if (ctx != NULL)
  ------------------
  |  Branch (39:9): [True: 1, False: 0]
  ------------------
   40|      1|        ctx->corebiometh = corebiometh;
   41|      1|}
ossl_prov_ctx_set0_core_get_params:
   45|      1|{
   46|      1|    if (ctx != NULL)
  ------------------
  |  Branch (46:9): [True: 1, False: 0]
  ------------------
   47|      1|        ctx->core_get_params = c_get_params;
   48|      1|}
ossl_prov_ctx_get0_libctx:
   51|      8|{
   52|      8|    if (ctx == NULL)
  ------------------
  |  Branch (52:9): [True: 0, False: 8]
  ------------------
   53|      0|        return NULL;
   54|      8|    return ctx->libctx;
   55|      8|}

ossl_err_load_PROV_strings:
  285|      1|{
  286|      1|#ifndef OPENSSL_NO_ERR
  287|      1|    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (287:9): [True: 1, False: 0]
  ------------------
  288|      1|        ERR_load_strings_const(PROV_str_reasons);
  289|      1|#endif
  290|      1|    return 1;
  291|      1|}

ossl_prov_seeding_from_dispatch:
   42|      1|{
   43|     54|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (43:12): [True: 53, False: 1]
  ------------------
   44|       |        /*
   45|       |         * We do not support the scenario of an application linked against
   46|       |         * multiple versions of libcrypto (e.g. one static and one dynamic), but
   47|       |         * sharing a single fips.so. We do a simple sanity check here.
   48|       |         */
   49|     53|#define set_func(c, f)   \
   50|     53|    do {                 \
   51|     53|        if (c == NULL)   \
   52|     53|            c = f;       \
   53|     53|        else if (c != f) \
   54|     53|            return 0;    \
   55|     53|    } while (0)
   56|     53|        switch (fns->function_id) {
  ------------------
  |  Branch (56:17): [True: 8, False: 45]
  ------------------
   57|      1|        case OSSL_FUNC_GET_ENTROPY:
  ------------------
  |  |  188|      1|#define OSSL_FUNC_GET_ENTROPY 101
  ------------------
  |  Branch (57:9): [True: 1, False: 52]
  ------------------
   58|      1|            set_func(c_get_entropy, OSSL_FUNC_get_entropy(fns));
  ------------------
  |  |   50|      1|    do {                 \
  |  |   51|      1|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 0]
  |  |  ------------------
  |  |   52|      1|            c = f;       \
  |  |   53|      1|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|            return 0;    \
  |  |   55|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   59|      1|            break;
   60|      1|        case OSSL_FUNC_GET_USER_ENTROPY:
  ------------------
  |  |  179|      1|#define OSSL_FUNC_GET_USER_ENTROPY 98
  ------------------
  |  Branch (60:9): [True: 1, False: 52]
  ------------------
   61|      1|            set_func(c_get_user_entropy, OSSL_FUNC_get_user_entropy(fns));
  ------------------
  |  |   50|      1|    do {                 \
  |  |   51|      1|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 0]
  |  |  ------------------
  |  |   52|      1|            c = f;       \
  |  |   53|      1|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|            return 0;    \
  |  |   55|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   62|      1|            break;
   63|      1|        case OSSL_FUNC_CLEANUP_ENTROPY:
  ------------------
  |  |  189|      1|#define OSSL_FUNC_CLEANUP_ENTROPY 102
  ------------------
  |  Branch (63:9): [True: 1, False: 52]
  ------------------
   64|      1|            set_func(c_cleanup_entropy, OSSL_FUNC_cleanup_entropy(fns));
  ------------------
  |  |   50|      1|    do {                 \
  |  |   51|      1|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 0]
  |  |  ------------------
  |  |   52|      1|            c = f;       \
  |  |   53|      1|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|            return 0;    \
  |  |   55|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   65|      1|            break;
   66|      1|        case OSSL_FUNC_CLEANUP_USER_ENTROPY:
  ------------------
  |  |  177|      1|#define OSSL_FUNC_CLEANUP_USER_ENTROPY 96
  ------------------
  |  Branch (66:9): [True: 1, False: 52]
  ------------------
   67|      1|            set_func(c_cleanup_user_entropy, OSSL_FUNC_cleanup_user_entropy(fns));
  ------------------
  |  |   50|      1|    do {                 \
  |  |   51|      1|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 0]
  |  |  ------------------
  |  |   52|      1|            c = f;       \
  |  |   53|      1|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|            return 0;    \
  |  |   55|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   68|      1|            break;
   69|      1|        case OSSL_FUNC_GET_NONCE:
  ------------------
  |  |  190|      1|#define OSSL_FUNC_GET_NONCE 103
  ------------------
  |  Branch (69:9): [True: 1, False: 52]
  ------------------
   70|      1|            set_func(c_get_nonce, OSSL_FUNC_get_nonce(fns));
  ------------------
  |  |   50|      1|    do {                 \
  |  |   51|      1|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 0]
  |  |  ------------------
  |  |   52|      1|            c = f;       \
  |  |   53|      1|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|            return 0;    \
  |  |   55|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   71|      1|            break;
   72|      1|        case OSSL_FUNC_GET_USER_NONCE:
  ------------------
  |  |  180|      1|#define OSSL_FUNC_GET_USER_NONCE 99
  ------------------
  |  Branch (72:9): [True: 1, False: 52]
  ------------------
   73|      1|            set_func(c_get_user_nonce, OSSL_FUNC_get_user_nonce(fns));
  ------------------
  |  |   50|      1|    do {                 \
  |  |   51|      1|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 0]
  |  |  ------------------
  |  |   52|      1|            c = f;       \
  |  |   53|      1|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|            return 0;    \
  |  |   55|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   74|      1|            break;
   75|      1|        case OSSL_FUNC_CLEANUP_NONCE:
  ------------------
  |  |  191|      1|#define OSSL_FUNC_CLEANUP_NONCE 104
  ------------------
  |  Branch (75:9): [True: 1, False: 52]
  ------------------
   76|      1|            set_func(c_cleanup_nonce, OSSL_FUNC_cleanup_nonce(fns));
  ------------------
  |  |   50|      1|    do {                 \
  |  |   51|      1|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 0]
  |  |  ------------------
  |  |   52|      1|            c = f;       \
  |  |   53|      1|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|            return 0;    \
  |  |   55|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   77|      1|            break;
   78|      1|        case OSSL_FUNC_CLEANUP_USER_NONCE:
  ------------------
  |  |  178|      1|#define OSSL_FUNC_CLEANUP_USER_NONCE 97
  ------------------
  |  Branch (78:9): [True: 1, False: 52]
  ------------------
   79|      1|            set_func(c_cleanup_user_nonce, OSSL_FUNC_cleanup_user_nonce(fns));
  ------------------
  |  |   50|      1|    do {                 \
  |  |   51|      1|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 0]
  |  |  ------------------
  |  |   52|      1|            c = f;       \
  |  |   53|      1|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 0]
  |  |  ------------------
  |  |   54|      0|            return 0;    \
  |  |   55|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   80|      1|            break;
   81|     53|        }
   82|     53|#undef set_func
   83|     53|    }
   84|      1|    return 1;
   85|      1|}

ossl_prov_cache_exported_algorithms:
  221|      1|{
  222|      1|    int i, j;
  223|       |
  224|      1|    if (out[0].algorithm_names == NULL) {
  ------------------
  |  Branch (224:9): [True: 1, False: 0]
  ------------------
  225|    141|        for (i = j = 0; in[i].alg.algorithm_names != NULL; ++i) {
  ------------------
  |  Branch (225:25): [True: 140, False: 1]
  ------------------
  226|    140|            if (in[i].capable == NULL || in[i].capable())
  ------------------
  |  Branch (226:17): [True: 127, False: 13]
  |  Branch (226:42): [True: 4, False: 9]
  ------------------
  227|    131|                out[j++] = in[i].alg;
  228|    140|        }
  229|      1|        out[j++] = in[i].alg;
  230|      1|    }
  231|      1|}

ossl_default_provider_init:
  805|      1|{
  806|      1|    OSSL_FUNC_core_get_libctx_fn *c_get_libctx = NULL;
  807|      1|    OSSL_FUNC_core_get_params_fn *c_get_params = NULL;
  808|      1|    BIO_METHOD *corebiometh;
  809|       |
  810|      1|    if (!ossl_prov_bio_from_dispatch(in)
  ------------------
  |  Branch (810:9): [True: 0, False: 1]
  ------------------
  811|      1|        || !ossl_prov_seeding_from_dispatch(in))
  ------------------
  |  Branch (811:12): [True: 0, False: 1]
  ------------------
  812|      0|        return 0;
  813|     54|    for (; in->function_id != 0; in++) {
  ------------------
  |  Branch (813:12): [True: 53, False: 1]
  ------------------
  814|     53|        switch (in->function_id) {
  815|      1|        case OSSL_FUNC_CORE_GET_PARAMS:
  ------------------
  |  |   75|      1|#define OSSL_FUNC_CORE_GET_PARAMS 2
  ------------------
  |  Branch (815:9): [True: 1, False: 52]
  ------------------
  816|      1|            c_get_params = OSSL_FUNC_core_get_params(in);
  817|      1|            break;
  818|      1|        case OSSL_FUNC_CORE_GET_LIBCTX:
  ------------------
  |  |   79|      1|#define OSSL_FUNC_CORE_GET_LIBCTX 4
  ------------------
  |  Branch (818:9): [True: 1, False: 52]
  ------------------
  819|      1|            c_get_libctx = OSSL_FUNC_core_get_libctx(in);
  820|      1|            break;
  821|     51|        default:
  ------------------
  |  Branch (821:9): [True: 51, False: 2]
  ------------------
  822|       |            /* Just ignore anything we don't understand */
  823|     51|            break;
  824|     53|        }
  825|     53|    }
  826|       |
  827|      1|    if (c_get_libctx == NULL)
  ------------------
  |  Branch (827:9): [True: 0, False: 1]
  ------------------
  828|      0|        return 0;
  829|       |
  830|       |    /*
  831|       |     * We want to make sure that all calls from this provider that requires
  832|       |     * a library context use the same context as the one used to call our
  833|       |     * functions.  We do that by passing it along in the provider context.
  834|       |     *
  835|       |     * This only works for built-in providers.  Most providers should
  836|       |     * create their own library context.
  837|       |     */
  838|      1|    if ((*provctx = ossl_prov_ctx_new()) == NULL
  ------------------
  |  Branch (838:9): [True: 0, False: 1]
  ------------------
  839|      1|        || (corebiometh = ossl_bio_prov_init_bio_method()) == NULL) {
  ------------------
  |  Branch (839:12): [True: 0, False: 1]
  ------------------
  840|      0|        ossl_prov_ctx_free(*provctx);
  841|      0|        *provctx = NULL;
  842|      0|        return 0;
  843|      0|    }
  844|      1|    ossl_prov_ctx_set0_libctx(*provctx,
  845|      1|        (OSSL_LIB_CTX *)c_get_libctx(handle));
  846|      1|    ossl_prov_ctx_set0_handle(*provctx, handle);
  847|      1|    ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
  848|      1|    ossl_prov_ctx_set0_core_get_params(*provctx, c_get_params);
  849|       |
  850|      1|    *out = deflt_dispatch_table;
  851|      1|    ossl_prov_cache_exported_algorithms(deflt_ciphers, exported_ciphers);
  852|       |
  853|      1|    return 1;
  854|      1|}
defltprov.c:deflt_query:
  747|      5|{
  748|      5|    *no_cache = 0;
  749|      5|    switch (operation_id) {
  ------------------
  |  Branch (749:13): [True: 5, False: 0]
  ------------------
  750|      1|    case OSSL_OP_DIGEST:
  ------------------
  |  |  283|      1|#define OSSL_OP_DIGEST 1
  ------------------
  |  Branch (750:5): [True: 1, False: 4]
  ------------------
  751|      1|        return deflt_digests;
  752|      2|    case OSSL_OP_CIPHER:
  ------------------
  |  |  284|      2|#define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
  ------------------
  |  Branch (752:5): [True: 2, False: 3]
  ------------------
  753|      2|        return exported_ciphers;
  754|      0|    case OSSL_OP_MAC:
  ------------------
  |  |  285|      0|#define OSSL_OP_MAC 3
  ------------------
  |  Branch (754:5): [True: 0, False: 5]
  ------------------
  755|      0|        return deflt_macs;
  756|      0|    case OSSL_OP_KDF:
  ------------------
  |  |  286|      0|#define OSSL_OP_KDF 4
  ------------------
  |  Branch (756:5): [True: 0, False: 5]
  ------------------
  757|      0|        return deflt_kdfs;
  758|      2|    case OSSL_OP_RAND:
  ------------------
  |  |  287|      2|#define OSSL_OP_RAND 5
  ------------------
  |  Branch (758:5): [True: 2, False: 3]
  ------------------
  759|      2|        return deflt_rands;
  760|      0|    case OSSL_OP_KEYMGMT:
  ------------------
  |  |  288|      0|#define OSSL_OP_KEYMGMT 10
  ------------------
  |  Branch (760:5): [True: 0, False: 5]
  ------------------
  761|      0|        return deflt_keymgmt;
  762|      0|    case OSSL_OP_KEYEXCH:
  ------------------
  |  |  289|      0|#define OSSL_OP_KEYEXCH 11
  ------------------
  |  Branch (762:5): [True: 0, False: 5]
  ------------------
  763|      0|        return deflt_keyexch;
  764|      0|    case OSSL_OP_SIGNATURE:
  ------------------
  |  |  290|      0|#define OSSL_OP_SIGNATURE 12
  ------------------
  |  Branch (764:5): [True: 0, False: 5]
  ------------------
  765|      0|        return deflt_signature;
  766|      0|    case OSSL_OP_ASYM_CIPHER:
  ------------------
  |  |  291|      0|#define OSSL_OP_ASYM_CIPHER 13
  ------------------
  |  Branch (766:5): [True: 0, False: 5]
  ------------------
  767|      0|        return deflt_asym_cipher;
  768|      0|    case OSSL_OP_KEM:
  ------------------
  |  |  292|      0|#define OSSL_OP_KEM 14
  ------------------
  |  Branch (768:5): [True: 0, False: 5]
  ------------------
  769|      0|        return deflt_asym_kem;
  770|      0|    case OSSL_OP_ENCODER:
  ------------------
  |  |  295|      0|#define OSSL_OP_ENCODER 20
  ------------------
  |  Branch (770:5): [True: 0, False: 5]
  ------------------
  771|      0|        return deflt_encoder;
  772|      0|    case OSSL_OP_DECODER:
  ------------------
  |  |  296|      0|#define OSSL_OP_DECODER 21
  ------------------
  |  Branch (772:5): [True: 0, False: 5]
  ------------------
  773|      0|        return deflt_decoder;
  774|      0|    case OSSL_OP_STORE:
  ------------------
  |  |  297|      0|#define OSSL_OP_STORE 22
  ------------------
  |  Branch (774:5): [True: 0, False: 5]
  ------------------
  775|      0|        return deflt_store;
  776|      0|    case OSSL_OP_SKEYMGMT:
  ------------------
  |  |  293|      0|#define OSSL_OP_SKEYMGMT 15
  ------------------
  |  Branch (776:5): [True: 0, False: 5]
  ------------------
  777|      0|        return deflt_skeymgmt;
  778|      5|    }
  779|      0|    return NULL;
  780|      5|}

cipher_aes_cbc_hmac_sha.c:aes_128_cbc_hmac_sha1_get_params:
  426|      1|    {                                                                               \
  427|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,            \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  428|      1|            flags, kbits, blkbits, ivbits);                                         \
  429|      1|    }                                                                               \
cipher_aes_cbc_hmac_sha.c:aes_gettable_ctx_params:
  289|      4|{
  290|      4|    return aes_cbc_hmac_sha_get_ctx_params_list;
  291|      4|}
cipher_aes_cbc_hmac_sha.c:aes_256_cbc_hmac_sha1_get_params:
  426|      1|    {                                                                               \
  427|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,            \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  428|      1|            flags, kbits, blkbits, ivbits);                                         \
  429|      1|    }                                                                               \
cipher_aes_cbc_hmac_sha.c:aes_128_cbc_hmac_sha256_get_params:
  426|      1|    {                                                                               \
  427|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,            \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  428|      1|            flags, kbits, blkbits, ivbits);                                         \
  429|      1|    }                                                                               \
cipher_aes_cbc_hmac_sha.c:aes_256_cbc_hmac_sha256_get_params:
  426|      1|    {                                                                               \
  427|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,            \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  428|      1|            flags, kbits, blkbits, ivbits);                                         \
  429|      1|    }                                                                               \

ossl_cipher_capable_aes_cbc_hmac_sha1_etm:
   14|      3|{
   15|      3|    return 0;
   16|      3|}

ossl_cipher_capable_aes_cbc_hmac_sha1:
   41|      2|{
   42|      2|    return AESNI_CBC_HMAC_SHA_CAPABLE;
  ------------------
  |  |  177|      2|#define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  ------------------
   43|      2|}

ossl_cipher_capable_aes_cbc_hmac_sha256_etm:
   14|      3|{
   15|      3|    return 0;
   16|      3|}

ossl_cipher_capable_aes_cbc_hmac_sha256:
   41|      2|{
   42|      2|    return AESNI_CBC_HMAC_SHA_CAPABLE
  ------------------
  |  |  177|      4|#define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (177:36): [True: 2, False: 0]
  |  |  ------------------
  ------------------
   43|      2|        && aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL);
  ------------------
  |  Branch (43:12): [True: 2, False: 0]
  ------------------
   44|      2|}

ossl_cipher_capable_aes_cbc_hmac_sha512_etm:
   20|      3|{
   21|      3|    return 0;
   22|      3|}

cipher_aes_gcm_siv.c:ossl_aes_128_gcm_siv_get_params:
  284|      1|    {                                                                                                      \
  285|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                            \
  ------------------
  |  |  297|      1|#define EVP_CIPH_GCM_SIV_MODE 0x10005
  ------------------
  286|      1|            flags, kbits, blkbits, ivbits);                                                                \
  287|      1|    }                                                                                                      \
cipher_aes_gcm_siv.c:ossl_aes_gcm_siv_gettable_ctx_params:
  211|      3|{
  212|      3|    return ossl_aes_gcm_siv_get_ctx_params_list;
  213|      3|}
cipher_aes_gcm_siv.c:ossl_aes_192_gcm_siv_get_params:
  284|      1|    {                                                                                                      \
  285|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                            \
  ------------------
  |  |  297|      1|#define EVP_CIPH_GCM_SIV_MODE 0x10005
  ------------------
  286|      1|            flags, kbits, blkbits, ivbits);                                                                \
  287|      1|    }                                                                                                      \
cipher_aes_gcm_siv.c:ossl_aes_256_gcm_siv_get_params:
  284|      1|    {                                                                                                      \
  285|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                            \
  ------------------
  |  |  297|      1|#define EVP_CIPH_GCM_SIV_MODE 0x10005
  ------------------
  286|      1|            flags, kbits, blkbits, ivbits);                                                                \
  287|      1|    }                                                                                                      \

ossl_cipher_set_aes_initkey:
   23|     33|{
   24|     33|    PROV_AES_CTX *actx = (PROV_AES_CTX *)ctx;
   25|     33|    AES_KEY *ks = &actx->ks.ks;
   26|       |
   27|     33|    int ret = fn_set_key(key, (int)(keylen * 8), ks);
   28|     33|    if (ret < 0) {
  ------------------
  |  Branch (28:9): [True: 0, False: 33]
  ------------------
   29|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   30|      0|        return 0;
   31|      0|    }
   32|     33|    ctx->ks = ks;
   33|       |
   34|     33|    ctx->block = (block128_f)fn_block;
   35|       |
   36|     33|    switch (ctx->mode) {
   37|     22|    case EVP_CIPH_ECB_MODE:
  ------------------
  |  |  286|     22|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  |  Branch (37:5): [True: 22, False: 11]
  ------------------
   38|     22|        ctx->stream.ecb = fn_ecb;
   39|     22|        break;
   40|      0|    case EVP_CIPH_CBC_MODE:
  ------------------
  |  |  287|      0|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  |  Branch (40:5): [True: 0, False: 33]
  ------------------
   41|      0|        ctx->stream.cbc = fn_cbc;
   42|      0|        break;
   43|     11|    case EVP_CIPH_CTR_MODE:
  ------------------
  |  |  290|     11|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  |  Branch (43:5): [True: 11, False: 22]
  ------------------
   44|     11|        ctx->stream.ctr = fn_ctr;
   45|     11|        break;
   46|      0|    default:
  ------------------
  |  Branch (46:5): [True: 0, False: 33]
  ------------------
   47|      0|        memset(&ctx->stream, 0, sizeof(ctx->stream));
   48|      0|        break;
   49|     33|    }
   50|       |
   51|     33|    return 1;
   52|     33|}
ossl_prov_cipher_hw_aes_ecb:
  256|      4|{
  257|      4|    return ossl_prov_cipher_hw_aes_mode(AES_MODE_ECB, keybits);
  258|      4|}
ossl_prov_cipher_hw_aes_ctr:
  286|      2|{
  287|      2|    return ossl_prov_cipher_hw_aes_mode(AES_MODE_CTR, keybits);
  288|      2|}
cipher_aes_hw.c:ossl_prov_cipher_hw_aes_mode:
  216|      6|{
  217|      6|    const PROV_CIPHER_HW *aes_hw_mode = NULL;
  218|       |
  219|      6|#if defined(AESNI_CAPABLE)
  220|      6|    aes_hw_mode = ossl_prov_cipher_hw_aesni(mode);
  221|       |#elif defined(ARMv8_HWAES_CAPABLE)
  222|       |    aes_hw_mode = ossl_prov_cipher_hw_arm(mode);
  223|       |#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
  224|       |    aes_hw_mode = ossl_prov_cipher_hw_rv32i(mode);
  225|       |#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
  226|       |    aes_hw_mode = ossl_prov_cipher_hw_rv64i(mode);
  227|       |#elif defined(S390X_aes_128_CAPABLE)
  228|       |    aes_hw_mode = ossl_prov_cipher_hw_s390x(mode, keybits);
  229|       |#elif defined(SPARC_AES_CAPABLE)
  230|       |    aes_hw_mode = ossl_prov_cipher_hw_t4(mode);
  231|       |#endif
  232|       |
  233|      6|    if (aes_hw_mode == NULL) {
  ------------------
  |  Branch (233:9): [True: 0, False: 6]
  ------------------
  234|      0|        switch (mode) {
  ------------------
  |  Branch (234:17): [True: 0, False: 0]
  ------------------
  235|      0|        case AES_MODE_ECB:
  ------------------
  |  Branch (235:9): [True: 0, False: 0]
  ------------------
  236|      0|            return &aes_ecb;
  237|      0|        case AES_MODE_CBC:
  ------------------
  |  Branch (237:9): [True: 0, False: 0]
  ------------------
  238|      0|            return &aes_cbc;
  239|      0|        case AES_MODE_CFB128:
  ------------------
  |  Branch (239:9): [True: 0, False: 0]
  ------------------
  240|      0|            return &aes_cfb128;
  241|      0|        case AES_MODE_CFB8:
  ------------------
  |  Branch (241:9): [True: 0, False: 0]
  ------------------
  242|      0|            return &aes_cfb8;
  243|      0|        case AES_MODE_CFB1:
  ------------------
  |  Branch (243:9): [True: 0, False: 0]
  ------------------
  244|      0|            return &aes_cfb1;
  245|      0|        case AES_MODE_OFB128:
  ------------------
  |  Branch (245:9): [True: 0, False: 0]
  ------------------
  246|      0|            return &aes_ofb128;
  247|      0|        case AES_MODE_CTR:
  ------------------
  |  Branch (247:9): [True: 0, False: 0]
  ------------------
  248|      0|            return &aes_ctr;
  249|      0|        }
  250|      0|    }
  251|       |
  252|      6|    return aes_hw_mode;
  253|      6|}

ossl_prov_cipher_hw_aesni:
  201|      6|{
  202|      6|    if (AESNI_CAPABLE) {
  ------------------
  |  |  236|      6|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (236:23): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  203|      6|        switch (mode) {
  204|      4|        case AES_MODE_ECB:
  ------------------
  |  Branch (204:9): [True: 4, False: 2]
  ------------------
  205|      4|            return &aesni_ecb;
  206|      0|        case AES_MODE_CBC:
  ------------------
  |  Branch (206:9): [True: 0, False: 6]
  ------------------
  207|      0|#if VAES_CBC_ELIGIBLE
  208|      0|            if (ossl_aes_cbc_vaes_eligible())
  ------------------
  |  Branch (208:17): [True: 0, False: 0]
  ------------------
  209|      0|                return &aesni_vaes_cbc;
  210|      0|#endif
  211|      0|            return &aesni_cbc;
  212|      0|        case AES_MODE_CFB128:
  ------------------
  |  Branch (212:9): [True: 0, False: 6]
  ------------------
  213|      0|#if VAES_CFB128_ELIGIBLE
  214|      0|            if (ossl_aes_cfb128_vaes_eligible())
  ------------------
  |  Branch (214:17): [True: 0, False: 0]
  ------------------
  215|      0|                return &aesni_vaes_cfb128;
  216|      0|#endif
  217|      0|            return &aesni_cfb128;
  218|      0|        case AES_MODE_CFB8:
  ------------------
  |  Branch (218:9): [True: 0, False: 6]
  ------------------
  219|      0|            return &aesni_cfb8;
  220|      0|        case AES_MODE_CFB1:
  ------------------
  |  Branch (220:9): [True: 0, False: 6]
  ------------------
  221|      0|            return &aesni_cfb1;
  222|      0|        case AES_MODE_OFB128:
  ------------------
  |  Branch (222:9): [True: 0, False: 6]
  ------------------
  223|      0|            return &aesni_ofb128;
  224|      2|        case AES_MODE_CTR:
  ------------------
  |  Branch (224:9): [True: 2, False: 4]
  ------------------
  225|      2|#if VAES_CTR_ELIGIBLE
  226|      2|            if (ossl_aes_ctr_vaes_eligible())
  ------------------
  |  Branch (226:17): [True: 0, False: 2]
  ------------------
  227|      0|                return &aesni_vaes_ctr;
  228|      2|#endif
  229|      2|            return &aesni_ctr;
  230|      0|        default:
  ------------------
  |  Branch (230:9): [True: 0, False: 6]
  ------------------
  231|      0|            return NULL;
  232|      6|        }
  233|      6|    }
  234|      0|    return NULL;
  235|      6|}
cipher_aes_hw_aesni.c:cipher_hw_aesni_initkey:
   27|     33|{
   28|     33|    if ((ctx->mode == EVP_CIPH_ECB_MODE || ctx->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  286|     66|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
                  if ((ctx->mode == EVP_CIPH_ECB_MODE || ctx->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  287|     11|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  |  Branch (28:10): [True: 22, False: 11]
  |  Branch (28:44): [True: 0, False: 11]
  ------------------
   29|     22|        && !ctx->enc) {
  ------------------
  |  Branch (29:12): [True: 0, False: 22]
  ------------------
   30|      0|        return ossl_cipher_set_aes_initkey(ctx, key, keylen,
   31|      0|            aesni_set_decrypt_key, aesni_decrypt, NULL,
   32|      0|            (cbc128_f)aesni_cbc_encrypt, NULL);
   33|     33|    } else {
   34|     33|        return ossl_cipher_set_aes_initkey(ctx, key, keylen,
   35|       |            aesni_set_encrypt_key, aesni_encrypt, NULL,
   36|     33|            (cbc128_f)aesni_cbc_encrypt, (ctr128_f)aesni_ctr32_encrypt_blocks);
   37|     33|    }
   38|     33|}
cipher_aes_hw_aesni.c:cipher_hw_aesni_ecb:
   42|     67|{
   43|     67|    if (len < ctx->blocksize)
  ------------------
  |  Branch (43:9): [True: 0, False: 67]
  ------------------
   44|      0|        return 1;
   45|       |
   46|     67|    aesni_ecb_encrypt(in, out, len, ctx->ks, ctx->enc);
   47|       |
   48|     67|    return 1;
   49|     67|}

cipher_aes_ocb.c:aes_256_ocb_get_params:
  545|      1|    {                                                                           \
  546|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  295|      1|#define EVP_CIPH_OCB_MODE 0x10003
  ------------------
  547|      1|            flags, kbits, blkbits, ivbits);                                     \
  548|      1|    }                                                                           \
cipher_aes_ocb.c:cipher_ocb_gettable_ctx_params:
  428|      3|{
  429|      3|    return aes_ocb_get_ctx_params_list;
  430|      3|}
cipher_aes_ocb.c:aes_192_ocb_get_params:
  545|      1|    {                                                                           \
  546|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  295|      1|#define EVP_CIPH_OCB_MODE 0x10003
  ------------------
  547|      1|            flags, kbits, blkbits, ivbits);                                     \
  548|      1|    }                                                                           \
cipher_aes_ocb.c:aes_128_ocb_get_params:
  545|      1|    {                                                                           \
  546|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  295|      1|#define EVP_CIPH_OCB_MODE 0x10003
  ------------------
  547|      1|            flags, kbits, blkbits, ivbits);                                     \
  548|      1|    }                                                                           \

cipher_aes_siv.c:aes_128_siv_get_params:
  258|      1|    {                                                                            \
  259|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  296|      1|#define EVP_CIPH_SIV_MODE 0x10004
  ------------------
  260|      1|            flags, 2 * kbits, blkbits, ivbits);                                  \
  261|      1|    }                                                                            \
cipher_aes_siv.c:aes_siv_gettable_ctx_params:
  187|      3|{
  188|      3|    return aes_siv_get_ctx_params_list;
  189|      3|}
cipher_aes_siv.c:aes_192_siv_get_params:
  258|      1|    {                                                                            \
  259|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  296|      1|#define EVP_CIPH_SIV_MODE 0x10004
  ------------------
  260|      1|            flags, 2 * kbits, blkbits, ivbits);                                  \
  261|      1|    }                                                                            \
cipher_aes_siv.c:aes_256_siv_get_params:
  258|      1|    {                                                                            \
  259|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  296|      1|#define EVP_CIPH_SIV_MODE 0x10004
  ------------------
  260|      1|            flags, 2 * kbits, blkbits, ivbits);                                  \
  261|      1|    }                                                                            \

cipher_aes_wrp.c:aes_256_wrap_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_192_wrap_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_128_wrap_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_256_wrappad_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_192_wrappad_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_128_wrappad_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_256_wrapinv_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_192_wrapinv_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_128_wrapinv_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_256_wrappadinv_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_192_wrappadinv_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \
cipher_aes_wrp.c:aes_128_wrappadinv_get_params:
  305|      1|    {                                                                           \
  306|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  307|      1|            flags, kbits, blkbits, ivbits);                                     \
  308|      1|    }                                                                           \

cipher_aes_xts.c:aes_256_xts_get_params:
  274|      1|    {                                                                              \
  275|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  ------------------
  |  |  293|      1|#define EVP_CIPH_XTS_MODE 0x10001
  ------------------
  276|      1|            flags, 2 * kbits, AES_XTS_BLOCK_BITS,                                  \
  ------------------
  |  |   26|      1|#define AES_XTS_BLOCK_BITS 8
  ------------------
  277|      1|            AES_XTS_IV_BITS);                                                      \
  ------------------
  |  |   25|      1|#define AES_XTS_IV_BITS 128
  ------------------
  278|      1|    }                                                                              \
cipher_aes_xts.c:aes_128_xts_get_params:
  274|      1|    {                                                                              \
  275|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  ------------------
  |  |  293|      1|#define EVP_CIPH_XTS_MODE 0x10001
  ------------------
  276|      1|            flags, 2 * kbits, AES_XTS_BLOCK_BITS,                                  \
  ------------------
  |  |   26|      1|#define AES_XTS_BLOCK_BITS 8
  ------------------
  277|      1|            AES_XTS_IV_BITS);                                                      \
  ------------------
  |  |   25|      1|#define AES_XTS_IV_BITS 128
  ------------------
  278|      1|    }                                                                              \

cipher_ascon_aead128.c:ascon_aead128_get_params:
  375|      1|{
  376|      1|    return ossl_cipher_generic_get_params(params, 0, ASCON_AEAD128_FLAGS,
  ------------------
  |  |   37|      1|#define ASCON_AEAD128_FLAGS (PROV_CIPHER_FLAG_AEAD | PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   39|      1|#define PROV_CIPHER_FLAG_AEAD 0x0001
  |  |  ------------------
  |  |               #define ASCON_AEAD128_FLAGS (PROV_CIPHER_FLAG_AEAD | PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|      1|#define PROV_CIPHER_FLAG_CUSTOM_IV 0x0002
  |  |  ------------------
  ------------------
  377|      1|        ASCON_AEAD128_KEY_LEN * 8,
  ------------------
  |  |   31|      1|#define ASCON_AEAD128_KEY_LEN 16
  ------------------
  378|      1|        1 * 8,
  379|      1|        ASCON_AEAD_NONCE_LEN * 8);
  ------------------
  |  |   30|      1|#define ASCON_AEAD_NONCE_LEN 16
  ------------------
  380|      1|}
cipher_ascon_aead128.c:ascon_aead128_gettable_ctx_params:
  384|      1|{
  385|      1|    return ascon_aead128_get_ctx_params_list;
  386|      1|}

cipher_chacha20.c:chacha20_get_params:
   95|      1|{
   96|      1|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_FLAGS,
  ------------------
  |  |   22|      1|#define CHACHA20_FLAGS (PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|      1|#define PROV_CIPHER_FLAG_CUSTOM_IV 0x0002
  |  |  ------------------
  ------------------
   97|      1|        CHACHA20_KEYLEN * 8,
  ------------------
  |  |   19|      1|#define CHACHA20_KEYLEN (CHACHA_KEY_SIZE)
  |  |  ------------------
  |  |  |  |   44|      1|#define CHACHA_KEY_SIZE 32
  |  |  ------------------
  ------------------
   98|      1|        CHACHA20_BLKLEN * 8,
  ------------------
  |  |   20|      1|#define CHACHA20_BLKLEN (1)
  ------------------
   99|      1|        CHACHA20_IVLEN * 8);
  ------------------
  |  |   21|      1|#define CHACHA20_IVLEN (CHACHA_CTR_SIZE)
  |  |  ------------------
  |  |  |  |   45|      1|#define CHACHA_CTR_SIZE 16
  |  |  ------------------
  ------------------
  100|      1|}
cipher_chacha20.c:chacha20_gettable_ctx_params:
  136|      1|{
  137|      1|    return chacha20_get_ctx_params_list;
  138|      1|}

cipher_chacha20_poly1305.c:chacha20_poly1305_get_params:
   90|      1|{
   91|      1|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_POLY1305_FLAGS,
  ------------------
  |  |   23|      1|#define CHACHA20_POLY1305_FLAGS (PROV_CIPHER_FLAG_AEAD \
  |  |  ------------------
  |  |  |  |   39|      1|#define PROV_CIPHER_FLAG_AEAD 0x0001
  |  |  ------------------
  |  |   24|      1|    | PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|      1|#define PROV_CIPHER_FLAG_CUSTOM_IV 0x0002
  |  |  ------------------
  ------------------
   92|      1|        CHACHA20_POLY1305_KEYLEN * 8,
  ------------------
  |  |   19|      1|#define CHACHA20_POLY1305_KEYLEN CHACHA_KEY_SIZE
  |  |  ------------------
  |  |  |  |   44|      1|#define CHACHA_KEY_SIZE 32
  |  |  ------------------
  ------------------
   93|      1|        CHACHA20_POLY1305_BLKLEN * 8,
  ------------------
  |  |   20|      1|#define CHACHA20_POLY1305_BLKLEN 1
  ------------------
   94|      1|        CHACHA20_POLY1305_IVLEN * 8);
  ------------------
  |  |   19|      1|#define CHACHA20_POLY1305_IVLEN 12
  ------------------
   95|      1|}
cipher_chacha20_poly1305.c:chacha20_poly1305_gettable_ctx_params:
  150|      1|{
  151|      1|    return chacha20_poly1305_get_ctx_params_list;
  152|      1|}

ossl_cipher_cbc_cts_gettable_ctx_params:
  138|      6|{
  139|      6|    return cipher_cts_get_ctx_params_list;
  140|      6|}

cipher_aes.c:aes_cts_256_cbc_get_params:
   20|      1|    {                                                                            \
   21|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   22|      1|            flags, kbits, blkbits, ivbits);                                      \
   23|      1|    }                                                                            \
cipher_aes.c:aes_cts_192_cbc_get_params:
   20|      1|    {                                                                            \
   21|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   22|      1|            flags, kbits, blkbits, ivbits);                                      \
   23|      1|    }                                                                            \
cipher_aes.c:aes_cts_128_cbc_get_params:
   20|      1|    {                                                                            \
   21|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   22|      1|            flags, kbits, blkbits, ivbits);                                      \
   23|      1|    }                                                                            \
cipher_camellia.c:camellia_cts_256_cbc_get_params:
   20|      1|    {                                                                            \
   21|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   22|      1|            flags, kbits, blkbits, ivbits);                                      \
   23|      1|    }                                                                            \
cipher_camellia.c:camellia_cts_192_cbc_get_params:
   20|      1|    {                                                                            \
   21|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   22|      1|            flags, kbits, blkbits, ivbits);                                      \
   23|      1|    }                                                                            \
cipher_camellia.c:camellia_cts_128_cbc_get_params:
   20|      1|    {                                                                            \
   21|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   22|      1|            flags, kbits, blkbits, ivbits);                                      \
   23|      1|    }                                                                            \

cipher_null.c:null_get_params:
  105|      1|{
  106|      1|    return ossl_cipher_generic_get_params(params, 0, 0, 0, 8, 0);
  107|      1|}
cipher_null.c:null_gettable_ctx_params:
  112|      1|{
  113|      1|    return null_get_ctx_params_list;
  114|      1|}

cipher_sm4_xts.c:sm4_128_xts_get_params:
  239|      1|    {                                                                              \
  240|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  ------------------
  |  |  293|      1|#define EVP_CIPH_XTS_MODE 0x10001
  ------------------
  241|      1|            flags, 2 * kbits, SM4_XTS_BLOCK_BITS,                                  \
  ------------------
  |  |   20|      1|#define SM4_XTS_BLOCK_BITS 8
  ------------------
  242|      1|            SM4_XTS_IV_BITS);                                                      \
  ------------------
  |  |   19|      1|#define SM4_XTS_IV_BITS 128
  ------------------
  243|      1|    }                                                                              \

cipher_tdes.c:tdes_ede3_ecb_get_params:
   49|      1|    {                                                                              \
   50|      1|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
   51|      1|            flags, kbits, blkbits, ivbits);                                        \
   52|      1|    }                                                                              \
cipher_tdes.c:tdes_ede3_cbc_get_params:
   49|      1|    {                                                                              \
   50|      1|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   51|      1|            flags, kbits, blkbits, ivbits);                                        \
   52|      1|    }                                                                              \
cipher_tdes_default.c:tdes_ede3_ofb_get_params:
   49|      1|    {                                                                              \
   50|      1|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
   51|      1|            flags, kbits, blkbits, ivbits);                                        \
   52|      1|    }                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb_get_params:
   49|      1|    {                                                                              \
   50|      1|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
   51|      1|            flags, kbits, blkbits, ivbits);                                        \
   52|      1|    }                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb1_get_params:
   49|      1|    {                                                                              \
   50|      1|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
   51|      1|            flags, kbits, blkbits, ivbits);                                        \
   52|      1|    }                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb8_get_params:
   49|      1|    {                                                                              \
   50|      1|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
   51|      1|            flags, kbits, blkbits, ivbits);                                        \
   52|      1|    }                                                                              \
cipher_tdes_default.c:tdes_ede2_ecb_get_params:
   49|      1|    {                                                                              \
   50|      1|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
   51|      1|            flags, kbits, blkbits, ivbits);                                        \
   52|      1|    }                                                                              \
cipher_tdes_default.c:tdes_ede2_cbc_get_params:
   49|      1|    {                                                                              \
   50|      1|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   51|      1|            flags, kbits, blkbits, ivbits);                                        \
   52|      1|    }                                                                              \
cipher_tdes_default.c:tdes_ede2_ofb_get_params:
   49|      1|    {                                                                              \
   50|      1|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
   51|      1|            flags, kbits, blkbits, ivbits);                                        \
   52|      1|    }                                                                              \
cipher_tdes_default.c:tdes_ede2_cfb_get_params:
   49|      1|    {                                                                              \
   50|      1|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
   51|      1|            flags, kbits, blkbits, ivbits);                                        \
   52|      1|    }                                                                              \

cipher_tdes_common.c:tdes_get_params_decoder:
   56|     10|{
   57|     10|    const char *s;
   58|       |
   59|     10|    memset(r, 0, sizeof(*r));
   60|     10|    if (p != NULL)
  ------------------
  |  Branch (60:9): [True: 10, False: 0]
  ------------------
   61|    110|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (61:16): [True: 100, False: 10]
  ------------------
   62|    100|            switch(s[0]) {
   63|      0|            default:
  ------------------
  |  Branch (63:13): [True: 0, False: 100]
  ------------------
   64|      0|                break;
   65|     10|            case 'a':
  ------------------
  |  Branch (65:13): [True: 10, False: 90]
  ------------------
   66|     10|                if (ossl_likely(strcmp("ead", s + 1) == 0)) {
  ------------------
  |  |   23|     10|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 10, False: 0]
  |  |  ------------------
  ------------------
   67|       |                    /* OSSL_CIPHER_PARAM_AEAD */
   68|     10|                    if (ossl_unlikely(r->common.aead != NULL)) {
  ------------------
  |  |   24|     10|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
   69|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   70|      0|                                       "param %s is repeated", s);
   71|      0|                        return 0;
   72|      0|                    }
   73|     10|                    r->common.aead = (OSSL_PARAM *)p;
   74|     10|                }
   75|     10|                break;
   76|     10|            case 'b':
  ------------------
  |  Branch (76:13): [True: 10, False: 90]
  ------------------
   77|     10|                if (ossl_likely(strcmp("locksize", s + 1) == 0)) {
  ------------------
  |  |   23|     10|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 10, False: 0]
  |  |  ------------------
  ------------------
   78|       |                    /* OSSL_CIPHER_PARAM_BLOCK_SIZE */
   79|     10|                    if (ossl_unlikely(r->common.bsize != NULL)) {
  ------------------
  |  |   24|     10|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
   80|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   81|      0|                                       "param %s is repeated", s);
   82|      0|                        return 0;
   83|      0|                    }
   84|     10|                    r->common.bsize = (OSSL_PARAM *)p;
   85|     10|                }
   86|     10|                break;
   87|     20|            case 'c':
  ------------------
  |  Branch (87:13): [True: 20, False: 80]
  ------------------
   88|     20|                switch(s[1]) {
   89|      0|                default:
  ------------------
  |  Branch (89:17): [True: 0, False: 20]
  ------------------
   90|      0|                    break;
   91|     10|                case 't':
  ------------------
  |  Branch (91:17): [True: 10, False: 10]
  ------------------
   92|     10|                    if (ossl_likely(strcmp("s", s + 2) == 0)) {
  ------------------
  |  |   23|     10|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 10, False: 0]
  |  |  ------------------
  ------------------
   93|       |                        /* OSSL_CIPHER_PARAM_CTS */
   94|     10|                        if (ossl_unlikely(r->common.cts != NULL)) {
  ------------------
  |  |   24|     10|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
   95|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   96|      0|                                           "param %s is repeated", s);
   97|      0|                            return 0;
   98|      0|                        }
   99|     10|                        r->common.cts = (OSSL_PARAM *)p;
  100|     10|                    }
  101|     10|                    break;
  102|     10|                case 'u':
  ------------------
  |  Branch (102:17): [True: 10, False: 10]
  ------------------
  103|     10|                    if (ossl_likely(strcmp("stom-iv", s + 2) == 0)) {
  ------------------
  |  |   23|     10|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  104|       |                        /* OSSL_CIPHER_PARAM_CUSTOM_IV */
  105|     10|                        if (ossl_unlikely(r->common.custiv != NULL)) {
  ------------------
  |  |   24|     10|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
  106|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  107|      0|                                           "param %s is repeated", s);
  108|      0|                            return 0;
  109|      0|                        }
  110|     10|                        r->common.custiv = (OSSL_PARAM *)p;
  111|     10|                    }
  112|     20|                }
  113|     20|                break;
  114|     20|            case 'd':
  ------------------
  |  Branch (114:13): [True: 0, False: 100]
  ------------------
  115|      0|                if (ossl_likely(strcmp("ecrypt-only", s + 1) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  116|       |                    /* OSSL_CIPHER_PARAM_DECRYPT_ONLY */
  117|      0|                    if (ossl_unlikely(r->decrypt != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  118|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  119|      0|                                       "param %s is repeated", s);
  120|      0|                        return 0;
  121|      0|                    }
  122|      0|                    r->decrypt = (OSSL_PARAM *)p;
  123|      0|                }
  124|      0|                break;
  125|     10|            case 'e':
  ------------------
  |  Branch (125:13): [True: 10, False: 90]
  ------------------
  126|     10|                if (ossl_likely(strcmp("ncrypt-then-mac", s + 1) == 0)) {
  ------------------
  |  |   23|     10|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  127|       |                    /* OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC */
  128|     10|                    if (ossl_unlikely(r->common.etm != NULL)) {
  ------------------
  |  |   24|     10|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
  129|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  130|      0|                                       "param %s is repeated", s);
  131|      0|                        return 0;
  132|      0|                    }
  133|     10|                    r->common.etm = (OSSL_PARAM *)p;
  134|     10|                }
  135|     10|                break;
  136|     10|            case 'h':
  ------------------
  |  Branch (136:13): [True: 10, False: 90]
  ------------------
  137|     10|                if (ossl_likely(strcmp("as-randkey", s + 1) == 0)) {
  ------------------
  |  |   23|     10|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  138|       |                    /* OSSL_CIPHER_PARAM_HAS_RAND_KEY */
  139|     10|                    if (ossl_unlikely(r->common.rand != NULL)) {
  ------------------
  |  |   24|     10|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
  140|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  141|      0|                                       "param %s is repeated", s);
  142|      0|                        return 0;
  143|      0|                    }
  144|     10|                    r->common.rand = (OSSL_PARAM *)p;
  145|     10|                }
  146|     10|                break;
  147|     10|            case 'i':
  ------------------
  |  Branch (147:13): [True: 10, False: 90]
  ------------------
  148|     10|                if (ossl_likely(strcmp("vlen", s + 1) == 0)) {
  ------------------
  |  |   23|     10|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  149|       |                    /* OSSL_CIPHER_PARAM_IVLEN */
  150|     10|                    if (ossl_unlikely(r->common.ivlen != NULL)) {
  ------------------
  |  |   24|     10|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
  151|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  152|      0|                                       "param %s is repeated", s);
  153|      0|                        return 0;
  154|      0|                    }
  155|     10|                    r->common.ivlen = (OSSL_PARAM *)p;
  156|     10|                }
  157|     10|                break;
  158|     10|            case 'k':
  ------------------
  |  Branch (158:13): [True: 10, False: 90]
  ------------------
  159|     10|                if (ossl_likely(strcmp("eylen", s + 1) == 0)) {
  ------------------
  |  |   23|     10|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  160|       |                    /* OSSL_CIPHER_PARAM_KEYLEN */
  161|     10|                    if (ossl_unlikely(r->common.keylen != NULL)) {
  ------------------
  |  |   24|     10|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
  162|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  163|      0|                                       "param %s is repeated", s);
  164|      0|                        return 0;
  165|      0|                    }
  166|     10|                    r->common.keylen = (OSSL_PARAM *)p;
  167|     10|                }
  168|     10|                break;
  169|     10|            case 'm':
  ------------------
  |  Branch (169:13): [True: 10, False: 90]
  ------------------
  170|     10|                if (ossl_likely(strcmp("ode", s + 1) == 0)) {
  ------------------
  |  |   23|     10|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  171|       |                    /* OSSL_CIPHER_PARAM_MODE */
  172|     10|                    if (ossl_unlikely(r->common.mode != NULL)) {
  ------------------
  |  |   24|     10|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
  173|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  174|      0|                                       "param %s is repeated", s);
  175|      0|                        return 0;
  176|      0|                    }
  177|     10|                    r->common.mode = (OSSL_PARAM *)p;
  178|     10|                }
  179|     10|                break;
  180|     10|            case 't':
  ------------------
  |  Branch (180:13): [True: 10, False: 90]
  ------------------
  181|     10|                if (ossl_likely(strcmp("ls-multi", s + 1) == 0)) {
  ------------------
  |  |   23|     10|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 10, False: 0]
  |  |  ------------------
  ------------------
  182|       |                    /* OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK */
  183|     10|                    if (ossl_unlikely(r->common.mb != NULL)) {
  ------------------
  |  |   24|     10|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
  184|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  185|      0|                                       "param %s is repeated", s);
  186|      0|                        return 0;
  187|      0|                    }
  188|     10|                    r->common.mb = (OSSL_PARAM *)p;
  189|     10|                }
  190|    100|            }
  191|     10|    return 1;
  192|     10|}

ossl_tdes_gettable_ctx_params:
  177|     11|{
  178|     11|    return tdes_get_ctx_params_list;
  179|     11|}
ossl_tdes_get_params:
  227|     10|{
  228|       |#ifdef FIPS_MODULE
  229|       |    const int decrypt_only = 1;
  230|       |#else
  231|     10|    const int decrypt_only = 0;
  232|     10|#endif
  233|     10|    struct tdes_get_param_list_st p;
  234|       |
  235|     10|    if (!tdes_get_params_decoder(params, &p))
  ------------------
  |  Branch (235:9): [True: 0, False: 10]
  ------------------
  236|      0|        return 0;
  237|       |
  238|     10|    if (p.decrypt != NULL && !OSSL_PARAM_set_int(p.decrypt, decrypt_only)) {
  ------------------
  |  Branch (238:9): [True: 0, False: 10]
  |  Branch (238:30): [True: 0, False: 0]
  ------------------
  239|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  240|      0|        return 0;
  241|      0|    }
  242|       |
  243|     10|    return ossl_cipher_common_get_params(&p.common, md, flags, kbits, blkbits,
  244|     10|        ivbits);
  245|     10|}

cipher_tdes_wrap.c:tdes_wrap_get_params:
  181|      1|    {                                                                            \
  182|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_WRAP_MODE, flags, \
  ------------------
  |  |  294|      1|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  183|      1|            kbits, blkbits, ivbits);                                             \
  184|      1|    }                                                                            \

ossl_cipher_generic_get_params:
   44|    121|{
   45|    121|    struct ossl_cipher_get_param_list_st p;
   46|       |
   47|    121|    if (!ossl_cipher_generic_get_params_decoder(params, &p))
  ------------------
  |  Branch (47:9): [True: 0, False: 121]
  ------------------
   48|      0|        return 0;
   49|       |
   50|    121|    return ossl_cipher_common_get_params(&p, md, flags, kbits, blkbits,
   51|    121|        ivbits);
   52|    121|}
ossl_cipher_common_get_params:
   57|    131|{
   58|    131|    if (p->mode != NULL && !OSSL_PARAM_set_uint(p->mode, md)) {
  ------------------
  |  Branch (58:9): [True: 131, False: 0]
  |  Branch (58:28): [True: 0, False: 131]
  ------------------
   59|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   60|      0|        return 0;
   61|      0|    }
   62|    131|    if (p->aead != NULL
  ------------------
  |  Branch (62:9): [True: 131, False: 0]
  ------------------
   63|    131|        && !OSSL_PARAM_set_int(p->aead, (flags & PROV_CIPHER_FLAG_AEAD) != 0)) {
  ------------------
  |  |   39|    131|#define PROV_CIPHER_FLAG_AEAD 0x0001
  ------------------
  |  Branch (63:12): [True: 0, False: 131]
  ------------------
   64|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   65|      0|        return 0;
   66|      0|    }
   67|    131|    if (p->custiv != NULL
  ------------------
  |  Branch (67:9): [True: 131, False: 0]
  ------------------
   68|    131|        && !OSSL_PARAM_set_int(p->custiv,
  ------------------
  |  Branch (68:12): [True: 0, False: 131]
  ------------------
   69|    131|            (flags & PROV_CIPHER_FLAG_CUSTOM_IV) != 0)) {
  ------------------
  |  |   40|    131|#define PROV_CIPHER_FLAG_CUSTOM_IV 0x0002
  ------------------
   70|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   71|      0|        return 0;
   72|      0|    }
   73|    131|    if (p->cts != NULL
  ------------------
  |  Branch (73:9): [True: 131, False: 0]
  ------------------
   74|    131|        && !OSSL_PARAM_set_int(p->cts, (flags & PROV_CIPHER_FLAG_CTS) != 0)) {
  ------------------
  |  |   41|    131|#define PROV_CIPHER_FLAG_CTS 0x0004
  ------------------
  |  Branch (74:12): [True: 0, False: 131]
  ------------------
   75|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   76|      0|        return 0;
   77|      0|    }
   78|    131|    if (p->mb != NULL
  ------------------
  |  Branch (78:9): [True: 131, False: 0]
  ------------------
   79|    131|        && !OSSL_PARAM_set_int(p->mb,
  ------------------
  |  Branch (79:12): [True: 0, False: 131]
  ------------------
   80|    131|            (flags & PROV_CIPHER_FLAG_TLS1_MULTIBLOCK) != 0)) {
  ------------------
  |  |   42|    131|#define PROV_CIPHER_FLAG_TLS1_MULTIBLOCK 0x0008
  ------------------
   81|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   82|      0|        return 0;
   83|      0|    }
   84|    131|    if (p->rand != NULL
  ------------------
  |  Branch (84:9): [True: 131, False: 0]
  ------------------
   85|    131|        && !OSSL_PARAM_set_int(p->rand,
  ------------------
  |  Branch (85:12): [True: 0, False: 131]
  ------------------
   86|    131|            (flags & PROV_CIPHER_FLAG_RAND_KEY) != 0)) {
  ------------------
  |  |   43|    131|#define PROV_CIPHER_FLAG_RAND_KEY 0x0010
  ------------------
   87|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   88|      0|        return 0;
   89|      0|    }
   90|    131|    if (p->etm != NULL
  ------------------
  |  Branch (90:9): [True: 131, False: 0]
  ------------------
   91|    131|        && !OSSL_PARAM_set_int(p->etm,
  ------------------
  |  Branch (91:12): [True: 0, False: 131]
  ------------------
   92|    131|            (flags & EVP_CIPH_FLAG_ENC_THEN_MAC) != 0)) {
  ------------------
  |  |  343|    131|#define EVP_CIPH_FLAG_ENC_THEN_MAC 0x10000000
  ------------------
   93|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   94|      0|        return 0;
   95|      0|    }
   96|    131|    if (p->keylen != NULL
  ------------------
  |  Branch (96:9): [True: 131, False: 0]
  ------------------
   97|    131|        && !OSSL_PARAM_set_size_t(p->keylen, kbits / 8)) {
  ------------------
  |  Branch (97:12): [True: 0, False: 131]
  ------------------
   98|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   99|      0|        return 0;
  100|      0|    }
  101|    131|    if (p->bsize != NULL
  ------------------
  |  Branch (101:9): [True: 131, False: 0]
  ------------------
  102|    131|        && !OSSL_PARAM_set_size_t(p->bsize, blkbits / 8)) {
  ------------------
  |  Branch (102:12): [True: 0, False: 131]
  ------------------
  103|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  104|      0|        return 0;
  105|      0|    }
  106|    131|    if (p->ivlen != NULL
  ------------------
  |  Branch (106:9): [True: 131, False: 0]
  ------------------
  107|    131|        && !OSSL_PARAM_set_size_t(p->ivlen, ivbits / 8)) {
  ------------------
  |  Branch (107:12): [True: 0, False: 131]
  ------------------
  108|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  109|      0|        return 0;
  110|      0|    }
  111|    131|    return 1;
  112|    131|}
ossl_cipher_generic_gettable_ctx_params:
  115|     83|{
  116|     83|    return cipher_generic_get_ctx_params_list;
  117|     83|}
ossl_cipher_generic_einit:
  214|     41|{
  215|     41|    return cipher_generic_init_internal((PROV_CIPHER_CTX *)vctx, key, keylen,
  216|     41|        iv, ivlen, params, 1);
  217|     41|}
ossl_cipher_generic_block_update:
  255|     67|{
  256|     67|    size_t outlint = 0;
  257|     67|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  258|     67|    size_t blksz = ctx->blocksize;
  259|     67|    size_t nextblocks;
  260|       |
  261|     67|    if (!ctx->key_set) {
  ------------------
  |  Branch (261:9): [True: 0, False: 67]
  ------------------
  262|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_SET);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  263|      0|        return 0;
  264|      0|    }
  265|       |
  266|     67|    if (ctx->tlsversion > 0) {
  ------------------
  |  Branch (266:9): [True: 0, False: 67]
  ------------------
  267|       |        /*
  268|       |         * Each update call corresponds to a TLS record and is individually
  269|       |         * padded
  270|       |         */
  271|       |
  272|       |        /* Sanity check inputs */
  273|      0|        if (in == NULL
  ------------------
  |  Branch (273:13): [True: 0, False: 0]
  ------------------
  274|      0|            || in != out
  ------------------
  |  Branch (274:16): [True: 0, False: 0]
  ------------------
  275|      0|            || outsize < inl
  ------------------
  |  Branch (275:16): [True: 0, False: 0]
  ------------------
  276|      0|            || !ctx->pad) {
  ------------------
  |  Branch (276:16): [True: 0, False: 0]
  ------------------
  277|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  278|      0|            return 0;
  279|      0|        }
  280|       |
  281|      0|        if (ctx->enc) {
  ------------------
  |  Branch (281:13): [True: 0, False: 0]
  ------------------
  282|      0|            unsigned char padval;
  283|      0|            size_t padnum, loop;
  284|       |
  285|       |            /* Add padding */
  286|       |
  287|      0|            padnum = blksz - (inl % blksz);
  288|       |
  289|      0|            if (outsize < inl + padnum) {
  ------------------
  |  Branch (289:17): [True: 0, False: 0]
  ------------------
  290|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  291|      0|                return 0;
  292|      0|            }
  293|       |
  294|      0|            if (padnum > MAX_PADDING) {
  ------------------
  |  |  250|      0|#define MAX_PADDING 256
  ------------------
  |  Branch (294:17): [True: 0, False: 0]
  ------------------
  295|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  296|      0|                return 0;
  297|      0|            }
  298|      0|            padval = (unsigned char)(padnum - 1);
  299|       |            /* we need to add 'padnum' padding bytes of value padval */
  300|      0|            for (loop = inl; loop < inl + padnum; loop++)
  ------------------
  |  Branch (300:30): [True: 0, False: 0]
  ------------------
  301|      0|                out[loop] = padval;
  302|      0|            inl += padnum;
  303|      0|        }
  304|       |
  305|      0|        if ((inl % blksz) != 0) {
  ------------------
  |  Branch (305:13): [True: 0, False: 0]
  ------------------
  306|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  307|      0|            return 0;
  308|      0|        }
  309|       |
  310|       |        /* Shouldn't normally fail */
  311|      0|        if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (311:13): [True: 0, False: 0]
  ------------------
  312|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  313|      0|            return 0;
  314|      0|        }
  315|       |
  316|      0|        if (ctx->alloced) {
  ------------------
  |  Branch (316:13): [True: 0, False: 0]
  ------------------
  317|      0|            OPENSSL_free(ctx->tlsmac);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  318|      0|            ctx->alloced = 0;
  319|      0|            ctx->tlsmac = NULL;
  320|      0|        }
  321|       |
  322|       |        /* This only fails if padding is publicly invalid */
  323|      0|        *outl = inl;
  324|      0|        if (!ctx->enc
  ------------------
  |  Branch (324:13): [True: 0, False: 0]
  ------------------
  325|      0|            && !ossl_cipher_tlsunpadblock(ctx->libctx, ctx->tlsversion,
  ------------------
  |  Branch (325:16): [True: 0, False: 0]
  ------------------
  326|      0|                out, outl,
  327|      0|                blksz, &ctx->tlsmac, &ctx->alloced,
  328|      0|                ctx->tlsmacsize, 0)) {
  329|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  330|      0|            return 0;
  331|      0|        }
  332|      0|        return 1;
  333|      0|    }
  334|       |
  335|     67|    if (ctx->bufsz != 0)
  ------------------
  |  Branch (335:9): [True: 0, False: 67]
  ------------------
  336|      0|        nextblocks = ossl_cipher_fillblock(ctx->buf, &ctx->bufsz, blksz,
  337|      0|            &in, &inl);
  338|     67|    else
  339|     67|        nextblocks = inl & ~(blksz - 1);
  340|       |
  341|       |    /*
  342|       |     * If we're decrypting and we end an update on a block boundary we hold
  343|       |     * the last block back in case this is the last update call and the last
  344|       |     * block is padded.
  345|       |     */
  346|     67|    if (ctx->bufsz == blksz && (ctx->enc || inl > 0 || !ctx->pad)) {
  ------------------
  |  Branch (346:9): [True: 0, False: 67]
  |  Branch (346:33): [True: 0, False: 0]
  |  Branch (346:45): [True: 0, False: 0]
  |  Branch (346:56): [True: 0, False: 0]
  ------------------
  347|      0|        if (outsize < blksz) {
  ------------------
  |  Branch (347:13): [True: 0, False: 0]
  ------------------
  348|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  349|      0|            return 0;
  350|      0|        }
  351|      0|        if (!ctx->hw->cipher(ctx, out, ctx->buf, blksz)) {
  ------------------
  |  Branch (351:13): [True: 0, False: 0]
  ------------------
  352|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  353|      0|            return 0;
  354|      0|        }
  355|      0|        ctx->bufsz = 0;
  356|      0|        outlint = blksz;
  357|      0|        out += blksz;
  358|      0|    }
  359|     67|    if (nextblocks > 0) {
  ------------------
  |  Branch (359:9): [True: 67, False: 0]
  ------------------
  360|     67|        if (!ctx->enc && ctx->pad && nextblocks == inl) {
  ------------------
  |  Branch (360:13): [True: 0, False: 67]
  |  Branch (360:26): [True: 0, False: 0]
  |  Branch (360:38): [True: 0, False: 0]
  ------------------
  361|      0|            if (!ossl_assert(inl >= blksz)) {
  ------------------
  |  |   45|      0|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (361:17): [True: 0, False: 0]
  ------------------
  362|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  363|      0|                return 0;
  364|      0|            }
  365|      0|            nextblocks -= blksz;
  366|      0|        }
  367|     67|        outlint += nextblocks;
  368|     67|        if (outsize < outlint) {
  ------------------
  |  Branch (368:13): [True: 0, False: 67]
  ------------------
  369|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  370|      0|            return 0;
  371|      0|        }
  372|     67|    }
  373|     67|    if (nextblocks > 0) {
  ------------------
  |  Branch (373:9): [True: 67, False: 0]
  ------------------
  374|     67|        if (!ctx->hw->cipher(ctx, out, in, nextblocks)) {
  ------------------
  |  Branch (374:13): [True: 0, False: 67]
  ------------------
  375|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  376|      0|            return 0;
  377|      0|        }
  378|     67|        in += nextblocks;
  379|     67|        inl -= nextblocks;
  380|     67|    }
  381|     67|    if (inl != 0
  ------------------
  |  Branch (381:9): [True: 0, False: 67]
  ------------------
  382|      0|        && !ossl_cipher_trailingdata(ctx->buf, &ctx->bufsz, blksz, &in, &inl)) {
  ------------------
  |  Branch (382:12): [True: 0, False: 0]
  ------------------
  383|       |        /* ERR_raise already called */
  384|      0|        return 0;
  385|      0|    }
  386|       |
  387|     67|    *outl = outlint;
  388|     67|    return inl == 0;
  389|     67|}
ossl_cipher_generic_stream_update:
  468|      4|{
  469|      4|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  470|       |
  471|      4|    if (!ctx->key_set) {
  ------------------
  |  Branch (471:9): [True: 0, False: 4]
  ------------------
  472|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_SET);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  473|      0|        return 0;
  474|      0|    }
  475|       |
  476|      4|    if (inl == 0) {
  ------------------
  |  Branch (476:9): [True: 0, False: 4]
  ------------------
  477|      0|        *outl = 0;
  478|      0|        return 1;
  479|      0|    }
  480|       |
  481|      4|    if (outsize < inl) {
  ------------------
  |  Branch (481:9): [True: 0, False: 4]
  ------------------
  482|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  483|      0|        return 0;
  484|      0|    }
  485|       |
  486|      4|    if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (486:9): [True: 0, False: 4]
  ------------------
  487|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  488|      0|        return 0;
  489|      0|    }
  490|       |
  491|      4|    *outl = inl;
  492|      4|    if (!ctx->enc && ctx->tlsversion > 0) {
  ------------------
  |  Branch (492:9): [True: 0, False: 4]
  |  Branch (492:22): [True: 0, False: 0]
  ------------------
  493|       |        /*
  494|       |         * Remove any TLS padding. Only used by cipher_aes_cbc_hmac_sha1_hw.c and
  495|       |         * cipher_aes_cbc_hmac_sha256_hw.c
  496|       |         */
  497|      0|        if (ctx->removetlspad) {
  ------------------
  |  Branch (497:13): [True: 0, False: 0]
  ------------------
  498|       |            /*
  499|       |             * We should have already failed in the cipher() call above if this
  500|       |             * isn't true.
  501|       |             */
  502|      0|            if (!ossl_assert(*outl >= (size_t)(out[inl - 1] + 1)))
  ------------------
  |  |   45|      0|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (502:17): [True: 0, False: 0]
  ------------------
  503|      0|                return 0;
  504|       |            /* The actual padding length */
  505|      0|            *outl -= out[inl - 1] + 1;
  506|      0|        }
  507|       |
  508|       |        /* TLS MAC and explicit IV if relevant. We should have already failed
  509|       |         * in the cipher() call above if *outl is too short.
  510|       |         */
  511|      0|        if (!ossl_assert(*outl >= ctx->removetlsfixed))
  ------------------
  |  |   45|      0|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (511:13): [True: 0, False: 0]
  ------------------
  512|      0|            return 0;
  513|      0|        *outl -= ctx->removetlsfixed;
  514|       |
  515|       |        /* Extract the MAC if there is one */
  516|      0|        if (ctx->tlsmacsize > 0) {
  ------------------
  |  Branch (516:13): [True: 0, False: 0]
  ------------------
  517|      0|            if (*outl < ctx->tlsmacsize)
  ------------------
  |  Branch (517:17): [True: 0, False: 0]
  ------------------
  518|      0|                return 0;
  519|       |
  520|      0|            ctx->tlsmac = out + *outl - ctx->tlsmacsize;
  521|      0|            *outl -= ctx->tlsmacsize;
  522|      0|        }
  523|      0|    }
  524|       |
  525|      4|    return 1;
  526|      4|}
ossl_cipher_common_get_ctx_params:
  573|      8|{
  574|      8|    if (p->ivlen != NULL && !OSSL_PARAM_set_size_t(p->ivlen, ctx->ivlen)) {
  ------------------
  |  Branch (574:9): [True: 2, False: 6]
  |  Branch (574:29): [True: 0, False: 2]
  ------------------
  575|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  576|      0|        return 0;
  577|      0|    }
  578|       |
  579|      8|    if (p->pad != NULL && !OSSL_PARAM_set_uint(p->pad, ctx->pad)) {
  ------------------
  |  Branch (579:9): [True: 0, False: 8]
  |  Branch (579:27): [True: 0, False: 0]
  ------------------
  580|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  581|      0|        return 0;
  582|      0|    }
  583|       |
  584|      8|    if (p->iv != NULL
  ------------------
  |  Branch (584:9): [True: 0, False: 8]
  ------------------
  585|      0|        && !OSSL_PARAM_set_octet_string_or_ptr(p->iv, ctx->oiv, ctx->ivlen)) {
  ------------------
  |  Branch (585:12): [True: 0, False: 0]
  ------------------
  586|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  587|      0|        return 0;
  588|      0|    }
  589|       |
  590|      8|    if (p->updiv != NULL
  ------------------
  |  Branch (590:9): [True: 0, False: 8]
  ------------------
  591|      0|        && !OSSL_PARAM_set_octet_string_or_ptr(p->updiv, ctx->iv, ctx->ivlen)) {
  ------------------
  |  Branch (591:12): [True: 0, False: 0]
  ------------------
  592|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  593|      0|        return 0;
  594|      0|    }
  595|       |
  596|      8|    if (p->num != NULL && !OSSL_PARAM_set_uint(p->num, ctx->num)) {
  ------------------
  |  Branch (596:9): [True: 0, False: 8]
  |  Branch (596:27): [True: 0, False: 0]
  ------------------
  597|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  598|      0|        return 0;
  599|      0|    }
  600|       |
  601|      8|    if (p->keylen != NULL && !OSSL_PARAM_set_size_t(p->keylen, ctx->keylen)) {
  ------------------
  |  Branch (601:9): [True: 6, False: 2]
  |  Branch (601:30): [True: 0, False: 6]
  ------------------
  602|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  603|      0|        return 0;
  604|      0|    }
  605|       |
  606|      8|    if (p->tlsmac != NULL
  ------------------
  |  Branch (606:9): [True: 0, False: 8]
  ------------------
  607|      0|        && !OSSL_PARAM_set_octet_ptr(p->tlsmac, ctx->tlsmac, ctx->tlsmacsize)) {
  ------------------
  |  Branch (607:12): [True: 0, False: 0]
  ------------------
  608|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  609|      0|        return 0;
  610|      0|    }
  611|      8|    return 1;
  612|      8|}
ossl_cipher_generic_get_ctx_params:
  615|      8|{
  616|      8|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  617|      8|    struct ossl_cipher_get_ctx_param_list_st p;
  618|       |
  619|      8|    if (ctx == NULL || !cipher_generic_get_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (619:9): [True: 0, False: 8]
  |  Branch (619:24): [True: 0, False: 8]
  ------------------
  620|      0|        return 0;
  621|      8|    return ossl_cipher_common_get_ctx_params(ctx, &p);
  622|      8|}
ossl_cipher_generic_set_ctx_params:
  690|     41|{
  691|     41|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  692|     41|    struct ossl_cipher_set_ctx_param_list_st p;
  693|       |
  694|     41|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (694:9): [True: 41, False: 0]
  ------------------
  695|     41|        return 1;
  696|       |
  697|      0|    if (ctx == NULL || !cipher_generic_set_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (697:9): [True: 0, False: 0]
  |  Branch (697:24): [True: 0, False: 0]
  ------------------
  698|      0|        return 0;
  699|      0|    return ossl_cipher_common_set_ctx_params(ctx, &p);
  700|      0|}
ossl_cipher_generic_initiv:
  704|      4|{
  705|      4|    if (ivlen != ctx->ivlen
  ------------------
  |  Branch (705:9): [True: 0, False: 4]
  ------------------
  706|      4|        || ivlen > sizeof(ctx->iv)) {
  ------------------
  |  Branch (706:12): [True: 0, False: 4]
  ------------------
  707|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  708|      0|        return 0;
  709|      0|    }
  710|      4|    ctx->iv_set = 1;
  711|      4|    memcpy(ctx->iv, iv, ivlen);
  712|      4|    memcpy(ctx->oiv, iv, ivlen);
  713|      4|    return 1;
  714|      4|}
ossl_cipher_generic_initkey:
  720|      6|{
  721|      6|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  722|       |
  723|      6|    if ((flags & PROV_CIPHER_FLAG_INVERSE_CIPHER) != 0)
  ------------------
  |  |   46|      6|#define PROV_CIPHER_FLAG_INVERSE_CIPHER 0x0200
  ------------------
  |  Branch (723:9): [True: 0, False: 6]
  ------------------
  724|      0|        ctx->inverse_cipher = 1;
  725|      6|    if ((flags & PROV_CIPHER_FLAG_VARIABLE_LENGTH) != 0)
  ------------------
  |  |   45|      6|#define PROV_CIPHER_FLAG_VARIABLE_LENGTH 0x0100
  ------------------
  |  Branch (725:9): [True: 0, False: 6]
  ------------------
  726|      0|        ctx->variable_keylength = 1;
  727|       |
  728|      6|    ctx->pad = 1;
  729|      6|    ctx->keylen = ((kbits) / 8);
  730|      6|    ctx->ivlen = ((ivbits) / 8);
  731|      6|    ctx->hw = hw;
  732|      6|    ctx->mode = mode;
  733|      6|    ctx->blocksize = blkbits / 8;
  734|      6|    if (provctx != NULL)
  ------------------
  |  Branch (734:9): [True: 6, False: 0]
  ------------------
  735|      6|        ctx->libctx = PROV_LIBCTX_OF(provctx); /* used for rand */
  ------------------
  |  |   31|      6|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  736|      6|}
ciphercommon.c:cipher_generic_init_internal:
  175|     41|{
  176|     41|    ctx->num = 0;
  177|     41|    ctx->bufsz = 0;
  178|     41|    ctx->updated = 0;
  179|     41|    ctx->enc = enc ? 1 : 0;
  ------------------
  |  Branch (179:16): [True: 41, False: 0]
  ------------------
  180|       |
  181|     41|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (181:9): [True: 0, False: 41]
  ------------------
  182|      0|        return 0;
  183|       |
  184|     41|    if (iv != NULL && ctx->mode != EVP_CIPH_ECB_MODE) {
  ------------------
  |  |  286|      4|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  |  Branch (184:9): [True: 4, False: 37]
  |  Branch (184:23): [True: 4, False: 0]
  ------------------
  185|      4|        if (!ossl_cipher_generic_initiv(ctx, iv, ivlen))
  ------------------
  |  Branch (185:13): [True: 0, False: 4]
  ------------------
  186|      0|            return 0;
  187|      4|    }
  188|     41|    if (iv == NULL && ctx->iv_set
  ------------------
  |  Branch (188:9): [True: 37, False: 4]
  |  Branch (188:23): [True: 5, False: 32]
  ------------------
  189|      5|        && (ctx->mode == EVP_CIPH_CBC_MODE
  ------------------
  |  |  287|     10|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  |  Branch (189:13): [True: 0, False: 5]
  ------------------
  190|      5|            || ctx->mode == EVP_CIPH_CFB_MODE
  ------------------
  |  |  288|     10|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  |  Branch (190:16): [True: 0, False: 5]
  ------------------
  191|      5|            || ctx->mode == EVP_CIPH_OFB_MODE))
  ------------------
  |  |  289|      5|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  |  Branch (191:16): [True: 0, False: 5]
  ------------------
  192|       |        /* reset IV for these modes to keep compatibility with 1.1.1 */
  193|      0|        memcpy(ctx->iv, ctx->oiv, ctx->ivlen);
  194|       |
  195|     41|    if (key != NULL) {
  ------------------
  |  Branch (195:9): [True: 33, False: 8]
  ------------------
  196|     33|        if (ctx->variable_keylength == 0) {
  ------------------
  |  Branch (196:13): [True: 33, False: 0]
  ------------------
  197|     33|            if (keylen != ctx->keylen) {
  ------------------
  |  Branch (197:17): [True: 0, False: 33]
  ------------------
  198|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|                return 0;
  200|      0|            }
  201|     33|        } else {
  202|      0|            ctx->keylen = keylen;
  203|      0|        }
  204|     33|        if (!ctx->hw->init(ctx, key, ctx->keylen))
  ------------------
  |  Branch (204:13): [True: 0, False: 33]
  ------------------
  205|      0|            return 0;
  206|     33|        ctx->key_set = 1;
  207|     33|    }
  208|     41|    return ossl_cipher_generic_set_ctx_params(ctx, params);
  209|     41|}

ciphercommon.c:ossl_cipher_generic_get_params_decoder:
   54|    121|{
   55|    121|    const char *s;
   56|       |
   57|    121|    memset(r, 0, sizeof(*r));
   58|    121|    if (p != NULL)
  ------------------
  |  Branch (58:9): [True: 121, False: 0]
  ------------------
   59|  1.33k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (59:16): [True: 1.21k, False: 121]
  ------------------
   60|  1.21k|            switch(s[0]) {
   61|      0|            default:
  ------------------
  |  Branch (61:13): [True: 0, False: 1.21k]
  ------------------
   62|      0|                break;
   63|    121|            case 'a':
  ------------------
  |  Branch (63:13): [True: 121, False: 1.08k]
  ------------------
   64|    121|                if (ossl_likely(strcmp("ead", s + 1) == 0)) {
  ------------------
  |  |   23|    121|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 121, False: 0]
  |  |  ------------------
  ------------------
   65|       |                    /* OSSL_CIPHER_PARAM_AEAD */
   66|    121|                    if (ossl_unlikely(r->aead != NULL)) {
  ------------------
  |  |   24|    121|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 121]
  |  |  ------------------
  ------------------
   67|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   68|      0|                                       "param %s is repeated", s);
   69|      0|                        return 0;
   70|      0|                    }
   71|    121|                    r->aead = (OSSL_PARAM *)p;
   72|    121|                }
   73|    121|                break;
   74|    121|            case 'b':
  ------------------
  |  Branch (74:13): [True: 121, False: 1.08k]
  ------------------
   75|    121|                if (ossl_likely(strcmp("locksize", s + 1) == 0)) {
  ------------------
  |  |   23|    121|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 121, False: 0]
  |  |  ------------------
  ------------------
   76|       |                    /* OSSL_CIPHER_PARAM_BLOCK_SIZE */
   77|    121|                    if (ossl_unlikely(r->bsize != NULL)) {
  ------------------
  |  |   24|    121|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 121]
  |  |  ------------------
  ------------------
   78|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   79|      0|                                       "param %s is repeated", s);
   80|      0|                        return 0;
   81|      0|                    }
   82|    121|                    r->bsize = (OSSL_PARAM *)p;
   83|    121|                }
   84|    121|                break;
   85|    242|            case 'c':
  ------------------
  |  Branch (85:13): [True: 242, False: 968]
  ------------------
   86|    242|                switch(s[1]) {
   87|      0|                default:
  ------------------
  |  Branch (87:17): [True: 0, False: 242]
  ------------------
   88|      0|                    break;
   89|    121|                case 't':
  ------------------
  |  Branch (89:17): [True: 121, False: 121]
  ------------------
   90|    121|                    if (ossl_likely(strcmp("s", s + 2) == 0)) {
  ------------------
  |  |   23|    121|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 121, False: 0]
  |  |  ------------------
  ------------------
   91|       |                        /* OSSL_CIPHER_PARAM_CTS */
   92|    121|                        if (ossl_unlikely(r->cts != NULL)) {
  ------------------
  |  |   24|    121|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 121]
  |  |  ------------------
  ------------------
   93|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   94|      0|                                           "param %s is repeated", s);
   95|      0|                            return 0;
   96|      0|                        }
   97|    121|                        r->cts = (OSSL_PARAM *)p;
   98|    121|                    }
   99|    121|                    break;
  100|    121|                case 'u':
  ------------------
  |  Branch (100:17): [True: 121, False: 121]
  ------------------
  101|    121|                    if (ossl_likely(strcmp("stom-iv", s + 2) == 0)) {
  ------------------
  |  |   23|    121|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 121, False: 0]
  |  |  ------------------
  ------------------
  102|       |                        /* OSSL_CIPHER_PARAM_CUSTOM_IV */
  103|    121|                        if (ossl_unlikely(r->custiv != NULL)) {
  ------------------
  |  |   24|    121|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 121]
  |  |  ------------------
  ------------------
  104|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  105|      0|                                           "param %s is repeated", s);
  106|      0|                            return 0;
  107|      0|                        }
  108|    121|                        r->custiv = (OSSL_PARAM *)p;
  109|    121|                    }
  110|    242|                }
  111|    242|                break;
  112|    242|            case 'e':
  ------------------
  |  Branch (112:13): [True: 121, False: 1.08k]
  ------------------
  113|    121|                if (ossl_likely(strcmp("ncrypt-then-mac", s + 1) == 0)) {
  ------------------
  |  |   23|    121|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 121, False: 0]
  |  |  ------------------
  ------------------
  114|       |                    /* OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC */
  115|    121|                    if (ossl_unlikely(r->etm != NULL)) {
  ------------------
  |  |   24|    121|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 121]
  |  |  ------------------
  ------------------
  116|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  117|      0|                                       "param %s is repeated", s);
  118|      0|                        return 0;
  119|      0|                    }
  120|    121|                    r->etm = (OSSL_PARAM *)p;
  121|    121|                }
  122|    121|                break;
  123|    121|            case 'h':
  ------------------
  |  Branch (123:13): [True: 121, False: 1.08k]
  ------------------
  124|    121|                if (ossl_likely(strcmp("as-randkey", s + 1) == 0)) {
  ------------------
  |  |   23|    121|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 121, False: 0]
  |  |  ------------------
  ------------------
  125|       |                    /* OSSL_CIPHER_PARAM_HAS_RAND_KEY */
  126|    121|                    if (ossl_unlikely(r->rand != NULL)) {
  ------------------
  |  |   24|    121|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 121]
  |  |  ------------------
  ------------------
  127|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  128|      0|                                       "param %s is repeated", s);
  129|      0|                        return 0;
  130|      0|                    }
  131|    121|                    r->rand = (OSSL_PARAM *)p;
  132|    121|                }
  133|    121|                break;
  134|    121|            case 'i':
  ------------------
  |  Branch (134:13): [True: 121, False: 1.08k]
  ------------------
  135|    121|                if (ossl_likely(strcmp("vlen", s + 1) == 0)) {
  ------------------
  |  |   23|    121|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 121, False: 0]
  |  |  ------------------
  ------------------
  136|       |                    /* OSSL_CIPHER_PARAM_IVLEN */
  137|    121|                    if (ossl_unlikely(r->ivlen != NULL)) {
  ------------------
  |  |   24|    121|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 121]
  |  |  ------------------
  ------------------
  138|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  139|      0|                                       "param %s is repeated", s);
  140|      0|                        return 0;
  141|      0|                    }
  142|    121|                    r->ivlen = (OSSL_PARAM *)p;
  143|    121|                }
  144|    121|                break;
  145|    121|            case 'k':
  ------------------
  |  Branch (145:13): [True: 121, False: 1.08k]
  ------------------
  146|    121|                if (ossl_likely(strcmp("eylen", s + 1) == 0)) {
  ------------------
  |  |   23|    121|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 121, False: 0]
  |  |  ------------------
  ------------------
  147|       |                    /* OSSL_CIPHER_PARAM_KEYLEN */
  148|    121|                    if (ossl_unlikely(r->keylen != NULL)) {
  ------------------
  |  |   24|    121|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 121]
  |  |  ------------------
  ------------------
  149|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  150|      0|                                       "param %s is repeated", s);
  151|      0|                        return 0;
  152|      0|                    }
  153|    121|                    r->keylen = (OSSL_PARAM *)p;
  154|    121|                }
  155|    121|                break;
  156|    121|            case 'm':
  ------------------
  |  Branch (156:13): [True: 121, False: 1.08k]
  ------------------
  157|    121|                if (ossl_likely(strcmp("ode", s + 1) == 0)) {
  ------------------
  |  |   23|    121|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 121, False: 0]
  |  |  ------------------
  ------------------
  158|       |                    /* OSSL_CIPHER_PARAM_MODE */
  159|    121|                    if (ossl_unlikely(r->mode != NULL)) {
  ------------------
  |  |   24|    121|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 121]
  |  |  ------------------
  ------------------
  160|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  161|      0|                                       "param %s is repeated", s);
  162|      0|                        return 0;
  163|      0|                    }
  164|    121|                    r->mode = (OSSL_PARAM *)p;
  165|    121|                }
  166|    121|                break;
  167|    121|            case 't':
  ------------------
  |  Branch (167:13): [True: 121, False: 1.08k]
  ------------------
  168|    121|                if (ossl_likely(strcmp("ls-multi", s + 1) == 0)) {
  ------------------
  |  |   23|    121|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 121, False: 0]
  |  |  ------------------
  ------------------
  169|       |                    /* OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK */
  170|    121|                    if (ossl_unlikely(r->mb != NULL)) {
  ------------------
  |  |   24|    121|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 121]
  |  |  ------------------
  ------------------
  171|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  172|      0|                                       "param %s is repeated", s);
  173|      0|                        return 0;
  174|      0|                    }
  175|    121|                    r->mb = (OSSL_PARAM *)p;
  176|    121|                }
  177|  1.21k|            }
  178|    121|    return 1;
  179|    121|}
ciphercommon.c:cipher_generic_get_ctx_params_decoder:
  215|      8|{
  216|      8|    const char *s;
  217|       |
  218|      8|    memset(r, 0, sizeof(*r));
  219|      8|    if (p != NULL)
  ------------------
  |  Branch (219:9): [True: 8, False: 0]
  ------------------
  220|     16|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (220:16): [True: 8, False: 8]
  ------------------
  221|      8|            switch(s[0]) {
  222|      0|            default:
  ------------------
  |  Branch (222:13): [True: 0, False: 8]
  ------------------
  223|      0|                break;
  224|      0|            case 'f':
  ------------------
  |  Branch (224:13): [True: 0, False: 8]
  ------------------
  225|       |# if defined(FIPS_MODULE)
  226|       |                if (ossl_likely(strcmp("ips-indicator", s + 1) == 0)) {
  227|       |                    /* OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR */
  228|       |                    if (!OSSL_PARAM_set_int((OSSL_PARAM *)p, 1))
  229|       |                        return 0;
  230|       |                }
  231|       |# endif
  232|      0|                break;
  233|      2|            case 'i':
  ------------------
  |  Branch (233:13): [True: 2, False: 6]
  ------------------
  234|      2|                switch(s[1]) {
  235|      0|                default:
  ------------------
  |  Branch (235:17): [True: 0, False: 2]
  ------------------
  236|      0|                    break;
  237|      2|                case 'v':
  ------------------
  |  Branch (237:17): [True: 2, False: 0]
  ------------------
  238|      2|                    switch(s[2]) {
  239|      0|                    default:
  ------------------
  |  Branch (239:21): [True: 0, False: 2]
  ------------------
  240|      0|                        break;
  241|      2|                    case 'l':
  ------------------
  |  Branch (241:21): [True: 2, False: 0]
  ------------------
  242|      2|                        if (ossl_likely(strcmp("en", s + 3) == 0)) {
  ------------------
  |  |   23|      2|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  243|       |                            /* OSSL_CIPHER_PARAM_IVLEN */
  244|      2|                            if (ossl_unlikely(r->ivlen != NULL)) {
  ------------------
  |  |   24|      2|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  245|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  246|      0|                                               "param %s is repeated", s);
  247|      0|                                return 0;
  248|      0|                            }
  249|      2|                            r->ivlen = (OSSL_PARAM *)p;
  250|      2|                        }
  251|      2|                        break;
  252|      2|                    case '\0':
  ------------------
  |  Branch (252:21): [True: 0, False: 2]
  ------------------
  253|      0|                        if (ossl_unlikely(r->iv != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  254|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  255|      0|                                           "param %s is repeated", s);
  256|      0|                            return 0;
  257|      0|                        }
  258|      0|                        r->iv = (OSSL_PARAM *)p;
  259|      2|                    }
  260|      2|                }
  261|      2|                break;
  262|      6|            case 'k':
  ------------------
  |  Branch (262:13): [True: 6, False: 2]
  ------------------
  263|      6|                if (ossl_likely(strcmp("eylen", s + 1) == 0)) {
  ------------------
  |  |   23|      6|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  264|       |                    /* OSSL_CIPHER_PARAM_KEYLEN */
  265|      6|                    if (ossl_unlikely(r->keylen != NULL)) {
  ------------------
  |  |   24|      6|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  266|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  267|      0|                                       "param %s is repeated", s);
  268|      0|                        return 0;
  269|      0|                    }
  270|      6|                    r->keylen = (OSSL_PARAM *)p;
  271|      6|                }
  272|      6|                break;
  273|      6|            case 'n':
  ------------------
  |  Branch (273:13): [True: 0, False: 8]
  ------------------
  274|      0|                if (ossl_likely(strcmp("um", s + 1) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  275|       |                    /* OSSL_CIPHER_PARAM_NUM */
  276|      0|                    if (ossl_unlikely(r->num != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  277|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  278|      0|                                       "param %s is repeated", s);
  279|      0|                        return 0;
  280|      0|                    }
  281|      0|                    r->num = (OSSL_PARAM *)p;
  282|      0|                }
  283|      0|                break;
  284|      0|            case 'p':
  ------------------
  |  Branch (284:13): [True: 0, False: 8]
  ------------------
  285|      0|                if (ossl_likely(strcmp("adding", s + 1) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  286|       |                    /* OSSL_CIPHER_PARAM_PADDING */
  287|      0|                    if (ossl_unlikely(r->pad != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  288|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  289|      0|                                       "param %s is repeated", s);
  290|      0|                        return 0;
  291|      0|                    }
  292|      0|                    r->pad = (OSSL_PARAM *)p;
  293|      0|                }
  294|      0|                break;
  295|      0|            case 't':
  ------------------
  |  Branch (295:13): [True: 0, False: 8]
  ------------------
  296|      0|                if (ossl_likely(strcmp("ls-mac", s + 1) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  297|       |                    /* OSSL_CIPHER_PARAM_TLS_MAC */
  298|      0|                    if (ossl_unlikely(r->tlsmac != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  299|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  300|      0|                                       "param %s is repeated", s);
  301|      0|                        return 0;
  302|      0|                    }
  303|      0|                    r->tlsmac = (OSSL_PARAM *)p;
  304|      0|                }
  305|      0|                break;
  306|      0|            case 'u':
  ------------------
  |  Branch (306:13): [True: 0, False: 8]
  ------------------
  307|      0|                if (ossl_likely(strcmp("pdated-iv", s + 1) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  308|       |                    /* OSSL_CIPHER_PARAM_UPDATED_IV */
  309|      0|                    if (ossl_unlikely(r->updiv != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  310|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  311|      0|                                       "param %s is repeated", s);
  312|      0|                        return 0;
  313|      0|                    }
  314|      0|                    r->updiv = (OSSL_PARAM *)p;
  315|      0|                }
  316|      8|            }
  317|      8|    return 1;
  318|      8|}

ossl_ccm_gettable_ctx_params:
  150|      7|{
  151|      7|    return ossl_cipher_ccm_get_ctx_params_list;
  152|      7|}

ossl_gcm_gettable_ctx_params:
  158|      7|{
  159|      7|    return ossl_cipher_gcm_get_ctx_params_list;
  160|      7|}

ossl_cipher_hw_generic_ctr:
  112|      4|{
  113|      4|    unsigned int num = dat->num;
  114|       |
  115|      4|    if (dat->stream.ctr)
  ------------------
  |  Branch (115:9): [True: 4, False: 0]
  ------------------
  116|      4|        CRYPTO_ctr128_encrypt_ctr32(in, out, len, dat->ks, dat->iv, dat->buf,
  117|      4|            &num, dat->stream.ctr);
  118|      0|    else
  119|      0|        CRYPTO_ctr128_encrypt(in, out, len, dat->ks, dat->iv, dat->buf,
  120|      0|            &num, dat->block);
  121|      4|    dat->num = num;
  122|       |
  123|      4|    return 1;
  124|      4|}

blake2_prov.c:blake2s256_get_params:
  166|      1|    {                                                                                                             \
  167|      1|        return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  ------------------
  |  |   19|      1|#define BLAKE2S_BLOCKBYTES 64
  ------------------
                      return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  ------------------
  |  |   20|      1|#define BLAKE2S_OUTBYTES 32
  ------------------
  168|      1|    }                                                                                                             \
blake2_prov.c:blake2b512_get_params:
  166|      1|    {                                                                                                             \
  167|      1|        return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  ------------------
  |  |   25|      1|#define BLAKE2B_BLOCKBYTES 128
  ------------------
                      return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  ------------------
  |  |   26|      1|#define BLAKE2B_OUTBYTES 64
  ------------------
  168|      1|    }                                                                                                             \

ossl_digest_default_get_params:
   20|     30|{
   21|     30|    struct digest_default_get_params_st p;
   22|       |
   23|     30|    if (!digest_default_get_params_decoder(params, &p))
  ------------------
  |  Branch (23:9): [True: 0, False: 30]
  ------------------
   24|      0|        return 0;
   25|       |
   26|     30|    if (p.bsize != NULL && !OSSL_PARAM_set_size_t(p.bsize, blksz)) {
  ------------------
  |  Branch (26:9): [True: 30, False: 0]
  |  Branch (26:28): [True: 0, False: 30]
  ------------------
   27|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   28|      0|        return 0;
   29|      0|    }
   30|     30|    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, paramsz)) {
  ------------------
  |  Branch (30:9): [True: 30, False: 0]
  |  Branch (30:27): [True: 0, False: 30]
  ------------------
   31|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   32|      0|        return 0;
   33|      0|    }
   34|     30|    if (p.xof != NULL
  ------------------
  |  Branch (34:9): [True: 30, False: 0]
  ------------------
   35|     30|        && !OSSL_PARAM_set_int(p.xof, (flags & PROV_DIGEST_FLAG_XOF) != 0)) {
  ------------------
  |  |   19|     30|#define PROV_DIGEST_FLAG_XOF 0x0001
  ------------------
  |  Branch (35:12): [True: 0, False: 30]
  ------------------
   36|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   37|      0|        return 0;
   38|      0|    }
   39|     30|    if (p.aldid != NULL
  ------------------
  |  Branch (39:9): [True: 30, False: 0]
  ------------------
   40|     30|        && !OSSL_PARAM_set_int(p.aldid, (flags & PROV_DIGEST_FLAG_ALGID_ABSENT) != 0)) {
  ------------------
  |  |   20|     30|#define PROV_DIGEST_FLAG_ALGID_ABSENT 0x0002
  ------------------
  |  Branch (40:12): [True: 0, False: 30]
  ------------------
   41|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   42|      0|        return 0;
   43|      0|    }
   44|     30|    return 1;
   45|     30|}

digestcommon.c:digest_default_get_params_decoder:
   42|     30|{
   43|     30|    const char *s;
   44|       |
   45|     30|    memset(r, 0, sizeof(*r));
   46|     30|    if (p != NULL)
  ------------------
  |  Branch (46:9): [True: 30, False: 0]
  ------------------
   47|    150|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (47:16): [True: 120, False: 30]
  ------------------
   48|    120|            switch(s[0]) {
   49|      0|            default:
  ------------------
  |  Branch (49:13): [True: 0, False: 120]
  ------------------
   50|      0|                break;
   51|     30|            case 'a':
  ------------------
  |  Branch (51:13): [True: 30, False: 90]
  ------------------
   52|     30|                if (ossl_likely(strcmp("lgid-absent", s + 1) == 0)) {
  ------------------
  |  |   23|     30|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 30, False: 0]
  |  |  ------------------
  ------------------
   53|       |                    /* OSSL_DIGEST_PARAM_ALGID_ABSENT */
   54|     30|                    if (ossl_unlikely(r->aldid != NULL)) {
  ------------------
  |  |   24|     30|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 30]
  |  |  ------------------
  ------------------
   55|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   56|      0|                                       "param %s is repeated", s);
   57|      0|                        return 0;
   58|      0|                    }
   59|     30|                    r->aldid = (OSSL_PARAM *)p;
   60|     30|                }
   61|     30|                break;
   62|     30|            case 'b':
  ------------------
  |  Branch (62:13): [True: 30, False: 90]
  ------------------
   63|     30|                if (ossl_likely(strcmp("locksize", s + 1) == 0)) {
  ------------------
  |  |   23|     30|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 30, False: 0]
  |  |  ------------------
  ------------------
   64|       |                    /* OSSL_DIGEST_PARAM_BLOCK_SIZE */
   65|     30|                    if (ossl_unlikely(r->bsize != NULL)) {
  ------------------
  |  |   24|     30|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 30]
  |  |  ------------------
  ------------------
   66|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   67|      0|                                       "param %s is repeated", s);
   68|      0|                        return 0;
   69|      0|                    }
   70|     30|                    r->bsize = (OSSL_PARAM *)p;
   71|     30|                }
   72|     30|                break;
   73|     30|            case 's':
  ------------------
  |  Branch (73:13): [True: 30, False: 90]
  ------------------
   74|     30|                if (ossl_likely(strcmp("ize", s + 1) == 0)) {
  ------------------
  |  |   23|     30|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 30, False: 0]
  |  |  ------------------
  ------------------
   75|       |                    /* OSSL_DIGEST_PARAM_SIZE */
   76|     30|                    if (ossl_unlikely(r->size != NULL)) {
  ------------------
  |  |   24|     30|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 30]
  |  |  ------------------
  ------------------
   77|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   78|      0|                                       "param %s is repeated", s);
   79|      0|                        return 0;
   80|      0|                    }
   81|     30|                    r->size = (OSSL_PARAM *)p;
   82|     30|                }
   83|     30|                break;
   84|     30|            case 'x':
  ------------------
  |  Branch (84:13): [True: 30, False: 90]
  ------------------
   85|     30|                if (ossl_likely(strcmp("of", s + 1) == 0)) {
  ------------------
  |  |   23|     30|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 30, False: 0]
  |  |  ------------------
  ------------------
   86|       |                    /* OSSL_DIGEST_PARAM_XOF */
   87|     30|                    if (ossl_unlikely(r->xof != NULL)) {
  ------------------
  |  |   24|     30|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 30]
  |  |  ------------------
  ------------------
   88|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   89|      0|                                       "param %s is repeated", s);
   90|      0|                        return 0;
   91|      0|                    }
   92|     30|                    r->xof = (OSSL_PARAM *)p;
   93|     30|                }
   94|    120|            }
   95|     30|    return 1;
   96|     30|}

ml_dsa_mu_prov.c:mu_get_params:
  136|      1|{
  137|      1|    return ossl_digest_default_get_params(params, SHA3_BLOCKSIZE(256),
  ------------------
  |  |   21|      1|#define SHA3_BLOCKSIZE(bitlen) (KECCAK1600_WIDTH - bitlen * 2) / 8
  |  |  ------------------
  |  |  |  |   18|      1|#define KECCAK1600_WIDTH 1600
  |  |  ------------------
  ------------------
  138|      1|        SHAKE256_SIZE, SHAKE_FLAGS);
  ------------------
  |  |   36|      1|#define SHAKE256_SIZE 64
  ------------------
                      SHAKE256_SIZE, SHAKE_FLAGS);
  ------------------
  |  |   37|      1|#define SHAKE_FLAGS (PROV_DIGEST_FLAG_ALGID_ABSENT)
  |  |  ------------------
  |  |  |  |   20|      1|#define PROV_DIGEST_FLAG_ALGID_ABSENT 0x0002
  |  |  ------------------
  ------------------
  139|      1|}

cipher_aes.c:aes_256_ecb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_192_ecb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_128_ecb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_256_cbc_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_192_cbc_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_128_cbc_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_256_ofb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_192_ofb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_128_ofb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_256_cfb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_192_cfb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_128_cfb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_256_cfb1_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_192_cfb1_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_128_cfb1_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_256_cfb8_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_192_cfb8_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_128_cfb8_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_256_ctr_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  290|      1|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_192_ctr_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  290|      1|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aes.c:aes_128_ctr_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  290|      1|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_256_ecb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_192_ecb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_128_ecb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_256_cbc_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_192_cbc_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_128_cbc_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_256_ofb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_192_ofb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_128_ofb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_256_cfb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_192_cfb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_128_cfb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_256_cfb1_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_192_cfb1_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_128_cfb1_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_256_cfb8_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_192_cfb8_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_128_cfb8_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_256_ctr_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  290|      1|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_192_ctr_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  290|      1|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_aria.c:aria_128_ctr_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  290|      1|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_256_ecb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_192_ecb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_128_ecb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_256_cbc_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_192_cbc_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_128_cbc_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_256_ofb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_192_ofb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_128_ofb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_256_cfb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_192_cfb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_128_cfb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_256_cfb1_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_192_cfb1_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_128_cfb1_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_256_cfb8_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_192_cfb8_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_128_cfb8_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_256_ctr_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  290|      1|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_192_ctr_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  290|      1|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_camellia.c:camellia_128_ctr_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  290|      1|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_sm4.c:sm4_128_ecb_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  286|      1|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_sm4.c:sm4_128_cbc_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  287|      1|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_sm4.c:sm4_128_ctr_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  290|      1|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_sm4.c:sm4_128_ofb128_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  289|      1|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \
cipher_sm4.c:sm4_128_cfb128_get_params:
  215|      1|    {                                                                            \
  216|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  288|      1|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  217|      1|            flags, kbits, blkbits, ivbits);                                      \
  218|      1|    }                                                                            \

cipher_aes_ccm.c:aes_128_ccm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  292|      1|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aes_ccm.c:aes_192_ccm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  292|      1|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aes_ccm.c:aes_256_ccm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  292|      1|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aes_gcm.c:aes_128_gcm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  291|      1|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aes_gcm.c:aes_192_gcm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  291|      1|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aes_gcm.c:aes_256_gcm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  291|      1|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aria_ccm.c:aria_128_ccm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  292|      1|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aria_ccm.c:aria_192_ccm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  292|      1|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aria_ccm.c:aria_256_ccm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  292|      1|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aria_gcm.c:aria_128_gcm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  291|      1|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aria_gcm.c:aria_192_gcm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  291|      1|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_aria_gcm.c:aria_256_gcm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  291|      1|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_sm4_ccm.c:sm4_128_ccm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  292|      1|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \
cipher_sm4_gcm.c:sm4_128_gcm_get_params:
   21|      1|    {                                                                           \
   22|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  291|      1|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|      1|            flags, kbits, blkbits, ivbits);                                     \
   24|      1|    }                                                                           \

cshake_prov.c:cshake_128_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
cshake_prov.c:cshake_256_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
md5_prov.c:md5_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
md5_sha1_prov.c:md5_sha1_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
null_prov.c:nullmd_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
ripemd_prov.c:ripemd160_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha2_prov.c:sha1_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha2_prov.c:sha224_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha2_prov.c:sha256_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha2_prov.c:sha256_192_internal_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha2_prov.c:sha384_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha2_prov.c:sha512_internal_final:
   59|      1|    {                                                                             \
   60|      1|        if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {       \
  ------------------
  |  Branch (60:13): [True: 1, False: 0]
  |  Branch (60:39): [True: 1, False: 0]
  |  Branch (60:60): [True: 1, False: 0]
  ------------------
   61|      1|            *outl = dgstsize;                                                     \
   62|      1|            return 1;                                                             \
   63|      1|        }                                                                         \
   64|      1|        return 0;                                                                 \
   65|      1|    }
sha2_prov.c:sha512_freectx:
   93|      1|    {                                                                            \
   94|      1|        CTX *ctx = (CTX *)vctx;                                                  \
   95|      1|        OPENSSL_clear_free(ctx, sizeof(*ctx));                                   \
  ------------------
  |  |  134|      1|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   96|      1|    }                                                                            \
sha2_prov.c:sha512_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha2_prov.c:sha512_internal_init:
  165|      1|    {                                                                              \
  166|      1|        return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (166:16): [True: 1, False: 0]
  |  Branch (166:42): [True: 1, False: 0]
  ------------------
  167|      1|    }                                                                              \
sha2_prov.c:sha512_224_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha2_prov.c:sha512_256_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:sha3_224_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:sha3_256_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:sha3_384_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:sha3_512_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:keccak_224_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:keccak_256_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:keccak_384_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:keccak_512_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:shake_128_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:shake_256_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:cshake_keccak_128_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sha3_prov.c:cshake_keccak_256_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }
sm3_prov.c:sm3_get_params:
   29|      1|    {                                                                            \
   30|      1|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|      1|    }

ossl_drbg_lock:
   54|     17|{
   55|     17|    return 1;
   56|     17|}
ossl_drbg_unlock:
   60|     17|{
   61|     17|}
ossl_drbg_get_seed:
  148|      2|{
  149|      2|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  150|      2|    size_t bytes_needed;
  151|      2|    unsigned char *buffer;
  152|       |
  153|       |    /* Figure out how many bytes we need */
  154|      2|    bytes_needed = entropy >= 0 ? (entropy + 7) / 8 : 0;
  ------------------
  |  Branch (154:20): [True: 2, False: 0]
  ------------------
  155|      2|    if (bytes_needed < min_len)
  ------------------
  |  Branch (155:9): [True: 0, False: 2]
  ------------------
  156|      0|        bytes_needed = min_len;
  157|      2|    if (bytes_needed > max_len)
  ------------------
  |  Branch (157:9): [True: 0, False: 2]
  ------------------
  158|      0|        bytes_needed = max_len;
  159|       |
  160|       |    /* Allocate storage */
  161|      2|    buffer = OPENSSL_secure_malloc(bytes_needed);
  ------------------
  |  |  144|      2|    CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  162|      2|    if (buffer == NULL)
  ------------------
  |  Branch (162:9): [True: 0, False: 2]
  ------------------
  163|      0|        return 0;
  164|       |
  165|       |    /*
  166|       |     * Get random data.  Include our DRBG address as
  167|       |     * additional input, in order to provide a distinction between
  168|       |     * different DRBG child instances.
  169|       |     *
  170|       |     * Note: using the sizeof() operator on a pointer triggers
  171|       |     *       a warning in some static code analyzers, but it's
  172|       |     *       intentional and correct here.
  173|       |     */
  174|      2|    if (!ossl_prov_drbg_generate(drbg, buffer, bytes_needed,
  ------------------
  |  Branch (174:9): [True: 0, False: 2]
  ------------------
  175|      2|            drbg->strength, prediction_resistance,
  176|      2|            (unsigned char *)&drbg, sizeof(drbg))) {
  177|      0|        OPENSSL_secure_clear_free(buffer, bytes_needed);
  ------------------
  |  |  154|      0|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  178|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_GENERATE_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  179|      0|        return 0;
  180|      0|    }
  181|      2|    *pout = buffer;
  182|      2|    return bytes_needed;
  183|      2|}
ossl_drbg_clear_seed:
  188|      2|{
  189|      2|    OPENSSL_secure_clear_free(out, outlen);
  ------------------
  |  |  154|      2|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  190|      2|}
ossl_prov_drbg_nonce_ctx_new:
  272|      1|{
  273|      1|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|       |
  275|      1|    if (dngbl == NULL)
  ------------------
  |  Branch (275:9): [True: 0, False: 1]
  ------------------
  276|      0|        return NULL;
  277|       |
  278|      1|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  279|      1|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (279:9): [True: 0, False: 1]
  ------------------
  280|      0|        OPENSSL_free(dngbl);
  ------------------
  |  |  136|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|      0|        return NULL;
  282|      0|    }
  283|       |
  284|      1|    return dngbl;
  285|      1|}
ossl_prov_drbg_instantiate:
  352|      2|{
  353|      2|    unsigned char *nonce = NULL, *entropy = NULL;
  354|      2|    size_t noncelen = 0, entropylen = 0;
  355|      2|    unsigned int min_entropy;
  356|      2|    size_t min_entropylen, max_entropylen;
  357|       |
  358|      2|    if (strength > drbg->strength) {
  ------------------
  |  Branch (358:9): [True: 0, False: 2]
  ------------------
  359|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  360|      0|        goto end;
  361|      0|    }
  362|      2|    min_entropy = drbg->strength;
  363|      2|    min_entropylen = drbg->min_entropylen;
  364|      2|    max_entropylen = drbg->max_entropylen;
  365|       |
  366|      2|    if (pers == NULL) {
  ------------------
  |  Branch (366:9): [True: 2, False: 0]
  ------------------
  367|      2|        pers = (const unsigned char *)ossl_pers_string;
  368|      2|        perslen = sizeof(ossl_pers_string);
  369|      2|    }
  370|      2|    if (perslen > drbg->max_perslen) {
  ------------------
  |  Branch (370:9): [True: 0, False: 2]
  ------------------
  371|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PERSONALISATION_STRING_TOO_LONG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|        goto end;
  373|      0|    }
  374|       |
  375|      2|    if (drbg->state != EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1330|      2|#define EVP_RAND_STATE_UNINITIALISED 0
  ------------------
  |  Branch (375:9): [True: 0, False: 2]
  ------------------
  376|      0|        if (drbg->state == EVP_RAND_STATE_ERROR)
  ------------------
  |  | 1332|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  |  Branch (376:13): [True: 0, False: 0]
  ------------------
  377|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  378|      0|        else
  379|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_ALREADY_INSTANTIATED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  380|      0|        goto end;
  381|      0|    }
  382|       |
  383|      2|    drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1332|      2|#define EVP_RAND_STATE_ERROR 2
  ------------------
  384|       |
  385|      2|    if (drbg->min_noncelen > 0) {
  ------------------
  |  Branch (385:9): [True: 2, False: 0]
  ------------------
  386|      2|        if (drbg->parent_nonce != NULL) {
  ------------------
  |  Branch (386:13): [True: 0, False: 2]
  ------------------
  387|      0|            noncelen = drbg->parent_nonce(drbg->parent, NULL, drbg->strength,
  388|      0|                drbg->min_noncelen,
  389|      0|                drbg->max_noncelen);
  390|      0|            if (noncelen == 0) {
  ------------------
  |  Branch (390:17): [True: 0, False: 0]
  ------------------
  391|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  392|      0|                goto end;
  393|      0|            }
  394|      0|            nonce = OPENSSL_malloc(noncelen);
  ------------------
  |  |  111|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  395|      0|            if (nonce == NULL) {
  ------------------
  |  Branch (395:17): [True: 0, False: 0]
  ------------------
  396|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  397|      0|                goto end;
  398|      0|            }
  399|      0|            if (noncelen != drbg->parent_nonce(drbg->parent, nonce, drbg->strength, drbg->min_noncelen, drbg->max_noncelen)) {
  ------------------
  |  Branch (399:17): [True: 0, False: 0]
  ------------------
  400|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  401|      0|                goto end;
  402|      0|            }
  403|      0|#ifndef PROV_RAND_GET_RANDOM_NONCE
  404|      2|        } else if (drbg->parent != NULL) {
  ------------------
  |  Branch (404:20): [True: 2, False: 0]
  ------------------
  405|      2|#endif
  406|       |            /*
  407|       |             * NIST SP800-90Ar1 section 9.1 says you can combine getting
  408|       |             * the entropy and nonce in 1 call by increasing the entropy
  409|       |             * with 50% and increasing the minimum length to accommodate
  410|       |             * the length of the nonce. We do this in case a nonce is
  411|       |             * required and there is no parental nonce capability.
  412|       |             */
  413|      2|            min_entropy += drbg->strength / 2;
  414|      2|            min_entropylen += drbg->min_noncelen;
  415|      2|            max_entropylen += drbg->max_noncelen;
  416|      2|        }
  417|      0|#ifndef PROV_RAND_GET_RANDOM_NONCE
  418|      0|        else { /* parent == NULL */
  419|      0|            noncelen = prov_drbg_get_nonce(drbg, &nonce, drbg->min_noncelen,
  420|      0|                drbg->max_noncelen);
  421|      0|            if (noncelen < drbg->min_noncelen
  ------------------
  |  Branch (421:17): [True: 0, False: 0]
  ------------------
  422|      0|                || noncelen > drbg->max_noncelen) {
  ------------------
  |  Branch (422:20): [True: 0, False: 0]
  ------------------
  423|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  424|      0|                goto end;
  425|      0|            }
  426|      0|        }
  427|      2|#endif
  428|      2|    }
  429|       |
  430|      2|    drbg->reseed_next_counter = tsan_load(&drbg->reseed_counter);
  ------------------
  |  |   61|      2|#define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  431|      2|    if (drbg->reseed_next_counter) {
  ------------------
  |  Branch (431:9): [True: 2, False: 0]
  ------------------
  432|      2|        drbg->reseed_next_counter++;
  433|      2|        if (!drbg->reseed_next_counter)
  ------------------
  |  Branch (433:13): [True: 0, False: 2]
  ------------------
  434|      0|            drbg->reseed_next_counter = 1;
  435|      2|    }
  436|       |
  437|      2|    entropylen = get_entropy(drbg, &entropy, min_entropy,
  438|      2|        min_entropylen, max_entropylen,
  439|      2|        prediction_resistance);
  440|      2|    if (entropylen < min_entropylen
  ------------------
  |  Branch (440:9): [True: 0, False: 2]
  ------------------
  441|      2|        || entropylen > max_entropylen) {
  ------------------
  |  Branch (441:12): [True: 0, False: 2]
  ------------------
  442|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  443|      0|        goto end;
  444|      0|    }
  445|       |
  446|      2|    if (!drbg->instantiate(drbg, entropy, entropylen, nonce, noncelen,
  ------------------
  |  Branch (446:9): [True: 0, False: 2]
  ------------------
  447|      2|            pers, perslen)) {
  448|      0|        cleanup_entropy(drbg, entropy, entropylen);
  449|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  450|      0|        goto end;
  451|      0|    }
  452|      2|    cleanup_entropy(drbg, entropy, entropylen);
  453|       |
  454|      2|    drbg->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1331|      2|#define EVP_RAND_STATE_READY 1
  ------------------
  455|      2|    drbg->generate_counter = 1;
  456|      2|    drbg->reseed_time = time(NULL);
  457|      2|    tsan_store(&drbg->reseed_counter, drbg->reseed_next_counter);
  ------------------
  |  |   62|      2|#define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  458|       |
  459|      2|end:
  460|      2|    if (nonce != NULL)
  ------------------
  |  Branch (460:9): [True: 0, False: 2]
  ------------------
  461|      0|        ossl_prov_cleanup_nonce(drbg->provctx, nonce, noncelen);
  462|      2|    if (drbg->state == EVP_RAND_STATE_READY)
  ------------------
  |  | 1331|      2|#define EVP_RAND_STATE_READY 1
  ------------------
  |  Branch (462:9): [True: 2, False: 0]
  ------------------
  463|      2|        return 1;
  464|      0|    return 0;
  465|      2|}
ossl_prov_drbg_reseed:
  597|      2|{
  598|      2|    int ret;
  599|       |
  600|      2|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (600:9): [True: 2, False: 0]
  |  Branch (600:31): [True: 0, False: 2]
  ------------------
  601|      0|        return 0;
  602|       |
  603|      2|    ret = ossl_prov_drbg_reseed_unlocked(drbg, prediction_resistance, ent,
  604|      2|        ent_len, adin, adinlen);
  605|       |
  606|      2|    if (drbg->lock != NULL)
  ------------------
  |  Branch (606:9): [True: 2, False: 0]
  ------------------
  607|      2|        CRYPTO_THREAD_unlock(drbg->lock);
  608|       |
  609|      2|    return ret;
  610|      2|}
ossl_prov_drbg_generate:
  625|      4|{
  626|      4|    int fork_id;
  627|      4|    int reseed_required = 0;
  628|      4|    int ret = 0;
  629|      4|    time_t reseed_time_interval = drbg->reseed_time_interval;
  630|      4|    time_t now = 0;
  631|       |
  632|      4|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (632:9): [True: 0, False: 4]
  ------------------
  633|      0|        return 0;
  634|       |
  635|      4|    fork_id = openssl_get_fork_id();
  636|       |
  637|      4|    if (reseed_time_interval > 0)
  ------------------
  |  Branch (637:9): [True: 4, False: 0]
  ------------------
  638|      4|        now = time(NULL);
  639|       |
  640|      4|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (640:9): [True: 2, False: 2]
  |  Branch (640:31): [True: 0, False: 2]
  ------------------
  641|      0|        return 0;
  642|       |
  643|      4|    if (drbg->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1331|      4|#define EVP_RAND_STATE_READY 1
  ------------------
  |  Branch (643:9): [True: 0, False: 4]
  ------------------
  644|       |        /* try to recover from previous errors */
  645|      0|        rand_drbg_restart(drbg);
  646|       |
  647|      0|        if (drbg->state == EVP_RAND_STATE_ERROR) {
  ------------------
  |  | 1332|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  |  Branch (647:13): [True: 0, False: 0]
  ------------------
  648|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  649|      0|            goto err;
  650|      0|        }
  651|      0|        if (drbg->state == EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1330|      0|#define EVP_RAND_STATE_UNINITIALISED 0
  ------------------
  |  Branch (651:13): [True: 0, False: 0]
  ------------------
  652|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_INSTANTIATED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  653|      0|            goto err;
  654|      0|        }
  655|      0|    }
  656|      4|    if (strength > drbg->strength) {
  ------------------
  |  Branch (656:9): [True: 0, False: 4]
  ------------------
  657|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  658|      0|        goto err;
  659|      0|    }
  660|       |
  661|      4|    if (outlen > drbg->max_request) {
  ------------------
  |  Branch (661:9): [True: 0, False: 4]
  ------------------
  662|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_REQUEST_TOO_LARGE_FOR_DRBG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  663|      0|        goto err;
  664|      0|    }
  665|      4|    if (adinlen > drbg->max_adinlen) {
  ------------------
  |  Branch (665:9): [True: 0, False: 4]
  ------------------
  666|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_TOO_LONG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  667|      0|        goto err;
  668|      0|    }
  669|       |
  670|      4|    if (drbg->fork_id != fork_id) {
  ------------------
  |  Branch (670:9): [True: 0, False: 4]
  ------------------
  671|      0|        drbg->fork_id = fork_id;
  672|      0|        reseed_required = 1;
  673|      0|    }
  674|       |
  675|      4|    if (drbg->reseed_interval > 0) {
  ------------------
  |  Branch (675:9): [True: 4, False: 0]
  ------------------
  676|      4|        if (drbg->generate_counter >= drbg->reseed_interval)
  ------------------
  |  Branch (676:13): [True: 0, False: 4]
  ------------------
  677|      0|            reseed_required = 1;
  678|      4|    }
  679|      4|    if (reseed_time_interval > 0) {
  ------------------
  |  Branch (679:9): [True: 4, False: 0]
  ------------------
  680|      4|        if (now < drbg->reseed_time
  ------------------
  |  Branch (680:13): [True: 0, False: 4]
  ------------------
  681|      4|            || now - drbg->reseed_time >= reseed_time_interval)
  ------------------
  |  Branch (681:16): [True: 0, False: 4]
  ------------------
  682|      0|            reseed_required = 1;
  683|      4|    }
  684|      4|    if (drbg->parent != NULL
  ------------------
  |  Branch (684:9): [True: 4, False: 0]
  ------------------
  685|      4|        && get_parent_reseed_count(drbg) != drbg->parent_reseed_counter)
  ------------------
  |  Branch (685:12): [True: 1, False: 3]
  ------------------
  686|      1|        reseed_required = 1;
  687|       |
  688|      4|    if (reseed_required || prediction_resistance) {
  ------------------
  |  Branch (688:9): [True: 1, False: 3]
  |  Branch (688:28): [True: 0, False: 3]
  ------------------
  689|      1|        if (!ossl_prov_drbg_reseed_unlocked(drbg, prediction_resistance, NULL,
  ------------------
  |  Branch (689:13): [True: 0, False: 1]
  ------------------
  690|      1|                0, adin, adinlen)) {
  691|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_RESEED_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  692|      0|            goto err;
  693|      0|        }
  694|      1|        adin = NULL;
  695|      1|        adinlen = 0;
  696|      1|    }
  697|       |
  698|      4|    if (!drbg->generate(drbg, out, outlen, adin, adinlen)) {
  ------------------
  |  Branch (698:9): [True: 0, False: 4]
  ------------------
  699|      0|        drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1332|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  700|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_GENERATE_ERROR);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  701|      0|        goto err;
  702|      0|    }
  703|       |
  704|      4|    drbg->generate_counter++;
  705|       |
  706|      4|    ret = 1;
  707|      4|err:
  708|      4|    if (drbg->lock != NULL)
  ------------------
  |  Branch (708:9): [True: 2, False: 2]
  ------------------
  709|      2|        CRYPTO_THREAD_unlock(drbg->lock);
  710|       |
  711|      4|    return ret;
  712|      4|}
ossl_drbg_enable_locking:
  759|      1|{
  760|      1|    PROV_DRBG *drbg = vctx;
  761|       |
  762|      1|    if (drbg != NULL && drbg->lock == NULL) {
  ------------------
  |  Branch (762:9): [True: 1, False: 0]
  |  Branch (762:25): [True: 1, False: 0]
  ------------------
  763|      1|        if (drbg->parent_enable_locking != NULL)
  ------------------
  |  Branch (763:13): [True: 1, False: 0]
  ------------------
  764|      1|            if (!drbg->parent_enable_locking(drbg->parent)) {
  ------------------
  |  Branch (764:17): [True: 0, False: 1]
  ------------------
  765|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  766|      0|                return 0;
  767|      0|            }
  768|      1|        drbg->lock = CRYPTO_THREAD_lock_new();
  769|      1|        if (drbg->lock == NULL) {
  ------------------
  |  Branch (769:13): [True: 0, False: 1]
  ------------------
  770|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_CREATE_LOCK);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  771|      0|            return 0;
  772|      0|        }
  773|      1|    }
  774|      1|    return 1;
  775|      1|}
ossl_rand_drbg_new:
  797|      2|{
  798|      2|    PROV_DRBG *drbg;
  799|      2|    unsigned int p_str;
  800|      2|    const OSSL_DISPATCH *pfunc;
  801|       |
  802|      2|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (802:9): [True: 0, False: 2]
  ------------------
  803|      0|        return NULL;
  804|       |
  805|      2|    drbg = OPENSSL_zalloc(sizeof(*drbg));
  ------------------
  |  |  113|      2|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  806|      2|    if (drbg == NULL)
  ------------------
  |  Branch (806:9): [True: 0, False: 2]
  ------------------
  807|      0|        return NULL;
  808|       |
  809|      2|    drbg->provctx = provctx;
  810|      2|    drbg->instantiate = instantiate;
  811|      2|    drbg->uninstantiate = uninstantiate;
  812|      2|    drbg->reseed = reseed;
  813|      2|    drbg->generate = generate;
  814|      2|    drbg->fork_id = openssl_get_fork_id();
  815|       |
  816|       |    /* Extract parent's functions */
  817|      2|    drbg->parent = parent;
  818|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_ENABLE_LOCKING)) != NULL)
  ------------------
  |  |  556|      2|#define OSSL_FUNC_RAND_ENABLE_LOCKING 8
  ------------------
  |  Branch (818:9): [True: 2, False: 0]
  ------------------
  819|      2|        drbg->parent_enable_locking = OSSL_FUNC_rand_enable_locking(pfunc);
  820|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_LOCK)) != NULL)
  ------------------
  |  |  557|      2|#define OSSL_FUNC_RAND_LOCK 9
  ------------------
  |  Branch (820:9): [True: 2, False: 0]
  ------------------
  821|      2|        drbg->parent_lock = OSSL_FUNC_rand_lock(pfunc);
  822|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_UNLOCK)) != NULL)
  ------------------
  |  |  558|      2|#define OSSL_FUNC_RAND_UNLOCK 10
  ------------------
  |  Branch (822:9): [True: 2, False: 0]
  ------------------
  823|      2|        drbg->parent_unlock = OSSL_FUNC_rand_unlock(pfunc);
  824|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_GET_CTX_PARAMS)) != NULL)
  ------------------
  |  |  563|      2|#define OSSL_FUNC_RAND_GET_CTX_PARAMS 15
  ------------------
  |  Branch (824:9): [True: 2, False: 0]
  ------------------
  825|      2|        drbg->parent_get_ctx_params = OSSL_FUNC_rand_get_ctx_params(pfunc);
  826|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_NONCE)) != NULL)
  ------------------
  |  |  555|      2|#define OSSL_FUNC_RAND_NONCE 7
  ------------------
  |  Branch (826:9): [True: 0, False: 2]
  ------------------
  827|      0|        drbg->parent_nonce = OSSL_FUNC_rand_nonce(pfunc);
  828|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_GET_SEED)) != NULL)
  ------------------
  |  |  566|      2|#define OSSL_FUNC_RAND_GET_SEED 18
  ------------------
  |  Branch (828:9): [True: 2, False: 0]
  ------------------
  829|      2|        drbg->parent_get_seed = OSSL_FUNC_rand_get_seed(pfunc);
  830|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_CLEAR_SEED)) != NULL)
  ------------------
  |  |  567|      2|#define OSSL_FUNC_RAND_CLEAR_SEED 19
  ------------------
  |  Branch (830:9): [True: 2, False: 0]
  ------------------
  831|      2|        drbg->parent_clear_seed = OSSL_FUNC_rand_clear_seed(pfunc);
  832|       |
  833|       |    /* Set some default maximums up */
  834|      2|    drbg->max_entropylen = DRBG_MAX_LENGTH;
  ------------------
  |  |   37|      2|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  835|      2|    drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   37|      2|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  836|      2|    drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   37|      2|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  837|      2|    drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   37|      2|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  838|      2|    drbg->generate_counter = 1;
  839|      2|    drbg->reseed_counter = 1;
  840|      2|    drbg->reseed_interval = RESEED_INTERVAL;
  ------------------
  |  |   27|      2|#define RESEED_INTERVAL (1 << 8)
  ------------------
  841|      2|    drbg->reseed_time_interval = TIME_INTERVAL;
  ------------------
  |  |   28|      2|#define TIME_INTERVAL (60 * 60) /* 1 hour */
  ------------------
  842|       |
  843|      2|    if (!dnew(drbg))
  ------------------
  |  Branch (843:9): [True: 0, False: 2]
  ------------------
  844|      0|        goto err;
  845|       |
  846|      2|    if (parent != NULL) {
  ------------------
  |  Branch (846:9): [True: 2, False: 0]
  ------------------
  847|      2|        if (!get_parent_strength(drbg, &p_str))
  ------------------
  |  Branch (847:13): [True: 0, False: 2]
  ------------------
  848|      0|            goto err;
  849|      2|        if (drbg->strength > p_str) {
  ------------------
  |  Branch (849:13): [True: 0, False: 2]
  ------------------
  850|       |            /*
  851|       |             * We currently don't support the algorithm from NIST SP 800-90C
  852|       |             * 10.1.2 to use a weaker DRBG as source
  853|       |             */
  854|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  855|      0|            goto err;
  856|      0|        }
  857|      2|    }
  858|       |#ifdef TSAN_REQUIRES_LOCKING
  859|       |    if (!ossl_drbg_enable_locking(drbg))
  860|       |        goto err;
  861|       |#endif
  862|      2|    return drbg;
  863|       |
  864|      0|err:
  865|      0|    dfree(drbg);
  866|       |    return NULL;
  867|      2|}
ossl_drbg_get_ctx_params:
  884|      4|{
  885|      4|    if (p->state != NULL && !OSSL_PARAM_set_int(p->state, drbg->state))
  ------------------
  |  Branch (885:9): [True: 1, False: 3]
  |  Branch (885:29): [True: 0, False: 1]
  ------------------
  886|      0|        return 0;
  887|       |
  888|      4|    if (p->str != NULL && !OSSL_PARAM_set_int(p->str, drbg->strength))
  ------------------
  |  Branch (888:9): [True: 3, False: 1]
  |  Branch (888:27): [True: 0, False: 3]
  ------------------
  889|      0|        return 0;
  890|       |
  891|      4|    if (p->minentlen != NULL
  ------------------
  |  Branch (891:9): [True: 0, False: 4]
  ------------------
  892|      0|        && !OSSL_PARAM_set_size_t(p->minentlen, drbg->min_entropylen))
  ------------------
  |  Branch (892:12): [True: 0, False: 0]
  ------------------
  893|      0|        return 0;
  894|       |
  895|      4|    if (p->maxentlen != NULL
  ------------------
  |  Branch (895:9): [True: 0, False: 4]
  ------------------
  896|      0|        && !OSSL_PARAM_set_size_t(p->maxentlen, drbg->max_entropylen))
  ------------------
  |  Branch (896:12): [True: 0, False: 0]
  ------------------
  897|      0|        return 0;
  898|       |
  899|      4|    if (p->minnonlen != NULL
  ------------------
  |  Branch (899:9): [True: 0, False: 4]
  ------------------
  900|      0|        && !OSSL_PARAM_set_size_t(p->minnonlen, drbg->min_noncelen))
  ------------------
  |  Branch (900:12): [True: 0, False: 0]
  ------------------
  901|      0|        return 0;
  902|       |
  903|      4|    if (p->maxnonlen != NULL
  ------------------
  |  Branch (903:9): [True: 0, False: 4]
  ------------------
  904|      0|        && !OSSL_PARAM_set_size_t(p->maxnonlen, drbg->max_noncelen))
  ------------------
  |  Branch (904:12): [True: 0, False: 0]
  ------------------
  905|      0|        return 0;
  906|       |
  907|      4|    if (p->maxperlen != NULL
  ------------------
  |  Branch (907:9): [True: 0, False: 4]
  ------------------
  908|      0|        && !OSSL_PARAM_set_size_t(p->maxperlen, drbg->max_perslen))
  ------------------
  |  Branch (908:12): [True: 0, False: 0]
  ------------------
  909|      0|        return 0;
  910|       |
  911|      4|    if (p->maxadlen != NULL
  ------------------
  |  Branch (911:9): [True: 0, False: 4]
  ------------------
  912|      0|        && !OSSL_PARAM_set_size_t(p->maxadlen, drbg->max_adinlen))
  ------------------
  |  Branch (912:12): [True: 0, False: 0]
  ------------------
  913|      0|        return 0;
  914|       |
  915|      4|    if (p->reseed_req != NULL
  ------------------
  |  Branch (915:9): [True: 0, False: 4]
  ------------------
  916|      0|        && !OSSL_PARAM_set_uint(p->reseed_req, drbg->reseed_interval))
  ------------------
  |  Branch (916:12): [True: 0, False: 0]
  ------------------
  917|      0|        return 0;
  918|       |
  919|      4|    if (p->reseed_time != NULL
  ------------------
  |  Branch (919:9): [True: 0, False: 4]
  ------------------
  920|      0|        && !OSSL_PARAM_set_time_t(p->reseed_time, drbg->reseed_time))
  ------------------
  |  Branch (920:12): [True: 0, False: 0]
  ------------------
  921|      0|        return 0;
  922|       |
  923|      4|    if (p->reseed_int != NULL
  ------------------
  |  Branch (923:9): [True: 0, False: 4]
  ------------------
  924|      0|        && !OSSL_PARAM_set_time_t(p->reseed_int, drbg->reseed_time_interval))
  ------------------
  |  Branch (924:12): [True: 0, False: 0]
  ------------------
  925|      0|        return 0;
  926|       |
  927|      4|    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(drbg, p->ind))
  ------------------
  |  |  172|      4|#define OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, params) 1
  ------------------
  |  Branch (927:9): [Folded, False: 4]
  ------------------
  928|      0|        return 0;
  929|       |
  930|      4|    return 1;
  931|      4|}
ossl_drbg_get_ctx_params_no_lock:
  940|      9|{
  941|      9|    size_t cnt = 0;
  942|       |
  943|       |    /* This value never changes once set */
  944|      9|    if (p->maxreq != NULL) {
  ------------------
  |  Branch (944:9): [True: 2, False: 7]
  ------------------
  945|      2|        if (!OSSL_PARAM_set_size_t(p->maxreq, drbg->max_request))
  ------------------
  |  Branch (945:13): [True: 0, False: 2]
  ------------------
  946|      0|            return 0;
  947|      2|        cnt++;
  948|      2|    }
  949|       |
  950|       |    /*
  951|       |     * Can be changed by multiple threads, but we tolerate inaccuracies in this
  952|       |     * value.
  953|       |     */
  954|      9|    if (p->reseed_cnt != NULL) {
  ------------------
  |  Branch (954:9): [True: 3, False: 6]
  ------------------
  955|      3|        if (!OSSL_PARAM_set_uint(p->reseed_cnt, tsan_load(&drbg->reseed_counter)))
  ------------------
  |  |   61|      3|#define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (955:13): [True: 0, False: 3]
  ------------------
  956|      0|            return 0;
  957|      3|        cnt++;
  958|      3|    }
  959|       |
  960|      9|    if (params[cnt].key == NULL)
  ------------------
  |  Branch (960:9): [True: 5, False: 4]
  ------------------
  961|      5|        *complete = 1;
  962|      4|    else
  963|      4|        *complete = 0;
  964|       |
  965|      9|    return 1;
  966|      9|}
ossl_drbg_set_ctx_params:
  970|      2|{
  971|      2|    if (p->reseed_req != NULL
  ------------------
  |  Branch (971:9): [True: 2, False: 0]
  ------------------
  972|      2|        && !OSSL_PARAM_get_uint(p->reseed_req, &drbg->reseed_interval))
  ------------------
  |  Branch (972:12): [True: 0, False: 2]
  ------------------
  973|      0|        return 0;
  974|       |
  975|      2|    if (p->reseed_time != NULL
  ------------------
  |  Branch (975:9): [True: 2, False: 0]
  ------------------
  976|      2|        && !OSSL_PARAM_get_time_t(p->reseed_time, &drbg->reseed_time_interval))
  ------------------
  |  Branch (976:12): [True: 0, False: 2]
  ------------------
  977|      0|        return 0;
  978|       |
  979|      2|    return 1;
  980|      2|}
drbg.c:get_entropy:
  195|      5|{
  196|      5|    size_t bytes;
  197|      5|    unsigned int p_str;
  198|       |
  199|      5|    if (drbg->parent == NULL)
  ------------------
  |  Branch (199:9): [True: 0, False: 5]
  ------------------
  200|       |        /*
  201|       |         * In normal use (i.e. OpenSSL's own uses), this is never called.
  202|       |         * This remains purely for legacy reasons.
  203|       |         */
  204|      0|        return ossl_prov_get_entropy(drbg->provctx, pout, entropy, min_len,
  205|      0|            max_len);
  206|       |
  207|      5|    if (drbg->parent_get_seed == NULL) {
  ------------------
  |  Branch (207:9): [True: 0, False: 5]
  ------------------
  208|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  209|      0|        return 0;
  210|      0|    }
  211|      5|    if (!get_parent_strength(drbg, &p_str))
  ------------------
  |  Branch (211:9): [True: 0, False: 5]
  ------------------
  212|      0|        return 0;
  213|      5|    if (drbg->strength > p_str) {
  ------------------
  |  Branch (213:9): [True: 0, False: 5]
  ------------------
  214|       |        /*
  215|       |         * We currently don't support the algorithm from NIST SP 800-90C
  216|       |         * 10.1.2 to use a weaker DRBG as source
  217|       |         */
  218|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  219|      0|        return 0;
  220|      0|    }
  221|       |
  222|       |    /*
  223|       |     * Our lock is already held, but we need to lock our parent before
  224|       |     * generating bits from it.  Note: taking the lock will be a no-op
  225|       |     * if locking is not required (while drbg->parent->lock == NULL).
  226|       |     */
  227|      5|    if (!ossl_drbg_lock_parent(drbg))
  ------------------
  |  Branch (227:9): [True: 0, False: 5]
  ------------------
  228|      0|        return 0;
  229|       |    /*
  230|       |     * Get random data from parent.  Include our DRBG address as
  231|       |     * additional input, in order to provide a distinction between
  232|       |     * different DRBG child instances.
  233|       |     *
  234|       |     * Note: using the sizeof() operator on a pointer triggers
  235|       |     *       a warning in some static code analyzers, but it's
  236|       |     *       intentional and correct here.
  237|       |     */
  238|      5|    bytes = drbg->parent_get_seed(drbg->parent, pout,
  239|      5|        entropy > 0 ? entropy : (int)drbg->strength,
  ------------------
  |  Branch (239:9): [True: 5, False: 0]
  ------------------
  240|      5|        min_len, max_len, prediction_resistance,
  241|      5|        (unsigned char *)&drbg, sizeof(drbg));
  242|      5|    ossl_drbg_unlock_parent(drbg);
  243|      5|    return bytes;
  244|      5|}
drbg.c:ossl_drbg_lock_parent:
   64|     24|{
   65|     24|    void *parent = drbg->parent;
   66|       |
   67|     24|    if (parent != NULL
  ------------------
  |  Branch (67:9): [True: 24, False: 0]
  ------------------
   68|     24|        && drbg->parent_lock != NULL
  ------------------
  |  Branch (68:12): [True: 24, False: 0]
  ------------------
   69|     24|        && !drbg->parent_lock(parent)) {
  ------------------
  |  Branch (69:12): [True: 0, False: 24]
  ------------------
   70|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   71|      0|        return 0;
   72|      0|    }
   73|     24|    return 1;
   74|     24|}
drbg.c:ossl_drbg_unlock_parent:
   77|     24|{
   78|     24|    void *parent = drbg->parent;
   79|       |
   80|     24|    if (parent != NULL && drbg->parent_unlock != NULL)
  ------------------
  |  Branch (80:9): [True: 24, False: 0]
  |  Branch (80:27): [True: 24, False: 0]
  ------------------
   81|     24|        drbg->parent_unlock(parent);
   82|     24|}
drbg.c:cleanup_entropy:
  247|      5|{
  248|      5|    if (drbg->parent == NULL) {
  ------------------
  |  Branch (248:9): [True: 0, False: 5]
  ------------------
  249|      0|        ossl_prov_cleanup_entropy(drbg->provctx, out, outlen);
  250|      5|    } else if (drbg->parent_clear_seed != NULL) {
  ------------------
  |  Branch (250:16): [True: 5, False: 0]
  ------------------
  251|      5|        if (!ossl_drbg_lock_parent(drbg))
  ------------------
  |  Branch (251:13): [True: 0, False: 5]
  ------------------
  252|      0|            return;
  253|      5|        drbg->parent_clear_seed(drbg->parent, out, outlen);
  254|      5|        ossl_drbg_unlock_parent(drbg);
  255|      5|    }
  256|      5|}
drbg.c:ossl_prov_drbg_reseed_unlocked:
  486|      3|{
  487|      3|    unsigned char *entropy = NULL;
  488|      3|    size_t entropylen = 0;
  489|       |
  490|      3|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (490:9): [True: 0, False: 3]
  ------------------
  491|      0|        return 0;
  492|       |
  493|      3|    if (drbg->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1331|      3|#define EVP_RAND_STATE_READY 1
  ------------------
  |  Branch (493:9): [True: 0, False: 3]
  ------------------
  494|       |        /* try to recover from previous errors */
  495|      0|        rand_drbg_restart(drbg);
  496|       |
  497|      0|        if (drbg->state == EVP_RAND_STATE_ERROR) {
  ------------------
  |  | 1332|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  |  Branch (497:13): [True: 0, False: 0]
  ------------------
  498|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  499|      0|            return 0;
  500|      0|        }
  501|      0|        if (drbg->state == EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1330|      0|#define EVP_RAND_STATE_UNINITIALISED 0
  ------------------
  |  Branch (501:13): [True: 0, False: 0]
  ------------------
  502|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_INSTANTIATED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  503|      0|            return 0;
  504|      0|        }
  505|      0|    }
  506|       |
  507|      3|    if (ent != NULL) {
  ------------------
  |  Branch (507:9): [True: 0, False: 3]
  ------------------
  508|      0|        if (ent_len < drbg->min_entropylen) {
  ------------------
  |  Branch (508:13): [True: 0, False: 0]
  ------------------
  509|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  510|      0|            drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1332|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  511|      0|            return 0;
  512|      0|        }
  513|      0|        if (ent_len > drbg->max_entropylen) {
  ------------------
  |  Branch (513:13): [True: 0, False: 0]
  ------------------
  514|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  515|      0|            drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1332|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  516|      0|            return 0;
  517|      0|        }
  518|      0|    }
  519|       |
  520|      3|    if (adin == NULL) {
  ------------------
  |  Branch (520:9): [True: 1, False: 2]
  ------------------
  521|      1|        adinlen = 0;
  522|      2|    } else if (adinlen > drbg->max_adinlen) {
  ------------------
  |  Branch (522:16): [True: 0, False: 2]
  ------------------
  523|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_TOO_LONG);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  524|      0|        return 0;
  525|      0|    }
  526|       |
  527|      3|    drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1332|      3|#define EVP_RAND_STATE_ERROR 2
  ------------------
  528|       |
  529|      3|    drbg->reseed_next_counter = tsan_load(&drbg->reseed_counter);
  ------------------
  |  |   61|      3|#define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  530|      3|    if (drbg->reseed_next_counter) {
  ------------------
  |  Branch (530:9): [True: 3, False: 0]
  ------------------
  531|      3|        drbg->reseed_next_counter++;
  532|      3|        if (!drbg->reseed_next_counter)
  ------------------
  |  Branch (532:13): [True: 0, False: 3]
  ------------------
  533|      0|            drbg->reseed_next_counter = 1;
  534|      3|    }
  535|       |
  536|      3|    if (ent != NULL) {
  ------------------
  |  Branch (536:9): [True: 0, False: 3]
  ------------------
  537|       |#ifdef FIPS_MODULE
  538|       |        /*
  539|       |         * NIST SP-800-90A mandates that entropy *shall not* be provided
  540|       |         * by the consuming application. Instead the data is added as additional
  541|       |         * input.
  542|       |         *
  543|       |         * (NIST SP-800-90Ar1, Sections 9.1 and 9.2)
  544|       |         */
  545|       |        if (!drbg->reseed(drbg, NULL, 0, ent, ent_len)) {
  546|       |            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED);
  547|       |            return 0;
  548|       |        }
  549|       |#else
  550|      0|        if (!drbg->reseed(drbg, ent, ent_len, adin, adinlen)) {
  ------------------
  |  Branch (550:13): [True: 0, False: 0]
  ------------------
  551|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  552|      0|            return 0;
  553|      0|        }
  554|       |        /* There isn't much point adding the same additional input twice */
  555|      0|        adin = NULL;
  556|      0|        adinlen = 0;
  557|      0|#endif
  558|      0|    }
  559|       |
  560|       |    /* Reseed using our sources in addition */
  561|      3|    entropylen = get_entropy(drbg, &entropy, drbg->strength,
  562|      3|        drbg->min_entropylen, drbg->max_entropylen,
  563|      3|        prediction_resistance);
  564|      3|    if (entropylen < drbg->min_entropylen
  ------------------
  |  Branch (564:9): [True: 0, False: 3]
  ------------------
  565|      3|        || entropylen > drbg->max_entropylen) {
  ------------------
  |  Branch (565:12): [True: 0, False: 3]
  ------------------
  566|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  567|      0|        goto end;
  568|      0|    }
  569|       |
  570|      3|    if (!drbg->reseed(drbg, entropy, entropylen, adin, adinlen))
  ------------------
  |  Branch (570:9): [True: 0, False: 3]
  ------------------
  571|      0|        goto end;
  572|       |
  573|      3|    drbg->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1331|      3|#define EVP_RAND_STATE_READY 1
  ------------------
  574|      3|    drbg->generate_counter = 1;
  575|      3|    drbg->reseed_time = time(NULL);
  576|      3|    tsan_store(&drbg->reseed_counter, drbg->reseed_next_counter);
  ------------------
  |  |   62|      3|#define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  577|      3|    if (drbg->parent != NULL)
  ------------------
  |  Branch (577:9): [True: 3, False: 0]
  ------------------
  578|      3|        drbg->parent_reseed_counter = get_parent_reseed_count(drbg);
  579|       |
  580|      3|end:
  581|      3|    cleanup_entropy(drbg, entropy, entropylen);
  582|      3|    if (drbg->state == EVP_RAND_STATE_READY)
  ------------------
  |  | 1331|      3|#define EVP_RAND_STATE_READY 1
  ------------------
  |  Branch (582:9): [True: 3, False: 0]
  ------------------
  583|      3|        return 1;
  584|      0|    return 0;
  585|      3|}
drbg.c:get_parent_reseed_count:
  110|      7|{
  111|      7|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      7|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      7|    { NULL, 0, NULL, 0, 0 }
  ------------------
  112|      7|    void *parent = drbg->parent;
  113|      7|    unsigned int r = 0;
  114|       |
  115|      7|    *params = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_COUNTER, &r);
  ------------------
  |  |  256|      7|# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
  ------------------
  116|      7|    if (!ossl_drbg_lock_parent(drbg)) {
  ------------------
  |  Branch (116:9): [True: 0, False: 7]
  ------------------
  117|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_PARENT);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  118|      0|        goto err;
  119|      0|    }
  120|      7|    if (!drbg->parent_get_ctx_params(parent, params))
  ------------------
  |  Branch (120:9): [True: 0, False: 7]
  ------------------
  121|      0|        r = 0;
  122|      7|    ossl_drbg_unlock_parent(drbg);
  123|      7|    return r;
  124|       |
  125|      0|err:
  126|      0|    r = tsan_load(&drbg->reseed_counter) - 2;
  ------------------
  |  |   61|      0|#define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  127|      0|    if (r == 0)
  ------------------
  |  Branch (127:9): [True: 0, False: 0]
  ------------------
  128|      0|        r = UINT_MAX;
  129|      0|    return r;
  130|      7|}
drbg.c:find_call:
  748|     14|{
  749|     14|    if (dispatch != NULL)
  ------------------
  |  Branch (749:9): [True: 14, False: 0]
  ------------------
  750|    162|        while (dispatch->function_id != 0) {
  ------------------
  |  Branch (750:16): [True: 160, False: 2]
  ------------------
  751|    160|            if (dispatch->function_id == function)
  ------------------
  |  Branch (751:17): [True: 12, False: 148]
  ------------------
  752|     12|                return dispatch;
  753|    148|            dispatch++;
  754|    148|        }
  755|      2|    return NULL;
  756|     14|}
drbg.c:get_parent_strength:
   85|      7|{
   86|      7|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      7|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      7|    { NULL, 0, NULL, 0, 0 }
  ------------------
   87|      7|    void *parent = drbg->parent;
   88|      7|    int res;
   89|       |
   90|      7|    if (drbg->parent_get_ctx_params == NULL) {
  ------------------
  |  Branch (90:9): [True: 0, False: 7]
  ------------------
   91|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   92|      0|        return 0;
   93|      0|    }
   94|       |
   95|      7|    *params = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH, str);
  ------------------
  |  |  559|      7|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
   96|      7|    if (!ossl_drbg_lock_parent(drbg)) {
  ------------------
  |  Branch (96:9): [True: 0, False: 7]
  ------------------
   97|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_PARENT);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        return 0;
   99|      0|    }
  100|      7|    res = drbg->parent_get_ctx_params(parent, params);
  101|      7|    ossl_drbg_unlock_parent(drbg);
  102|      7|    if (!res) {
  ------------------
  |  Branch (102:9): [True: 0, False: 7]
  ------------------
  103|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  104|      0|        return 0;
  105|      0|    }
  106|      7|    return 1;
  107|      7|}

drbg_ctr.c:drbg_ctr_new_wrapper:
  661|      2|{
  662|       |#ifdef FIPS_MODULE
  663|       |    if (!ossl_deferred_self_test(PROV_LIBCTX_OF(provctx),
  664|       |            ST_ID_DRBG_CTR))
  665|       |        return NULL;
  666|       |#endif
  667|       |
  668|      2|    return ossl_rand_drbg_new(provctx, parent, parent_dispatch,
  669|      2|        &drbg_ctr_new, &drbg_ctr_free,
  670|      2|        &drbg_ctr_instantiate, &drbg_ctr_uninstantiate,
  671|      2|        &drbg_ctr_reseed, &drbg_ctr_generate);
  672|      2|}
drbg_ctr.c:drbg_ctr_new:
  646|      2|{
  647|      2|    PROV_DRBG_CTR *ctr;
  648|       |
  649|      2|    ctr = OPENSSL_secure_zalloc(sizeof(*ctr));
  ------------------
  |  |  146|      2|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  650|      2|    if (ctr == NULL)
  ------------------
  |  Branch (650:9): [True: 0, False: 2]
  ------------------
  651|      0|        return 0;
  652|       |
  653|      2|    ctr->use_df = 1;
  654|      2|    drbg->data = ctr;
  655|      2|    OSSL_FIPS_IND_INIT(drbg)
  656|      2|    return drbg_ctr_init_lengths(drbg);
  657|      2|}
drbg_ctr.c:drbg_ctr_init_lengths:
  540|      4|{
  541|      4|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  542|      4|    int res = 1;
  543|       |
  544|       |    /* Maximum number of bits per request = 2^19  = 2^16 bytes */
  545|      4|    drbg->max_request = 1 << 16;
  546|      4|    if (ctr->use_df) {
  ------------------
  |  Branch (546:9): [True: 4, False: 0]
  ------------------
  547|      4|        drbg->min_entropylen = 0;
  548|      4|        drbg->max_entropylen = DRBG_MAX_LENGTH;
  ------------------
  |  |   37|      4|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  549|      4|        drbg->min_noncelen = 0;
  550|      4|        drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   37|      4|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  551|      4|        drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   37|      4|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  552|      4|        drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   37|      4|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  553|       |
  554|      4|        if (ctr->keylen > 0) {
  ------------------
  |  Branch (554:13): [True: 2, False: 2]
  ------------------
  555|      2|            drbg->min_entropylen = ctr->keylen;
  556|      2|            drbg->min_noncelen = drbg->min_entropylen / 2;
  557|      2|        }
  558|      4|    } else {
  559|      0|        const size_t len = ctr->keylen > 0 ? drbg->seedlen : DRBG_MAX_LENGTH;
  ------------------
  |  |   37|      0|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  |  Branch (559:28): [True: 0, False: 0]
  ------------------
  560|       |
  561|      0|        drbg->min_entropylen = len;
  562|      0|        drbg->max_entropylen = len;
  563|       |        /* Nonce not used */
  564|      0|        drbg->min_noncelen = 0;
  565|      0|        drbg->max_noncelen = 0;
  566|      0|        drbg->max_perslen = len;
  567|      0|        drbg->max_adinlen = len;
  568|      0|    }
  569|      4|    return res;
  570|      4|}
drbg_ctr.c:drbg_ctr_instantiate:
  323|      2|{
  324|      2|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  325|       |
  326|      2|    if (entropy == NULL)
  ------------------
  |  Branch (326:9): [True: 0, False: 2]
  ------------------
  327|      0|        return 0;
  328|       |
  329|      2|    memset(ctr->K, 0, sizeof(ctr->K));
  330|      2|    memset(ctr->V, 0, sizeof(ctr->V));
  331|      2|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (331:9): [True: 0, False: 2]
  ------------------
  332|      0|        return 0;
  333|       |
  334|      2|    inc_128(ctr);
  335|      2|    if (!ctr_update(drbg, entropy, entropylen, pers, perslen, nonce, noncelen))
  ------------------
  |  Branch (335:9): [True: 0, False: 2]
  ------------------
  336|      0|        return 0;
  337|      2|    return 1;
  338|      2|}
drbg_ctr.c:inc_128:
   72|     33|{
   73|     33|    unsigned char *p = &ctr->V[0];
   74|     33|    uint32_t n = 16, c = 1;
   75|       |
   76|    528|    do {
   77|    528|        --n;
   78|    528|        c += p[n];
   79|    528|        p[n] = (uint8_t)c;
   80|    528|        c >>= 8;
   81|    528|    } while (n);
  ------------------
  |  Branch (81:14): [True: 495, False: 33]
  ------------------
   82|     33|}
drbg_ctr.c:ctr_update:
  277|     11|{
  278|     11|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  279|     11|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|     11|#define AES_BLOCK_SIZE 16
  ------------------
  280|     11|    unsigned char V_tmp[48], out[48];
  281|     11|    unsigned char len;
  282|       |
  283|       |    /* correct key is already set up. */
  284|     11|    memcpy(V_tmp, ctr->V, 16);
  285|     11|    inc_128(ctr);
  286|     11|    memcpy(V_tmp + 16, ctr->V, 16);
  287|     11|    if (ctr->keylen == 16) {
  ------------------
  |  Branch (287:9): [True: 0, False: 11]
  ------------------
  288|      0|        len = 32;
  289|     11|    } else {
  290|     11|        inc_128(ctr);
  291|     11|        memcpy(V_tmp + 32, ctr->V, 16);
  292|     11|        len = 48;
  293|     11|    }
  294|     11|    if (!EVP_CipherUpdate(ctr->ctx_ecb, out, &outlen, V_tmp, len)
  ------------------
  |  Branch (294:9): [True: 0, False: 11]
  ------------------
  295|     11|        || outlen != len)
  ------------------
  |  Branch (295:12): [True: 0, False: 11]
  ------------------
  296|      0|        return 0;
  297|     11|    memcpy(ctr->K, out, ctr->keylen);
  298|     11|    memcpy(ctr->V, out + ctr->keylen, 16);
  299|       |
  300|     11|    if (ctr->use_df) {
  ------------------
  |  Branch (300:9): [True: 11, False: 0]
  ------------------
  301|       |        /* If no input reuse existing derived value */
  302|     11|        if (in1 != NULL || nonce != NULL || in2 != NULL)
  ------------------
  |  Branch (302:13): [True: 7, False: 4]
  |  Branch (302:28): [True: 0, False: 4]
  |  Branch (302:45): [True: 0, False: 4]
  ------------------
  303|      7|            if (!ctr_df(ctr, in1, in1len, nonce, noncelen, in2, in2len))
  ------------------
  |  Branch (303:17): [True: 0, False: 7]
  ------------------
  304|      0|                return 0;
  305|       |        /* If this a reuse input in1len != 0 */
  306|     11|        if (in1len)
  ------------------
  |  Branch (306:13): [True: 9, False: 2]
  ------------------
  307|      9|            ctr_XOR(ctr, ctr->KX, drbg->seedlen);
  308|     11|    } else {
  309|      0|        ctr_XOR(ctr, in1, in1len);
  310|      0|        ctr_XOR(ctr, in2, in2len);
  311|      0|    }
  312|       |
  313|     11|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1)
  ------------------
  |  Branch (313:9): [True: 0, False: 11]
  ------------------
  314|     11|        || !EVP_CipherInit_ex(ctr->ctx_ctr, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (314:12): [True: 0, False: 11]
  ------------------
  315|      0|        return 0;
  316|     11|    return 1;
  317|     11|}
drbg_ctr.c:ctr_df:
  214|      7|{
  215|      7|    static unsigned char c80 = 0x80;
  216|      7|    size_t inlen;
  217|      7|    unsigned char *p = ctr->bltmp;
  218|      7|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|      7|#define AES_BLOCK_SIZE 16
  ------------------
  219|       |
  220|      7|    if (!ctr_BCC_init(ctr))
  ------------------
  |  Branch (220:9): [True: 0, False: 7]
  ------------------
  221|      0|        return 0;
  222|      7|    if (in1 == NULL)
  ------------------
  |  Branch (222:9): [True: 0, False: 7]
  ------------------
  223|      0|        in1len = 0;
  224|      7|    if (in2 == NULL)
  ------------------
  |  Branch (224:9): [True: 7, False: 0]
  ------------------
  225|      7|        in2len = 0;
  226|      7|    if (in3 == NULL)
  ------------------
  |  Branch (226:9): [True: 3, False: 4]
  ------------------
  227|      3|        in3len = 0;
  228|      7|    inlen = in1len + in2len + in3len;
  229|       |    /* Initialise L||N in temporary block */
  230|      7|    *p++ = (inlen >> 24) & 0xff;
  231|      7|    *p++ = (inlen >> 16) & 0xff;
  232|      7|    *p++ = (inlen >> 8) & 0xff;
  233|      7|    *p++ = inlen & 0xff;
  234|       |
  235|       |    /* NB keylen is at most 32 bytes */
  236|      7|    *p++ = 0;
  237|      7|    *p++ = 0;
  238|      7|    *p++ = 0;
  239|      7|    *p = (unsigned char)((ctr->keylen + 16) & 0xff);
  240|      7|    ctr->bltmp_pos = 8;
  241|      7|    if (!ctr_BCC_update(ctr, in1, in1len)
  ------------------
  |  Branch (241:9): [True: 0, False: 7]
  ------------------
  242|      7|        || !ctr_BCC_update(ctr, in2, in2len)
  ------------------
  |  Branch (242:12): [True: 0, False: 7]
  ------------------
  243|      7|        || !ctr_BCC_update(ctr, in3, in3len)
  ------------------
  |  Branch (243:12): [True: 0, False: 7]
  ------------------
  244|      7|        || !ctr_BCC_update(ctr, &c80, 1)
  ------------------
  |  Branch (244:12): [True: 0, False: 7]
  ------------------
  245|      7|        || !ctr_BCC_final(ctr))
  ------------------
  |  Branch (245:12): [True: 0, False: 7]
  ------------------
  246|      0|        return 0;
  247|       |    /* Set up key K */
  248|      7|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->KX, NULL, -1))
  ------------------
  |  Branch (248:9): [True: 0, False: 7]
  ------------------
  249|      0|        return 0;
  250|       |    /* X follows key K */
  251|      7|    if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX, &outlen, ctr->KX + ctr->keylen,
  ------------------
  |  Branch (251:9): [True: 0, False: 7]
  ------------------
  252|      7|            AES_BLOCK_SIZE)
  ------------------
  |  |   26|      7|#define AES_BLOCK_SIZE 16
  ------------------
  253|      7|        || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      7|#define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (253:12): [True: 0, False: 7]
  ------------------
  254|      0|        return 0;
  255|      7|    if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 16, &outlen, ctr->KX,
  ------------------
  |  Branch (255:9): [True: 0, False: 7]
  ------------------
  256|      7|            AES_BLOCK_SIZE)
  ------------------
  |  |   26|      7|#define AES_BLOCK_SIZE 16
  ------------------
  257|      7|        || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      7|#define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (257:12): [True: 0, False: 7]
  ------------------
  258|      0|        return 0;
  259|      7|    if (ctr->keylen != 16)
  ------------------
  |  Branch (259:9): [True: 7, False: 0]
  ------------------
  260|      7|        if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 32, &outlen,
  ------------------
  |  Branch (260:13): [True: 0, False: 7]
  ------------------
  261|      7|                ctr->KX + 16, AES_BLOCK_SIZE)
  ------------------
  |  |   26|      7|#define AES_BLOCK_SIZE 16
  ------------------
  262|      7|            || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      7|#define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (262:16): [True: 0, False: 7]
  ------------------
  263|      0|            return 0;
  264|      7|    return 1;
  265|      7|}
drbg_ctr.c:ctr_BCC_init:
  151|      7|{
  152|      7|    unsigned char bltmp[48] = { 0 };
  153|      7|    unsigned char num_of_blk;
  154|       |
  155|      7|    memset(ctr->KX, 0, 48);
  156|      7|    num_of_blk = ctr->keylen == 16 ? 2 : 3;
  ------------------
  |  Branch (156:18): [True: 0, False: 7]
  ------------------
  157|      7|    bltmp[(AES_BLOCK_SIZE * 1) + 3] = 1;
  ------------------
  |  |   26|      7|#define AES_BLOCK_SIZE 16
  ------------------
  158|      7|    bltmp[(AES_BLOCK_SIZE * 2) + 3] = 2;
  ------------------
  |  |   26|      7|#define AES_BLOCK_SIZE 16
  ------------------
  159|      7|    return ctr_BCC_block(ctr, ctr->KX, bltmp, num_of_blk * AES_BLOCK_SIZE);
  ------------------
  |  |   26|      7|#define AES_BLOCK_SIZE 16
  ------------------
  160|      7|}
drbg_ctr.c:ctr_BCC_block:
  117|     35|{
  118|     35|    int i, outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|     35|#define AES_BLOCK_SIZE 16
  ------------------
  119|       |
  120|  1.71k|    for (i = 0; i < len; i++)
  ------------------
  |  Branch (120:17): [True: 1.68k, False: 35]
  ------------------
  121|  1.68k|        out[i] ^= in[i];
  122|       |
  123|     35|    if (!EVP_CipherUpdate(ctr->ctx_df, out, &outlen, out, len)
  ------------------
  |  Branch (123:9): [True: 0, False: 35]
  ------------------
  124|     35|        || outlen != len)
  ------------------
  |  Branch (124:12): [True: 0, False: 35]
  ------------------
  125|      0|        return 0;
  126|     35|    return 1;
  127|     35|}
drbg_ctr.c:ctr_BCC_update:
  167|     28|{
  168|     28|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (168:9): [True: 10, False: 18]
  |  Branch (168:23): [True: 0, False: 18]
  ------------------
  169|     10|        return 1;
  170|       |
  171|       |    /* If we have partial block handle it first */
  172|     18|    if (ctr->bltmp_pos) {
  ------------------
  |  Branch (172:9): [True: 15, False: 3]
  ------------------
  173|     15|        size_t left = 16 - ctr->bltmp_pos;
  174|       |
  175|       |        /* If we now have a complete block process it */
  176|     15|        if (inlen >= left) {
  ------------------
  |  Branch (176:13): [True: 11, False: 4]
  ------------------
  177|     11|            memcpy(ctr->bltmp + ctr->bltmp_pos, in, left);
  178|     11|            if (!ctr_BCC_blocks(ctr, ctr->bltmp))
  ------------------
  |  Branch (178:17): [True: 0, False: 11]
  ------------------
  179|      0|                return 0;
  180|     11|            ctr->bltmp_pos = 0;
  181|     11|            inlen -= left;
  182|     11|            in += left;
  183|     11|        }
  184|     15|    }
  185|       |
  186|       |    /* Process zero or more complete blocks */
  187|     28|    for (; inlen >= 16; in += 16, inlen -= 16) {
  ------------------
  |  Branch (187:12): [True: 10, False: 18]
  ------------------
  188|     10|        if (!ctr_BCC_blocks(ctr, in))
  ------------------
  |  Branch (188:13): [True: 0, False: 10]
  ------------------
  189|      0|            return 0;
  190|     10|    }
  191|       |
  192|       |    /* Copy any remaining partial block to the temporary buffer */
  193|     18|    if (inlen > 0) {
  ------------------
  |  Branch (193:9): [True: 15, False: 3]
  ------------------
  194|     15|        memcpy(ctr->bltmp + ctr->bltmp_pos, in, inlen);
  195|     15|        ctr->bltmp_pos += inlen;
  196|     15|    }
  197|     18|    return 1;
  198|     18|}
drbg_ctr.c:ctr_BCC_blocks:
  133|     28|{
  134|     28|    unsigned char in_tmp[48];
  135|     28|    unsigned char num_of_blk = 2;
  136|       |
  137|     28|    memcpy(in_tmp, in, 16);
  138|     28|    memcpy(in_tmp + 16, in, 16);
  139|     28|    if (ctr->keylen != 16) {
  ------------------
  |  Branch (139:9): [True: 28, False: 0]
  ------------------
  140|     28|        memcpy(in_tmp + 32, in, 16);
  141|     28|        num_of_blk = 3;
  142|     28|    }
  143|     28|    return ctr_BCC_block(ctr, ctr->KX, in_tmp, AES_BLOCK_SIZE * num_of_blk);
  ------------------
  |  |   26|     28|#define AES_BLOCK_SIZE 16
  ------------------
  144|     28|}
drbg_ctr.c:ctr_BCC_final:
  201|      7|{
  202|      7|    if (ctr->bltmp_pos) {
  ------------------
  |  Branch (202:9): [True: 7, False: 0]
  ------------------
  203|      7|        memset(ctr->bltmp + ctr->bltmp_pos, 0, 16 - ctr->bltmp_pos);
  204|      7|        if (!ctr_BCC_blocks(ctr, ctr->bltmp))
  ------------------
  |  Branch (204:13): [True: 0, False: 7]
  ------------------
  205|      0|            return 0;
  206|      7|    }
  207|      7|    return 1;
  208|      7|}
drbg_ctr.c:ctr_XOR:
   85|      9|{
   86|      9|    size_t i, n;
   87|       |
   88|      9|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (88:9): [True: 0, False: 9]
  |  Branch (88:23): [True: 0, False: 9]
  ------------------
   89|      0|        return;
   90|       |
   91|       |    /*
   92|       |     * Any zero padding will have no effect on the result as we
   93|       |     * are XORing. So just process however much input we have.
   94|       |     */
   95|      9|    n = inlen < ctr->keylen ? inlen : ctr->keylen;
  ------------------
  |  Branch (95:9): [True: 0, False: 9]
  ------------------
   96|      9|    if (!ossl_assert(n <= sizeof(ctr->K)))
  ------------------
  |  |   45|      9|#define ossl_assert(x) ossl_likely((x) != 0)
  |  |  ------------------
  |  |  |  |   23|      9|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  ------------------
  |  Branch (96:9): [True: 0, False: 9]
  ------------------
   97|      0|        return;
   98|    297|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (98:17): [True: 288, False: 9]
  ------------------
   99|    288|        ctr->K[i] ^= in[i];
  100|      9|    if (inlen <= ctr->keylen)
  ------------------
  |  Branch (100:9): [True: 0, False: 9]
  ------------------
  101|      0|        return;
  102|       |
  103|      9|    n = inlen - ctr->keylen;
  104|      9|    if (n > 16) {
  ------------------
  |  Branch (104:9): [True: 0, False: 9]
  ------------------
  105|       |        /* Should never happen */
  106|      0|        n = 16;
  107|      0|    }
  108|    153|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (108:17): [True: 144, False: 9]
  ------------------
  109|    144|        ctr->V[i] ^= in[i + ctr->keylen];
  110|      9|}
drbg_ctr.c:drbg_ctr_reseed:
  370|      3|{
  371|      3|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  372|       |
  373|      3|    if (entropy == NULL)
  ------------------
  |  Branch (373:9): [True: 0, False: 3]
  ------------------
  374|      0|        return 0;
  375|       |
  376|      3|    inc_128(ctr);
  377|      3|    if (!ctr_update(drbg, entropy, entropylen, adin, adinlen, NULL, 0))
  ------------------
  |  Branch (377:9): [True: 0, False: 3]
  ------------------
  378|      0|        return 0;
  379|      3|    return 1;
  380|      3|}
drbg_ctr.c:drbg_ctr_generate:
  407|      4|{
  408|      4|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  409|      4|    unsigned int ctr32, blocks;
  410|      4|    int outl, buflen;
  411|       |
  412|      4|    if (adin != NULL && adinlen != 0) {
  ------------------
  |  Branch (412:9): [True: 2, False: 2]
  |  Branch (412:25): [True: 2, False: 0]
  ------------------
  413|      2|        inc_128(ctr);
  414|       |
  415|      2|        if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (415:13): [True: 0, False: 2]
  ------------------
  416|      0|            return 0;
  417|       |        /* This means we reuse derived value */
  418|      2|        if (ctr->use_df) {
  ------------------
  |  Branch (418:13): [True: 2, False: 0]
  ------------------
  419|      2|            adin = NULL;
  420|      2|            adinlen = 1;
  421|      2|        }
  422|      2|    } else {
  423|      2|        adinlen = 0;
  424|      2|    }
  425|       |
  426|      4|    inc_128(ctr);
  427|       |
  428|      4|    if (outlen == 0) {
  ------------------
  |  Branch (428:9): [True: 0, False: 4]
  ------------------
  429|      0|        inc_128(ctr);
  430|       |
  431|      0|        if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            return 0;
  433|      0|        return 1;
  434|      0|    }
  435|       |
  436|      4|    memset(out, 0, outlen);
  437|       |
  438|      4|    do {
  439|      4|        if (!EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (439:13): [True: 0, False: 4]
  ------------------
  440|      4|                NULL, NULL, NULL, ctr->V, -1))
  441|      0|            return 0;
  442|       |
  443|       |        /*-
  444|       |         * outlen has type size_t while EVP_CipherUpdate takes an
  445|       |         * int argument and thus cannot be guaranteed to process more
  446|       |         * than 2^31-1 bytes at a time. We process such huge generate
  447|       |         * requests in 2^30 byte chunks, which is the greatest multiple
  448|       |         * of AES block size lower than or equal to 2^31-1.
  449|       |         */
  450|      4|        buflen = outlen > (1U << 30) ? (1 << 30) : (int)outlen;
  ------------------
  |  Branch (450:18): [True: 0, False: 4]
  ------------------
  451|      4|        blocks = (buflen + 15) / 16;
  452|       |
  453|      4|        ctr32 = GETU32(ctr->V + 12) + blocks;
  ------------------
  |  |   94|      4|#define GETU32(p) BSWAP4(*(const uint32_t *)(p))
  |  |  ------------------
  |  |  |  |   39|      4|#define BSWAP4(x) ({ uint32_t ret_=(x);                   \
  |  |  |  |   40|      4|                        asm ("bswapl %0"                \
  |  |  |  |   41|      4|                        : "+r"(ret_));   ret_; })
  |  |  ------------------
  ------------------
  454|      4|        if (ctr32 < blocks) {
  ------------------
  |  Branch (454:13): [True: 0, False: 4]
  ------------------
  455|       |            /* 32-bit counter overflow into V. */
  456|      0|            if (ctr32 != 0) {
  ------------------
  |  Branch (456:17): [True: 0, False: 0]
  ------------------
  457|      0|                blocks -= ctr32;
  458|      0|                buflen = blocks * 16;
  459|      0|                ctr32 = 0;
  460|      0|            }
  461|      0|            ctr96_inc(ctr->V);
  462|      0|        }
  463|      4|        PUTU32(ctr->V + 12, ctr32);
  ------------------
  |  |   95|      4|#define PUTU32(p, v) *(uint32_t *)(p) = BSWAP4(v)
  |  |  ------------------
  |  |  |  |   39|      4|#define BSWAP4(x) ({ uint32_t ret_=(x);                   \
  |  |  |  |   40|      4|                        asm ("bswapl %0"                \
  |  |  |  |   41|      4|                        : "+r"(ret_));   ret_; })
  |  |  ------------------
  ------------------
  464|       |
  465|      4|        if (!EVP_CipherUpdate(ctr->ctx_ctr, out, &outl, out, buflen)
  ------------------
  |  Branch (465:13): [True: 0, False: 4]
  ------------------
  466|      4|            || outl != buflen)
  ------------------
  |  Branch (466:16): [True: 0, False: 4]
  ------------------
  467|      0|            return 0;
  468|       |
  469|      4|        out += buflen;
  470|      4|        outlen -= buflen;
  471|      4|    } while (outlen);
  ------------------
  |  Branch (471:14): [True: 0, False: 4]
  ------------------
  472|       |
  473|      4|    if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (473:9): [True: 0, False: 4]
  ------------------
  474|      0|        return 0;
  475|      4|    return 1;
  476|      4|}
drbg_ctr.c:drbg_ctr_instantiate_wrapper:
  345|      2|{
  346|      2|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  347|      2|    struct drbg_set_ctx_params_st p;
  348|      2|    int ret = 0;
  349|       |
  350|      2|    if (drbg == NULL || !drbg_ctr_set_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (350:9): [True: 0, False: 2]
  |  Branch (350:25): [True: 0, False: 2]
  ------------------
  351|      0|        return 0;
  352|       |
  353|      2|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (353:9): [True: 0, False: 2]
  |  Branch (353:31): [True: 0, False: 0]
  ------------------
  354|      0|        return 0;
  355|       |
  356|      2|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (356:9): [True: 0, False: 2]
  ------------------
  357|      2|        || !drbg_ctr_set_ctx_params_locked(drbg, &p))
  ------------------
  |  Branch (357:12): [True: 0, False: 2]
  ------------------
  358|      0|        goto err;
  359|      2|    ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
  360|      2|        pstr, pstr_len);
  361|      2|err:
  362|      2|    if (drbg->lock != NULL)
  ------------------
  |  Branch (362:9): [True: 0, False: 2]
  ------------------
  363|      0|        CRYPTO_THREAD_unlock(drbg->lock);
  364|      2|    return ret;
  365|      2|}
drbg_ctr.c:drbg_ctr_set_ctx_params_locked:
  738|      2|{
  739|      2|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)ctx->data;
  740|      2|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
  ------------------
  |  |   31|      2|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  741|      2|    char *ecb;
  742|      2|    const char *propquery = NULL;
  743|      2|    int i, cipher_init = 0;
  744|       |
  745|      2|    if (p->df != NULL && OSSL_PARAM_get_int(p->df, &i)) {
  ------------------
  |  Branch (745:9): [True: 2, False: 0]
  |  Branch (745:26): [True: 2, False: 0]
  ------------------
  746|       |        /* FIPS errors out in the drbg_ctr_init() call later */
  747|      2|        ctr->use_df = i != 0;
  748|      2|        cipher_init = 1;
  749|      2|    }
  750|       |
  751|      2|#ifndef FIPS_MODULE
  752|      2|    propquery = "provider=default";
  753|      2|    if (p->propq != NULL
  ------------------
  |  Branch (753:9): [True: 0, False: 2]
  ------------------
  754|      0|        && p->propq->data_type == OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (754:12): [True: 0, False: 0]
  ------------------
  755|      0|        propquery = (const char *)p->propq->data;
  756|      2|#endif
  757|       |
  758|      2|    if (p->cipher != NULL) {
  ------------------
  |  Branch (758:9): [True: 2, False: 0]
  ------------------
  759|      2|        const char *base = (const char *)p->cipher->data;
  760|      2|        size_t ctr_str_len = sizeof("CTR") - 1;
  761|      2|        size_t ecb_str_len = sizeof("ECB") - 1;
  762|       |
  763|      2|        if (p->cipher->data_type != OSSL_PARAM_UTF8_STRING
  ------------------
  |  |  117|      4|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (763:13): [True: 0, False: 2]
  ------------------
  764|      2|            || p->cipher->data_size < ctr_str_len) {
  ------------------
  |  Branch (764:16): [True: 0, False: 2]
  ------------------
  765|      0|            return 0;
  766|      0|        }
  767|      2|        if (OPENSSL_strcasecmp("CTR", base + p->cipher->data_size - ctr_str_len) != 0) {
  ------------------
  |  Branch (767:13): [True: 0, False: 2]
  ------------------
  768|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_REQUIRE_CTR_MODE_CIPHER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  769|      0|            return 0;
  770|      0|        }
  771|      2|        if ((ecb = OPENSSL_strndup(base, p->cipher->data_size)) == NULL) {
  ------------------
  |  |  142|      2|    CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (771:13): [True: 0, False: 2]
  ------------------
  772|      0|            return 0;
  773|      0|        }
  774|      2|        strcpy(ecb + p->cipher->data_size - ecb_str_len, "ECB");
  775|      2|        EVP_CIPHER_free(ctr->cipher_ecb);
  776|      2|        EVP_CIPHER_free(ctr->cipher_ctr);
  777|      2|        ctr->cipher_ctr = NULL;
  778|      2|        ctr->cipher_ecb = NULL;
  779|       |        /*
  780|       |         * Try to fetch algorithms from our own provider code, fallback
  781|       |         * to generic fetch only if that fails
  782|       |         */
  783|      2|        ctr->cipher_ctr = EVP_CIPHER_fetch(libctx, base, propquery);
  784|      2|        ctr->cipher_ecb = EVP_CIPHER_fetch(libctx, ecb, propquery);
  785|      2|        OPENSSL_free(ecb);
  ------------------
  |  |  136|      2|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  786|      2|        if (ctr->cipher_ctr == NULL || ctr->cipher_ecb == NULL) {
  ------------------
  |  Branch (786:13): [True: 0, False: 2]
  |  Branch (786:40): [True: 0, False: 2]
  ------------------
  787|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_FIND_CIPHERS);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  788|      0|            return 0;
  789|      0|        }
  790|      2|        cipher_init = 1;
  791|      2|    }
  792|       |
  793|      2|    if (cipher_init && !drbg_ctr_init(ctx))
  ------------------
  |  Branch (793:9): [True: 2, False: 0]
  |  Branch (793:24): [True: 0, False: 2]
  ------------------
  794|      0|        return 0;
  795|       |
  796|      2|    return ossl_drbg_set_ctx_params(ctx, p);
  797|      2|}
drbg_ctr.c:drbg_ctr_init:
  573|      2|{
  574|      2|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  575|      2|    size_t keylen;
  576|       |
  577|      2|    if (ctr->cipher_ctr == NULL) {
  ------------------
  |  Branch (577:9): [True: 0, False: 2]
  ------------------
  578|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_CIPHER);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  579|      0|        return 0;
  580|      0|    }
  581|      2|    ctr->keylen = keylen = EVP_CIPHER_get_key_length(ctr->cipher_ctr);
  582|      2|    if (ctr->ctx_ecb == NULL)
  ------------------
  |  Branch (582:9): [True: 2, False: 0]
  ------------------
  583|      2|        ctr->ctx_ecb = EVP_CIPHER_CTX_new();
  584|      2|    if (ctr->ctx_ctr == NULL)
  ------------------
  |  Branch (584:9): [True: 2, False: 0]
  ------------------
  585|      2|        ctr->ctx_ctr = EVP_CIPHER_CTX_new();
  586|      2|    if (ctr->ctx_ecb == NULL || ctr->ctx_ctr == NULL) {
  ------------------
  |  Branch (586:9): [True: 0, False: 2]
  |  Branch (586:33): [True: 0, False: 2]
  ------------------
  587|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_EVP_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  588|      0|        goto err;
  589|      0|    }
  590|       |
  591|      2|    if (!EVP_CipherInit_ex(ctr->ctx_ecb,
  ------------------
  |  Branch (591:9): [True: 0, False: 2]
  ------------------
  592|      2|            ctr->cipher_ecb, NULL, NULL, NULL, 1)
  593|      2|        || !EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (593:12): [True: 0, False: 2]
  ------------------
  594|      2|            ctr->cipher_ctr, NULL, NULL, NULL, 1)) {
  595|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_INITIALISE_CIPHERS);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  596|      0|        goto err;
  597|      0|    }
  598|       |
  599|      2|    drbg->strength = (unsigned int)(keylen * 8);
  600|      2|    drbg->seedlen = keylen + 16;
  601|       |
  602|       |#ifdef FIPS_MODULE
  603|       |    /*
  604|       |     * FIPS requires that we use a derivation function since our
  605|       |     * entropy source is outside the fips boundary
  606|       |     */
  607|       |    if (ctr->use_df == 0) {
  608|       |        ERR_raise_data(ERR_LIB_PROV, PROV_R_DERIVATION_FUNCTION_INIT_FAILED,
  609|       |            "FIPS requires the use of a derivation function");
  610|       |        goto err;
  611|       |    }
  612|       |#endif
  613|       |
  614|      2|    if (ctr->use_df) {
  ------------------
  |  Branch (614:9): [True: 2, False: 0]
  ------------------
  615|       |        /* df initialisation */
  616|      2|        static const unsigned char df_key[32] = {
  617|      2|            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
  618|      2|            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
  619|      2|            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
  620|      2|            0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
  621|      2|        };
  622|       |
  623|      2|        if (ctr->ctx_df == NULL)
  ------------------
  |  Branch (623:13): [True: 2, False: 0]
  ------------------
  624|      2|            ctr->ctx_df = EVP_CIPHER_CTX_new();
  625|      2|        if (ctr->ctx_df == NULL) {
  ------------------
  |  Branch (625:13): [True: 0, False: 2]
  ------------------
  626|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_EVP_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  627|      0|            goto err;
  628|      0|        }
  629|       |        /* Set key schedule for df_key */
  630|      2|        if (!EVP_CipherInit_ex(ctr->ctx_df,
  ------------------
  |  Branch (630:13): [True: 0, False: 2]
  ------------------
  631|      2|                ctr->cipher_ecb, NULL, df_key, NULL, 1)) {
  632|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_DERIVATION_FUNCTION_INIT_FAILED);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  633|      0|            goto err;
  634|      0|        }
  635|      2|    }
  636|      2|    return drbg_ctr_init_lengths(drbg);
  637|       |
  638|      0|err:
  639|      0|    EVP_CIPHER_CTX_free(ctr->ctx_ecb);
  640|      0|    EVP_CIPHER_CTX_free(ctr->ctx_ctr);
  641|       |    ctr->ctx_ecb = ctr->ctx_ctr = NULL;
  642|      0|    return 0;
  643|      2|}
drbg_ctr.c:drbg_ctr_generate_wrapper:
  481|      2|{
  482|      2|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  483|       |
  484|      2|    return ossl_prov_drbg_generate(drbg, out, outlen, strength,
  485|      2|        prediction_resistance, adin, adin_len);
  486|      2|}
drbg_ctr.c:drbg_ctr_reseed_wrapper:
  385|      2|{
  386|      2|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  387|       |
  388|      2|    return ossl_prov_drbg_reseed(drbg, prediction_resistance, ent, ent_len,
  389|      2|        adin, adin_len);
  390|      2|}
drbg_ctr.c:drbg_ctr_settable_ctx_params:
  821|      2|{
  822|      2|    return drbg_ctr_set_ctx_params_list;
  823|      2|}
drbg_ctr.c:drbg_ctr_get_ctx_params:
  692|      9|{
  693|      9|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  694|      9|    PROV_DRBG_CTR *ctr;
  695|      9|    struct drbg_ctr_get_ctx_params_st p;
  696|      9|    int ret = 0, complete = 0;
  697|       |
  698|      9|    if (drbg == NULL || !drbg_ctr_get_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (698:9): [True: 0, False: 9]
  |  Branch (698:25): [True: 0, False: 9]
  ------------------
  699|      0|        return 0;
  700|       |
  701|      9|    if (!ossl_drbg_get_ctx_params_no_lock(drbg, &p, params, &complete))
  ------------------
  |  Branch (701:9): [True: 0, False: 9]
  ------------------
  702|      0|        return 0;
  703|       |
  704|      9|    if (complete)
  ------------------
  |  Branch (704:9): [True: 5, False: 4]
  ------------------
  705|      5|        return 1;
  706|       |
  707|      4|    ctr = (PROV_DRBG_CTR *)drbg->data;
  708|       |
  709|      4|    if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
  ------------------
  |  Branch (709:9): [True: 4, False: 0]
  |  Branch (709:31): [True: 0, False: 4]
  ------------------
  710|      0|        return 0;
  711|       |
  712|      4|    if (p.df != NULL && !OSSL_PARAM_set_int(p.df, ctr->use_df))
  ------------------
  |  Branch (712:9): [True: 0, False: 4]
  |  Branch (712:25): [True: 0, False: 0]
  ------------------
  713|      0|        goto err;
  714|       |
  715|      4|    if (p.cipher != NULL) {
  ------------------
  |  Branch (715:9): [True: 0, False: 4]
  ------------------
  716|      0|        if (ctr->cipher_ctr == NULL
  ------------------
  |  Branch (716:13): [True: 0, False: 0]
  ------------------
  717|      0|            || !OSSL_PARAM_set_utf8_string(p.cipher,
  ------------------
  |  Branch (717:16): [True: 0, False: 0]
  ------------------
  718|      0|                EVP_CIPHER_get0_name(ctr->cipher_ctr)))
  719|      0|            goto err;
  720|      0|    }
  721|       |
  722|      4|    ret = ossl_drbg_get_ctx_params(drbg, &p);
  723|      4|err:
  724|      4|    if (drbg->lock != NULL)
  ------------------
  |  Branch (724:9): [True: 4, False: 0]
  ------------------
  725|      4|        CRYPTO_THREAD_unlock(drbg->lock);
  726|       |
  727|      4|    return ret;
  728|      4|}

drbg_ctr.c:drbg_ctr_set_ctx_params_decoder:
  390|      2|{
  391|      2|    const char *s;
  392|       |
  393|      2|    memset(r, 0, sizeof(*r));
  394|      2|    if (p != NULL)
  ------------------
  |  Branch (394:9): [True: 2, False: 0]
  ------------------
  395|     10|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (395:16): [True: 8, False: 2]
  ------------------
  396|      8|            switch(s[0]) {
  397|      0|            default:
  ------------------
  |  Branch (397:13): [True: 0, False: 8]
  ------------------
  398|      0|                break;
  399|      2|            case 'c':
  ------------------
  |  Branch (399:13): [True: 2, False: 6]
  ------------------
  400|      2|                if (ossl_likely(strcmp("ipher", s + 1) == 0)) {
  ------------------
  |  |   23|      2|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  401|       |                    /* OSSL_DRBG_PARAM_CIPHER */
  402|      2|                    if (ossl_unlikely(r->cipher != NULL)) {
  ------------------
  |  |   24|      2|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  403|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  404|      0|                                       "param %s is repeated", s);
  405|      0|                        return 0;
  406|      0|                    }
  407|      2|                    r->cipher = (OSSL_PARAM *)p;
  408|      2|                }
  409|      2|                break;
  410|      2|            case 'p':
  ------------------
  |  Branch (410:13): [True: 0, False: 8]
  ------------------
  411|      0|                switch(s[1]) {
  412|      0|                default:
  ------------------
  |  Branch (412:17): [True: 0, False: 0]
  ------------------
  413|      0|                    break;
  414|      0|                case 'r':
  ------------------
  |  Branch (414:17): [True: 0, False: 0]
  ------------------
  415|      0|                    switch(s[2]) {
  416|      0|                    default:
  ------------------
  |  Branch (416:21): [True: 0, False: 0]
  ------------------
  417|      0|                        break;
  418|      0|                    case 'o':
  ------------------
  |  Branch (418:21): [True: 0, False: 0]
  ------------------
  419|      0|                        switch(s[3]) {
  420|      0|                        default:
  ------------------
  |  Branch (420:25): [True: 0, False: 0]
  ------------------
  421|      0|                            break;
  422|      0|                        case 'p':
  ------------------
  |  Branch (422:25): [True: 0, False: 0]
  ------------------
  423|      0|                            if (ossl_likely(strcmp("erties", s + 4) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  424|       |                                /* OSSL_DRBG_PARAM_PROPERTIES */
  425|      0|                                if (ossl_unlikely(r->propq != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  426|      0|                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  427|      0|                                                   "param %s is repeated", s);
  428|      0|                                    return 0;
  429|      0|                                }
  430|      0|                                r->propq = (OSSL_PARAM *)p;
  431|      0|                            }
  432|      0|                            break;
  433|      0|                        case 'v':
  ------------------
  |  Branch (433:25): [True: 0, False: 0]
  ------------------
  434|      0|                            if (ossl_likely(strcmp("ider-name", s + 4) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  435|       |                                /* OSSL_PROV_PARAM_CORE_PROV_NAME */
  436|      0|                                if (ossl_unlikely(r->prov != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  437|      0|                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  438|      0|                                                   "param %s is repeated", s);
  439|      0|                                    return 0;
  440|      0|                                }
  441|      0|                                r->prov = (OSSL_PARAM *)p;
  442|      0|                            }
  443|      0|                        }
  444|      0|                    }
  445|      0|                }
  446|      0|                break;
  447|      4|            case 'r':
  ------------------
  |  Branch (447:13): [True: 4, False: 4]
  ------------------
  448|      4|                switch(s[1]) {
  449|      0|                default:
  ------------------
  |  Branch (449:17): [True: 0, False: 4]
  ------------------
  450|      0|                    break;
  451|      4|                case 'e':
  ------------------
  |  Branch (451:17): [True: 4, False: 0]
  ------------------
  452|      4|                    switch(s[2]) {
  453|      0|                    default:
  ------------------
  |  Branch (453:21): [True: 0, False: 4]
  ------------------
  454|      0|                        break;
  455|      4|                    case 's':
  ------------------
  |  Branch (455:21): [True: 4, False: 0]
  ------------------
  456|      4|                        switch(s[3]) {
  457|      0|                        default:
  ------------------
  |  Branch (457:25): [True: 0, False: 4]
  ------------------
  458|      0|                            break;
  459|      4|                        case 'e':
  ------------------
  |  Branch (459:25): [True: 4, False: 0]
  ------------------
  460|      4|                            switch(s[4]) {
  461|      0|                            default:
  ------------------
  |  Branch (461:29): [True: 0, False: 4]
  ------------------
  462|      0|                                break;
  463|      4|                            case 'e':
  ------------------
  |  Branch (463:29): [True: 4, False: 0]
  ------------------
  464|      4|                                switch(s[5]) {
  465|      0|                                default:
  ------------------
  |  Branch (465:33): [True: 0, False: 4]
  ------------------
  466|      0|                                    break;
  467|      4|                                case 'd':
  ------------------
  |  Branch (467:33): [True: 4, False: 0]
  ------------------
  468|      4|                                    switch(s[6]) {
  469|      0|                                    default:
  ------------------
  |  Branch (469:37): [True: 0, False: 4]
  ------------------
  470|      0|                                        break;
  471|      4|                                    case '_':
  ------------------
  |  Branch (471:37): [True: 4, False: 0]
  ------------------
  472|      4|                                        switch(s[7]) {
  473|      0|                                        default:
  ------------------
  |  Branch (473:41): [True: 0, False: 4]
  ------------------
  474|      0|                                            break;
  475|      2|                                        case 'r':
  ------------------
  |  Branch (475:41): [True: 2, False: 2]
  ------------------
  476|      2|                                            if (ossl_likely(strcmp("equests", s + 8) == 0)) {
  ------------------
  |  |   23|      2|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  477|       |                                                /* OSSL_DRBG_PARAM_RESEED_REQUESTS */
  478|      2|                                                if (ossl_unlikely(r->reseed_req != NULL)) {
  ------------------
  |  |   24|      2|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  479|      0|                                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  480|      0|                                                                   "param %s is repeated", s);
  481|      0|                                                    return 0;
  482|      0|                                                }
  483|      2|                                                r->reseed_req = (OSSL_PARAM *)p;
  484|      2|                                            }
  485|      2|                                            break;
  486|      2|                                        case 't':
  ------------------
  |  Branch (486:41): [True: 2, False: 2]
  ------------------
  487|      2|                                            if (ossl_likely(strcmp("ime_interval", s + 8) == 0)) {
  ------------------
  |  |   23|      2|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  488|       |                                                /* OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL */
  489|      2|                                                if (ossl_unlikely(r->reseed_time != NULL)) {
  ------------------
  |  |   24|      2|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  490|      0|                                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  491|      0|                                                                   "param %s is repeated", s);
  492|      0|                                                    return 0;
  493|      0|                                                }
  494|      2|                                                r->reseed_time = (OSSL_PARAM *)p;
  495|      2|                                            }
  496|      4|                                        }
  497|      4|                                    }
  498|      4|                                }
  499|      4|                            }
  500|      4|                        }
  501|      4|                    }
  502|      4|                }
  503|      4|                break;
  504|      4|            case 'u':
  ------------------
  |  Branch (504:13): [True: 2, False: 6]
  ------------------
  505|      2|# if !defined(FIPS_MODULE)
  506|      2|                if (ossl_likely(strcmp("se_derivation_function", s + 1) == 0)) {
  ------------------
  |  |   23|      2|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  507|       |                    /* OSSL_DRBG_PARAM_USE_DF */
  508|      2|                    if (ossl_unlikely(r->df != NULL)) {
  ------------------
  |  |   24|      2|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  509|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  510|      0|                                       "param %s is repeated", s);
  511|      0|                        return 0;
  512|      0|                    }
  513|      2|                    r->df = (OSSL_PARAM *)p;
  514|      2|                }
  515|      2|# endif
  516|      2|                break;
  517|      8|            }
  518|      2|    return 1;
  519|      2|}
drbg_ctr.c:drbg_ctr_get_ctx_params_decoder:
   70|      9|{
   71|      9|    const char *s;
   72|       |
   73|      9|    memset(r, 0, sizeof(*r));
   74|      9|    if (p != NULL)
  ------------------
  |  Branch (74:9): [True: 9, False: 0]
  ------------------
   75|     18|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (75:16): [True: 9, False: 9]
  ------------------
   76|      9|            switch(s[0]) {
   77|      0|            default:
  ------------------
  |  Branch (77:13): [True: 0, False: 9]
  ------------------
   78|      0|                break;
   79|      0|            case 'c':
  ------------------
  |  Branch (79:13): [True: 0, False: 9]
  ------------------
   80|      0|                if (ossl_likely(strcmp("ipher", s + 1) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   81|       |                    /* OSSL_DRBG_PARAM_CIPHER */
   82|      0|                    if (ossl_unlikely(r->cipher != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   83|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   84|      0|                                       "param %s is repeated", s);
   85|      0|                        return 0;
   86|      0|                    }
   87|      0|                    r->cipher = (OSSL_PARAM *)p;
   88|      0|                }
   89|      0|                break;
   90|      0|            case 'f':
  ------------------
  |  Branch (90:13): [True: 0, False: 9]
  ------------------
   91|       |# if defined(FIPS_MODULE)
   92|       |                if (ossl_likely(strcmp("ips-indicator", s + 1) == 0)) {
   93|       |                    /* OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR */
   94|       |                    if (ossl_unlikely(r->ind != NULL)) {
   95|       |                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
   96|       |                                       "param %s is repeated", s);
   97|       |                        return 0;
   98|       |                    }
   99|       |                    r->ind = (OSSL_PARAM *)p;
  100|       |                }
  101|       |# endif
  102|      0|                break;
  103|      2|            case 'm':
  ------------------
  |  Branch (103:13): [True: 2, False: 7]
  ------------------
  104|      2|                switch(s[1]) {
  105|      0|                default:
  ------------------
  |  Branch (105:17): [True: 0, False: 2]
  ------------------
  106|      0|                    break;
  107|      2|                case 'a':
  ------------------
  |  Branch (107:17): [True: 2, False: 0]
  ------------------
  108|      2|                    switch(s[2]) {
  109|      0|                    default:
  ------------------
  |  Branch (109:21): [True: 0, False: 2]
  ------------------
  110|      0|                        break;
  111|      2|                    case 'x':
  ------------------
  |  Branch (111:21): [True: 2, False: 0]
  ------------------
  112|      2|                        switch(s[3]) {
  113|      0|                        default:
  ------------------
  |  Branch (113:25): [True: 0, False: 2]
  ------------------
  114|      0|                            break;
  115|      2|                        case '_':
  ------------------
  |  Branch (115:25): [True: 2, False: 0]
  ------------------
  116|      2|                            switch(s[4]) {
  117|      0|                            default:
  ------------------
  |  Branch (117:29): [True: 0, False: 2]
  ------------------
  118|      0|                                break;
  119|      0|                            case 'a':
  ------------------
  |  Branch (119:29): [True: 0, False: 2]
  ------------------
  120|      0|                                if (ossl_likely(strcmp("dinlen", s + 5) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  121|       |                                    /* OSSL_DRBG_PARAM_MAX_ADINLEN */
  122|      0|                                    if (ossl_unlikely(r->maxadlen != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  123|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  124|      0|                                                       "param %s is repeated", s);
  125|      0|                                        return 0;
  126|      0|                                    }
  127|      0|                                    r->maxadlen = (OSSL_PARAM *)p;
  128|      0|                                }
  129|      0|                                break;
  130|      0|                            case 'e':
  ------------------
  |  Branch (130:29): [True: 0, False: 2]
  ------------------
  131|      0|                                if (ossl_likely(strcmp("ntropylen", s + 5) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  132|       |                                    /* OSSL_DRBG_PARAM_MAX_ENTROPYLEN */
  133|      0|                                    if (ossl_unlikely(r->maxentlen != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  134|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  135|      0|                                                       "param %s is repeated", s);
  136|      0|                                        return 0;
  137|      0|                                    }
  138|      0|                                    r->maxentlen = (OSSL_PARAM *)p;
  139|      0|                                }
  140|      0|                                break;
  141|      0|                            case 'n':
  ------------------
  |  Branch (141:29): [True: 0, False: 2]
  ------------------
  142|      0|                                if (ossl_likely(strcmp("oncelen", s + 5) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  143|       |                                    /* OSSL_DRBG_PARAM_MAX_NONCELEN */
  144|      0|                                    if (ossl_unlikely(r->maxnonlen != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  145|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  146|      0|                                                       "param %s is repeated", s);
  147|      0|                                        return 0;
  148|      0|                                    }
  149|      0|                                    r->maxnonlen = (OSSL_PARAM *)p;
  150|      0|                                }
  151|      0|                                break;
  152|      0|                            case 'p':
  ------------------
  |  Branch (152:29): [True: 0, False: 2]
  ------------------
  153|      0|                                if (ossl_likely(strcmp("erslen", s + 5) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  154|       |                                    /* OSSL_DRBG_PARAM_MAX_PERSLEN */
  155|      0|                                    if (ossl_unlikely(r->maxperlen != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  156|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  157|      0|                                                       "param %s is repeated", s);
  158|      0|                                        return 0;
  159|      0|                                    }
  160|      0|                                    r->maxperlen = (OSSL_PARAM *)p;
  161|      0|                                }
  162|      0|                                break;
  163|      2|                            case 'r':
  ------------------
  |  Branch (163:29): [True: 2, False: 0]
  ------------------
  164|      2|                                if (ossl_likely(strcmp("equest", s + 5) == 0)) {
  ------------------
  |  |   23|      2|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  165|       |                                    /* OSSL_RAND_PARAM_MAX_REQUEST */
  166|      2|                                    if (ossl_unlikely(r->maxreq != NULL)) {
  ------------------
  |  |   24|      2|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  167|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  168|      0|                                                       "param %s is repeated", s);
  169|      0|                                        return 0;
  170|      0|                                    }
  171|      2|                                    r->maxreq = (OSSL_PARAM *)p;
  172|      2|                                }
  173|      2|                            }
  174|      2|                        }
  175|      2|                    }
  176|      2|                    break;
  177|      2|                case 'i':
  ------------------
  |  Branch (177:17): [True: 0, False: 2]
  ------------------
  178|      0|                    switch(s[2]) {
  179|      0|                    default:
  ------------------
  |  Branch (179:21): [True: 0, False: 0]
  ------------------
  180|      0|                        break;
  181|      0|                    case 'n':
  ------------------
  |  Branch (181:21): [True: 0, False: 0]
  ------------------
  182|      0|                        switch(s[3]) {
  183|      0|                        default:
  ------------------
  |  Branch (183:25): [True: 0, False: 0]
  ------------------
  184|      0|                            break;
  185|      0|                        case '_':
  ------------------
  |  Branch (185:25): [True: 0, False: 0]
  ------------------
  186|      0|                            switch(s[4]) {
  187|      0|                            default:
  ------------------
  |  Branch (187:29): [True: 0, False: 0]
  ------------------
  188|      0|                                break;
  189|      0|                            case 'e':
  ------------------
  |  Branch (189:29): [True: 0, False: 0]
  ------------------
  190|      0|                                if (ossl_likely(strcmp("ntropylen", s + 5) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  191|       |                                    /* OSSL_DRBG_PARAM_MIN_ENTROPYLEN */
  192|      0|                                    if (ossl_unlikely(r->minentlen != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  193|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  194|      0|                                                       "param %s is repeated", s);
  195|      0|                                        return 0;
  196|      0|                                    }
  197|      0|                                    r->minentlen = (OSSL_PARAM *)p;
  198|      0|                                }
  199|      0|                                break;
  200|      0|                            case 'n':
  ------------------
  |  Branch (200:29): [True: 0, False: 0]
  ------------------
  201|      0|                                if (ossl_likely(strcmp("oncelen", s + 5) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  202|       |                                    /* OSSL_DRBG_PARAM_MIN_NONCELEN */
  203|      0|                                    if (ossl_unlikely(r->minnonlen != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  204|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  205|      0|                                                       "param %s is repeated", s);
  206|      0|                                        return 0;
  207|      0|                                    }
  208|      0|                                    r->minnonlen = (OSSL_PARAM *)p;
  209|      0|                                }
  210|      0|                            }
  211|      0|                        }
  212|      0|                    }
  213|      2|                }
  214|      2|                break;
  215|      3|            case 'r':
  ------------------
  |  Branch (215:13): [True: 3, False: 6]
  ------------------
  216|      3|                switch(s[1]) {
  217|      0|                default:
  ------------------
  |  Branch (217:17): [True: 0, False: 3]
  ------------------
  218|      0|                    break;
  219|      3|                case 'e':
  ------------------
  |  Branch (219:17): [True: 3, False: 0]
  ------------------
  220|      3|                    switch(s[2]) {
  221|      0|                    default:
  ------------------
  |  Branch (221:21): [True: 0, False: 3]
  ------------------
  222|      0|                        break;
  223|      3|                    case 's':
  ------------------
  |  Branch (223:21): [True: 3, False: 0]
  ------------------
  224|      3|                        switch(s[3]) {
  225|      0|                        default:
  ------------------
  |  Branch (225:25): [True: 0, False: 3]
  ------------------
  226|      0|                            break;
  227|      3|                        case 'e':
  ------------------
  |  Branch (227:25): [True: 3, False: 0]
  ------------------
  228|      3|                            switch(s[4]) {
  229|      0|                            default:
  ------------------
  |  Branch (229:29): [True: 0, False: 3]
  ------------------
  230|      0|                                break;
  231|      3|                            case 'e':
  ------------------
  |  Branch (231:29): [True: 3, False: 0]
  ------------------
  232|      3|                                switch(s[5]) {
  233|      0|                                default:
  ------------------
  |  Branch (233:33): [True: 0, False: 3]
  ------------------
  234|      0|                                    break;
  235|      3|                                case 'd':
  ------------------
  |  Branch (235:33): [True: 3, False: 0]
  ------------------
  236|      3|                                    switch(s[6]) {
  237|      0|                                    default:
  ------------------
  |  Branch (237:37): [True: 0, False: 3]
  ------------------
  238|      0|                                        break;
  239|      3|                                    case '_':
  ------------------
  |  Branch (239:37): [True: 3, False: 0]
  ------------------
  240|      3|                                        switch(s[7]) {
  241|      0|                                        default:
  ------------------
  |  Branch (241:41): [True: 0, False: 3]
  ------------------
  242|      0|                                            break;
  243|      3|                                        case 'c':
  ------------------
  |  Branch (243:41): [True: 3, False: 0]
  ------------------
  244|      3|                                            if (ossl_likely(strcmp("ounter", s + 8) == 0)) {
  ------------------
  |  |   23|      3|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  245|       |                                                /* OSSL_DRBG_PARAM_RESEED_COUNTER */
  246|      3|                                                if (ossl_unlikely(r->reseed_cnt != NULL)) {
  ------------------
  |  |   24|      3|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  247|      0|                                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  248|      0|                                                                   "param %s is repeated", s);
  249|      0|                                                    return 0;
  250|      0|                                                }
  251|      3|                                                r->reseed_cnt = (OSSL_PARAM *)p;
  252|      3|                                            }
  253|      3|                                            break;
  254|      3|                                        case 'r':
  ------------------
  |  Branch (254:41): [True: 0, False: 3]
  ------------------
  255|      0|                                            if (ossl_likely(strcmp("equests", s + 8) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  256|       |                                                /* OSSL_DRBG_PARAM_RESEED_REQUESTS */
  257|      0|                                                if (ossl_unlikely(r->reseed_req != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  258|      0|                                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  259|      0|                                                                   "param %s is repeated", s);
  260|      0|                                                    return 0;
  261|      0|                                                }
  262|      0|                                                r->reseed_req = (OSSL_PARAM *)p;
  263|      0|                                            }
  264|      0|                                            break;
  265|      0|                                        case 't':
  ------------------
  |  Branch (265:41): [True: 0, False: 3]
  ------------------
  266|      0|                                            switch(s[8]) {
  267|      0|                                            default:
  ------------------
  |  Branch (267:45): [True: 0, False: 0]
  ------------------
  268|      0|                                                break;
  269|      0|                                            case 'i':
  ------------------
  |  Branch (269:45): [True: 0, False: 0]
  ------------------
  270|      0|                                                switch(s[9]) {
  271|      0|                                                default:
  ------------------
  |  Branch (271:49): [True: 0, False: 0]
  ------------------
  272|      0|                                                    break;
  273|      0|                                                case 'm':
  ------------------
  |  Branch (273:49): [True: 0, False: 0]
  ------------------
  274|      0|                                                    switch(s[10]) {
  275|      0|                                                    default:
  ------------------
  |  Branch (275:53): [True: 0, False: 0]
  ------------------
  276|      0|                                                        break;
  277|      0|                                                    case 'e':
  ------------------
  |  Branch (277:53): [True: 0, False: 0]
  ------------------
  278|      0|                                                        switch(s[11]) {
  279|      0|                                                        default:
  ------------------
  |  Branch (279:57): [True: 0, False: 0]
  ------------------
  280|      0|                                                            break;
  281|      0|                                                        case '_':
  ------------------
  |  Branch (281:57): [True: 0, False: 0]
  ------------------
  282|      0|                                                            if (ossl_likely(strcmp("interval", s + 12) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  283|       |                                                                /* OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL */
  284|      0|                                                                if (ossl_unlikely(r->reseed_int != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  285|      0|                                                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  286|      0|                                                                                   "param %s is repeated", s);
  287|      0|                                                                    return 0;
  288|      0|                                                                }
  289|      0|                                                                r->reseed_int = (OSSL_PARAM *)p;
  290|      0|                                                            }
  291|      0|                                                            break;
  292|      0|                                                        case '\0':
  ------------------
  |  Branch (292:57): [True: 0, False: 0]
  ------------------
  293|      0|                                                            if (ossl_unlikely(r->reseed_time != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  294|      0|                                                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  295|      0|                                                                               "param %s is repeated", s);
  296|      0|                                                                return 0;
  297|      0|                                                            }
  298|      0|                                                            r->reseed_time = (OSSL_PARAM *)p;
  299|      0|                                                        }
  300|      0|                                                    }
  301|      0|                                                }
  302|      0|                                            }
  303|      3|                                        }
  304|      3|                                    }
  305|      3|                                }
  306|      3|                            }
  307|      3|                        }
  308|      3|                    }
  309|      3|                }
  310|      3|                break;
  311|      4|            case 's':
  ------------------
  |  Branch (311:13): [True: 4, False: 5]
  ------------------
  312|      4|                switch(s[1]) {
  313|      0|                default:
  ------------------
  |  Branch (313:17): [True: 0, False: 4]
  ------------------
  314|      0|                    break;
  315|      4|                case 't':
  ------------------
  |  Branch (315:17): [True: 4, False: 0]
  ------------------
  316|      4|                    switch(s[2]) {
  317|      0|                    default:
  ------------------
  |  Branch (317:21): [True: 0, False: 4]
  ------------------
  318|      0|                        break;
  319|      1|                    case 'a':
  ------------------
  |  Branch (319:21): [True: 1, False: 3]
  ------------------
  320|      1|                        if (ossl_likely(strcmp("te", s + 3) == 0)) {
  ------------------
  |  |   23|      1|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  321|       |                            /* OSSL_RAND_PARAM_STATE */
  322|      1|                            if (ossl_unlikely(r->state != NULL)) {
  ------------------
  |  |   24|      1|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  323|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  324|      0|                                               "param %s is repeated", s);
  325|      0|                                return 0;
  326|      0|                            }
  327|      1|                            r->state = (OSSL_PARAM *)p;
  328|      1|                        }
  329|      1|                        break;
  330|      3|                    case 'r':
  ------------------
  |  Branch (330:21): [True: 3, False: 1]
  ------------------
  331|      3|                        if (ossl_likely(strcmp("ength", s + 3) == 0)) {
  ------------------
  |  |   23|      3|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  332|       |                            /* OSSL_RAND_PARAM_STRENGTH */
  333|      3|                            if (ossl_unlikely(r->str != NULL)) {
  ------------------
  |  |   24|      3|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  334|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  335|      0|                                               "param %s is repeated", s);
  336|      0|                                return 0;
  337|      0|                            }
  338|      3|                            r->str = (OSSL_PARAM *)p;
  339|      3|                        }
  340|      4|                    }
  341|      4|                }
  342|      4|                break;
  343|      4|            case 'u':
  ------------------
  |  Branch (343:13): [True: 0, False: 9]
  ------------------
  344|      0|                if (ossl_likely(strcmp("se_derivation_function", s + 1) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  345|       |                    /* OSSL_DRBG_PARAM_USE_DF */
  346|      0|                    if (ossl_unlikely(r->df != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  347|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  348|      0|                                       "param %s is repeated", s);
  349|      0|                        return 0;
  350|      0|                    }
  351|      0|                    r->df = (OSSL_PARAM *)p;
  352|      0|                }
  353|      9|            }
  354|      9|    return 1;
  355|      9|}

seed_src.c:seed_src_new:
   49|      1|{
   50|      1|    PROV_SEED_SRC *s;
   51|       |
   52|      1|    if (parent != NULL) {
  ------------------
  |  Branch (52:9): [True: 0, False: 1]
  ------------------
   53|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   54|      0|        return NULL;
   55|      0|    }
   56|       |
   57|      1|    s = OPENSSL_zalloc(sizeof(*s));
  ------------------
  |  |  113|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|      1|    if (s == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 1]
  ------------------
   59|      0|        return NULL;
   60|       |
   61|      1|    s->provctx = provctx;
   62|      1|    s->state = EVP_RAND_STATE_UNINITIALISED;
  ------------------
  |  | 1330|      1|#define EVP_RAND_STATE_UNINITIALISED 0
  ------------------
   63|      1|    return s;
   64|      1|}
seed_src.c:seed_src_instantiate:
   75|      1|{
   76|      1|    PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
   77|       |
   78|      1|    s->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1331|      1|#define EVP_RAND_STATE_READY 1
  ------------------
   79|      1|    return 1;
   80|      1|}
seed_src.c:seed_src_enable_locking:
  212|      1|{
  213|      1|    return 1;
  214|      1|}
seed_src.c:seed_src_lock:
  217|     15|{
  218|     15|    return 1;
  219|     15|}
seed_src.c:seed_src_unlock:
  222|     15|{
  223|     15|}
seed_src.c:seed_src_get_ctx_params:
  147|      8|{
  148|      8|    PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
  149|      8|    struct seed_src_get_ctx_params_st p;
  150|       |
  151|      8|    if (s == NULL || !seed_src_get_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (151:9): [True: 0, False: 8]
  |  Branch (151:22): [True: 0, False: 8]
  ------------------
  152|      0|        return 0;
  153|       |
  154|      8|    if (p.state != NULL && !OSSL_PARAM_set_int(p.state, s->state))
  ------------------
  |  Branch (154:9): [True: 0, False: 8]
  |  Branch (154:28): [True: 0, False: 0]
  ------------------
  155|      0|        return 0;
  156|       |
  157|      8|    if (p.str != NULL && !OSSL_PARAM_set_uint(p.str, 1024))
  ------------------
  |  Branch (157:9): [True: 4, False: 4]
  |  Branch (157:26): [True: 0, False: 4]
  ------------------
  158|      0|        return 0;
  159|       |
  160|      8|    if (p.maxreq != NULL && !OSSL_PARAM_set_size_t(p.maxreq, 128))
  ------------------
  |  Branch (160:9): [True: 0, False: 8]
  |  Branch (160:29): [True: 0, False: 0]
  ------------------
  161|      0|        return 0;
  162|      8|    return 1;
  163|      8|}
seed_src.c:seed_get_seed:
  180|      3|{
  181|      3|    size_t ret = 0;
  182|      3|    size_t entropy_available = 0;
  183|      3|    RAND_POOL *pool;
  184|       |
  185|      3|    pool = ossl_rand_pool_new(entropy, 1, min_len, max_len);
  186|      3|    if (pool == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 3]
  ------------------
  187|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_RAND_LIB);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  188|      0|        return 0;
  189|      0|    }
  190|       |
  191|       |    /* Get entropy by polling system entropy sources. */
  192|      3|    entropy_available = ossl_pool_acquire_entropy(pool);
  193|       |
  194|      3|    if (entropy_available > 0
  ------------------
  |  Branch (194:9): [True: 3, False: 0]
  ------------------
  195|      3|        && ossl_rand_pool_adin_mix_in(pool, adin, adin_len)) {
  ------------------
  |  Branch (195:12): [True: 3, False: 0]
  ------------------
  196|      3|        ret = ossl_rand_pool_length(pool);
  197|      3|        *pout = ossl_rand_pool_detach(pool);
  198|      3|    } else {
  199|       |        ERR_raise(ERR_LIB_PROV, PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  200|      0|    }
  201|      3|    ossl_rand_pool_free(pool);
  202|      3|    return ret;
  203|      3|}
seed_src.c:seed_clear_seed:
  207|      3|{
  208|      3|    OPENSSL_secure_clear_free(out, outlen);
  ------------------
  |  |  154|      3|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  209|      3|}

seed_src.c:seed_src_get_ctx_params_decoder:
   40|      8|{
   41|      8|    const char *s;
   42|       |
   43|      8|    memset(r, 0, sizeof(*r));
   44|      8|    if (p != NULL)
  ------------------
  |  Branch (44:9): [True: 8, False: 0]
  ------------------
   45|     16|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (45:16): [True: 8, False: 8]
  ------------------
   46|      8|            switch(s[0]) {
   47|      4|            default:
  ------------------
  |  Branch (47:13): [True: 4, False: 4]
  ------------------
   48|      4|                break;
   49|      4|            case 'm':
  ------------------
  |  Branch (49:13): [True: 0, False: 8]
  ------------------
   50|      0|                if (ossl_likely(strcmp("ax_request", s + 1) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   51|       |                    /* OSSL_RAND_PARAM_MAX_REQUEST */
   52|      0|                    if (ossl_unlikely(r->maxreq != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   53|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   54|      0|                                       "param %s is repeated", s);
   55|      0|                        return 0;
   56|      0|                    }
   57|      0|                    r->maxreq = (OSSL_PARAM *)p;
   58|      0|                }
   59|      0|                break;
   60|      4|            case 's':
  ------------------
  |  Branch (60:13): [True: 4, False: 4]
  ------------------
   61|      4|                switch(s[1]) {
   62|      0|                default:
  ------------------
  |  Branch (62:17): [True: 0, False: 4]
  ------------------
   63|      0|                    break;
   64|      4|                case 't':
  ------------------
  |  Branch (64:17): [True: 4, False: 0]
  ------------------
   65|      4|                    switch(s[2]) {
   66|      0|                    default:
  ------------------
  |  Branch (66:21): [True: 0, False: 4]
  ------------------
   67|      0|                        break;
   68|      0|                    case 'a':
  ------------------
  |  Branch (68:21): [True: 0, False: 4]
  ------------------
   69|      0|                        if (ossl_likely(strcmp("te", s + 3) == 0)) {
  ------------------
  |  |   23|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   70|       |                            /* OSSL_RAND_PARAM_STATE */
   71|      0|                            if (ossl_unlikely(r->state != NULL)) {
  ------------------
  |  |   24|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   72|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   73|      0|                                               "param %s is repeated", s);
   74|      0|                                return 0;
   75|      0|                            }
   76|      0|                            r->state = (OSSL_PARAM *)p;
   77|      0|                        }
   78|      0|                        break;
   79|      4|                    case 'r':
  ------------------
  |  Branch (79:21): [True: 4, False: 0]
  ------------------
   80|      4|                        if (ossl_likely(strcmp("ength", s + 3) == 0)) {
  ------------------
  |  |   23|      4|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (23:24): [True: 4, False: 0]
  |  |  ------------------
  ------------------
   81|       |                            /* OSSL_RAND_PARAM_STRENGTH */
   82|      4|                            if (ossl_unlikely(r->str != NULL)) {
  ------------------
  |  |   24|      4|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (24:26): [True: 0, False: 4]
  |  |  ------------------
  ------------------
   83|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  361|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  101|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  149|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   84|      0|                                               "param %s is repeated", s);
   85|      0|                                return 0;
   86|      0|                            }
   87|      4|                            r->str = (OSSL_PARAM *)p;
   88|      4|                        }
   89|      4|                    }
   90|      4|                }
   91|      8|            }
   92|      8|    return 1;
   93|      8|}

ossl_rand_pool_init:
  576|      1|{
  577|      1|    size_t i;
  578|       |
  579|      5|    for (i = 0; i < OSSL_NELEM(random_devices); i++)
  ------------------
  |  |   14|      5|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (579:17): [True: 4, False: 1]
  ------------------
  580|      4|        random_devices[i].fd = -1;
  581|       |
  582|      1|    return 1;
  583|      1|}
ossl_pool_acquire_entropy:
  644|      3|{
  645|       |#if defined(OPENSSL_RAND_SEED_NONE)
  646|       |    return ossl_rand_pool_entropy_available(pool);
  647|       |#else
  648|      3|    size_t entropy_available = 0;
  649|       |
  650|      3|    (void)entropy_available; /* avoid compiler warning */
  651|       |
  652|      3|#if defined(OPENSSL_RAND_SEED_GETRANDOM)
  653|      3|    {
  654|      3|        size_t bytes_needed;
  655|      3|        unsigned char *buffer;
  656|      3|        ssize_t bytes;
  657|       |        /* Maximum allowed number of consecutive unsuccessful attempts */
  658|      3|        int attempts = 3;
  659|       |
  660|      3|        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  661|      6|        while (bytes_needed != 0 && attempts-- > 0) {
  ------------------
  |  Branch (661:16): [True: 3, False: 3]
  |  Branch (661:37): [True: 3, False: 0]
  ------------------
  662|      3|            buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  663|      3|            bytes = syscall_random(buffer, bytes_needed);
  664|      3|            if (bytes > 0) {
  ------------------
  |  Branch (664:17): [True: 3, False: 0]
  ------------------
  665|      3|                ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  666|      3|                bytes_needed -= bytes;
  667|      3|                attempts = 3; /* reset counter after successful attempt */
  668|      3|            } else if (bytes < 0 && errno != EINTR) {
  ------------------
  |  Branch (668:24): [True: 0, False: 0]
  |  Branch (668:37): [True: 0, False: 0]
  ------------------
  669|      0|                break;
  670|      0|            }
  671|      3|        }
  672|      3|    }
  673|      3|    entropy_available = ossl_rand_pool_entropy_available(pool);
  674|      3|    if (entropy_available > 0)
  ------------------
  |  Branch (674:9): [True: 3, False: 0]
  ------------------
  675|      3|        return entropy_available;
  676|      0|#endif
  677|       |
  678|      0|#if defined(OPENSSL_RAND_SEED_DEVRANDOM)
  679|      0|    if (wait_random_seeded()) {
  ------------------
  |  Branch (679:9): [True: 0, False: 0]
  ------------------
  680|      0|        size_t bytes_needed;
  681|      0|        unsigned char *buffer;
  682|      0|        size_t i;
  683|       |
  684|      0|        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  685|      0|        for (i = 0; bytes_needed > 0 && i < OSSL_NELEM(random_device_paths);
  ------------------
  |  |   14|      0|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (685:21): [True: 0, False: 0]
  |  Branch (685:41): [True: 0, False: 0]
  ------------------
  686|      0|            i++) {
  687|      0|            ssize_t bytes = 0;
  688|       |            /* Maximum number of consecutive unsuccessful attempts */
  689|      0|            int attempts = 3;
  690|      0|            const int fd = get_random_device(i);
  691|       |
  692|      0|            if (fd == -1)
  ------------------
  |  Branch (692:17): [True: 0, False: 0]
  ------------------
  693|      0|                continue;
  694|       |
  695|      0|            while (bytes_needed != 0 && attempts-- > 0) {
  ------------------
  |  Branch (695:20): [True: 0, False: 0]
  |  Branch (695:41): [True: 0, False: 0]
  ------------------
  696|      0|                buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  697|      0|                bytes = read(fd, buffer, bytes_needed);
  698|       |
  699|      0|                if (bytes > 0) {
  ------------------
  |  Branch (699:21): [True: 0, False: 0]
  ------------------
  700|      0|                    ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  701|      0|                    bytes_needed -= bytes;
  702|      0|                    attempts = 3; /* reset counter on successful attempt */
  703|      0|                } else if (bytes < 0 && errno != EINTR) {
  ------------------
  |  Branch (703:28): [True: 0, False: 0]
  |  Branch (703:41): [True: 0, False: 0]
  ------------------
  704|      0|                    break;
  705|      0|                }
  706|      0|            }
  707|      0|            if (bytes < 0 || !keep_random_devices_open)
  ------------------
  |  Branch (707:17): [True: 0, False: 0]
  |  Branch (707:30): [True: 0, False: 0]
  ------------------
  708|      0|                close_random_device(i);
  709|       |
  710|      0|            bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
  711|      0|        }
  712|      0|        entropy_available = ossl_rand_pool_entropy_available(pool);
  713|      0|        if (entropy_available > 0)
  ------------------
  |  Branch (713:13): [True: 0, False: 0]
  ------------------
  714|      0|            return entropy_available;
  715|      0|    }
  716|      0|#endif
  717|       |
  718|       |#if defined(OPENSSL_RAND_SEED_RDTSC)
  719|       |    entropy_available = ossl_prov_acquire_entropy_from_tsc(pool);
  720|       |    if (entropy_available > 0)
  721|       |        return entropy_available;
  722|       |#endif
  723|       |
  724|       |#if defined(OPENSSL_RAND_SEED_RDCPU)
  725|       |    entropy_available = ossl_prov_acquire_entropy_from_cpu(pool);
  726|       |    if (entropy_available > 0)
  727|       |        return entropy_available;
  728|       |#endif
  729|       |
  730|       |#if defined(OPENSSL_RAND_SEED_EGD)
  731|       |    {
  732|       |        static const char *paths[] = { DEVRANDOM_EGD, NULL };
  733|       |        size_t bytes_needed;
  734|       |        unsigned char *buffer;
  735|       |        int i;
  736|       |
  737|       |        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  738|       |        for (i = 0; bytes_needed > 0 && paths[i] != NULL; i++) {
  739|       |            size_t bytes = 0;
  740|       |            int num;
  741|       |
  742|       |            buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  743|       |            num = RAND_query_egd_bytes(paths[i],
  744|       |                buffer, (int)bytes_needed);
  745|       |            if (num == (int)bytes_needed)
  746|       |                bytes = bytes_needed;
  747|       |
  748|       |            ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  749|       |            bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
  750|       |        }
  751|       |        entropy_available = ossl_rand_pool_entropy_available(pool);
  752|       |        if (entropy_available > 0)
  753|       |            return entropy_available;
  754|       |    }
  755|       |#endif
  756|       |
  757|      0|    return ossl_rand_pool_entropy_available(pool);
  758|      0|#endif
  759|      0|}
rand_unix.c:syscall_random:
  333|      3|{
  334|       |    /*
  335|       |     * Note: 'buflen' equals the size of the buffer which is used by the
  336|       |     * get_entropy() callback of the RAND_DRBG. It is roughly bounded by
  337|       |     *
  338|       |     *   2 * RAND_POOL_FACTOR * (RAND_DRBG_STRENGTH / 8) = 2^14
  339|       |     *
  340|       |     * which is way below the OSSL_SSIZE_MAX limit. Therefore sign conversion
  341|       |     * between size_t and ssize_t is safe even without a range check.
  342|       |     */
  343|       |
  344|       |    /*
  345|       |     * Do runtime detection to find getentropy().
  346|       |     *
  347|       |     * Known OSs that should support this:
  348|       |     * - Darwin since 16 (OSX 10.12, IOS 10.0).
  349|       |     * - Solaris since 11.3
  350|       |     * - OpenBSD since 5.6
  351|       |     * - Linux since 3.17 with glibc 2.25
  352|       |     *
  353|       |     * Note: Sometimes getentropy() can be provided but not implemented
  354|       |     * internally. So we need to check errno for ENOSYS
  355|       |     */
  356|      3|#if !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
  357|      3|#if defined(__GNUC__) && defined(__ELF__) && !defined(__hpux)
  358|      3|    extern int getentropy(void *buffer, size_t length) __attribute__((weak));
  359|       |
  360|      3|    if (getentropy != NULL) {
  ------------------
  |  Branch (360:9): [True: 3, False: 0]
  ------------------
  361|      3|        if (getentropy(buf, buflen) == 0)
  ------------------
  |  Branch (361:13): [True: 3, False: 0]
  ------------------
  362|      3|            return (ssize_t)buflen;
  363|      0|        if (errno != ENOSYS)
  ------------------
  |  Branch (363:13): [True: 0, False: 0]
  ------------------
  364|      0|            return -1;
  365|      0|    }
  366|       |#elif defined(OPENSSL_APPLE_CRYPTO_RANDOM)
  367|       |
  368|       |    if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
  369|       |        return (ssize_t)buflen;
  370|       |
  371|       |    return -1;
  372|       |#else
  373|       |    union {
  374|       |        void *p;
  375|       |        int (*f)(void *buffer, size_t length);
  376|       |    } p_getentropy;
  377|       |
  378|       |    /*
  379|       |     * We could cache the result of the lookup, but we normally don't
  380|       |     * call this function often.
  381|       |     */
  382|       |    ERR_set_mark();
  383|       |    p_getentropy.p = DSO_global_lookup("getentropy");
  384|       |    ERR_pop_to_mark();
  385|       |    if (p_getentropy.p != NULL)
  386|       |        return p_getentropy.f(buf, buflen) == 0 ? (ssize_t)buflen : -1;
  387|       |#endif
  388|      0|#endif /* !__DragonFly__ && !__NetBSD__ && !__FreeBSD__ */
  389|       |
  390|       |    /* Linux supports this since version 3.17 */
  391|      0|#if defined(__linux) && defined(__NR_getrandom)
  392|      0|    return syscall(__NR_getrandom, buf, buflen, 0);
  393|       |#elif (defined(__DragonFly__) && __DragonFly_version >= 500700) \
  394|       |    || (defined(__NetBSD__) && __NetBSD_Version >= 1000000000)  \
  395|       |    || (defined(__FreeBSD__) && __FreeBSD_version >= 1200061)
  396|       |    return getrandom(buf, buflen, 0);
  397|       |#elif (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND)
  398|       |    return sysctl_random(buf, buflen);
  399|       |#elif defined(__wasi__) || defined(__EMSCRIPTEN__)
  400|       |    if (getentropy(buf, buflen) == 0)
  401|       |        return (ssize_t)buflen;
  402|       |    return -1;
  403|       |#else
  404|       |    errno = ENOSYS;
  405|       |    return -1;
  406|       |#endif
  407|      3|}

ossl_prov_is_running:
   20|     61|{
   21|     61|    return 1;
   22|     61|}

ssl_sort_cipher_list:
 3771|      1|{
 3772|      1|    qsort(tls13_ciphers, TLS13_NUM_CIPHERS, sizeof(tls13_ciphers[0]),
  ------------------
  |  |   27|      1|#define TLS13_NUM_CIPHERS OSSL_NELEM(tls13_ciphers)
  |  |  ------------------
  |  |  |  |   14|      1|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3773|      1|        cipher_compare);
 3774|      1|    qsort(ssl3_ciphers, SSL3_NUM_CIPHERS, sizeof(ssl3_ciphers[0]),
  ------------------
  |  |   28|      1|#define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|      1|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3775|      1|        cipher_compare);
 3776|      1|    qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
  ------------------
  |  |   29|      1|#define SSL3_NUM_SCSVS OSSL_NELEM(ssl3_scsvs)
  |  |  ------------------
  |  |  |  |   14|      1|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3777|      1|}
s3_lib.c:cipher_compare:
 3761|    982|{
 3762|    982|    const SSL_CIPHER *ap = (const SSL_CIPHER *)a;
 3763|    982|    const SSL_CIPHER *bp = (const SSL_CIPHER *)b;
 3764|       |
 3765|    982|    if (ap->id == bp->id)
  ------------------
  |  Branch (3765:9): [True: 0, False: 982]
  ------------------
 3766|      0|        return 0;
 3767|    982|    return ap->id < bp->id ? -1 : 1;
  ------------------
  |  Branch (3767:12): [True: 629, False: 353]
  ------------------
 3768|    982|}

SSL_COMP_get_compression_methods:
 2003|      1|{
 2004|      1|    STACK_OF(SSL_COMP) **rv;
  ------------------
  |  |   33|      1|#define STACK_OF(type) struct stack_st_##type
  ------------------
 2005|       |
 2006|      1|    rv = (STACK_OF(SSL_COMP) **)OSSL_LIB_CTX_get_data(NULL,
 2007|      1|        OSSL_LIB_CTX_COMP_METHODS);
  ------------------
  |  |  119|      1|#define OSSL_LIB_CTX_COMP_METHODS 21
  ------------------
 2008|      1|    if (rv != NULL)
  ------------------
  |  Branch (2008:9): [True: 1, False: 0]
  ------------------
 2009|      1|        return *rv;
 2010|      0|    else
 2011|      0|        return NULL;
 2012|      1|}

OPENSSL_init_ssl:
   44|      1|{
   45|      1|    static int stoperrset = 0;
   46|       |
   47|      1|    if (stopped) {
  ------------------
  |  Branch (47:9): [True: 0, False: 1]
  ------------------
   48|      0|        if (!stoperrset) {
  ------------------
  |  Branch (48:13): [True: 0, False: 0]
  ------------------
   49|       |            /*
   50|       |             * We only ever set this once to avoid getting into an infinite
   51|       |             * loop where the error system keeps trying to init and fails so
   52|       |             * sets an error etc
   53|       |             */
   54|      0|            stoperrset = 1;
   55|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_INIT_FAIL);
  ------------------
  |  |  357|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  359|      0|    (ERR_new(),                                                  \
  |  |  |  |  360|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   56|      0|        }
   57|      0|        return 0;
   58|      0|    }
   59|       |
   60|      1|    opts |= OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  549|      1|#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
  ------------------
   61|      1|        | OPENSSL_INIT_ADD_ALL_DIGESTS;
  ------------------
  |  |  550|      1|#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
  ------------------
   62|      1|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   63|      1|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG) == 0)
  ------------------
  |  |  554|      1|#define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000080L
  ------------------
  |  Branch (63:9): [True: 1, False: 0]
  ------------------
   64|      1|        opts |= OPENSSL_INIT_LOAD_CONFIG;
  ------------------
  |  |  553|      1|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
   65|      1|#endif
   66|       |
   67|      1|    if (!OPENSSL_init_crypto(opts, settings))
  ------------------
  |  Branch (67:9): [True: 0, False: 1]
  ------------------
   68|      0|        return 0;
   69|       |
   70|      1|    if (!RUN_ONCE(&ssl_base, ossl_init_ssl_base))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (70:9): [True: 0, False: 1]
  ------------------
   71|      0|        return 0;
   72|       |
   73|      1|    return 1;
   74|      1|}
ssl_init.c:ossl_init_ssl_base:
   23|      1|{
   24|      1|#ifndef OPENSSL_NO_COMP
   25|      1|    OSSL_TRACE(INIT, "ossl_init_ssl_base: "
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   26|      1|                     "SSL_COMP_get_compression_methods()\n");
   27|       |    /*
   28|       |     * This will initialise the built-in compression algorithms. The value
   29|       |     * returned is a STACK_OF(SSL_COMP), but that can be discarded safely
   30|       |     */
   31|      1|    SSL_COMP_get_compression_methods();
   32|      1|#endif
   33|      1|    ssl_sort_cipher_list();
   34|      1|    OSSL_TRACE(INIT, "ossl_init_ssl_base: SSL_add_ssl_module()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   35|      1|    return 1;
   36|      1|}

get_options_mgr:
  925|      1|{
  926|      1|  if (PREDICT_UNLIKELY(options_mgr == NULL)) {
  ------------------
  |  |  182|      1|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  927|      1|    options_mgr = config_mgr_new(&options_format);
  928|      1|    int rv = subsystems_register_options_formats(options_mgr);
  929|      1|    tor_assert(rv == 0);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  930|      1|    config_mgr_freeze(options_mgr);
  931|      1|  }
  932|      1|  return options_mgr;
  933|      1|}
escaped_safe_str_client:
 1151|    221|{
 1152|    221|  if (get_options()->SafeLogging_ == SAFELOG_SCRUB_ALL)
  ------------------
  |  Branch (1152:7): [True: 221, False: 0]
  ------------------
 1153|    221|    return "[scrubbed]";
 1154|      0|  else
 1155|      0|    return escaped(address);
 1156|    221|}
init_protocol_warning_severity_level:
 1202|      1|{
 1203|      1|  atomic_counter_init(&protocol_warning_severity_level);
 1204|       |  set_protocol_warning_severity_level(LOG_WARN);
  ------------------
  |  |   24|      1|#define LOG_WARN LOG_WARNING
  ------------------
 1205|      1|}
options_new:
 2929|      1|{
 2930|      1|  or_options_t *options = config_new(get_options_mgr());
 2931|      1|  options->command = CMD_RUN_TOR;
 2932|      1|  return options;
 2933|      1|}
config.c:set_protocol_warning_severity_level:
 1191|      1|{
 1192|      1|  atomic_counter_exchange(&protocol_warning_severity_level,
 1193|      1|                          warning_severity);
 1194|      1|}

subsystems_init_upto:
  125|      1|{
  126|      1|  check_and_setup();
  127|       |
  128|     14|  for (unsigned i = 0; i < n_tor_subsystems; ++i) {
  ------------------
  |  Branch (128:24): [True: 14, False: 0]
  ------------------
  129|     14|    const subsys_fns_t *sys = tor_subsystems[i];
  130|     14|    if (!sys->supported)
  ------------------
  |  Branch (130:9): [True: 3, False: 11]
  ------------------
  131|      3|      continue;
  132|     11|    if (sys->level > target_level)
  ------------------
  |  Branch (132:9): [True: 1, False: 10]
  ------------------
  133|      1|      break;
  134|     10|    if (sys_status[i].initialized)
  ------------------
  |  Branch (134:9): [True: 0, False: 10]
  ------------------
  135|      0|      continue;
  136|     10|    int r = 0;
  137|     10|    if (sys->initialize) {
  ------------------
  |  Branch (137:9): [True: 10, False: 0]
  ------------------
  138|       |      // Note that the logging subsystem is designed so that it does no harm
  139|       |      // to log a message in an uninitialized state.  These messages will be
  140|       |      // discarded for now, however.
  141|     10|      log_debug(LD_GENERAL, "Initializing %s", sys->name);
  ------------------
  |  |  269|     10|  STMT_BEGIN                                                                \
  |  |  ------------------
  |  |  |  |  204|     10|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  270|     10|    if (debug_logging_enabled())                                            \
  |  |  ------------------
  |  |  |  Branch (270:9): [True: 0, False: 10]
  |  |  ------------------
  |  |  271|     10|      log_fn_(LOG_DEBUG, domain, __FUNCTION__, args, ##__VA_ARGS__);        \
  |  |  272|     10|  STMT_END
  |  |  ------------------
  |  |  |  |  205|     10|#define STMT_END })
  |  |  ------------------
  ------------------
  142|     10|      r = sys->initialize();
  143|     10|    }
  144|     10|    if (r < 0) {
  ------------------
  |  Branch (144:9): [True: 0, False: 10]
  ------------------
  145|      0|      fprintf(stderr, "BUG: subsystem %s (at %u) initialization failed.\n",
  146|      0|              sys->name, i);
  147|      0|      raw_assert_unreached_msg("A subsystem couldn't be initialized.");
  ------------------
  |  |   27|      0|#define raw_assert_unreached_msg(msg) STMT_BEGIN                    \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   28|      0|    tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg));  \
  |  |   29|      0|    tor_raw_abort_();                                               \
  |  |   30|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
  148|      0|    }
  149|     10|    sys_status[i].initialized = true;
  150|     10|  }
  151|       |
  152|      1|  return 0;
  153|      1|}
subsystems_register_options_formats:
  317|      1|{
  318|      1|  tor_assert(mgr);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|      1|  check_and_setup();
  320|       |
  321|     23|  for (unsigned i = 0; i < n_tor_subsystems; ++i) {
  ------------------
  |  Branch (321:24): [True: 22, False: 1]
  ------------------
  322|     22|    const subsys_fns_t *sys = tor_subsystems[i];
  323|     22|    if (sys->options_format) {
  ------------------
  |  Branch (323:9): [True: 3, False: 19]
  ------------------
  324|      3|      int options_idx = config_mgr_add_format(mgr, sys->options_format);
  325|      3|      sys_status[i].options_idx = options_idx;
  326|       |      log_debug(LD_CONFIG, "Added options format for %s with index %d",
  ------------------
  |  |  269|      3|  STMT_BEGIN                                                                \
  |  |  ------------------
  |  |  |  |  204|      3|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  270|      3|    if (debug_logging_enabled())                                            \
  |  |  ------------------
  |  |  |  Branch (270:9): [True: 0, False: 3]
  |  |  ------------------
  |  |  271|      3|      log_fn_(LOG_DEBUG, domain, __FUNCTION__, args, ##__VA_ARGS__);        \
  |  |  272|      3|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      3|#define STMT_END })
  |  |  ------------------
  ------------------
  327|      3|                sys->name, options_idx);
  328|      3|    }
  329|     22|  }
  330|      1|  return 0;
  331|      1|}
subsysmgr.c:check_and_setup:
   79|      2|{
   80|      2|  if (subsystem_array_validated)
  ------------------
  |  Branch (80:7): [True: 1, False: 1]
  ------------------
   81|      1|    return;
   82|       |
   83|      2|  raw_assert(ARRAY_LENGTH(sys_status) >= n_tor_subsystems);
  ------------------
  |  |   20|      1|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|      1|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|      2|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      2|#define STMT_END })
  |  |  ------------------
  ------------------
   84|      1|  memset(sys_status, 0, sizeof(sys_status));
   85|       |
   86|      1|  int last_level = MIN_SUBSYS_LEVEL;
  ------------------
  |  |  218|      1|#define MIN_SUBSYS_LEVEL -100
  ------------------
   87|       |
   88|     23|  for (unsigned i = 0; i < n_tor_subsystems; ++i) {
  ------------------
  |  Branch (88:24): [True: 22, False: 1]
  ------------------
   89|     22|    const subsys_fns_t *sys = tor_subsystems[i];
   90|     22|    if (sys->level < MIN_SUBSYS_LEVEL || sys->level > MAX_SUBSYS_LEVEL) {
  ------------------
  |  |  218|     44|#define MIN_SUBSYS_LEVEL -100
  ------------------
                  if (sys->level < MIN_SUBSYS_LEVEL || sys->level > MAX_SUBSYS_LEVEL) {
  ------------------
  |  |  222|     22|#define MAX_SUBSYS_LEVEL 100
  ------------------
  |  Branch (90:9): [True: 0, False: 22]
  |  Branch (90:42): [True: 0, False: 22]
  ------------------
   91|      0|      fprintf(stderr, "BUG: Subsystem %s (at %u) has an invalid level %d. "
   92|      0|              "It is supposed to be between %d and %d (inclusive).\n",
   93|      0|              sys->name, i, sys->level, MIN_SUBSYS_LEVEL, MAX_SUBSYS_LEVEL);
  ------------------
  |  |  218|      0|#define MIN_SUBSYS_LEVEL -100
  ------------------
                            sys->name, i, sys->level, MIN_SUBSYS_LEVEL, MAX_SUBSYS_LEVEL);
  ------------------
  |  |  222|      0|#define MAX_SUBSYS_LEVEL 100
  ------------------
   94|      0|      raw_assert_unreached_msg("There is a bug in subsystem_list.c");
  ------------------
  |  |   27|      0|#define raw_assert_unreached_msg(msg) STMT_BEGIN                    \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   28|      0|    tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg));  \
  |  |   29|      0|    tor_raw_abort_();                                               \
  |  |   30|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
   95|      0|    }
   96|     22|    if (sys->level < last_level) {
  ------------------
  |  Branch (96:9): [True: 0, False: 22]
  ------------------
   97|      0|      fprintf(stderr, "BUG: Subsystem %s (at #%u) is in the wrong position. "
   98|      0|              "Its level is %d; but the previous subsystem's level was %d.\n",
   99|      0|              sys->name, i, sys->level, last_level);
  100|      0|      raw_assert_unreached_msg("There is a bug in subsystem_list.c");
  ------------------
  |  |   27|      0|#define raw_assert_unreached_msg(msg) STMT_BEGIN                    \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   28|      0|    tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg));  \
  |  |   29|      0|    tor_raw_abort_();                                               \
  |  |   30|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
  101|      0|    }
  102|     22|    subsys_status_clear(&sys_status[i]);
  103|       |
  104|     22|    last_level = sys->level;
  105|     22|  }
  106|       |
  107|      1|  subsystem_array_validated = true;
  108|      1|}
subsysmgr.c:subsys_status_clear:
   64|     22|{
   65|     22|  if (!status)
  ------------------
  |  Branch (65:7): [True: 0, False: 22]
  ------------------
   66|      0|    return;
   67|     22|  memset(status, 0, sizeof(*status));
   68|     22|  status->initialized = false;
   69|     22|  status->state_idx = IDX_NONE;
  ------------------
  |  |   38|     22|#define IDX_NONE (-1)
  ------------------
   70|     22|  status->options_idx = IDX_NONE;
  ------------------
  |  |   38|     22|#define IDX_NONE (-1)
  ------------------
   71|     22|}

socks_request_new:
   93|  1.42k|{
   94|  1.42k|  return tor_malloc_zero(sizeof(socks_request_t));
  ------------------
  |  |   63|  1.42k|#define tor_malloc_zero(size)  tor_malloc_zero_(size)
  ------------------
   95|  1.42k|}
socks_request_free_:
  100|  1.42k|{
  101|  1.42k|  if (!req)
  ------------------
  |  Branch (101:7): [True: 0, False: 1.42k]
  ------------------
  102|      0|    return;
  103|  1.42k|  if (req->username) {
  ------------------
  |  Branch (103:7): [True: 134, False: 1.28k]
  ------------------
  104|    134|    memwipe(req->username, 0x10, req->usernamelen);
  105|    134|    tor_free(req->username);
  ------------------
  |  |   47|    134|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|    134|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|    134|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|    134|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|    134|                                                 struct event *), \
  |  |   51|    134|                   "use tor_event_free for struct event *");   \
  |  |   52|    134|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|    134|#define raw_free    free
  |  |  ------------------
  |  |   53|    134|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|    134|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    134|#define STMT_END })
  |  |  ------------------
  ------------------
  106|    134|  }
  107|  1.42k|  if (req->password) {
  ------------------
  |  Branch (107:7): [True: 57, False: 1.36k]
  ------------------
  108|     57|    memwipe(req->password, 0x04, req->passwordlen);
  109|     57|    tor_free(req->password);
  ------------------
  |  |   47|     57|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|     57|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|     57|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|     57|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|     57|                                                 struct event *), \
  |  |   51|     57|                   "use tor_event_free for struct event *");   \
  |  |   52|     57|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|     57|#define raw_free    free
  |  |  ------------------
  |  |   53|     57|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|     57|  STMT_END
  |  |  ------------------
  |  |  |  |  205|     57|#define STMT_END })
  |  |  ------------------
  ------------------
  110|     57|  }
  111|  1.42k|  memwipe(req, 0xCC, sizeof(socks_request_t));
  112|       |  tor_free(req);
  ------------------
  |  |   47|  1.42k|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|  1.42k|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|  1.42k|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|  1.42k|                                                 struct event *), \
  |  |   51|  1.42k|                   "use tor_event_free for struct event *");   \
  |  |   52|  1.42k|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|  1.42k|#define raw_free    free
  |  |  ------------------
  |  |   53|  1.42k|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|  1.42k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  ------------------
  ------------------
  113|  1.42k|}
fetch_from_buf_socks:
  848|  1.42k|{
  849|  1.42k|  int res = 0;
  850|  1.42k|  size_t datalen = buf_datalen(buf);
  851|  1.42k|  size_t n_drain;
  852|  1.42k|  const char *head = NULL;
  853|  1.42k|  socks_result_t socks_res;
  854|  1.42k|  size_t n_pullup;
  855|       |
  856|  1.42k|  if (buf_datalen(buf) < 2) { /* version and another byte */
  ------------------
  |  Branch (856:7): [True: 2, False: 1.42k]
  ------------------
  857|      2|    res = 0;
  858|      2|    goto end;
  859|      2|  }
  860|       |
  861|  1.91k|  do {
  862|  1.91k|    n_drain = 0;
  863|  1.91k|    n_pullup = MIN(MAX_SOCKS_MESSAGE_LEN, buf_datalen(buf));
  ------------------
  |  Branch (863:16): [True: 644, False: 1.26k]
  ------------------
  864|  1.91k|    buf_pullup(buf, n_pullup, &head, &datalen);
  865|  1.91k|    tor_assert(head && datalen >= 2);
  ------------------
  |  |  103|  1.91k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.91k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.91k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.91k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.91k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.91k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.91k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.91k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  5.73k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.91k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.91k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.91k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.91k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.91k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.91k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.91k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.91k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.91k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.91k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  866|       |
  867|  1.91k|    socks_res = parse_socks(head, datalen, req, log_sockstype,
  868|  1.91k|                            safe_socks, &n_drain);
  869|       |
  870|  1.91k|    if (socks_res == SOCKS_RESULT_INVALID)
  ------------------
  |  Branch (870:9): [True: 821, False: 1.09k]
  ------------------
  871|    821|      buf_clear(buf);
  872|  1.09k|    else if (socks_res != SOCKS_RESULT_TRUNCATED && n_drain > 0)
  ------------------
  |  Branch (872:14): [True: 974, False: 118]
  |  Branch (872:53): [True: 974, False: 0]
  ------------------
  873|    974|      buf_drain(buf, n_drain);
  874|       |
  875|  1.91k|    switch (socks_res) {
  ------------------
  |  Branch (875:13): [True: 1.91k, False: 0]
  ------------------
  876|    821|      case SOCKS_RESULT_INVALID:
  ------------------
  |  Branch (876:7): [True: 821, False: 1.09k]
  ------------------
  877|    821|        res = -1;
  878|    821|        break;
  879|    429|      case SOCKS_RESULT_DONE:
  ------------------
  |  Branch (879:7): [True: 429, False: 1.48k]
  ------------------
  880|    429|        res = 1;
  881|    429|        break;
  882|    118|      case SOCKS_RESULT_TRUNCATED:
  ------------------
  |  Branch (882:7): [True: 118, False: 1.79k]
  ------------------
  883|    118|        if (datalen == n_pullup)
  ------------------
  |  Branch (883:13): [True: 118, False: 0]
  ------------------
  884|    118|          return 0;
  885|      0|        FALLTHROUGH;
  ------------------
  |  |   77|      0|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  886|    545|      case SOCKS_RESULT_MORE_EXPECTED:
  ------------------
  |  Branch (886:7): [True: 545, False: 1.36k]
  ------------------
  887|    545|        res = 0;
  888|    545|        break;
  889|  1.91k|    }
  890|  1.91k|  } while (res == 0 && head && buf_datalen(buf) >= 2);
  ------------------
  |  Branch (890:12): [True: 545, False: 1.25k]
  |  Branch (890:24): [True: 545, False: 0]
  |  Branch (890:32): [True: 492, False: 53]
  ------------------
  891|       |
  892|  1.30k|  end:
  893|  1.30k|  return res;
  894|  1.42k|}
proto_socks.c:parse_socks:
  968|  1.91k|{
  969|  1.91k|  uint8_t first_octet;
  970|       |
  971|  1.91k|  if (datalen < 2) {
  ------------------
  |  Branch (971:7): [True: 0, False: 1.91k]
  ------------------
  972|       |    /* We always need at least 2 bytes. */
  973|      0|    return SOCKS_RESULT_TRUNCATED;
  974|      0|  }
  975|       |
  976|  1.91k|  first_octet = get_uint8(data);
  977|       |
  978|  1.91k|  if (first_octet == SOCKS_VER_5 || first_octet == SOCKS_VER_4 ||
  ------------------
  |  |   27|  3.82k|#define SOCKS_VER_5 0x05 /* First octet of non-auth SOCKS5 messages */
  ------------------
                if (first_octet == SOCKS_VER_5 || first_octet == SOCKS_VER_4 ||
  ------------------
  |  |   28|  2.82k|#define SOCKS_VER_4 0x04 /*                SOCKS4 messages */
  ------------------
  |  Branch (978:7): [True: 1.00k, False: 913]
  |  Branch (978:37): [True: 598, False: 315]
  ------------------
  979|  1.80k|      first_octet == SOCKS_AUTH) { // XXX: RFC 1929
  ------------------
  |  |   29|    315|#define SOCKS_AUTH  0x01 /*                SOCKS5 auth messages */
  ------------------
  |  Branch (979:7): [True: 209, False: 106]
  ------------------
  980|  1.80k|    return handle_socks_message((const uint8_t *)data, datalen, req,
  981|  1.80k|                                log_sockstype, safe_socks, drain_out);
  982|  1.80k|  }
  983|       |
  984|    106|  switch (first_octet) { /* which version of socks? */
  985|      1|    case 'G': /* get */
  ------------------
  |  Branch (985:5): [True: 1, False: 105]
  ------------------
  986|      3|    case 'H': /* head */
  ------------------
  |  Branch (986:5): [True: 2, False: 104]
  ------------------
  987|      9|    case 'P': /* put/post */
  ------------------
  |  Branch (987:5): [True: 6, False: 100]
  ------------------
  988|     11|    case 'C': /* connect */
  ------------------
  |  Branch (988:5): [True: 2, False: 104]
  ------------------
  989|     11|      strlcpy((char*)req->reply, SOCKS_PROXY_IS_NOT_AN_HTTP_PROXY_MSG,
  990|     11|              MAX_SOCKS_REPLY_LEN);
  ------------------
  |  |   17|     11|#define MAX_SOCKS_REPLY_LEN 1024
  ------------------
  991|     11|      req->replylen = strlen((char*)req->reply)+1;
  992|     11|      FALLTHROUGH;
  ------------------
  |  |   77|     11|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  993|    106|    default: /* version is not socks4 or socks5 */
  ------------------
  |  Branch (993:5): [True: 95, False: 11]
  ------------------
  994|    106|      log_warn(LD_APP,
  ------------------
  |  |  278|    106|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|    106|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  995|    106|               "Socks version %d not recognized. (This port is not an "
  996|    106|               "HTTP proxy; did you want to use HTTPTunnelPort?)",
  997|    106|               *(data));
  998|    106|      {
  999|       |        /* Tell the controller the first 8 bytes. */
 1000|    106|        char *tmp = tor_strndup(data, datalen < 8 ? datalen : 8);
  ------------------
  |  |   69|    212|#define tor_strndup(s, n)      tor_strndup_(s, n)
  |  |  ------------------
  |  |  |  Branch (69:48): [True: 51, False: 55]
  |  |  ------------------
  ------------------
 1001|    106|        control_event_client_status(LOG_WARN,
  ------------------
  |  |   24|    106|#define LOG_WARN LOG_WARNING
  ------------------
 1002|    106|                                    "SOCKS_UNKNOWN_PROTOCOL DATA=\"%s\"",
 1003|    106|                                    escaped(tmp));
 1004|    106|        tor_free(tmp);
  ------------------
  |  |   47|    106|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|    106|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|    106|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|    106|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|    106|                                                 struct event *), \
  |  |   51|    106|                   "use tor_event_free for struct event *");   \
  |  |   52|    106|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|    106|#define raw_free    free
  |  |  ------------------
  |  |   53|    106|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|    106|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    106|#define STMT_END })
  |  |  ------------------
  ------------------
 1005|    106|      }
 1006|    106|      return SOCKS_RESULT_INVALID;
 1007|    106|  }
 1008|       |
 1009|    106|  tor_assert_unreached();
  ------------------
  |  |  115|      0|  STMT_BEGIN {                                                  \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  116|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__,     \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  117|      0|                          "line should be unreached", NULL);    \
  |  |  118|      0|    tor_abort_();                                               \
  |  |  119|    106|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|    106|#define STMT_END })
  |  |  ------------------
  ------------------
 1010|    106|  return SOCKS_RESULT_INVALID;
 1011|    106|}
proto_socks.c:handle_socks_message:
  722|  1.80k|{
  723|  1.80k|  socks_result_t res = SOCKS_RESULT_DONE;
  724|       |
  725|  1.80k|  uint8_t socks_version = raw_data[0];
  726|       |
  727|  1.80k|  if (socks_version == SOCKS_AUTH)
  ------------------
  |  |   29|  1.80k|#define SOCKS_AUTH  0x01 /*                SOCKS5 auth messages */
  ------------------
  |  Branch (727:7): [True: 209, False: 1.59k]
  ------------------
  728|    209|    socks_version = SOCKS_VER_5; // SOCKS5 username/pass subnegotiation
  ------------------
  |  |   27|    209|#define SOCKS_VER_5 0x05 /* First octet of non-auth SOCKS5 messages */
  ------------------
  729|       |
  730|  1.80k|  if (socks_version == SOCKS_VER_4) {
  ------------------
  |  |   28|  1.80k|#define SOCKS_VER_4 0x04 /*                SOCKS4 messages */
  ------------------
  |  Branch (730:7): [True: 598, False: 1.20k]
  ------------------
  731|    598|    if (datalen < SOCKS4_NETWORK_LEN) {
  ------------------
  |  |  509|    598|#define SOCKS4_NETWORK_LEN 8
  ------------------
  |  Branch (731:9): [True: 4, False: 594]
  ------------------
  732|      4|      res = 0;
  733|      4|      goto end;
  734|      4|    }
  735|       |
  736|    594|    int is_socks4a = 0;
  737|    594|    res = parse_socks4_request((const uint8_t *)raw_data, req, datalen,
  738|    594|                               &is_socks4a, drain_out);
  739|       |
  740|    594|    if (res != SOCKS_RESULT_DONE) {
  ------------------
  |  Branch (740:9): [True: 186, False: 408]
  ------------------
  741|    186|      goto end;
  742|    186|    }
  743|       |
  744|    408|    res = process_socks4_request(req, is_socks4a,log_sockstype,
  745|    408|                                 safe_socks);
  746|       |
  747|    408|    if (res != SOCKS_RESULT_DONE) {
  ------------------
  |  Branch (747:9): [True: 201, False: 207]
  ------------------
  748|    201|      goto end;
  749|    201|    }
  750|       |
  751|    207|    goto end;
  752|  1.20k|  } else if (socks_version == SOCKS_VER_5) {
  ------------------
  |  |   27|  1.20k|#define SOCKS_VER_5 0x05 /* First octet of non-auth SOCKS5 messages */
  ------------------
  |  Branch (752:14): [True: 1.20k, False: 0]
  ------------------
  753|  1.20k|    if (datalen < 2) { /* version and another byte */
  ------------------
  |  Branch (753:9): [True: 0, False: 1.20k]
  ------------------
  754|      0|      res = 0;
  755|      0|      goto end;
  756|      0|    }
  757|       |    /* RFC1929 SOCKS5 username/password subnegotiation. */
  758|  1.20k|    if (!req->got_auth && (raw_data[0] == 1 ||
  ------------------
  |  Branch (758:9): [True: 1.19k, False: 12]
  |  Branch (758:28): [True: 203, False: 994]
  ------------------
  759|    994|        req->auth_type == SOCKS_USER_PASS)) {
  ------------------
  |  |   20|    994|#define SOCKS_USER_PASS 0x02
  ------------------
  |  Branch (759:9): [True: 1, False: 993]
  ------------------
  760|    204|      res = parse_socks5_userpass_auth(raw_data, req, datalen,
  761|    204|                                       drain_out);
  762|       |
  763|    204|      if (res != SOCKS_RESULT_DONE) {
  ------------------
  |  Branch (763:11): [True: 40, False: 164]
  ------------------
  764|     40|        goto end;
  765|     40|      }
  766|       |
  767|    164|      res = process_socks5_userpass_auth(req);
  768|    164|      if (res != SOCKS_RESULT_DONE) {
  ------------------
  |  Branch (768:11): [True: 139, False: 25]
  ------------------
  769|    139|        goto end;
  770|    139|      }
  771|       |
  772|     25|      res = SOCKS_RESULT_MORE_EXPECTED;
  773|     25|      goto end;
  774|  1.00k|    } else if (req->socks_version != SOCKS_VER_5) {
  ------------------
  |  |   27|  1.00k|#define SOCKS_VER_5 0x05 /* First octet of non-auth SOCKS5 messages */
  ------------------
  |  Branch (774:16): [True: 560, False: 445]
  ------------------
  775|    560|      int have_user_pass=0, have_no_auth=0;
  776|    560|      res = parse_socks5_methods_request(raw_data, req, datalen,
  777|    560|                                         &have_user_pass,
  778|    560|                                         &have_no_auth,
  779|    560|                                         drain_out);
  780|       |
  781|    560|      if (res != SOCKS_RESULT_DONE) {
  ------------------
  |  Branch (781:11): [True: 24, False: 536]
  ------------------
  782|     24|        goto end;
  783|     24|      }
  784|       |
  785|    536|      res = process_socks5_methods_request(req, have_user_pass,
  786|    536|                                           have_no_auth);
  787|       |
  788|    536|      if (res != SOCKS_RESULT_DONE) {
  ------------------
  |  Branch (788:11): [True: 16, False: 520]
  ------------------
  789|     16|        goto end;
  790|     16|      }
  791|       |
  792|    520|      res = SOCKS_RESULT_MORE_EXPECTED;
  793|    520|      goto end;
  794|    536|    } else {
  795|    445|      res = parse_socks5_client_request(raw_data, req,
  796|    445|                                        datalen, drain_out);
  797|    445|      if (BUG(res == SOCKS_RESULT_INVALID && req->replylen == 0)) {
  ------------------
  |  |  212|    445|  (ASSERT_PREDICT_UNLIKELY_(cond) ?                                     \
  |  |  ------------------
  |  |  |  |   75|    445|  ( {                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:3): [True: 0, False: 445]
  |  |  |  |  ------------------
  |  |  |  |   76|    445|    int tor__assert_tmp_value__;                \
  |  |  |  |   77|    928|    if (e)                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:9): [True: 38, False: 407]
  |  |  |  |  |  Branch (77:9): [True: 0, False: 38]
  |  |  |  |  ------------------
  |  |  |  |   78|    445|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |   79|    445|    else                                        \
  |  |  |  |   80|    445|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |   81|    445|    tor__assert_tmp_value__;                    \
  |  |  |  |   82|    445|  } )
  |  |  ------------------
  |  |  |  Branch (212:3): [True: 0, False: 445]
  |  |  ------------------
  |  |  213|    445|  (tor_bug_occurred_(SHORT_FILE__,__LINE__,__func__,"!("#cond")",0,NULL),1) \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  214|    445|   : 0)
  ------------------
  798|      0|        socks_request_set_socks5_error(req, SOCKS5_GENERAL_ERROR);
  799|      0|      }
  800|    445|      if (res != SOCKS_RESULT_DONE) {
  ------------------
  |  Branch (800:11): [True: 81, False: 364]
  ------------------
  801|     81|        goto end;
  802|     81|      }
  803|       |
  804|    364|      res = process_socks5_client_request(req, log_sockstype,
  805|    364|                                          safe_socks);
  806|       |
  807|    364|      if (res != SOCKS_RESULT_DONE) {
  ------------------
  |  Branch (807:11): [True: 142, False: 222]
  ------------------
  808|    142|        goto end;
  809|    142|      }
  810|    364|    }
  811|  1.20k|  } else {
  812|      0|    *drain_out = datalen;
  813|      0|    res = SOCKS_RESULT_INVALID;
  814|      0|  }
  815|       |
  816|  1.80k|  end:
  817|  1.80k|  return res;
  818|  1.80k|}
proto_socks.c:parse_socks4_request:
  128|    594|{
  129|       |  // http://ss5.sourceforge.net/socks4.protocol.txt
  130|       |  // http://ss5.sourceforge.net/socks4A.protocol.txt
  131|    594|  socks_result_t res = SOCKS_RESULT_DONE;
  132|    594|  tor_addr_t destaddr;
  133|       |
  134|    594|  tor_assert(is_socks4a);
  ------------------
  |  |  103|    594|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    594|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    594|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    594|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    594|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    594|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 594, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    594|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    594|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 594, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    594|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    594|    else                                        \
  |  |  |  |  |  |  |  |   80|    594|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    594|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    594|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    594|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    594|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    594|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  135|    594|  tor_assert(drain_out);
  ------------------
  |  |  103|    594|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    594|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    594|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    594|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    594|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    594|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 594, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    594|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    594|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 594, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    594|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    594|    else                                        \
  |  |  |  |  |  |  |  |   80|    594|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    594|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    594|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    594|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    594|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    594|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|       |
  137|    594|  *is_socks4a = 0;
  138|    594|  *drain_out = 0;
  139|       |
  140|    594|  req->socks_version = SOCKS_VER_4;
  ------------------
  |  |   28|    594|#define SOCKS_VER_4 0x04 /*                SOCKS4 messages */
  ------------------
  141|       |
  142|    594|  socks4_client_request_t *trunnel_req;
  143|       |
  144|    594|  ssize_t parsed =
  145|    594|  socks4_client_request_parse(&trunnel_req, raw_data, datalen);
  146|       |
  147|    594|  if (parsed == -1) {
  ------------------
  |  Branch (147:7): [True: 22, False: 572]
  ------------------
  148|     22|    log_warn(LD_APP, "socks4: parsing failed - invalid request.");
  ------------------
  |  |  278|     22|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|     22|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  149|     22|    res = SOCKS_RESULT_INVALID;
  150|     22|    goto end;
  151|    572|  } else if (parsed == -2) {
  ------------------
  |  Branch (151:14): [True: 34, False: 538]
  ------------------
  152|     34|    res = SOCKS_RESULT_TRUNCATED;
  153|     34|    if (datalen >= MAX_SOCKS_MESSAGE_LEN) {
  ------------------
  |  |   88|     34|#define MAX_SOCKS_MESSAGE_LEN 512
  ------------------
  |  Branch (153:9): [True: 13, False: 21]
  ------------------
  154|     13|      log_warn(LD_APP, "socks4: parsing failed - invalid request.");
  ------------------
  |  |  278|     13|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|     13|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  155|     13|      res = SOCKS_RESULT_INVALID;
  156|     13|    }
  157|     34|    goto end;
  158|     34|  }
  159|       |
  160|    538|  tor_assert(parsed >= 0);
  ------------------
  |  |  103|    594|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    538|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    538|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    538|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    538|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    538|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 538, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    538|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    538|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 538, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    538|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    538|    else                                        \
  |  |  |  |  |  |  |  |   80|    538|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    538|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    538|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    538|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    594|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    594|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|    538|  *drain_out = (size_t)parsed;
  162|       |
  163|    538|  uint8_t command = socks4_client_request_get_command(trunnel_req);
  164|    538|  req->command = command;
  165|       |
  166|    538|  req->port = socks4_client_request_get_port(trunnel_req);
  167|    538|  uint32_t dest_ip = socks4_client_request_get_addr(trunnel_req);
  168|       |
  169|    538|  if ((!req->port && req->command != SOCKS_COMMAND_RESOLVE) ||
  ------------------
  |  |   25|     81|#define SOCKS_COMMAND_RESOLVE       0xF0
  ------------------
  |  Branch (169:8): [True: 81, False: 457]
  |  Branch (169:22): [True: 3, False: 78]
  ------------------
  170|    535|      dest_ip == 0) {
  ------------------
  |  Branch (170:7): [True: 2, False: 533]
  ------------------
  171|      5|    log_warn(LD_APP, "socks4: Port or DestIP is zero. Rejecting.");
  ------------------
  |  |  278|      5|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      5|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  172|      5|    res = SOCKS_RESULT_INVALID;
  173|      5|    goto end;
  174|      5|  }
  175|       |
  176|    533|  *is_socks4a = (dest_ip >> 8) == 0;
  177|       |
  178|    533|  const char *username = socks4_client_request_get_username(trunnel_req);
  179|    533|  const size_t usernamelen = username ? strlen(username) : 0;
  ------------------
  |  Branch (179:30): [True: 533, False: 0]
  ------------------
  180|    533|  if (username && usernamelen) {
  ------------------
  |  Branch (180:7): [True: 533, False: 0]
  |  Branch (180:19): [True: 136, False: 397]
  ------------------
  181|    136|    if (usernamelen > MAX_SOCKS_MESSAGE_LEN) {
  ------------------
  |  |   88|    136|#define MAX_SOCKS_MESSAGE_LEN 512
  ------------------
  |  Branch (181:9): [True: 78, False: 58]
  ------------------
  182|     78|      log_warn(LD_APP, "Socks4 user name too long; rejecting.");
  ------------------
  |  |  278|     78|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|     78|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  183|     78|      res = SOCKS_RESULT_INVALID;
  184|     78|      goto end;
  185|     78|    }
  186|       |
  187|    136|    tor_free(req->username);
  ------------------
  |  |   47|     58|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|     58|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|     58|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|     58|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|     58|                                                 struct event *), \
  |  |   51|     58|                   "use tor_event_free for struct event *");   \
  |  |   52|     58|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|     58|#define raw_free    free
  |  |  ------------------
  |  |   53|     58|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|    136|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    136|#define STMT_END })
  |  |  ------------------
  ------------------
  188|     58|    req->got_auth = 1;
  189|     58|    req->username = tor_strdup(username);
  ------------------
  |  |   68|     58|#define tor_strdup(s)          tor_strdup_(s)
  ------------------
  190|     58|    req->usernamelen = usernamelen;
  191|     58|  }
  192|       |
  193|    455|  if (*is_socks4a) {
  ------------------
  |  Branch (193:7): [True: 330, False: 125]
  ------------------
  194|    330|    const char *trunnel_hostname =
  195|    330|      socks4_client_request_get_socks4a_addr_hostname(trunnel_req);
  196|    330|    if (BUG(!trunnel_hostname)) {
  ------------------
  |  |  212|    330|  (ASSERT_PREDICT_UNLIKELY_(cond) ?                                     \
  |  |  ------------------
  |  |  |  |   75|    330|  ( {                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:3): [True: 0, False: 330]
  |  |  |  |  ------------------
  |  |  |  |   76|    330|    int tor__assert_tmp_value__;                \
  |  |  |  |   77|    330|    if (e)                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:9): [True: 0, False: 330]
  |  |  |  |  ------------------
  |  |  |  |   78|    330|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |   79|    330|    else                                        \
  |  |  |  |   80|    330|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |   81|    330|    tor__assert_tmp_value__;                    \
  |  |  |  |   82|    330|  } )
  |  |  ------------------
  |  |  |  Branch (212:3): [True: 0, False: 330]
  |  |  ------------------
  |  |  213|    330|  (tor_bug_occurred_(SHORT_FILE__,__LINE__,__func__,"!("#cond")",0,NULL),1) \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  214|    330|   : 0)
  ------------------
  197|      0|      res = SOCKS_RESULT_INVALID;
  198|      0|      goto end;
  199|      0|    }
  200|    330|    size_t hostname_len = strlen(trunnel_hostname);
  201|    330|    if (hostname_len < sizeof(req->address)) {
  ------------------
  |  Branch (201:9): [True: 283, False: 47]
  ------------------
  202|    283|      strlcpy(req->address, trunnel_hostname, sizeof(req->address));
  203|    283|    } else {
  204|     47|      log_warn(LD_APP, "socks4: Destaddr too long. Rejecting.");
  ------------------
  |  |  278|     47|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|     47|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  205|     47|      res = SOCKS_RESULT_INVALID;
  206|     47|      goto end;
  207|     47|    }
  208|    330|  } else {
  209|    125|    tor_addr_from_ipv4h(&destaddr, dest_ip);
  ------------------
  |  |  330|    125|  tor_addr_from_ipv4n((dest), htonl(v4addr))
  ------------------
  210|       |
  211|    125|    if (!tor_addr_to_str(req->address, &destaddr,
  ------------------
  |  Branch (211:9): [True: 0, False: 125]
  ------------------
  212|    125|                         MAX_SOCKS_ADDR_LEN, 0)) {
  ------------------
  |  |  995|    125|#define MAX_SOCKS_ADDR_LEN 256
  ------------------
  213|      0|      res = SOCKS_RESULT_INVALID;
  214|      0|      goto end;
  215|      0|    }
  216|    125|  }
  217|       |
  218|    594|  end:
  219|    594|  socks4_client_request_free(trunnel_req);
  220|       |
  221|    594|  return res;
  222|    455|}
proto_socks.c:process_socks4_request:
  237|    408|{
  238|    408|  if (!is_socks4a && !addressmap_have_mapping(req->address, 0)) {
  ------------------
  |  Branch (238:7): [True: 125, False: 283]
  |  Branch (238:22): [True: 125, False: 0]
  ------------------
  239|    125|    log_unsafe_socks_warning(4, req->address, req->port, safe_socks,
  240|    125|                             safe_socks || log_sockstype);
  ------------------
  |  Branch (240:30): [True: 0, False: 125]
  |  Branch (240:44): [True: 0, False: 125]
  ------------------
  241|       |
  242|    125|    if (safe_socks)
  ------------------
  |  Branch (242:9): [True: 0, False: 125]
  ------------------
  243|      0|      return SOCKS_RESULT_INVALID;
  244|    125|  }
  245|       |
  246|    408|  if (req->command != SOCKS_COMMAND_CONNECT &&
  ------------------
  |  |   23|    816|#define SOCKS_COMMAND_CONNECT       0x01
  ------------------
  |  Branch (246:7): [True: 339, False: 69]
  ------------------
  247|    339|      req->command != SOCKS_COMMAND_RESOLVE) {
  ------------------
  |  |   25|    339|#define SOCKS_COMMAND_RESOLVE       0xF0
  ------------------
  |  Branch (247:7): [True: 6, False: 333]
  ------------------
  248|       |    /* not a connect or resolve? we don't support it. (No resolve_ptr with
  249|       |     * socks4.) */
  250|      6|    log_warn(LD_APP, "socks4: command %d not recognized. Rejecting.",
  ------------------
  |  |  278|      6|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      6|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  251|      6|             req->command);
  252|      6|    return SOCKS_RESULT_INVALID;
  253|      6|  }
  254|       |
  255|    402|  if (is_socks4a) {
  ------------------
  |  Branch (255:7): [True: 283, False: 119]
  ------------------
  256|    283|    if (log_sockstype)
  ------------------
  |  Branch (256:9): [True: 0, False: 283]
  ------------------
  257|      0|      log_notice(LD_APP,
  ------------------
  |  |  276|      0|  log_fn_(LOG_NOTICE, domain, __FUNCTION__, args, ##__VA_ARGS__)
  ------------------
  258|    283|                 "Your application (using socks4a to port %d) instructed "
  259|    283|                 "Tor to take care of the DNS resolution itself if "
  260|    283|                 "necessary. This is good.", req->port);
  261|    283|  }
  262|       |
  263|    402|  if (!string_is_valid_dest(req->address)) {
  ------------------
  |  Branch (263:7): [True: 195, False: 207]
  ------------------
  264|    195|    log_warn(LD_PROTOCOL,
  ------------------
  |  |  278|    195|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|    195|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  265|    195|             "Your application (using socks4 to port %d) gave Tor "
  266|    195|             "a malformed hostname: %s. Rejecting the connection.",
  267|    195|             req->port, escaped_safe_str_client(req->address));
  268|    195|     return SOCKS_RESULT_INVALID;
  269|    195|  }
  270|       |
  271|    207|  return SOCKS_RESULT_DONE;
  272|    402|}
proto_socks.c:log_unsafe_socks_warning:
   61|    242|{
   62|    242|  static ratelim_t socks_ratelim = RATELIM_INIT(SOCKS_WARN_INTERVAL);
  ------------------
  |  |   55|    242|#define RATELIM_INIT(r) { (r), 0, 0, 0 }
  ------------------
   63|    242|  char *m = NULL;
   64|       |
   65|       |  /* note the subtle "||" here: either warn every time, or else
   66|       |   * warn in a rate-limited way otherwise. */
   67|    242|  if (warn_every_time || (m = rate_limit_log(&socks_ratelim, approx_time()))) {
  ------------------
  |  Branch (67:7): [True: 0, False: 242]
  |  Branch (67:26): [True: 1, False: 241]
  ------------------
   68|      1|    log_warn(LD_APP,
  ------------------
  |  |  278|      4|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      1|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  |  |  |  Branch (278:51): [True: 0, False: 1]
  |  |  |  Branch (278:51): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   69|      1|             "Your application (using socks%d to port %d) is giving "
   70|      1|             "Tor only an IP address. Applications that do DNS resolves "
   71|      1|             "themselves may leak information. Consider using Socks4A "
   72|      1|             "(e.g. via privoxy or socat) instead. For more information, "
   73|      1|             "please see https://2019.www.torproject.org/docs/faq.html.en"
   74|      1|             "#WarningsAboutSOCKSandDNSInformationLeaks.%s%s",
   75|      1|             socks_protocol,
   76|      1|             (int)port,
   77|      1|             safe_socks ? " Rejecting." : "",
   78|      1|             m ? m : "");
   79|      1|    tor_free(m);
  ------------------
  |  |   47|      1|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|      1|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|      1|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|      1|                                                 struct event *), \
  |  |   51|      1|                   "use tor_event_free for struct event *");   \
  |  |   52|      1|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|      1|#define raw_free    free
  |  |  ------------------
  |  |   53|      1|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
   80|      1|  }
   81|       |  control_event_client_status(LOG_WARN,
  ------------------
  |  |   24|    242|#define LOG_WARN LOG_WARNING
  ------------------
   82|    242|                              "DANGEROUS_SOCKS PROTOCOL=SOCKS%d ADDRESS=%s:%d",
   83|    242|                              socks_protocol, address, (int)port);
   84|    242|}
proto_socks.c:parse_socks5_userpass_auth:
  427|    204|{
  428|    204|  socks_result_t res = SOCKS_RESULT_DONE;
  429|    204|  socks5_client_userpass_auth_t *trunnel_req = NULL;
  430|    204|  ssize_t parsed = socks5_client_userpass_auth_parse(&trunnel_req, raw_data,
  431|    204|                                                     datalen);
  432|    204|  tor_assert(drain_out);
  ------------------
  |  |  103|    204|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    204|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    204|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    204|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    204|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    204|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 204, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    204|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    204|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 204, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    204|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    204|    else                                        \
  |  |  |  |  |  |  |  |   80|    204|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    204|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    204|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    204|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    204|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    204|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|    204|  *drain_out = 0;
  434|       |
  435|    204|  if (parsed == -1) {
  ------------------
  |  Branch (435:7): [True: 1, False: 203]
  ------------------
  436|      1|    log_warn(LD_APP, "socks5: parsing failed - invalid user/pass "
  ------------------
  |  |  278|      1|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      1|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  437|      1|                     "authentication message.");
  438|      1|    res = SOCKS_RESULT_INVALID;
  439|      1|    goto end;
  440|    203|  } else if (parsed == -2) {
  ------------------
  |  Branch (440:14): [True: 39, False: 164]
  ------------------
  441|     39|    res = SOCKS_RESULT_TRUNCATED;
  442|     39|    goto end;
  443|     39|  }
  444|       |
  445|    164|  tor_assert(parsed >= 0);
  ------------------
  |  |  103|    204|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    164|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    164|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    164|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    164|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    164|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 164, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    164|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    164|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 164, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    164|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    164|    else                                        \
  |  |  |  |  |  |  |  |   80|    164|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    164|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    164|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    164|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    204|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    204|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  446|    164|  *drain_out = (size_t)parsed;
  447|       |
  448|    164|  uint8_t usernamelen =
  449|    164|   socks5_client_userpass_auth_get_username_len(trunnel_req);
  450|    164|  uint8_t passwordlen =
  451|    164|   socks5_client_userpass_auth_get_passwd_len(trunnel_req);
  452|    164|  const char *username =
  453|    164|   socks5_client_userpass_auth_getconstarray_username(trunnel_req);
  454|    164|  const char *password =
  455|    164|   socks5_client_userpass_auth_getconstarray_passwd(trunnel_req);
  456|       |
  457|       |  /* Detect invalid SOCKS5 extended-parameter requests. */
  458|    164|  if (usernamelen >= 8 &&
  ------------------
  |  Branch (458:7): [True: 59, False: 105]
  ------------------
  459|     59|      tor_memeq(username, "<torS0X>", 8)) {
  ------------------
  |  Branch (459:7): [True: 0, False: 59]
  ------------------
  460|       |    /* This is indeed an extended-parameter request. */
  461|      0|    if (usernamelen != 9 ||
  ------------------
  |  Branch (461:9): [True: 0, False: 0]
  ------------------
  462|      0|        tor_memneq(username, "<torS0X>0", 9)) {
  ------------------
  |  |   21|      0|#define tor_memneq(a,b,sz) (!tor_memeq((a),(b),(sz)))
  |  |  ------------------
  |  |  |  Branch (21:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  463|       |      /* This request is an unrecognized version, or it includes an Arti RPC
  464|       |       * object ID (which we do not recognize). */
  465|      0|      res = SOCKS_RESULT_INVALID;
  466|      0|      goto end;
  467|      0|    }
  468|      0|  }
  469|       |
  470|    164|  if (usernamelen && username) {
  ------------------
  |  Branch (470:7): [True: 76, False: 88]
  |  Branch (470:22): [True: 76, False: 0]
  ------------------
  471|     76|    tor_free(req->username);
  ------------------
  |  |   47|     76|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|     76|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|     76|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|     76|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|     76|                                                 struct event *), \
  |  |   51|     76|                   "use tor_event_free for struct event *");   \
  |  |   52|     76|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|     76|#define raw_free    free
  |  |  ------------------
  |  |   53|     76|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|     76|  STMT_END
  |  |  ------------------
  |  |  |  |  205|     76|#define STMT_END })
  |  |  ------------------
  ------------------
  472|     76|    req->username = tor_memdup_nulterm(username, usernamelen);
  ------------------
  |  |   71|     76|#define tor_memdup_nulterm(s, n)       tor_memdup_nulterm_(s, n)
  ------------------
  473|     76|    req->usernamelen = usernamelen;
  474|     76|  }
  475|       |
  476|    164|  if (passwordlen && password) {
  ------------------
  |  Branch (476:7): [True: 57, False: 107]
  |  Branch (476:22): [True: 57, False: 0]
  ------------------
  477|     57|    tor_free(req->password);
  ------------------
  |  |   47|     57|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|     57|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|     57|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|     57|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|     57|                                                 struct event *), \
  |  |   51|     57|                   "use tor_event_free for struct event *");   \
  |  |   52|     57|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|     57|#define raw_free    free
  |  |  ------------------
  |  |   53|     57|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|     57|  STMT_END
  |  |  ------------------
  |  |  |  |  205|     57|#define STMT_END })
  |  |  ------------------
  ------------------
  478|     57|    req->password = tor_memdup_nulterm(password, passwordlen);
  ------------------
  |  |   71|     57|#define tor_memdup_nulterm(s, n)       tor_memdup_nulterm_(s, n)
  ------------------
  479|     57|    req->passwordlen = passwordlen;
  480|     57|  }
  481|       |
  482|       |  /**
  483|       |   * Yes, we allow username and/or password to be empty. Yes, that does
  484|       |   * violate RFC 1929. However, some client software can send a username/
  485|       |   * password message with these fields being empty and we want to allow them
  486|       |   * to be used with Tor.
  487|       |   */
  488|    164|  req->got_auth = 1;
  489|       |
  490|    204|  end:
  491|    204|  socks5_client_userpass_auth_free(trunnel_req);
  492|    204|  return res;
  493|    164|}
proto_socks.c:process_socks5_userpass_auth:
  503|    164|{
  504|    164|  socks_result_t res = SOCKS_RESULT_DONE;
  505|    164|  socks5_server_userpass_auth_t *trunnel_resp =
  506|    164|    socks5_server_userpass_auth_new();
  507|    164|  tor_assert(trunnel_resp);
  ------------------
  |  |  103|    164|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    164|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    164|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    164|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    164|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    164|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 164, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    164|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    164|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 164, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    164|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    164|    else                                        \
  |  |  |  |  |  |  |  |   80|    164|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    164|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    164|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    164|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    164|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    164|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  508|       |
  509|    164|  if (req->socks_version != SOCKS_VER_5) {
  ------------------
  |  |   27|    164|#define SOCKS_VER_5 0x05 /* First octet of non-auth SOCKS5 messages */
  ------------------
  |  Branch (509:7): [True: 139, False: 25]
  ------------------
  510|    139|    res = SOCKS_RESULT_INVALID;
  511|    139|    goto end;
  512|    139|  }
  513|       |
  514|     25|  if (req->auth_type != SOCKS_USER_PASS &&
  ------------------
  |  |   20|     50|#define SOCKS_USER_PASS 0x02
  ------------------
  |  Branch (514:7): [True: 22, False: 3]
  ------------------
  515|     22|      req->auth_type != SOCKS_NO_AUTH) {
  ------------------
  |  |   19|     22|#define SOCKS_NO_AUTH 0x00
  ------------------
  |  Branch (515:7): [True: 0, False: 22]
  ------------------
  516|      0|    res = SOCKS_RESULT_INVALID;
  517|      0|    goto end;
  518|      0|  }
  519|       |
  520|     25|  socks5_server_userpass_auth_set_version(trunnel_resp, SOCKS_AUTH);
  ------------------
  |  |   29|     25|#define SOCKS_AUTH  0x01 /*                SOCKS5 auth messages */
  ------------------
  521|     25|  socks5_server_userpass_auth_set_status(trunnel_resp, 0); // auth OK
  522|       |
  523|     25|  const char *errmsg = socks5_server_userpass_auth_check(trunnel_resp);
  524|     25|  if (errmsg) {
  ------------------
  |  Branch (524:7): [True: 0, False: 25]
  ------------------
  525|      0|    log_warn(LD_APP, "socks5: server userpass auth validation failed: %s",
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  526|      0|             errmsg);
  527|      0|    res = SOCKS_RESULT_INVALID;
  528|      0|    goto end;
  529|      0|  }
  530|       |
  531|     25|  ssize_t encoded = socks5_server_userpass_auth_encode(req->reply,
  532|     25|                                                       sizeof(req->reply),
  533|     25|                                                       trunnel_resp);
  534|       |
  535|     25|  if (encoded < 0) {
  ------------------
  |  Branch (535:7): [True: 0, False: 25]
  ------------------
  536|      0|    log_warn(LD_APP, "socks5: server userpass auth encoding failed");
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  537|      0|    res = SOCKS_RESULT_INVALID;
  538|      0|    goto end;
  539|      0|  }
  540|       |
  541|     25|  req->replylen = (size_t)encoded;
  542|       |
  543|    164|  end:
  544|    164|  socks5_server_userpass_auth_free(trunnel_resp);
  545|    164|  return res;
  546|     25|}
proto_socks.c:parse_socks5_methods_request:
  289|    560|{
  290|    560|  socks_result_t res = SOCKS_RESULT_DONE;
  291|    560|  socks5_client_version_t *trunnel_req;
  292|       |
  293|    560|  ssize_t parsed = socks5_client_version_parse(&trunnel_req, raw_data,
  294|    560|                                               datalen);
  295|       |
  296|    560|  (void)req;
  297|       |
  298|    560|  tor_assert(have_no_auth);
  ------------------
  |  |  103|    560|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    560|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    560|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    560|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    560|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    560|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 560, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    560|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    560|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 560, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    560|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    560|    else                                        \
  |  |  |  |  |  |  |  |   80|    560|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    560|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    560|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    560|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    560|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    560|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  299|    560|  tor_assert(have_user_pass);
  ------------------
  |  |  103|    560|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    560|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    560|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    560|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    560|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    560|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 560, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    560|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    560|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 560, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    560|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    560|    else                                        \
  |  |  |  |  |  |  |  |   80|    560|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    560|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    560|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    560|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    560|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    560|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  300|    560|  tor_assert(drain_out);
  ------------------
  |  |  103|    560|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    560|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    560|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    560|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    560|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    560|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 560, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    560|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    560|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 560, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    560|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    560|    else                                        \
  |  |  |  |  |  |  |  |   80|    560|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    560|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    560|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    560|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    560|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    560|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  301|       |
  302|    560|  *drain_out = 0;
  303|       |
  304|    560|  if (parsed == -1) {
  ------------------
  |  Branch (304:7): [True: 0, False: 560]
  ------------------
  305|      0|    log_warn(LD_APP, "socks5: parsing failed - invalid version "
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  306|      0|                     "id/method selection message.");
  307|      0|    res = SOCKS_RESULT_INVALID;
  308|      0|    goto end;
  309|    560|  } else if (parsed == -2) {
  ------------------
  |  Branch (309:14): [True: 11, False: 549]
  ------------------
  310|     11|    res = SOCKS_RESULT_TRUNCATED;
  311|     11|    if (datalen > MAX_SOCKS_MESSAGE_LEN) {
  ------------------
  |  |   88|     11|#define MAX_SOCKS_MESSAGE_LEN 512
  ------------------
  |  Branch (311:9): [True: 0, False: 11]
  ------------------
  312|      0|      log_warn(LD_APP, "socks5: parsing failed - invalid version "
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  313|      0|                       "id/method selection message.");
  314|      0|      res = SOCKS_RESULT_INVALID;
  315|      0|    }
  316|     11|    goto end;
  317|     11|  }
  318|       |
  319|    549|  tor_assert(parsed >= 0);
  ------------------
  |  |  103|    560|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    549|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    549|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    549|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    549|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    549|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 549, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    549|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    549|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 549, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    549|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    549|    else                                        \
  |  |  |  |  |  |  |  |   80|    549|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    549|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    549|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    549|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    560|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    560|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|    549|  *drain_out = (size_t)parsed;
  321|       |
  322|    549|  size_t n_methods = (size_t)socks5_client_version_get_n_methods(trunnel_req);
  323|    549|  if (n_methods == 0) {
  ------------------
  |  Branch (323:7): [True: 13, False: 536]
  ------------------
  324|     13|    res = SOCKS_RESULT_INVALID;
  325|     13|    goto end;
  326|     13|  }
  327|       |
  328|    536|  *have_no_auth = 0;
  329|    536|  *have_user_pass = 0;
  330|       |
  331|  5.77k|  for (size_t i = 0; i < n_methods; i++) {
  ------------------
  |  Branch (331:22): [True: 5.24k, False: 536]
  ------------------
  332|  5.24k|    uint8_t method = socks5_client_version_get_methods(trunnel_req,
  333|  5.24k|                                                       i);
  334|       |
  335|  5.24k|    if (method == SOCKS_USER_PASS) {
  ------------------
  |  |   20|  5.24k|#define SOCKS_USER_PASS 0x02
  ------------------
  |  Branch (335:9): [True: 513, False: 4.72k]
  ------------------
  336|    513|      *have_user_pass = 1;
  337|  4.72k|    } else if (method == SOCKS_NO_AUTH) {
  ------------------
  |  |   19|  4.72k|#define SOCKS_NO_AUTH 0x00
  ------------------
  |  Branch (337:16): [True: 1.41k, False: 3.31k]
  ------------------
  338|  1.41k|      *have_no_auth = 1;
  339|  1.41k|    }
  340|  5.24k|  }
  341|       |
  342|    560|  end:
  343|    560|  socks5_client_version_free(trunnel_req);
  344|       |
  345|    560|  return res;
  346|    536|}
proto_socks.c:process_socks5_methods_request:
  361|    536|{
  362|    536|  socks_result_t res = SOCKS_RESULT_DONE;
  363|    536|  socks5_server_method_t *trunnel_resp = socks5_server_method_new();
  364|    536|  tor_assert(trunnel_resp);
  ------------------
  |  |  103|    536|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    536|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    536|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    536|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    536|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    536|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 536, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    536|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    536|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 536, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    536|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    536|    else                                        \
  |  |  |  |  |  |  |  |   80|    536|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    536|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    536|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    536|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    536|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    536|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  365|       |
  366|    536|  socks5_server_method_set_version(trunnel_resp, SOCKS_VER_5);
  ------------------
  |  |   27|    536|#define SOCKS_VER_5 0x05 /* First octet of non-auth SOCKS5 messages */
  ------------------
  367|       |
  368|    536|  if (have_user_pass && !(have_no_auth && req->socks_prefer_no_auth)) {
  ------------------
  |  Branch (368:7): [True: 34, False: 502]
  |  Branch (368:27): [True: 18, False: 16]
  |  Branch (368:43): [True: 0, False: 18]
  ------------------
  369|     34|    req->auth_type = SOCKS_USER_PASS;
  ------------------
  |  |   20|     34|#define SOCKS_USER_PASS 0x02
  ------------------
  370|     34|    socks5_server_method_set_method(trunnel_resp, SOCKS_USER_PASS);
  ------------------
  |  |   20|     34|#define SOCKS_USER_PASS 0x02
  ------------------
  371|       |
  372|     34|    req->socks_version = SOCKS_VER_5;
  ------------------
  |  |   27|     34|#define SOCKS_VER_5 0x05 /* First octet of non-auth SOCKS5 messages */
  ------------------
  373|       |    // FIXME: come up with better way to remember
  374|       |    // that we negotiated auth
  375|       |
  376|     34|    log_debug(LD_APP,"socks5: accepted method 2 (username/password)");
  ------------------
  |  |  269|     34|  STMT_BEGIN                                                                \
  |  |  ------------------
  |  |  |  |  204|     34|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  270|     34|    if (debug_logging_enabled())                                            \
  |  |  ------------------
  |  |  |  Branch (270:9): [True: 0, False: 34]
  |  |  ------------------
  |  |  271|     34|      log_fn_(LOG_DEBUG, domain, __FUNCTION__, args, ##__VA_ARGS__);        \
  |  |  272|     34|  STMT_END
  |  |  ------------------
  |  |  |  |  205|     34|#define STMT_END })
  |  |  ------------------
  ------------------
  377|    502|  } else if (have_no_auth) {
  ------------------
  |  Branch (377:14): [True: 486, False: 16]
  ------------------
  378|    486|    req->auth_type = SOCKS_NO_AUTH;
  ------------------
  |  |   19|    486|#define SOCKS_NO_AUTH 0x00
  ------------------
  379|    486|    socks5_server_method_set_method(trunnel_resp, SOCKS_NO_AUTH);
  ------------------
  |  |   19|    486|#define SOCKS_NO_AUTH 0x00
  ------------------
  380|       |
  381|    486|    req->socks_version = SOCKS_VER_5;
  ------------------
  |  |   27|    486|#define SOCKS_VER_5 0x05 /* First octet of non-auth SOCKS5 messages */
  ------------------
  382|       |
  383|    486|    log_debug(LD_APP,"socks5: accepted method 0 (no authentication)");
  ------------------
  |  |  269|    486|  STMT_BEGIN                                                                \
  |  |  ------------------
  |  |  |  |  204|    486|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  270|    486|    if (debug_logging_enabled())                                            \
  |  |  ------------------
  |  |  |  Branch (270:9): [True: 0, False: 486]
  |  |  ------------------
  |  |  271|    486|      log_fn_(LOG_DEBUG, domain, __FUNCTION__, args, ##__VA_ARGS__);        \
  |  |  272|    486|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    486|#define STMT_END })
  |  |  ------------------
  ------------------
  384|    486|  } else {
  385|     16|    log_warn(LD_APP,
  ------------------
  |  |  278|     16|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|     16|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  386|     16|             "socks5: offered methods don't include 'no auth' or "
  387|     16|             "username/password. Rejecting.");
  388|     16|    socks5_server_method_set_method(trunnel_resp, 0xFF); // reject all
  389|     16|    res = SOCKS_RESULT_INVALID;
  390|     16|  }
  391|       |
  392|    536|  const char *errmsg = socks5_server_method_check(trunnel_resp);
  393|    536|  if (errmsg) {
  ------------------
  |  Branch (393:7): [True: 0, False: 536]
  ------------------
  394|      0|    log_warn(LD_APP, "socks5: method selection validation failed: %s",
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  395|      0|             errmsg);
  396|      0|    res = SOCKS_RESULT_INVALID;
  397|    536|  } else {
  398|    536|    ssize_t encoded =
  399|    536|    socks5_server_method_encode(req->reply, sizeof(req->reply),
  400|    536|                                trunnel_resp);
  401|       |
  402|    536|    if (encoded < 0) {
  ------------------
  |  Branch (402:9): [True: 0, False: 536]
  ------------------
  403|      0|      log_warn(LD_APP, "socks5: method selection encoding failed");
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  404|      0|      res = SOCKS_RESULT_INVALID;
  405|    536|    } else {
  406|    536|      req->replylen = (size_t)encoded;
  407|    536|    }
  408|    536|  }
  409|       |
  410|    536|  socks5_server_method_free(trunnel_resp);
  411|    536|  return res;
  412|    536|}
proto_socks.c:parse_socks5_client_request:
  560|    445|{
  561|    445|  socks_result_t res = SOCKS_RESULT_DONE;
  562|    445|  tor_addr_t destaddr;
  563|    445|  socks5_client_request_t *trunnel_req = NULL;
  564|    445|  ssize_t parsed =
  565|    445|   socks5_client_request_parse(&trunnel_req, raw_data, datalen);
  566|    445|  if (parsed == -1) {
  ------------------
  |  Branch (566:7): [True: 38, False: 407]
  ------------------
  567|     38|    log_warn(LD_APP, "socks5: parsing failed - invalid client request");
  ------------------
  |  |  278|     38|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|     38|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  568|     38|    res = SOCKS_RESULT_INVALID;
  569|     38|    socks_request_set_socks5_error(req, SOCKS5_GENERAL_ERROR);
  570|     38|    goto end;
  571|    407|  } else if (parsed == -2) {
  ------------------
  |  Branch (571:14): [True: 43, False: 364]
  ------------------
  572|     43|    res = SOCKS_RESULT_TRUNCATED;
  573|     43|    goto end;
  574|     43|  }
  575|       |
  576|    364|  tor_assert(parsed >= 0);
  ------------------
  |  |  103|    445|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    364|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    364|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    364|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    364|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    364|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 364, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    364|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    364|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 364, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    364|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    364|    else                                        \
  |  |  |  |  |  |  |  |   80|    364|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    364|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    364|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    364|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    445|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    445|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  577|    364|  *drain_out = (size_t)parsed;
  578|       |
  579|    364|  if (socks5_client_request_get_version(trunnel_req) != 5) {
  ------------------
  |  Branch (579:7): [True: 0, False: 364]
  ------------------
  580|      0|    res = SOCKS_RESULT_INVALID;
  581|      0|    socks_request_set_socks5_error(req, SOCKS5_GENERAL_ERROR);
  582|      0|    goto end;
  583|      0|  }
  584|       |
  585|    364|  req->command = socks5_client_request_get_command(trunnel_req);
  586|       |
  587|    364|  req->port = socks5_client_request_get_dest_port(trunnel_req);
  588|       |
  589|    364|  uint8_t atype = socks5_client_request_get_atype(trunnel_req);
  590|    364|  req->socks5_atyp = atype;
  591|       |
  592|    364|  switch (atype) {
  593|     37|    case 1: {
  ------------------
  |  Branch (593:5): [True: 37, False: 327]
  ------------------
  594|     37|      uint32_t ipv4 = socks5_client_request_get_dest_addr_ipv4(trunnel_req);
  595|     37|      tor_addr_from_ipv4h(&destaddr, ipv4);
  ------------------
  |  |  330|     37|  tor_addr_from_ipv4n((dest), htonl(v4addr))
  ------------------
  596|       |
  597|     37|      tor_addr_to_str(req->address, &destaddr, sizeof(req->address), 1);
  598|     37|    } break;
  599|    161|    case 3: {
  ------------------
  |  Branch (599:5): [True: 161, False: 203]
  ------------------
  600|    161|      const struct domainname_st *dns_name =
  601|    161|        socks5_client_request_getconst_dest_addr_domainname(trunnel_req);
  602|       |
  603|    161|      const char *hostname = domainname_getconstarray_name(dns_name);
  604|       |
  605|    161|      strlcpy(req->address, hostname, sizeof(req->address));
  606|    161|    } break;
  607|    166|    case 4: {
  ------------------
  |  Branch (607:5): [True: 166, False: 198]
  ------------------
  608|    166|      const uint8_t *ipv6 =
  609|    166|          socks5_client_request_getarray_dest_addr_ipv6(trunnel_req);
  610|    166|      tor_addr_from_ipv6_bytes(&destaddr, ipv6);
  611|       |
  612|    166|      tor_addr_to_str(req->address, &destaddr, sizeof(req->address), 1);
  613|    166|    } break;
  614|      0|    default: {
  ------------------
  |  Branch (614:5): [True: 0, False: 364]
  ------------------
  615|      0|      socks_request_set_socks5_error(req, SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED);
  616|      0|      res = -1;
  617|      0|    } break;
  618|    364|  }
  619|       |
  620|    445|  end:
  621|    445|  socks5_client_request_free(trunnel_req);
  622|    445|  return res;
  623|    364|}
proto_socks.c:socks_request_set_socks5_error:
  902|    180|{
  903|    180|  socks5_server_reply_t *trunnel_resp = socks5_server_reply_new();
  904|    180|  tor_assert(trunnel_resp);
  ------------------
  |  |  103|    180|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    180|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    180|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    180|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    180|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    180|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    180|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    180|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    180|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    180|    else                                        \
  |  |  |  |  |  |  |  |   80|    180|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    180|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    180|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    180|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    180|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    180|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  905|       |
  906|    180|  socks5_server_reply_set_version(trunnel_resp, SOCKS_VER_5);
  ------------------
  |  |   27|    180|#define SOCKS_VER_5 0x05 /* First octet of non-auth SOCKS5 messages */
  ------------------
  907|    180|  socks5_server_reply_set_reply(trunnel_resp, reason);
  908|    180|  socks5_server_reply_set_atype(trunnel_resp, 0x01);
  909|       |
  910|    180|  const char *errmsg = socks5_server_reply_check(trunnel_resp);
  911|    180|  if (errmsg) {
  ------------------
  |  Branch (911:7): [True: 0, False: 180]
  ------------------
  912|      0|    log_warn(LD_APP, "socks5: reply validation failed: %s",
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  913|      0|             errmsg);
  914|      0|    goto end;
  915|      0|  }
  916|       |
  917|    180|  ssize_t encoded = socks5_server_reply_encode(req->reply,
  918|    180|                                               sizeof(req->reply),
  919|    180|                                               trunnel_resp);
  920|    180|  if (encoded < 0) {
  ------------------
  |  Branch (920:7): [True: 0, False: 180]
  ------------------
  921|      0|    log_warn(LD_APP, "socks5: reply encoding failed: %d",
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  922|      0|             (int)encoded);
  923|    180|  } else {
  924|    180|    req->replylen = (size_t)encoded;
  925|    180|  }
  926|       |
  927|    180|  end:
  928|    180|  socks5_server_reply_free(trunnel_resp);
  929|    180|}
proto_socks.c:process_socks5_client_request:
  639|    364|{
  640|    364|  socks_result_t res = SOCKS_RESULT_DONE;
  641|    364|  tor_addr_t tmpaddr;
  642|       |
  643|    364|  if (req->command != SOCKS_COMMAND_CONNECT &&
  ------------------
  |  |   23|    728|#define SOCKS_COMMAND_CONNECT       0x01
  ------------------
  |  Branch (643:7): [True: 223, False: 141]
  ------------------
  644|    223|      req->command != SOCKS_COMMAND_RESOLVE &&
  ------------------
  |  |   25|    587|#define SOCKS_COMMAND_RESOLVE       0xF0
  ------------------
  |  Branch (644:7): [True: 212, False: 11]
  ------------------
  645|    212|      req->command != SOCKS_COMMAND_RESOLVE_PTR) {
  ------------------
  |  |   27|    212|#define SOCKS_COMMAND_RESOLVE_PTR   0xF1
  ------------------
  |  Branch (645:7): [True: 5, False: 207]
  ------------------
  646|      5|    socks_request_set_socks5_error(req,SOCKS5_COMMAND_NOT_SUPPORTED);
  647|      5|    res = SOCKS_RESULT_INVALID;
  648|      5|    goto end;
  649|      5|  }
  650|       |
  651|    359|  if (req->command == SOCKS_COMMAND_RESOLVE_PTR &&
  ------------------
  |  |   27|    718|#define SOCKS_COMMAND_RESOLVE_PTR   0xF1
  ------------------
  |  Branch (651:7): [True: 207, False: 152]
  ------------------
  652|    207|      tor_addr_parse(&tmpaddr, req->address) < 0) {
  ------------------
  |  Branch (652:7): [True: 111, False: 96]
  ------------------
  653|    111|    socks_request_set_socks5_error(req, SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED);
  654|    111|    log_warn(LD_APP, "socks5 received RESOLVE_PTR command with "
  ------------------
  |  |  278|    111|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|    111|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  655|    111|                     "a malformed address. Rejecting.");
  656|       |
  657|    111|    res = SOCKS_RESULT_INVALID;
  658|    111|    goto end;
  659|    111|  }
  660|       |
  661|    248|  if (!string_is_valid_dest(req->address)) {
  ------------------
  |  Branch (661:7): [True: 26, False: 222]
  ------------------
  662|     26|    socks_request_set_socks5_error(req, SOCKS5_GENERAL_ERROR);
  663|       |
  664|     26|    log_warn(LD_PROTOCOL,
  ------------------
  |  |  278|     26|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|     26|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  665|     26|             "Your application (using socks5 to port %d) gave Tor "
  666|     26|             "a malformed hostname: %s. Rejecting the connection.",
  667|     26|             req->port, escaped_safe_str_client(req->address));
  668|       |
  669|     26|    res = SOCKS_RESULT_INVALID;
  670|     26|    goto end;
  671|     26|  }
  672|       |
  673|    222|  if (req->socks5_atyp == 1 || req->socks5_atyp == 4) {
  ------------------
  |  Branch (673:7): [True: 37, False: 185]
  |  Branch (673:32): [True: 165, False: 20]
  ------------------
  674|    202|    if (req->command != SOCKS_COMMAND_RESOLVE_PTR &&
  ------------------
  |  |   27|    404|#define SOCKS_COMMAND_RESOLVE_PTR   0xF1
  ------------------
  |  Branch (674:9): [True: 117, False: 85]
  ------------------
  675|    117|        !addressmap_have_mapping(req->address,0)) {
  ------------------
  |  Branch (675:9): [True: 117, False: 0]
  ------------------
  676|    117|      log_unsafe_socks_warning(5, req->address, req->port, safe_socks,
  677|    117|                               safe_socks || log_sockstype);
  ------------------
  |  Branch (677:32): [True: 0, False: 117]
  |  Branch (677:46): [True: 0, False: 117]
  ------------------
  678|    117|      if (safe_socks) {
  ------------------
  |  Branch (678:11): [True: 0, False: 117]
  ------------------
  679|      0|        socks_request_set_socks5_error(req, SOCKS5_NOT_ALLOWED);
  680|      0|        res = SOCKS_RESULT_INVALID;
  681|      0|        goto end;
  682|      0|      }
  683|    117|    }
  684|    202|  }
  685|       |
  686|    222|  if (log_sockstype)
  ------------------
  |  Branch (686:7): [True: 0, False: 222]
  ------------------
  687|      0|    log_notice(LD_APP,
  ------------------
  |  |  276|      0|  log_fn_(LOG_NOTICE, domain, __FUNCTION__, args, ##__VA_ARGS__)
  ------------------
  688|    222|              "Your application (using socks5 to port %d) instructed "
  689|    222|              "Tor to take care of the DNS resolution itself if "
  690|    222|              "necessary. This is good.", req->port);
  691|       |
  692|    364|  end:
  693|    364|  return res;
  694|    222|}

siphash24:
   65|    243|uint64_t siphash24(const void *src, unsigned long src_sz, const struct sipkey *key) {
   66|    243|	const uint8_t *m = src;
   67|    243|	uint64_t k0 = key->k0;
   68|    243|	uint64_t k1 = key->k1;
   69|    243|	uint64_t last7 = (uint64_t)(src_sz & 0xff) << 56;
   70|    243|	size_t i, blocks;
   71|       |
   72|    243|	uint64_t v0 = k0 ^ 0x736f6d6570736575ULL;
   73|    243|	uint64_t v1 = k1 ^ 0x646f72616e646f6dULL;
   74|    243|	uint64_t v2 = k0 ^ 0x6c7967656e657261ULL;
   75|    243|	uint64_t v3 = k1 ^ 0x7465646279746573ULL;
   76|       |
   77|    644|	for (i = 0, blocks = (src_sz & ~7); i < blocks; i+= 8) {
  ------------------
  |  Branch (77:38): [True: 401, False: 243]
  ------------------
   78|       |#ifdef UNALIGNED_OK
   79|       |		uint64_t mi = _le64toh(*(m + i));
   80|       |#else
   81|    401|		uint64_t mi;
   82|    401|		memcpy(&mi, m + i, 8);
   83|    401|		mi = _le64toh(mi);
  ------------------
  |  |   40|    401|#  define _le64toh(x) ((uint64_t)(x))
  ------------------
   84|    401|#endif
   85|    401|		v3 ^= mi;
   86|    401|		DOUBLE_ROUND(v0,v1,v2,v3);
  ------------------
  |  |   49|    401|	HALF_ROUND(v0,v1,v2,v3,13,16);		\
  |  |  ------------------
  |  |  |  |   43|    401|	a += b; c += d;				\
  |  |  |  |   44|    401|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    401|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    401|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   50|    401|	HALF_ROUND(v2,v1,v0,v3,17,21);		\
  |  |  ------------------
  |  |  |  |   43|    401|	a += b; c += d;				\
  |  |  |  |   44|    401|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    401|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    401|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   51|    401|	HALF_ROUND(v0,v1,v2,v3,13,16);		\
  |  |  ------------------
  |  |  |  |   43|    401|	a += b; c += d;				\
  |  |  |  |   44|    401|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    401|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    401|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|    401|	HALF_ROUND(v2,v1,v0,v3,17,21);
  |  |  ------------------
  |  |  |  |   43|    401|	a += b; c += d;				\
  |  |  |  |   44|    401|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    401|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    401|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    401|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   87|    401|		v0 ^= mi;
   88|    401|	}
   89|       |
   90|       |#ifdef __COVERITY__
   91|       |	{
   92|       |		uint64_t mi = 0;
   93|       |		memcpy(&mi, m+i, (src_sz-blocks));
   94|       |		last7 = _le64toh(mi) | (uint64_t)(src_sz & 0xff) << 56;
   95|       |	}
   96|       |#else
   97|    243|	switch (src_sz - blocks) {
   98|     56|		case 7: last7 |= (uint64_t)m[i + 6] << 48; FALLTHROUGH;
  ------------------
  |  |   77|     56|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  |  Branch (98:3): [True: 56, False: 187]
  ------------------
   99|     80|		case 6: last7 |= (uint64_t)m[i + 5] << 40; FALLTHROUGH;
  ------------------
  |  |   77|     80|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  |  Branch (99:3): [True: 24, False: 219]
  ------------------
  100|    113|		case 5:	last7 |= (uint64_t)m[i + 4] << 32; FALLTHROUGH;
  ------------------
  |  |   77|    113|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  |  Branch (100:3): [True: 33, False: 210]
  ------------------
  101|    138|		case 4: last7 |= (uint64_t)m[i + 3] << 24; FALLTHROUGH;
  ------------------
  |  |   77|    138|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  |  Branch (101:3): [True: 25, False: 218]
  ------------------
  102|    164|		case 3:	last7 |= (uint64_t)m[i + 2] << 16; FALLTHROUGH;
  ------------------
  |  |   77|    164|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  |  Branch (102:3): [True: 26, False: 217]
  ------------------
  103|    184|		case 2:	last7 |= (uint64_t)m[i + 1] <<  8; FALLTHROUGH;
  ------------------
  |  |   77|    184|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  |  Branch (103:3): [True: 20, False: 223]
  ------------------
  104|    220|		case 1: last7 |= (uint64_t)m[i + 0]      ; FALLTHROUGH;
  ------------------
  |  |   77|    220|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  |  Branch (104:3): [True: 36, False: 207]
  ------------------
  105|    243|		case 0:
  ------------------
  |  Branch (105:3): [True: 23, False: 220]
  ------------------
  106|    243|		default:;
  ------------------
  |  Branch (106:3): [True: 0, False: 243]
  ------------------
  107|    243|	}
  108|    243|#endif
  109|    243|	v3 ^= last7;
  110|    243|	DOUBLE_ROUND(v0,v1,v2,v3);
  ------------------
  |  |   49|    243|	HALF_ROUND(v0,v1,v2,v3,13,16);		\
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   50|    243|	HALF_ROUND(v2,v1,v0,v3,17,21);		\
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   51|    243|	HALF_ROUND(v0,v1,v2,v3,13,16);		\
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|    243|	HALF_ROUND(v2,v1,v0,v3,17,21);
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  111|    243|	v0 ^= last7;
  112|    243|	v2 ^= 0xff;
  113|    243|	DOUBLE_ROUND(v0,v1,v2,v3);
  ------------------
  |  |   49|    243|	HALF_ROUND(v0,v1,v2,v3,13,16);		\
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   50|    243|	HALF_ROUND(v2,v1,v0,v3,17,21);		\
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   51|    243|	HALF_ROUND(v0,v1,v2,v3,13,16);		\
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|    243|	HALF_ROUND(v2,v1,v0,v3,17,21);
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|    243|	DOUBLE_ROUND(v0,v1,v2,v3);
  ------------------
  |  |   49|    243|	HALF_ROUND(v0,v1,v2,v3,13,16);		\
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   50|    243|	HALF_ROUND(v2,v1,v0,v3,17,21);		\
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   51|    243|	HALF_ROUND(v0,v1,v2,v3,13,16);		\
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   52|    243|	HALF_ROUND(v2,v1,v0,v3,17,21);
  |  |  ------------------
  |  |  |  |   43|    243|	a += b; c += d;				\
  |  |  |  |   44|    243|	b = ROTATE(b, s) ^ a;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   45|    243|	d = ROTATE(d, t) ^ c;			\
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  |  |   46|    243|	a = ROTATE(a, 32);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|    243|#define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  115|    243|	return v0 ^ v1 ^ v2 ^ v3;
  116|    243|}
siphash24g:
  122|    243|uint64_t siphash24g(const void *src, unsigned long src_sz) {
  123|    243|	raw_assert(the_siphash_key_is_set);
  ------------------
  |  |   20|    243|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|    243|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|    243|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 243]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|    243|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    243|#define STMT_END })
  |  |  ------------------
  ------------------
  124|    243|	return siphash24(src, src_sz, &the_siphash_key);
  125|    243|}
siphash_set_global_key:
  128|      2|{
  129|      2|	raw_assert(! the_siphash_key_is_set);
  ------------------
  |  |   20|      2|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|      2|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|      2|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|      2|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      2|#define STMT_END })
  |  |  ------------------
  ------------------
  130|      2|	the_siphash_key.k0 = key->k0;
  131|      2|	the_siphash_key.k1 = key->k1;
  132|      2|	the_siphash_key_is_set = 1;
  133|      2|}
siphash_unset_global_key:
  136|      1|{
  137|      1|	the_siphash_key_is_set = 0;
  138|      1|	memset(&the_siphash_key, 0, sizeof(the_siphash_key));
  139|      1|}

curve25519_donna:
  435|      8|curve25519_donna(u8 *mypublic, const u8 *secret, const u8 *basepoint) {
  436|      8|  limb bp[5], x[5], z[5], zmone[5];
  437|      8|  uint8_t e[32];
  438|      8|  int i;
  439|       |
  440|    264|  for (i = 0;i < 32;++i) e[i] = secret[i];
  ------------------
  |  Branch (440:14): [True: 256, False: 8]
  ------------------
  441|      8|  e[0] &= 248;
  442|      8|  e[31] &= 127;
  443|      8|  e[31] |= 64;
  444|       |
  445|      8|  fexpand(bp, basepoint);
  446|      8|  cmult(x, z, e, bp);
  447|      8|  crecip(zmone, z);
  448|      8|  fmul(z, x, zmone);
  449|      8|  fcontract(mypublic, z);
  450|      8|  return 0;
  451|      8|}
curve25519-donna-c64.c:fexpand:
  219|      8|fexpand(limb *output, const u8 *in) {
  220|      8|  output[0] = load_limb(in) & 0x7ffffffffffff;
  221|      8|  output[1] = (load_limb(in+6) >> 3) & 0x7ffffffffffff;
  222|      8|  output[2] = (load_limb(in+12) >> 6) & 0x7ffffffffffff;
  223|      8|  output[3] = (load_limb(in+19) >> 1) & 0x7ffffffffffff;
  224|      8|  output[4] = (load_limb(in+24) >> 12) & 0x7ffffffffffff;
  225|      8|}
curve25519-donna-c64.c:load_limb:
  193|     40|load_limb(const u8 *in) {
  194|     40|  return
  195|     40|    ((limb)in[0]) |
  196|     40|    (((limb)in[1]) << 8) |
  197|     40|    (((limb)in[2]) << 16) |
  198|     40|    (((limb)in[3]) << 24) |
  199|     40|    (((limb)in[4]) << 32) |
  200|     40|    (((limb)in[5]) << 40) |
  201|     40|    (((limb)in[6]) << 48) |
  202|     40|    (((limb)in[7]) << 56);
  203|     40|}
curve25519-donna-c64.c:cmult:
  354|      8|cmult(limb *resultx, limb *resultz, const u8 *n, const limb *q) {
  355|      8|  limb a[5] = {0}, b[5] = {1}, c[5] = {1}, d[5] = {0};
  356|      8|  limb *nqpqx = a, *nqpqz = b, *nqx = c, *nqz = d, *t;
  357|      8|  limb e[5] = {0}, f[5] = {1}, g[5] = {0}, h[5] = {1};
  358|      8|  limb *nqpqx2 = e, *nqpqz2 = f, *nqx2 = g, *nqz2 = h;
  359|       |
  360|      8|  unsigned i, j;
  361|       |
  362|      8|  memcpy(nqpqx, q, sizeof(limb) * 5);
  363|       |
  364|    264|  for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (364:15): [True: 256, False: 8]
  ------------------
  365|    256|    u8 byte = n[31 - i];
  366|  2.30k|    for (j = 0; j < 8; ++j) {
  ------------------
  |  Branch (366:17): [True: 2.04k, False: 256]
  ------------------
  367|  2.04k|      const limb bit = byte >> 7;
  368|       |
  369|  2.04k|      swap_conditional(nqx, nqpqx, bit);
  370|  2.04k|      swap_conditional(nqz, nqpqz, bit);
  371|  2.04k|      fmonty(nqx2, nqz2,
  372|  2.04k|             nqpqx2, nqpqz2,
  373|  2.04k|             nqx, nqz,
  374|  2.04k|             nqpqx, nqpqz,
  375|  2.04k|             q);
  376|  2.04k|      swap_conditional(nqx2, nqpqx2, bit);
  377|  2.04k|      swap_conditional(nqz2, nqpqz2, bit);
  378|       |
  379|  2.04k|      t = nqx;
  380|  2.04k|      nqx = nqx2;
  381|  2.04k|      nqx2 = t;
  382|  2.04k|      t = nqz;
  383|  2.04k|      nqz = nqz2;
  384|  2.04k|      nqz2 = t;
  385|  2.04k|      t = nqpqx;
  386|  2.04k|      nqpqx = nqpqx2;
  387|  2.04k|      nqpqx2 = t;
  388|  2.04k|      t = nqpqz;
  389|  2.04k|      nqpqz = nqpqz2;
  390|  2.04k|      nqpqz2 = t;
  391|       |
  392|  2.04k|      byte <<= 1;
  393|  2.04k|    }
  394|    256|  }
  395|       |
  396|      8|  memcpy(resultx, nqx, sizeof(limb) * 5);
  397|      8|  memcpy(resultz, nqz, sizeof(limb) * 5);
  398|      8|}
curve25519-donna-c64.c:swap_conditional:
  336|  8.19k|swap_conditional(limb a[5], limb b[5], limb iswap) {
  337|  8.19k|  unsigned i;
  338|  8.19k|  const limb swap = -iswap;
  339|       |
  340|  49.1k|  for (i = 0; i < 5; ++i) {
  ------------------
  |  Branch (340:15): [True: 40.9k, False: 8.19k]
  ------------------
  341|  40.9k|    const limb x = swap & (a[i] ^ b[i]);
  342|  40.9k|    a[i] ^= x;
  343|  40.9k|    b[i] ^= x;
  344|  40.9k|  }
  345|  8.19k|}
curve25519-donna-c64.c:fmonty:
  299|  2.04k|       const limb *qmqp /* input Q - Q' */) {
  300|  2.04k|  limb origx[5], origxprime[5], zzz[5], xx[5], zz[5], xxprime[5],
  301|  2.04k|        zzprime[5], zzzprime[5];
  302|       |
  303|  2.04k|  memcpy(origx, x, 5 * sizeof(limb));
  304|  2.04k|  fsum(x, z);
  305|  2.04k|  fdifference_backwards(z, origx);  // does x - z
  306|       |
  307|  2.04k|  memcpy(origxprime, xprime, sizeof(limb) * 5);
  308|  2.04k|  fsum(xprime, zprime);
  309|  2.04k|  fdifference_backwards(zprime, origxprime);
  310|  2.04k|  fmul(xxprime, xprime, z);
  311|  2.04k|  fmul(zzprime, x, zprime);
  312|  2.04k|  memcpy(origxprime, xxprime, sizeof(limb) * 5);
  313|  2.04k|  fsum(xxprime, zzprime);
  314|  2.04k|  fdifference_backwards(zzprime, origxprime);
  315|  2.04k|  fsquare_times(x3, xxprime, 1);
  316|  2.04k|  fsquare_times(zzzprime, zzprime, 1);
  317|  2.04k|  fmul(z3, zzzprime, qmqp);
  318|       |
  319|  2.04k|  fsquare_times(xx, x, 1);
  320|  2.04k|  fsquare_times(zz, z, 1);
  321|  2.04k|  fmul(x2, xx, zz);
  322|  2.04k|  fdifference_backwards(zz, xx);  // does zz = xx - zz
  323|  2.04k|  fscalar_product(zzz, zz, 121665);
  324|  2.04k|  fsum(zzz, xx);
  325|  2.04k|  fmul(z2, zz, zzz);
  326|  2.04k|}
curve25519-donna-c64.c:fsum:
   42|  8.19k|fsum(limb *output, const limb *in) {
   43|  8.19k|  output[0] += in[0];
   44|  8.19k|  output[1] += in[1];
   45|  8.19k|  output[2] += in[2];
   46|  8.19k|  output[3] += in[3];
   47|  8.19k|  output[4] += in[4];
   48|  8.19k|}
curve25519-donna-c64.c:fdifference_backwards:
   57|  8.19k|fdifference_backwards(felem out, const felem in) {
   58|       |  /* 152 is 19 << 3 */
   59|  8.19k|  static const limb two54m152 = (((limb)1) << 54) - 152;
   60|  8.19k|  static const limb two54m8 = (((limb)1) << 54) - 8;
   61|       |
   62|  8.19k|  out[0] = in[0] + two54m152 - out[0];
   63|  8.19k|  out[1] = in[1] + two54m8 - out[1];
   64|  8.19k|  out[2] = in[2] + two54m8 - out[2];
   65|  8.19k|  out[3] = in[3] + two54m8 - out[3];
   66|  8.19k|  out[4] = in[4] + two54m8 - out[4];
   67|  8.19k|}
curve25519-donna-c64.c:fsquare_times:
  150|  8.28k|fsquare_times(felem output, const felem in, limb count) {
  151|  8.28k|  uint128_t t[5];
  152|  8.28k|  limb r0,r1,r2,r3,r4,c;
  153|  8.28k|  limb d0,d1,d2,d4,d419;
  154|       |
  155|  8.28k|  r0 = in[0];
  156|  8.28k|  r1 = in[1];
  157|  8.28k|  r2 = in[2];
  158|  8.28k|  r3 = in[3];
  159|  8.28k|  r4 = in[4];
  160|       |
  161|  10.2k|  do {
  162|  10.2k|    d0 = r0 * 2;
  163|  10.2k|    d1 = r1 * 2;
  164|  10.2k|    d2 = r2 * 2 * 19;
  165|  10.2k|    d419 = r4 * 19;
  166|  10.2k|    d4 = d419 * 2;
  167|       |
  168|  10.2k|    t[0] = ((uint128_t) r0) * r0 + ((uint128_t) d4) * r1 + (((uint128_t) d2) * (r3     ));
  169|  10.2k|    t[1] = ((uint128_t) d0) * r1 + ((uint128_t) d4) * r2 + (((uint128_t) r3) * (r3 * 19));
  170|  10.2k|    t[2] = ((uint128_t) d0) * r2 + ((uint128_t) r1) * r1 + (((uint128_t) d4) * (r3     ));
  171|  10.2k|    t[3] = ((uint128_t) d0) * r3 + ((uint128_t) d1) * r2 + (((uint128_t) r4) * (d419   ));
  172|  10.2k|    t[4] = ((uint128_t) d0) * r4 + ((uint128_t) d1) * r3 + (((uint128_t) r2) * (r2     ));
  173|       |
  174|  10.2k|                    r0 = (limb)t[0] & 0x7ffffffffffff; c = (limb)(t[0] >> 51);
  175|  10.2k|    t[1] += c;      r1 = (limb)t[1] & 0x7ffffffffffff; c = (limb)(t[1] >> 51);
  176|  10.2k|    t[2] += c;      r2 = (limb)t[2] & 0x7ffffffffffff; c = (limb)(t[2] >> 51);
  177|  10.2k|    t[3] += c;      r3 = (limb)t[3] & 0x7ffffffffffff; c = (limb)(t[3] >> 51);
  178|  10.2k|    t[4] += c;      r4 = (limb)t[4] & 0x7ffffffffffff; c = (limb)(t[4] >> 51);
  179|  10.2k|    r0 +=   c * 19; c = r0 >> 51; r0 = r0 & 0x7ffffffffffff;
  180|  10.2k|    r1 +=   c;      c = r1 >> 51; r1 = r1 & 0x7ffffffffffff;
  181|  10.2k|    r2 +=   c;
  182|  10.2k|  } while(--count);
  ------------------
  |  Branch (182:11): [True: 1.94k, False: 8.28k]
  ------------------
  183|       |
  184|  8.28k|  output[0] = r0;
  185|  8.28k|  output[1] = r1;
  186|  8.28k|  output[2] = r2;
  187|  8.28k|  output[3] = r3;
  188|  8.28k|  output[4] = r4;
  189|  8.28k|}
curve25519-donna-c64.c:fscalar_product:
   71|  2.04k|fscalar_product(felem output, const felem in, const limb scalar) {
   72|  2.04k|  uint128_t a;
   73|       |
   74|  2.04k|  a = ((uint128_t) in[0]) * scalar;
   75|  2.04k|  output[0] = ((limb)a) & 0x7ffffffffffff;
   76|       |
   77|  2.04k|  a = ((uint128_t) in[1]) * scalar + ((limb) (a >> 51));
   78|  2.04k|  output[1] = ((limb)a) & 0x7ffffffffffff;
   79|       |
   80|  2.04k|  a = ((uint128_t) in[2]) * scalar + ((limb) (a >> 51));
   81|  2.04k|  output[2] = ((limb)a) & 0x7ffffffffffff;
   82|       |
   83|  2.04k|  a = ((uint128_t) in[3]) * scalar + ((limb) (a >> 51));
   84|  2.04k|  output[3] = ((limb)a) & 0x7ffffffffffff;
   85|       |
   86|  2.04k|  a = ((uint128_t) in[4]) * scalar + ((limb) (a >> 51));
   87|  2.04k|  output[4] = ((limb)a) & 0x7ffffffffffff;
   88|       |
   89|  2.04k|  output[0] += (a >> 51) * 19;
   90|  2.04k|}
curve25519-donna-c64.c:crecip:
  405|      8|crecip(felem out, const felem z) {
  406|      8|  felem a,t0,b,c;
  407|       |
  408|       |  /* 2 */ fsquare_times(a, z, 1); // a = 2
  409|      8|  /* 8 */ fsquare_times(t0, a, 2);
  410|      8|  /* 9 */ fmul(b, t0, z); // b = 9
  411|      8|  /* 11 */ fmul(a, b, a); // a = 11
  412|      8|  /* 22 */ fsquare_times(t0, a, 1);
  413|      8|  /* 2^5 - 2^0 = 31 */ fmul(b, t0, b);
  414|      8|  /* 2^10 - 2^5 */ fsquare_times(t0, b, 5);
  415|      8|  /* 2^10 - 2^0 */ fmul(b, t0, b);
  416|      8|  /* 2^20 - 2^10 */ fsquare_times(t0, b, 10);
  417|      8|  /* 2^20 - 2^0 */ fmul(c, t0, b);
  418|      8|  /* 2^40 - 2^20 */ fsquare_times(t0, c, 20);
  419|      8|  /* 2^40 - 2^0 */ fmul(t0, t0, c);
  420|      8|  /* 2^50 - 2^10 */ fsquare_times(t0, t0, 10);
  421|      8|  /* 2^50 - 2^0 */ fmul(b, t0, b);
  422|      8|  /* 2^100 - 2^50 */ fsquare_times(t0, b, 50);
  423|      8|  /* 2^100 - 2^0 */ fmul(c, t0, b);
  424|      8|  /* 2^200 - 2^100 */ fsquare_times(t0, c, 100);
  425|      8|  /* 2^200 - 2^0 */ fmul(t0, t0, c);
  426|      8|  /* 2^250 - 2^50 */ fsquare_times(t0, t0, 50);
  427|      8|  /* 2^250 - 2^0 */ fmul(t0, t0, b);
  428|      8|  /* 2^255 - 2^5 */ fsquare_times(t0, t0, 5);
  429|      8|  /* 2^255 - 21 */ fmul(out, t0, a);
  430|      8|}
curve25519-donna-c64.c:fmul:
  101|  10.3k|fmul(felem output, const felem in2, const felem in) {
  102|  10.3k|  uint128_t t[5];
  103|  10.3k|  limb r0,r1,r2,r3,r4,s0,s1,s2,s3,s4,c;
  104|       |
  105|  10.3k|  r0 = in[0];
  106|  10.3k|  r1 = in[1];
  107|  10.3k|  r2 = in[2];
  108|  10.3k|  r3 = in[3];
  109|  10.3k|  r4 = in[4];
  110|       |
  111|  10.3k|  s0 = in2[0];
  112|  10.3k|  s1 = in2[1];
  113|  10.3k|  s2 = in2[2];
  114|  10.3k|  s3 = in2[3];
  115|  10.3k|  s4 = in2[4];
  116|       |
  117|  10.3k|  t[0]  =  ((uint128_t) r0) * s0;
  118|  10.3k|  t[1]  =  ((uint128_t) r0) * s1 + ((uint128_t) r1) * s0;
  119|  10.3k|  t[2]  =  ((uint128_t) r0) * s2 + ((uint128_t) r2) * s0 + ((uint128_t) r1) * s1;
  120|  10.3k|  t[3]  =  ((uint128_t) r0) * s3 + ((uint128_t) r3) * s0 + ((uint128_t) r1) * s2 + ((uint128_t) r2) * s1;
  121|  10.3k|  t[4]  =  ((uint128_t) r0) * s4 + ((uint128_t) r4) * s0 + ((uint128_t) r3) * s1 + ((uint128_t) r1) * s3 + ((uint128_t) r2) * s2;
  122|       |
  123|  10.3k|  r4 *= 19;
  124|  10.3k|  r1 *= 19;
  125|  10.3k|  r2 *= 19;
  126|  10.3k|  r3 *= 19;
  127|       |
  128|  10.3k|  t[0] += ((uint128_t) r4) * s1 + ((uint128_t) r1) * s4 + ((uint128_t) r2) * s3 + ((uint128_t) r3) * s2;
  129|  10.3k|  t[1] += ((uint128_t) r4) * s2 + ((uint128_t) r2) * s4 + ((uint128_t) r3) * s3;
  130|  10.3k|  t[2] += ((uint128_t) r4) * s3 + ((uint128_t) r3) * s4;
  131|  10.3k|  t[3] += ((uint128_t) r4) * s4;
  132|       |
  133|  10.3k|                  r0 = (limb)t[0] & 0x7ffffffffffff; c = (limb)(t[0] >> 51);
  134|  10.3k|  t[1] += c;      r1 = (limb)t[1] & 0x7ffffffffffff; c = (limb)(t[1] >> 51);
  135|  10.3k|  t[2] += c;      r2 = (limb)t[2] & 0x7ffffffffffff; c = (limb)(t[2] >> 51);
  136|  10.3k|  t[3] += c;      r3 = (limb)t[3] & 0x7ffffffffffff; c = (limb)(t[3] >> 51);
  137|  10.3k|  t[4] += c;      r4 = (limb)t[4] & 0x7ffffffffffff; c = (limb)(t[4] >> 51);
  138|  10.3k|  r0 +=   c * 19; c = r0 >> 51; r0 = r0 & 0x7ffffffffffff;
  139|  10.3k|  r1 +=   c;      c = r1 >> 51; r1 = r1 & 0x7ffffffffffff;
  140|  10.3k|  r2 +=   c;
  141|       |
  142|  10.3k|  output[0] = r0;
  143|  10.3k|  output[1] = r1;
  144|  10.3k|  output[2] = r2;
  145|  10.3k|  output[3] = r3;
  146|  10.3k|  output[4] = r4;
  147|  10.3k|}
curve25519-donna-c64.c:fcontract:
  231|      8|fcontract(u8 *output, const felem input) {
  232|      8|  uint128_t t[5];
  233|       |
  234|      8|  t[0] = input[0];
  235|      8|  t[1] = input[1];
  236|      8|  t[2] = input[2];
  237|      8|  t[3] = input[3];
  238|      8|  t[4] = input[4];
  239|       |
  240|      8|  t[1] += t[0] >> 51; t[0] &= 0x7ffffffffffff;
  241|      8|  t[2] += t[1] >> 51; t[1] &= 0x7ffffffffffff;
  242|      8|  t[3] += t[2] >> 51; t[2] &= 0x7ffffffffffff;
  243|      8|  t[4] += t[3] >> 51; t[3] &= 0x7ffffffffffff;
  244|      8|  t[0] += 19 * (t[4] >> 51); t[4] &= 0x7ffffffffffff;
  245|       |
  246|      8|  t[1] += t[0] >> 51; t[0] &= 0x7ffffffffffff;
  247|      8|  t[2] += t[1] >> 51; t[1] &= 0x7ffffffffffff;
  248|      8|  t[3] += t[2] >> 51; t[2] &= 0x7ffffffffffff;
  249|      8|  t[4] += t[3] >> 51; t[3] &= 0x7ffffffffffff;
  250|      8|  t[0] += 19 * (t[4] >> 51); t[4] &= 0x7ffffffffffff;
  251|       |
  252|       |  /* now t is between 0 and 2^255-1, properly carried. */
  253|       |  /* case 1: between 0 and 2^255-20. case 2: between 2^255-19 and 2^255-1. */
  254|       |
  255|      8|  t[0] += 19;
  256|       |
  257|      8|  t[1] += t[0] >> 51; t[0] &= 0x7ffffffffffff;
  258|      8|  t[2] += t[1] >> 51; t[1] &= 0x7ffffffffffff;
  259|      8|  t[3] += t[2] >> 51; t[2] &= 0x7ffffffffffff;
  260|      8|  t[4] += t[3] >> 51; t[3] &= 0x7ffffffffffff;
  261|      8|  t[0] += 19 * (t[4] >> 51); t[4] &= 0x7ffffffffffff;
  262|       |
  263|       |  /* now between 19 and 2^255-1 in both cases, and offset by 19. */
  264|       |
  265|      8|  t[0] += 0x8000000000000 - 19;
  266|      8|  t[1] += 0x8000000000000 - 1;
  267|      8|  t[2] += 0x8000000000000 - 1;
  268|      8|  t[3] += 0x8000000000000 - 1;
  269|      8|  t[4] += 0x8000000000000 - 1;
  270|       |
  271|       |  /* now between 2^255 and 2^256-20, and offset by 2^255. */
  272|       |
  273|      8|  t[1] += t[0] >> 51; t[0] &= 0x7ffffffffffff;
  274|      8|  t[2] += t[1] >> 51; t[1] &= 0x7ffffffffffff;
  275|      8|  t[3] += t[2] >> 51; t[2] &= 0x7ffffffffffff;
  276|      8|  t[4] += t[3] >> 51; t[3] &= 0x7ffffffffffff;
  277|      8|  t[4] &= 0x7ffffffffffff;
  278|       |
  279|      8|  store_limb(output,    t[0] | (t[1] << 51));
  280|      8|  store_limb(output+8,  (t[1] >> 13) | (t[2] << 38));
  281|      8|  store_limb(output+16, (t[2] >> 26) | (t[3] << 25));
  282|      8|  store_limb(output+24, (t[3] >> 39) | (t[4] << 12));
  283|      8|}
curve25519-donna-c64.c:store_limb:
  206|     32|store_limb(u8 *out, limb in) {
  207|     32|  out[0] = in & 0xff;
  208|     32|  out[1] = (in >> 8) & 0xff;
  209|     32|  out[2] = (in >> 16) & 0xff;
  210|     32|  out[3] = (in >> 24) & 0xff;
  211|     32|  out[4] = (in >> 32) & 0xff;
  212|     32|  out[5] = (in >> 40) & 0xff;
  213|     32|  out[6] = (in >> 48) & 0xff;
  214|     32|  out[7] = (in >> 56) & 0xff;
  215|     32|}

ed25519_tor.c:curve25519_copy:
   17|     96|curve25519_copy(bignum25519 out, const bignum25519 in) {
   18|     96|	out[0] = in[0];
   19|     96|	out[1] = in[1];
   20|     96|	out[2] = in[2];
   21|     96|	out[3] = in[3];
   22|     96|	out[4] = in[4];
   23|     96|}
ed25519_tor.c:curve25519_square:
  237|  1.18k|curve25519_square(bignum25519 out, const bignum25519 in) {
  238|       |#if !defined(HAVE_NATIVE_UINT128)
  239|       |	uint128_t mul;
  240|       |#endif
  241|  1.18k|	uint128_t t[5];
  242|  1.18k|	uint64_t r0,r1,r2,r3,r4,c;
  243|  1.18k|	uint64_t d0,d1,d2,d4,d419;
  244|       |
  245|  1.18k|	r0 = in[0];
  246|  1.18k|	r1 = in[1];
  247|  1.18k|	r2 = in[2];
  248|  1.18k|	r3 = in[3];
  249|  1.18k|	r4 = in[4];
  250|       |
  251|  1.18k|	d0 = r0 * 2;
  252|  1.18k|	d1 = r1 * 2;
  253|  1.18k|	d2 = r2 * 2 * 19;
  254|  1.18k|	d419 = r4 * 19;
  255|  1.18k|	d4 = d419 * 2;
  256|       |
  257|  1.18k|#if defined(HAVE_NATIVE_UINT128)
  258|  1.18k|	t[0] = ((uint128_t) r0) * r0 + ((uint128_t) d4) * r1 + (((uint128_t) d2) * (r3     ));
  259|  1.18k|	t[1] = ((uint128_t) d0) * r1 + ((uint128_t) d4) * r2 + (((uint128_t) r3) * (r3 * 19));
  260|  1.18k|	t[2] = ((uint128_t) d0) * r2 + ((uint128_t) r1) * r1 + (((uint128_t) d4) * (r3     ));
  261|  1.18k|	t[3] = ((uint128_t) d0) * r3 + ((uint128_t) d1) * r2 + (((uint128_t) r4) * (d419   ));
  262|  1.18k|	t[4] = ((uint128_t) d0) * r4 + ((uint128_t) d1) * r3 + (((uint128_t) r2) * (r2     ));
  263|       |#else
  264|       |	mul64x64_128(t[0], r0, r0) mul64x64_128(mul, d4, r1) add128(t[0], mul) mul64x64_128(mul, d2,      r3) add128(t[0], mul)
  265|       |	mul64x64_128(t[1], d0, r1) mul64x64_128(mul, d4, r2) add128(t[1], mul) mul64x64_128(mul, r3, r3 * 19) add128(t[1], mul)
  266|       |	mul64x64_128(t[2], d0, r2) mul64x64_128(mul, r1, r1) add128(t[2], mul) mul64x64_128(mul, d4,      r3) add128(t[2], mul)
  267|       |	mul64x64_128(t[3], d0, r3) mul64x64_128(mul, d1, r2) add128(t[3], mul) mul64x64_128(mul, r4,    d419) add128(t[3], mul)
  268|       |	mul64x64_128(t[4], d0, r4) mul64x64_128(mul, d1, r3) add128(t[4], mul) mul64x64_128(mul, r2,      r2) add128(t[4], mul)
  269|       |#endif
  270|       |
  271|  1.18k|	                     r0 = lo128(t[0]) & reduce_mask_51; shr128(c, t[0], 51);
  ------------------
  |  |   82|  1.18k|		#define lo128(a) ((uint64_t)a)
  ------------------
              	                     r0 = lo128(t[0]) & reduce_mask_51; shr128(c, t[0], 51);
  ------------------
  |  |   78|  1.18k|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  272|  1.18k|	add128_64(t[1], c)   r1 = lo128(t[1]) & reduce_mask_51; shr128(c, t[1], 51);
  ------------------
  |  |   81|  1.18k|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	add128_64(t[1], c)   r1 = lo128(t[1]) & reduce_mask_51; shr128(c, t[1], 51);
  ------------------
  |  |   82|  1.18k|		#define lo128(a) ((uint64_t)a)
  ------------------
              	add128_64(t[1], c)   r1 = lo128(t[1]) & reduce_mask_51; shr128(c, t[1], 51);
  ------------------
  |  |   78|  1.18k|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  273|  1.18k|	add128_64(t[2], c)   r2 = lo128(t[2]) & reduce_mask_51; shr128(c, t[2], 51);
  ------------------
  |  |   81|  1.18k|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	add128_64(t[2], c)   r2 = lo128(t[2]) & reduce_mask_51; shr128(c, t[2], 51);
  ------------------
  |  |   82|  1.18k|		#define lo128(a) ((uint64_t)a)
  ------------------
              	add128_64(t[2], c)   r2 = lo128(t[2]) & reduce_mask_51; shr128(c, t[2], 51);
  ------------------
  |  |   78|  1.18k|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  274|  1.18k|	add128_64(t[3], c)   r3 = lo128(t[3]) & reduce_mask_51; shr128(c, t[3], 51);
  ------------------
  |  |   81|  1.18k|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	add128_64(t[3], c)   r3 = lo128(t[3]) & reduce_mask_51; shr128(c, t[3], 51);
  ------------------
  |  |   82|  1.18k|		#define lo128(a) ((uint64_t)a)
  ------------------
              	add128_64(t[3], c)   r3 = lo128(t[3]) & reduce_mask_51; shr128(c, t[3], 51);
  ------------------
  |  |   78|  1.18k|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  275|  1.18k|	add128_64(t[4], c)   r4 = lo128(t[4]) & reduce_mask_51; shr128(c, t[4], 51);
  ------------------
  |  |   81|  1.18k|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	add128_64(t[4], c)   r4 = lo128(t[4]) & reduce_mask_51; shr128(c, t[4], 51);
  ------------------
  |  |   82|  1.18k|		#define lo128(a) ((uint64_t)a)
  ------------------
              	add128_64(t[4], c)   r4 = lo128(t[4]) & reduce_mask_51; shr128(c, t[4], 51);
  ------------------
  |  |   78|  1.18k|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  276|  1.18k|	r0 +=   c * 19; c = r0 >> 51; r0 = r0 & reduce_mask_51;
  277|  1.18k|	r1 +=   c;
  278|       |
  279|  1.18k|	out[0] = r0;
  280|  1.18k|	out[1] = r1;
  281|  1.18k|	out[2] = r2;
  282|  1.18k|	out[3] = r3;
  283|  1.18k|	out[4] = r4;
  284|  1.18k|}
ed25519_tor.c:curve25519_sub_reduce:
   83|     13|curve25519_sub_reduce(bignum25519 out, const bignum25519 a, const bignum25519 b) {
   84|     13|	uint64_t c;
   85|     13|	out[0] = a[0] + fourP0    - b[0]    ; c = (out[0] >> 51); out[0] &= reduce_mask_51;
   86|     13|	out[1] = a[1] + fourP1234 - b[1] + c; c = (out[1] >> 51); out[1] &= reduce_mask_51;
   87|     13|	out[2] = a[2] + fourP1234 - b[2] + c; c = (out[2] >> 51); out[2] &= reduce_mask_51;
   88|     13|	out[3] = a[3] + fourP1234 - b[3] + c; c = (out[3] >> 51); out[3] &= reduce_mask_51;
   89|     13|	out[4] = a[4] + fourP1234 - b[4] + c; c = (out[4] >> 51); out[4] &= reduce_mask_51;
   90|     13|	out[0] += c * 19;
   91|     13|}
ed25519_tor.c:curve25519_square_times:
  180|    143|curve25519_square_times(bignum25519 out, const bignum25519 in, uint64_t count) {
  181|       |#if !defined(HAVE_NATIVE_UINT128)
  182|       |	uint128_t mul;
  183|       |#endif
  184|    143|	uint128_t t[5];
  185|    143|	uint64_t r0,r1,r2,r3,r4,c;
  186|    143|	uint64_t d0,d1,d2,d4,d419;
  187|       |
  188|    143|	r0 = in[0];
  189|    143|	r1 = in[1];
  190|    143|	r2 = in[2];
  191|    143|	r3 = in[3];
  192|    143|	r4 = in[4];
  193|       |
  194|  3.29k|	do {
  195|  3.29k|		d0 = r0 * 2;
  196|  3.29k|		d1 = r1 * 2;
  197|  3.29k|		d2 = r2 * 2 * 19;
  198|  3.29k|		d419 = r4 * 19;
  199|  3.29k|		d4 = d419 * 2;
  200|       |
  201|  3.29k|#if defined(HAVE_NATIVE_UINT128)
  202|  3.29k|		t[0] = ((uint128_t) r0) * r0 + ((uint128_t) d4) * r1 + (((uint128_t) d2) * (r3     ));
  203|  3.29k|		t[1] = ((uint128_t) d0) * r1 + ((uint128_t) d4) * r2 + (((uint128_t) r3) * (r3 * 19));
  204|  3.29k|		t[2] = ((uint128_t) d0) * r2 + ((uint128_t) r1) * r1 + (((uint128_t) d4) * (r3     ));
  205|  3.29k|		t[3] = ((uint128_t) d0) * r3 + ((uint128_t) d1) * r2 + (((uint128_t) r4) * (d419   ));
  206|  3.29k|		t[4] = ((uint128_t) d0) * r4 + ((uint128_t) d1) * r3 + (((uint128_t) r2) * (r2     ));
  207|       |#else
  208|       |		mul64x64_128(t[0], r0, r0) mul64x64_128(mul, d4, r1) add128(t[0], mul) mul64x64_128(mul, d2,      r3) add128(t[0], mul)
  209|       |		mul64x64_128(t[1], d0, r1) mul64x64_128(mul, d4, r2) add128(t[1], mul) mul64x64_128(mul, r3, r3 * 19) add128(t[1], mul)
  210|       |		mul64x64_128(t[2], d0, r2) mul64x64_128(mul, r1, r1) add128(t[2], mul) mul64x64_128(mul, d4,      r3) add128(t[2], mul)
  211|       |		mul64x64_128(t[3], d0, r3) mul64x64_128(mul, d1, r2) add128(t[3], mul) mul64x64_128(mul, r4,    d419) add128(t[3], mul)
  212|       |		mul64x64_128(t[4], d0, r4) mul64x64_128(mul, d1, r3) add128(t[4], mul) mul64x64_128(mul, r2,      r2) add128(t[4], mul)
  213|       |#endif
  214|       |
  215|  3.29k|		r0 = lo128(t[0]) & reduce_mask_51;
  ------------------
  |  |   82|  3.29k|		#define lo128(a) ((uint64_t)a)
  ------------------
  216|  3.29k|		r1 = lo128(t[1]) & reduce_mask_51; shl128(c, t[0], 13); r1 += c;
  ------------------
  |  |   82|  3.29k|		#define lo128(a) ((uint64_t)a)
  ------------------
              		r1 = lo128(t[1]) & reduce_mask_51; shl128(c, t[0], 13); r1 += c;
  ------------------
  |  |   79|  3.29k|		#define shl128(out,in,shift) out = (uint64_t)((in << shift) >> 64);
  ------------------
  217|  3.29k|		r2 = lo128(t[2]) & reduce_mask_51; shl128(c, t[1], 13); r2 += c;
  ------------------
  |  |   82|  3.29k|		#define lo128(a) ((uint64_t)a)
  ------------------
              		r2 = lo128(t[2]) & reduce_mask_51; shl128(c, t[1], 13); r2 += c;
  ------------------
  |  |   79|  3.29k|		#define shl128(out,in,shift) out = (uint64_t)((in << shift) >> 64);
  ------------------
  218|  3.29k|		r3 = lo128(t[3]) & reduce_mask_51; shl128(c, t[2], 13); r3 += c;
  ------------------
  |  |   82|  3.29k|		#define lo128(a) ((uint64_t)a)
  ------------------
              		r3 = lo128(t[3]) & reduce_mask_51; shl128(c, t[2], 13); r3 += c;
  ------------------
  |  |   79|  3.29k|		#define shl128(out,in,shift) out = (uint64_t)((in << shift) >> 64);
  ------------------
  219|  3.29k|		r4 = lo128(t[4]) & reduce_mask_51; shl128(c, t[3], 13); r4 += c; 
  ------------------
  |  |   82|  3.29k|		#define lo128(a) ((uint64_t)a)
  ------------------
              		r4 = lo128(t[4]) & reduce_mask_51; shl128(c, t[3], 13); r4 += c; 
  ------------------
  |  |   79|  3.29k|		#define shl128(out,in,shift) out = (uint64_t)((in << shift) >> 64);
  ------------------
  220|  3.29k|		                                   shl128(c, t[4], 13); r0 += c * 19;
  ------------------
  |  |   79|  3.29k|		#define shl128(out,in,shift) out = (uint64_t)((in << shift) >> 64);
  ------------------
  221|  3.29k|		               c = r0 >> 51; r0 &= reduce_mask_51;
  222|  3.29k|		r1 += c     ;  c = r1 >> 51; r1 &= reduce_mask_51;
  223|  3.29k|		r2 += c     ;  c = r2 >> 51; r2 &= reduce_mask_51;
  224|  3.29k|		r3 += c     ;  c = r3 >> 51; r3 &= reduce_mask_51;
  225|  3.29k|		r4 += c     ;  c = r4 >> 51; r4 &= reduce_mask_51;
  226|  3.29k|		r0 += c * 19;
  227|  3.29k|	} while(--count);
  ------------------
  |  Branch (227:10): [True: 3.15k, False: 143]
  ------------------
  228|       |
  229|    143|	out[0] = r0;
  230|    143|	out[1] = r1;
  231|    143|	out[2] = r2;
  232|    143|	out[3] = r3;
  233|    143|	out[4] = r4;
  234|    143|}
ed25519_tor.c:curve25519_mul_noinline:
  174|    143|curve25519_mul_noinline(bignum25519 out, const bignum25519 in2, const bignum25519 in) {
  175|    143|	curve25519_mul(out, in2, in);
  176|    143|}
ed25519_tor.c:curve25519_add_reduce:
   46|    383|curve25519_add_reduce(bignum25519 out, const bignum25519 a, const bignum25519 b) {
   47|    383|	uint64_t c;
   48|    383|	out[0] = a[0] + b[0]    ; c = (out[0] >> 51); out[0] &= reduce_mask_51;
   49|    383|	out[1] = a[1] + b[1] + c; c = (out[1] >> 51); out[1] &= reduce_mask_51;
   50|    383|	out[2] = a[2] + b[2] + c; c = (out[2] >> 51); out[2] &= reduce_mask_51;
   51|    383|	out[3] = a[3] + b[3] + c; c = (out[3] >> 51); out[3] &= reduce_mask_51;
   52|    383|	out[4] = a[4] + b[4] + c; c = (out[4] >> 51); out[4] &= reduce_mask_51;
   53|    383|	out[0] += c * 19;
   54|    383|}
ed25519_tor.c:curve25519_add_after_basic:
   37|    701|curve25519_add_after_basic(bignum25519 out, const bignum25519 a, const bignum25519 b) {
   38|    701|	out[0] = a[0] + b[0];
   39|    701|	out[1] = a[1] + b[1];
   40|    701|	out[2] = a[2] + b[2];
   41|    701|	out[3] = a[3] + b[3];
   42|    701|	out[4] = a[4] + b[4];
   43|    701|}
ed25519_tor.c:curve25519_sub_after_basic:
   74|  1.29k|curve25519_sub_after_basic(bignum25519 out, const bignum25519 a, const bignum25519 b) {
   75|  1.29k|	out[0] = a[0] + fourP0    - b[0];
   76|  1.29k|	out[1] = a[1] + fourP1234 - b[1];
   77|  1.29k|	out[2] = a[2] + fourP1234 - b[2];
   78|  1.29k|	out[3] = a[3] + fourP1234 - b[3];
   79|  1.29k|	out[4] = a[4] + fourP1234 - b[4];
   80|  1.29k|}
ed25519_tor.c:curve25519_add:
   27|  2.93k|curve25519_add(bignum25519 out, const bignum25519 a, const bignum25519 b) {
   28|  2.93k|	out[0] = a[0] + b[0];
   29|  2.93k|	out[1] = a[1] + b[1];
   30|  2.93k|	out[2] = a[2] + b[2];
   31|  2.93k|	out[3] = a[3] + b[3];
   32|  2.93k|	out[4] = a[4] + b[4];
   33|  2.93k|}
ed25519_tor.c:curve25519_sub:
   64|  1.94k|curve25519_sub(bignum25519 out, const bignum25519 a, const bignum25519 b) {
   65|  1.94k|	out[0] = a[0] + twoP0    - b[0];
   66|  1.94k|	out[1] = a[1] + twoP1234 - b[1];
   67|  1.94k|	out[2] = a[2] + twoP1234 - b[2];
   68|  1.94k|	out[3] = a[3] + twoP1234 - b[3];
   69|  1.94k|	out[4] = a[4] + twoP1234 - b[4];
   70|  1.94k|}
ed25519_tor.c:curve25519_mul:
  107|  6.57k|curve25519_mul(bignum25519 out, const bignum25519 in2, const bignum25519 in) {
  108|       |#if !defined(HAVE_NATIVE_UINT128)
  109|       |	uint128_t mul;
  110|       |#endif
  111|  6.57k|	uint128_t t[5];
  112|  6.57k|	uint64_t r0,r1,r2,r3,r4,s0,s1,s2,s3,s4,c;
  113|       |
  114|  6.57k|	r0 = in[0];
  115|  6.57k|	r1 = in[1];
  116|  6.57k|	r2 = in[2];
  117|  6.57k|	r3 = in[3];
  118|  6.57k|	r4 = in[4];
  119|       |
  120|  6.57k|	s0 = in2[0];
  121|  6.57k|	s1 = in2[1];
  122|  6.57k|	s2 = in2[2];
  123|  6.57k|	s3 = in2[3];
  124|  6.57k|	s4 = in2[4];
  125|       |
  126|  6.57k|#if defined(HAVE_NATIVE_UINT128)
  127|  6.57k|	t[0]  =  ((uint128_t) r0) * s0;
  128|  6.57k|	t[1]  =  ((uint128_t) r0) * s1 + ((uint128_t) r1) * s0;
  129|  6.57k|	t[2]  =  ((uint128_t) r0) * s2 + ((uint128_t) r2) * s0 + ((uint128_t) r1) * s1;
  130|  6.57k|	t[3]  =  ((uint128_t) r0) * s3 + ((uint128_t) r3) * s0 + ((uint128_t) r1) * s2 + ((uint128_t) r2) * s1;
  131|  6.57k|	t[4]  =  ((uint128_t) r0) * s4 + ((uint128_t) r4) * s0 + ((uint128_t) r3) * s1 + ((uint128_t) r1) * s3 + ((uint128_t) r2) * s2;
  132|       |#else
  133|       |	mul64x64_128(t[0], r0, s0)
  134|       |	mul64x64_128(t[1], r0, s1) mul64x64_128(mul, r1, s0) add128(t[1], mul)
  135|       |	mul64x64_128(t[2], r0, s2) mul64x64_128(mul, r2, s0) add128(t[2], mul) mul64x64_128(mul, r1, s1) add128(t[2], mul)
  136|       |	mul64x64_128(t[3], r0, s3) mul64x64_128(mul, r3, s0) add128(t[3], mul) mul64x64_128(mul, r1, s2) add128(t[3], mul) mul64x64_128(mul, r2, s1) add128(t[3], mul)
  137|       |	mul64x64_128(t[4], r0, s4) mul64x64_128(mul, r4, s0) add128(t[4], mul) mul64x64_128(mul, r3, s1) add128(t[4], mul) mul64x64_128(mul, r1, s3) add128(t[4], mul) mul64x64_128(mul, r2, s2) add128(t[4], mul)
  138|       |#endif
  139|       |
  140|  6.57k|	r1 *= 19;
  141|  6.57k|	r2 *= 19;
  142|  6.57k|	r3 *= 19;
  143|  6.57k|	r4 *= 19;
  144|       |
  145|  6.57k|#if defined(HAVE_NATIVE_UINT128)
  146|  6.57k|	t[0] += ((uint128_t) r4) * s1 + ((uint128_t) r1) * s4 + ((uint128_t) r2) * s3 + ((uint128_t) r3) * s2;
  147|  6.57k|	t[1] += ((uint128_t) r4) * s2 + ((uint128_t) r2) * s4 + ((uint128_t) r3) * s3;
  148|  6.57k|	t[2] += ((uint128_t) r4) * s3 + ((uint128_t) r3) * s4;
  149|  6.57k|	t[3] += ((uint128_t) r4) * s4;
  150|       |#else
  151|       |	mul64x64_128(mul, r4, s1) add128(t[0], mul) mul64x64_128(mul, r1, s4) add128(t[0], mul) mul64x64_128(mul, r2, s3) add128(t[0], mul) mul64x64_128(mul, r3, s2) add128(t[0], mul)
  152|       |	mul64x64_128(mul, r4, s2) add128(t[1], mul) mul64x64_128(mul, r2, s4) add128(t[1], mul) mul64x64_128(mul, r3, s3) add128(t[1], mul)
  153|       |	mul64x64_128(mul, r4, s3) add128(t[2], mul) mul64x64_128(mul, r3, s4) add128(t[2], mul)
  154|       |	mul64x64_128(mul, r4, s4) add128(t[3], mul)
  155|       |#endif
  156|       |
  157|       |
  158|  6.57k|	                     r0 = lo128(t[0]) & reduce_mask_51; shr128(c, t[0], 51);
  ------------------
  |  |   82|  6.57k|		#define lo128(a) ((uint64_t)a)
  ------------------
              	                     r0 = lo128(t[0]) & reduce_mask_51; shr128(c, t[0], 51);
  ------------------
  |  |   78|  6.57k|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  159|  6.57k|	add128_64(t[1], c)   r1 = lo128(t[1]) & reduce_mask_51; shr128(c, t[1], 51);
  ------------------
  |  |   81|  6.57k|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	add128_64(t[1], c)   r1 = lo128(t[1]) & reduce_mask_51; shr128(c, t[1], 51);
  ------------------
  |  |   82|  6.57k|		#define lo128(a) ((uint64_t)a)
  ------------------
              	add128_64(t[1], c)   r1 = lo128(t[1]) & reduce_mask_51; shr128(c, t[1], 51);
  ------------------
  |  |   78|  6.57k|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  160|  6.57k|	add128_64(t[2], c)   r2 = lo128(t[2]) & reduce_mask_51; shr128(c, t[2], 51);
  ------------------
  |  |   81|  6.57k|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	add128_64(t[2], c)   r2 = lo128(t[2]) & reduce_mask_51; shr128(c, t[2], 51);
  ------------------
  |  |   82|  6.57k|		#define lo128(a) ((uint64_t)a)
  ------------------
              	add128_64(t[2], c)   r2 = lo128(t[2]) & reduce_mask_51; shr128(c, t[2], 51);
  ------------------
  |  |   78|  6.57k|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  161|  6.57k|	add128_64(t[3], c)   r3 = lo128(t[3]) & reduce_mask_51; shr128(c, t[3], 51);
  ------------------
  |  |   81|  6.57k|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	add128_64(t[3], c)   r3 = lo128(t[3]) & reduce_mask_51; shr128(c, t[3], 51);
  ------------------
  |  |   82|  6.57k|		#define lo128(a) ((uint64_t)a)
  ------------------
              	add128_64(t[3], c)   r3 = lo128(t[3]) & reduce_mask_51; shr128(c, t[3], 51);
  ------------------
  |  |   78|  6.57k|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  162|  6.57k|	add128_64(t[4], c)   r4 = lo128(t[4]) & reduce_mask_51; shr128(c, t[4], 51);
  ------------------
  |  |   81|  6.57k|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	add128_64(t[4], c)   r4 = lo128(t[4]) & reduce_mask_51; shr128(c, t[4], 51);
  ------------------
  |  |   82|  6.57k|		#define lo128(a) ((uint64_t)a)
  ------------------
              	add128_64(t[4], c)   r4 = lo128(t[4]) & reduce_mask_51; shr128(c, t[4], 51);
  ------------------
  |  |   78|  6.57k|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  163|  6.57k|	r0 +=   c * 19; c = r0 >> 51; r0 = r0 & reduce_mask_51;
  164|  6.57k|	r1 +=   c;
  165|       |
  166|  6.57k|	out[0] = r0;
  167|  6.57k|	out[1] = r1;
  168|  6.57k|	out[2] = r2;
  169|  6.57k|	out[3] = r3;
  170|  6.57k|	out[4] = r4;
  171|  6.57k|}
ed25519_tor.c:curve25519_contract:
  325|     28|curve25519_contract(unsigned char *out, const bignum25519 input) {
  326|     28|	uint64_t t[5];
  327|     28|	uint64_t f, i;
  328|       |
  329|     28|	t[0] = input[0];
  330|     28|	t[1] = input[1];
  331|     28|	t[2] = input[2];
  332|     28|	t[3] = input[3];
  333|     28|	t[4] = input[4];
  334|       |
  335|     28|	#define curve25519_contract_carry() \
  336|     28|		t[1] += t[0] >> 51; t[0] &= reduce_mask_51; \
  337|     28|		t[2] += t[1] >> 51; t[1] &= reduce_mask_51; \
  338|     28|		t[3] += t[2] >> 51; t[2] &= reduce_mask_51; \
  339|     28|		t[4] += t[3] >> 51; t[3] &= reduce_mask_51;
  340|       |
  341|     28|	#define curve25519_contract_carry_full() curve25519_contract_carry() \
  342|     28|		t[0] += 19 * (t[4] >> 51); t[4] &= reduce_mask_51;
  343|       |
  344|     28|	#define curve25519_contract_carry_final() curve25519_contract_carry() \
  345|     28|		t[4] &= reduce_mask_51;
  346|       |
  347|     28|	curve25519_contract_carry_full()
  ------------------
  |  |  341|     28|	#define curve25519_contract_carry_full() curve25519_contract_carry() \
  |  |  ------------------
  |  |  |  |  336|     28|		t[1] += t[0] >> 51; t[0] &= reduce_mask_51; \
  |  |  |  |  337|     28|		t[2] += t[1] >> 51; t[1] &= reduce_mask_51; \
  |  |  |  |  338|     28|		t[3] += t[2] >> 51; t[2] &= reduce_mask_51; \
  |  |  |  |  339|     28|		t[4] += t[3] >> 51; t[3] &= reduce_mask_51;
  |  |  ------------------
  |  |  342|     28|		t[0] += 19 * (t[4] >> 51); t[4] &= reduce_mask_51;
  ------------------
  348|     28|	curve25519_contract_carry_full()
  ------------------
  |  |  341|     28|	#define curve25519_contract_carry_full() curve25519_contract_carry() \
  |  |  ------------------
  |  |  |  |  336|     28|		t[1] += t[0] >> 51; t[0] &= reduce_mask_51; \
  |  |  |  |  337|     28|		t[2] += t[1] >> 51; t[1] &= reduce_mask_51; \
  |  |  |  |  338|     28|		t[3] += t[2] >> 51; t[2] &= reduce_mask_51; \
  |  |  |  |  339|     28|		t[4] += t[3] >> 51; t[3] &= reduce_mask_51;
  |  |  ------------------
  |  |  342|     28|		t[0] += 19 * (t[4] >> 51); t[4] &= reduce_mask_51;
  ------------------
  349|       |
  350|       |	/* now t is between 0 and 2^255-1, properly carried. */
  351|       |	/* case 1: between 0 and 2^255-20. case 2: between 2^255-19 and 2^255-1. */
  352|     28|	t[0] += 19;
  353|     28|	curve25519_contract_carry_full()
  ------------------
  |  |  341|     28|	#define curve25519_contract_carry_full() curve25519_contract_carry() \
  |  |  ------------------
  |  |  |  |  336|     28|		t[1] += t[0] >> 51; t[0] &= reduce_mask_51; \
  |  |  |  |  337|     28|		t[2] += t[1] >> 51; t[1] &= reduce_mask_51; \
  |  |  |  |  338|     28|		t[3] += t[2] >> 51; t[2] &= reduce_mask_51; \
  |  |  |  |  339|     28|		t[4] += t[3] >> 51; t[3] &= reduce_mask_51;
  |  |  ------------------
  |  |  342|     28|		t[0] += 19 * (t[4] >> 51); t[4] &= reduce_mask_51;
  ------------------
  354|       |
  355|       |	/* now between 19 and 2^255-1 in both cases, and offset by 19. */
  356|     28|	t[0] += (reduce_mask_51 + 1) - 19;
  357|     28|	t[1] += (reduce_mask_51 + 1) - 1;
  358|     28|	t[2] += (reduce_mask_51 + 1) - 1;
  359|     28|	t[3] += (reduce_mask_51 + 1) - 1;
  360|     28|	t[4] += (reduce_mask_51 + 1) - 1;
  361|       |
  362|       |	/* now between 2^255 and 2^256-20, and offset by 2^255. */
  363|     28|	curve25519_contract_carry_final()
  ------------------
  |  |  344|     28|	#define curve25519_contract_carry_final() curve25519_contract_carry() \
  |  |  ------------------
  |  |  |  |  336|     28|		t[1] += t[0] >> 51; t[0] &= reduce_mask_51; \
  |  |  |  |  337|     28|		t[2] += t[1] >> 51; t[1] &= reduce_mask_51; \
  |  |  |  |  338|     28|		t[3] += t[2] >> 51; t[2] &= reduce_mask_51; \
  |  |  |  |  339|     28|		t[4] += t[3] >> 51; t[3] &= reduce_mask_51;
  |  |  ------------------
  |  |  345|     28|		t[4] &= reduce_mask_51;
  ------------------
  364|       |
  365|     28|	#define write51full(n,shift) \
  366|     28|		f = ((t[n] >> shift) | (t[n+1] << (51 - shift))); \
  367|     28|		for (i = 0; i < 8; i++, f >>= 8) *out++ = (unsigned char)f;
  368|     28|	#define write51(n) write51full(n,13*n)
  369|     28|	write51(0)
  ------------------
  |  |  368|     28|	#define write51(n) write51full(n,13*n)
  |  |  ------------------
  |  |  |  |  366|     28|		f = ((t[n] >> shift) | (t[n+1] << (51 - shift))); \
  |  |  |  |  367|    252|		for (i = 0; i < 8; i++, f >>= 8) *out++ = (unsigned char)f;
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (367:15): [True: 224, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  370|     28|	write51(1)
  ------------------
  |  |  368|     28|	#define write51(n) write51full(n,13*n)
  |  |  ------------------
  |  |  |  |  366|     28|		f = ((t[n] >> shift) | (t[n+1] << (51 - shift))); \
  |  |  |  |  367|    252|		for (i = 0; i < 8; i++, f >>= 8) *out++ = (unsigned char)f;
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (367:15): [True: 224, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  371|     28|	write51(2)
  ------------------
  |  |  368|     28|	#define write51(n) write51full(n,13*n)
  |  |  ------------------
  |  |  |  |  366|     28|		f = ((t[n] >> shift) | (t[n+1] << (51 - shift))); \
  |  |  |  |  367|    252|		for (i = 0; i < 8; i++, f >>= 8) *out++ = (unsigned char)f;
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (367:15): [True: 224, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  372|     28|	write51(3)
  ------------------
  |  |  368|     28|	#define write51(n) write51full(n,13*n)
  |  |  ------------------
  |  |  |  |  366|     28|		f = ((t[n] >> shift) | (t[n+1] << (51 - shift))); \
  |  |  |  |  367|    252|		for (i = 0; i < 8; i++, f >>= 8) *out++ = (unsigned char)f;
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (367:15): [True: 224, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  373|     28|}
ed25519_tor.c:curve25519_expand:
  288|      1|curve25519_expand(bignum25519 out, const unsigned char *in) {
  289|      1|	static const union { uint8_t b[2]; uint16_t s; } endian_check = {{1,0}};
  290|      1|	uint64_t x0,x1,x2,x3;
  291|       |
  292|      1|	if (endian_check.s == 1) {
  ------------------
  |  Branch (292:6): [True: 1, False: 0]
  ------------------
  293|      1|		x0 = *(uint64_t *)(in + 0);
  294|      1|		x1 = *(uint64_t *)(in + 8);
  295|      1|		x2 = *(uint64_t *)(in + 16);
  296|      1|		x3 = *(uint64_t *)(in + 24);
  297|      1|	} else {
  298|      0|		#define F(s)                         \
  299|      0|			((((uint64_t)in[s + 0])      ) | \
  300|      0|			 (((uint64_t)in[s + 1]) <<  8) | \
  301|      0|			 (((uint64_t)in[s + 2]) << 16) | \
  302|      0|			 (((uint64_t)in[s + 3]) << 24) | \
  303|      0|			 (((uint64_t)in[s + 4]) << 32) | \
  304|      0|			 (((uint64_t)in[s + 5]) << 40) | \
  305|      0|			 (((uint64_t)in[s + 6]) << 48) | \
  306|      0|			 (((uint64_t)in[s + 7]) << 56))
  307|       |
  308|      0|		x0 = F(0);
  ------------------
  |  |  299|      0|			((((uint64_t)in[s + 0])      ) | \
  |  |  300|      0|			 (((uint64_t)in[s + 1]) <<  8) | \
  |  |  301|      0|			 (((uint64_t)in[s + 2]) << 16) | \
  |  |  302|      0|			 (((uint64_t)in[s + 3]) << 24) | \
  |  |  303|      0|			 (((uint64_t)in[s + 4]) << 32) | \
  |  |  304|      0|			 (((uint64_t)in[s + 5]) << 40) | \
  |  |  305|      0|			 (((uint64_t)in[s + 6]) << 48) | \
  |  |  306|      0|			 (((uint64_t)in[s + 7]) << 56))
  ------------------
  309|      0|		x1 = F(8);
  ------------------
  |  |  299|      0|			((((uint64_t)in[s + 0])      ) | \
  |  |  300|      0|			 (((uint64_t)in[s + 1]) <<  8) | \
  |  |  301|      0|			 (((uint64_t)in[s + 2]) << 16) | \
  |  |  302|      0|			 (((uint64_t)in[s + 3]) << 24) | \
  |  |  303|      0|			 (((uint64_t)in[s + 4]) << 32) | \
  |  |  304|      0|			 (((uint64_t)in[s + 5]) << 40) | \
  |  |  305|      0|			 (((uint64_t)in[s + 6]) << 48) | \
  |  |  306|      0|			 (((uint64_t)in[s + 7]) << 56))
  ------------------
  310|      0|		x2 = F(16);
  ------------------
  |  |  299|      0|			((((uint64_t)in[s + 0])      ) | \
  |  |  300|      0|			 (((uint64_t)in[s + 1]) <<  8) | \
  |  |  301|      0|			 (((uint64_t)in[s + 2]) << 16) | \
  |  |  302|      0|			 (((uint64_t)in[s + 3]) << 24) | \
  |  |  303|      0|			 (((uint64_t)in[s + 4]) << 32) | \
  |  |  304|      0|			 (((uint64_t)in[s + 5]) << 40) | \
  |  |  305|      0|			 (((uint64_t)in[s + 6]) << 48) | \
  |  |  306|      0|			 (((uint64_t)in[s + 7]) << 56))
  ------------------
  311|      0|		x3 = F(24);
  ------------------
  |  |  299|      0|			((((uint64_t)in[s + 0])      ) | \
  |  |  300|      0|			 (((uint64_t)in[s + 1]) <<  8) | \
  |  |  301|      0|			 (((uint64_t)in[s + 2]) << 16) | \
  |  |  302|      0|			 (((uint64_t)in[s + 3]) << 24) | \
  |  |  303|      0|			 (((uint64_t)in[s + 4]) << 32) | \
  |  |  304|      0|			 (((uint64_t)in[s + 5]) << 40) | \
  |  |  305|      0|			 (((uint64_t)in[s + 6]) << 48) | \
  |  |  306|      0|			 (((uint64_t)in[s + 7]) << 56))
  ------------------
  312|      0|	}
  313|       |
  314|      1|	out[0] = x0 & reduce_mask_51; x0 = (x0 >> 51) | (x1 << 13);
  315|      1|	out[1] = x0 & reduce_mask_51; x1 = (x1 >> 38) | (x2 << 26);
  316|      1|	out[2] = x1 & reduce_mask_51; x2 = (x2 >> 25) | (x3 << 39);
  317|      1|	out[3] = x2 & reduce_mask_51; x3 = (x3 >> 12);
  318|      1|	out[4] = x3 & reduce_mask_51;
  319|      1|}

ed25519_tor.c:curve25519_pow_two252m3:
   68|      1|curve25519_pow_two252m3(bignum25519 two252m3, const bignum25519 z) {
   69|      1|	bignum25519 ALIGN(16) b,c,t0;
   70|       |
   71|       |	/* 2 */ curve25519_square_times(c, z, 1); /* c = 2 */
   72|      1|	/* 8 */ curve25519_square_times(t0, c, 2); /* t0 = 8 */
   73|      1|	/* 9 */ curve25519_mul_noinline(b, t0, z); /* b = 9 */
   74|      1|	/* 11 */ curve25519_mul_noinline(c, b, c); /* c = 11 */
   75|      1|	/* 22 */ curve25519_square_times(t0, c, 1);
   76|      1|	/* 2^5 - 2^0 = 31 */ curve25519_mul_noinline(b, t0, b);
   77|      1|	/* 2^250 - 2^0 */ curve25519_pow_two5mtwo0_two250mtwo0(b);
   78|      1|	/* 2^252 - 2^2 */ curve25519_square_times(b, b, 2);
   79|      1|	/* 2^252 - 3 */ curve25519_mul_noinline(two252m3, b, z);
   80|      1|}
ed25519_tor.c:curve25519_pow_two5mtwo0_two250mtwo0:
   26|     13|curve25519_pow_two5mtwo0_two250mtwo0(bignum25519 b) {
   27|     13|	bignum25519 ALIGN(16) t0,c;
   28|       |
   29|       |	/* 2^5  - 2^0 */ /* b */
   30|       |	/* 2^10 - 2^5 */ curve25519_square_times(t0, b, 5);
   31|     13|	/* 2^10 - 2^0 */ curve25519_mul_noinline(b, t0, b);
   32|     13|	/* 2^20 - 2^10 */ curve25519_square_times(t0, b, 10);
   33|     13|	/* 2^20 - 2^0 */ curve25519_mul_noinline(c, t0, b);
   34|     13|	/* 2^40 - 2^20 */ curve25519_square_times(t0, c, 20);
   35|     13|	/* 2^40 - 2^0 */ curve25519_mul_noinline(t0, t0, c);
   36|     13|	/* 2^50 - 2^10 */ curve25519_square_times(t0, t0, 10);
   37|     13|	/* 2^50 - 2^0 */ curve25519_mul_noinline(b, t0, b);
   38|     13|	/* 2^100 - 2^50 */ curve25519_square_times(t0, b, 50);
   39|     13|	/* 2^100 - 2^0 */ curve25519_mul_noinline(c, t0, b);
   40|     13|	/* 2^200 - 2^100 */ curve25519_square_times(t0, c, 100);
   41|     13|	/* 2^200 - 2^0 */ curve25519_mul_noinline(t0, t0, c);
   42|     13|	/* 2^250 - 2^50 */ curve25519_square_times(t0, t0, 50);
   43|     13|	/* 2^250 - 2^0 */ curve25519_mul_noinline(b, t0, b);
   44|     13|}
ed25519_tor.c:curve25519_recip:
   50|     12|curve25519_recip(bignum25519 out, const bignum25519 z) {
   51|     12|	bignum25519 ALIGN(16) a,t0,b;
   52|       |
   53|       |	/* 2 */ curve25519_square_times(a, z, 1); /* a = 2 */
   54|     12|	/* 8 */ curve25519_square_times(t0, a, 2);
   55|     12|	/* 9 */ curve25519_mul_noinline(b, t0, z); /* b = 9 */
   56|     12|	/* 11 */ curve25519_mul_noinline(a, b, a); /* a = 11 */
   57|     12|	/* 22 */ curve25519_square_times(t0, a, 1);
   58|     12|	/* 2^5 - 2^0 = 31 */ curve25519_mul_noinline(b, t0, b);
   59|     12|	/* 2^250 - 2^0 */ curve25519_pow_two5mtwo0_two250mtwo0(b);
   60|     12|	/* 2^255 - 2^5 */ curve25519_square_times(b, b, 5);
   61|     12|	/* 2^255 - 21 */ curve25519_mul_noinline(out, b, a);
   62|     12|}

ed25519_tor.c:ge25519_scalarmult_base_choose_niels:
   11|    704|ge25519_scalarmult_base_choose_niels(ge25519_niels *t, const uint8_t table[256][96], uint32_t pos, signed char b) {
   12|    704|	int64_t breg = (int64_t)b;
   13|    704|	uint64_t sign = (uint64_t)breg >> 63;
   14|    704|	uint64_t mask = ~(sign - 1);
   15|    704|	uint64_t u = (breg + mask) ^ mask;
   16|       |
   17|    704|	__asm__ __volatile__ (
   18|       |		/* ysubx+xaddy+t2d */
   19|    704|		"movq %0, %%rax                  ;\n"
   20|    704|		"movd %%rax, %%xmm14             ;\n"
   21|    704|		"pshufd $0x00, %%xmm14, %%xmm14  ;\n"
   22|    704|		"pxor %%xmm0, %%xmm0             ;\n"
   23|    704|		"pxor %%xmm1, %%xmm1             ;\n"
   24|    704|		"pxor %%xmm2, %%xmm2             ;\n"
   25|    704|		"pxor %%xmm3, %%xmm3             ;\n"
   26|    704|		"pxor %%xmm4, %%xmm4             ;\n"
   27|    704|		"pxor %%xmm5, %%xmm5             ;\n"
   28|       |
   29|       |		/* 0 */
   30|    704|		"movq $0, %%rax                  ;\n"
   31|    704|		"movd %%rax, %%xmm15             ;\n"
   32|    704|		"pshufd $0x00, %%xmm15, %%xmm15  ;\n"
   33|    704|		"pcmpeqd %%xmm14, %%xmm15        ;\n"
   34|    704|		"movq $1, %%rax                  ;\n"
   35|    704|		"movd %%rax, %%xmm6              ;\n"
   36|    704|		"pxor %%xmm7, %%xmm7             ;\n"
   37|    704|		"pand %%xmm15, %%xmm6            ;\n"
   38|    704|		"pand %%xmm15, %%xmm7            ;\n"
   39|    704|		"por %%xmm6, %%xmm0              ;\n"
   40|    704|		"por %%xmm7, %%xmm1              ;\n"
   41|    704|		"por %%xmm6, %%xmm2              ;\n"
   42|    704|		"por %%xmm7, %%xmm3              ;\n"
   43|       |
   44|       |		/* 1 */
   45|    704|		"movq $1, %%rax                  ;\n"
   46|    704|		"movd %%rax, %%xmm15             ;\n"
   47|    704|		"pshufd $0x00, %%xmm15, %%xmm15  ;\n"
   48|    704|		"pcmpeqd %%xmm14, %%xmm15        ;\n"
   49|    704|		"movdqa 0(%1), %%xmm6            ;\n"
   50|    704|		"movdqa 16(%1), %%xmm7           ;\n"
   51|    704|		"movdqa 32(%1), %%xmm8           ;\n"
   52|    704|		"movdqa 48(%1), %%xmm9           ;\n"
   53|    704|		"movdqa 64(%1), %%xmm10          ;\n"
   54|    704|		"movdqa 80(%1), %%xmm11          ;\n"
   55|    704|		"pand %%xmm15, %%xmm6            ;\n"
   56|    704|		"pand %%xmm15, %%xmm7            ;\n"
   57|    704|		"pand %%xmm15, %%xmm8            ;\n"
   58|    704|		"pand %%xmm15, %%xmm9            ;\n"
   59|    704|		"pand %%xmm15, %%xmm10           ;\n"
   60|    704|		"pand %%xmm15, %%xmm11           ;\n"
   61|    704|		"por %%xmm6, %%xmm0              ;\n"
   62|    704|		"por %%xmm7, %%xmm1              ;\n"
   63|    704|		"por %%xmm8, %%xmm2              ;\n"
   64|    704|		"por %%xmm9, %%xmm3              ;\n"
   65|    704|		"por %%xmm10, %%xmm4             ;\n"
   66|    704|		"por %%xmm11, %%xmm5             ;\n"
   67|       |
   68|       |		/* 2 */
   69|    704|		"movq $2, %%rax                  ;\n"
   70|    704|		"movd %%rax, %%xmm15             ;\n"
   71|    704|		"pshufd $0x00, %%xmm15, %%xmm15  ;\n"
   72|    704|		"pcmpeqd %%xmm14, %%xmm15        ;\n"
   73|    704|		"movdqa 96(%1), %%xmm6           ;\n"
   74|    704|		"movdqa 112(%1), %%xmm7          ;\n"
   75|    704|		"movdqa 128(%1), %%xmm8          ;\n"
   76|    704|		"movdqa 144(%1), %%xmm9          ;\n"
   77|    704|		"movdqa 160(%1), %%xmm10         ;\n"
   78|    704|		"movdqa 176(%1), %%xmm11         ;\n"
   79|    704|		"pand %%xmm15, %%xmm6            ;\n"
   80|    704|		"pand %%xmm15, %%xmm7            ;\n"
   81|    704|		"pand %%xmm15, %%xmm8            ;\n"
   82|    704|		"pand %%xmm15, %%xmm9            ;\n"
   83|    704|		"pand %%xmm15, %%xmm10           ;\n"
   84|    704|		"pand %%xmm15, %%xmm11           ;\n"
   85|    704|		"por %%xmm6, %%xmm0              ;\n"
   86|    704|		"por %%xmm7, %%xmm1              ;\n"
   87|    704|		"por %%xmm8, %%xmm2              ;\n"
   88|    704|		"por %%xmm9, %%xmm3              ;\n"
   89|    704|		"por %%xmm10, %%xmm4             ;\n"
   90|    704|		"por %%xmm11, %%xmm5             ;\n"
   91|       |
   92|       |		/* 3 */
   93|    704|		"movq $3, %%rax                  ;\n"
   94|    704|		"movd %%rax, %%xmm15             ;\n"
   95|    704|		"pshufd $0x00, %%xmm15, %%xmm15  ;\n"
   96|    704|		"pcmpeqd %%xmm14, %%xmm15        ;\n"
   97|    704|		"movdqa 192(%1), %%xmm6          ;\n"
   98|    704|		"movdqa 208(%1), %%xmm7          ;\n"
   99|    704|		"movdqa 224(%1), %%xmm8          ;\n"
  100|    704|		"movdqa 240(%1), %%xmm9          ;\n"
  101|    704|		"movdqa 256(%1), %%xmm10         ;\n"
  102|    704|		"movdqa 272(%1), %%xmm11         ;\n"
  103|    704|		"pand %%xmm15, %%xmm6            ;\n"
  104|    704|		"pand %%xmm15, %%xmm7            ;\n"
  105|    704|		"pand %%xmm15, %%xmm8            ;\n"
  106|    704|		"pand %%xmm15, %%xmm9            ;\n"
  107|    704|		"pand %%xmm15, %%xmm10           ;\n"
  108|    704|		"pand %%xmm15, %%xmm11           ;\n"
  109|    704|		"por %%xmm6, %%xmm0              ;\n"
  110|    704|		"por %%xmm7, %%xmm1              ;\n"
  111|    704|		"por %%xmm8, %%xmm2              ;\n"
  112|    704|		"por %%xmm9, %%xmm3              ;\n"
  113|    704|		"por %%xmm10, %%xmm4             ;\n"
  114|    704|		"por %%xmm11, %%xmm5             ;\n"
  115|       |
  116|       |		/* 4 */
  117|    704|		"movq $4, %%rax                  ;\n"
  118|    704|		"movd %%rax, %%xmm15             ;\n"
  119|    704|		"pshufd $0x00, %%xmm15, %%xmm15  ;\n"
  120|    704|		"pcmpeqd %%xmm14, %%xmm15        ;\n"
  121|    704|		"movdqa 288(%1), %%xmm6          ;\n"
  122|    704|		"movdqa 304(%1), %%xmm7          ;\n"
  123|    704|		"movdqa 320(%1), %%xmm8          ;\n"
  124|    704|		"movdqa 336(%1), %%xmm9          ;\n"
  125|    704|		"movdqa 352(%1), %%xmm10         ;\n"
  126|    704|		"movdqa 368(%1), %%xmm11         ;\n"
  127|    704|		"pand %%xmm15, %%xmm6            ;\n"
  128|    704|		"pand %%xmm15, %%xmm7            ;\n"
  129|    704|		"pand %%xmm15, %%xmm8            ;\n"
  130|    704|		"pand %%xmm15, %%xmm9            ;\n"
  131|    704|		"pand %%xmm15, %%xmm10           ;\n"
  132|    704|		"pand %%xmm15, %%xmm11           ;\n"
  133|    704|		"por %%xmm6, %%xmm0              ;\n"
  134|    704|		"por %%xmm7, %%xmm1              ;\n"
  135|    704|		"por %%xmm8, %%xmm2              ;\n"
  136|    704|		"por %%xmm9, %%xmm3              ;\n"
  137|    704|		"por %%xmm10, %%xmm4             ;\n"
  138|    704|		"por %%xmm11, %%xmm5             ;\n"
  139|       |
  140|       |		/* 5 */
  141|    704|		"movq $5, %%rax                  ;\n"
  142|    704|		"movd %%rax, %%xmm15             ;\n"
  143|    704|		"pshufd $0x00, %%xmm15, %%xmm15  ;\n"
  144|    704|		"pcmpeqd %%xmm14, %%xmm15        ;\n"
  145|    704|		"movdqa 384(%1), %%xmm6          ;\n"
  146|    704|		"movdqa 400(%1), %%xmm7          ;\n"
  147|    704|		"movdqa 416(%1), %%xmm8          ;\n"
  148|    704|		"movdqa 432(%1), %%xmm9          ;\n"
  149|    704|		"movdqa 448(%1), %%xmm10         ;\n"
  150|    704|		"movdqa 464(%1), %%xmm11         ;\n"
  151|    704|		"pand %%xmm15, %%xmm6            ;\n"
  152|    704|		"pand %%xmm15, %%xmm7            ;\n"
  153|    704|		"pand %%xmm15, %%xmm8            ;\n"
  154|    704|		"pand %%xmm15, %%xmm9            ;\n"
  155|    704|		"pand %%xmm15, %%xmm10           ;\n"
  156|    704|		"pand %%xmm15, %%xmm11           ;\n"
  157|    704|		"por %%xmm6, %%xmm0              ;\n"
  158|    704|		"por %%xmm7, %%xmm1              ;\n"
  159|    704|		"por %%xmm8, %%xmm2              ;\n"
  160|    704|		"por %%xmm9, %%xmm3              ;\n"
  161|    704|		"por %%xmm10, %%xmm4             ;\n"
  162|    704|		"por %%xmm11, %%xmm5             ;\n"
  163|       |
  164|       |		/* 6 */
  165|    704|		"movq $6, %%rax                  ;\n"
  166|    704|		"movd %%rax, %%xmm15             ;\n"
  167|    704|		"pshufd $0x00, %%xmm15, %%xmm15  ;\n"
  168|    704|		"pcmpeqd %%xmm14, %%xmm15        ;\n"
  169|    704|		"movdqa 480(%1), %%xmm6          ;\n"
  170|    704|		"movdqa 496(%1), %%xmm7          ;\n"
  171|    704|		"movdqa 512(%1), %%xmm8          ;\n"
  172|    704|		"movdqa 528(%1), %%xmm9          ;\n"
  173|    704|		"movdqa 544(%1), %%xmm10         ;\n"
  174|    704|		"movdqa 560(%1), %%xmm11         ;\n"
  175|    704|		"pand %%xmm15, %%xmm6            ;\n"
  176|    704|		"pand %%xmm15, %%xmm7            ;\n"
  177|    704|		"pand %%xmm15, %%xmm8            ;\n"
  178|    704|		"pand %%xmm15, %%xmm9            ;\n"
  179|    704|		"pand %%xmm15, %%xmm10           ;\n"
  180|    704|		"pand %%xmm15, %%xmm11           ;\n"
  181|    704|		"por %%xmm6, %%xmm0              ;\n"
  182|    704|		"por %%xmm7, %%xmm1              ;\n"
  183|    704|		"por %%xmm8, %%xmm2              ;\n"
  184|    704|		"por %%xmm9, %%xmm3              ;\n"
  185|    704|		"por %%xmm10, %%xmm4             ;\n"
  186|    704|		"por %%xmm11, %%xmm5             ;\n"
  187|       |
  188|       |		/* 7 */
  189|    704|		"movq $7, %%rax                  ;\n"
  190|    704|		"movd %%rax, %%xmm15             ;\n"
  191|    704|		"pshufd $0x00, %%xmm15, %%xmm15  ;\n"
  192|    704|		"pcmpeqd %%xmm14, %%xmm15        ;\n"
  193|    704|		"movdqa 576(%1), %%xmm6          ;\n"
  194|    704|		"movdqa 592(%1), %%xmm7          ;\n"
  195|    704|		"movdqa 608(%1), %%xmm8          ;\n"
  196|    704|		"movdqa 624(%1), %%xmm9          ;\n"
  197|    704|		"movdqa 640(%1), %%xmm10         ;\n"
  198|    704|		"movdqa 656(%1), %%xmm11         ;\n"
  199|    704|		"pand %%xmm15, %%xmm6            ;\n"
  200|    704|		"pand %%xmm15, %%xmm7            ;\n"
  201|    704|		"pand %%xmm15, %%xmm8            ;\n"
  202|    704|		"pand %%xmm15, %%xmm9            ;\n"
  203|    704|		"pand %%xmm15, %%xmm10           ;\n"
  204|    704|		"pand %%xmm15, %%xmm11           ;\n"
  205|    704|		"por %%xmm6, %%xmm0              ;\n"
  206|    704|		"por %%xmm7, %%xmm1              ;\n"
  207|    704|		"por %%xmm8, %%xmm2              ;\n"
  208|    704|		"por %%xmm9, %%xmm3              ;\n"
  209|    704|		"por %%xmm10, %%xmm4             ;\n"
  210|    704|		"por %%xmm11, %%xmm5             ;\n"
  211|       |
  212|       |		/* 8 */
  213|    704|		"movq $8, %%rax                  ;\n"
  214|    704|		"movd %%rax, %%xmm15             ;\n"
  215|    704|		"pshufd $0x00, %%xmm15, %%xmm15  ;\n"
  216|    704|		"pcmpeqd %%xmm14, %%xmm15        ;\n"
  217|    704|		"movdqa 672(%1), %%xmm6          ;\n"
  218|    704|		"movdqa 688(%1), %%xmm7          ;\n"
  219|    704|		"movdqa 704(%1), %%xmm8          ;\n"
  220|    704|		"movdqa 720(%1), %%xmm9          ;\n"
  221|    704|		"movdqa 736(%1), %%xmm10         ;\n"
  222|    704|		"movdqa 752(%1), %%xmm11         ;\n"
  223|    704|		"pand %%xmm15, %%xmm6            ;\n"
  224|    704|		"pand %%xmm15, %%xmm7            ;\n"
  225|    704|		"pand %%xmm15, %%xmm8            ;\n"
  226|    704|		"pand %%xmm15, %%xmm9            ;\n"
  227|    704|		"pand %%xmm15, %%xmm10           ;\n"
  228|    704|		"pand %%xmm15, %%xmm11           ;\n"
  229|    704|		"por %%xmm6, %%xmm0              ;\n"
  230|    704|		"por %%xmm7, %%xmm1              ;\n"
  231|    704|		"por %%xmm8, %%xmm2              ;\n"
  232|    704|		"por %%xmm9, %%xmm3              ;\n"
  233|    704|		"por %%xmm10, %%xmm4             ;\n"
  234|    704|		"por %%xmm11, %%xmm5             ;\n"
  235|       |
  236|       |		/* conditionally swap ysubx and xaddy */
  237|    704|		"movq %3, %%rax                  ;\n"
  238|    704|		"xorq $1, %%rax                  ;\n"
  239|    704|		"movd %%rax, %%xmm14             ;\n"
  240|    704|		"pxor %%xmm15, %%xmm15           ;\n"
  241|    704|		"pshufd $0x00, %%xmm14, %%xmm14  ;\n"
  242|    704|		"pxor %%xmm0, %%xmm2             ;\n"
  243|    704|		"pxor %%xmm1, %%xmm3             ;\n"
  244|    704|		"pcmpeqd %%xmm14, %%xmm15        ;\n"
  245|    704|		"movdqa %%xmm2, %%xmm6           ;\n"
  246|    704|		"movdqa %%xmm3, %%xmm7           ;\n"
  247|    704|		"pand %%xmm15, %%xmm6            ;\n"
  248|    704|		"pand %%xmm15, %%xmm7            ;\n"
  249|    704|		"pxor %%xmm6, %%xmm0             ;\n"
  250|    704|		"pxor %%xmm7, %%xmm1             ;\n"
  251|    704|		"pxor %%xmm0, %%xmm2             ;\n"
  252|    704|		"pxor %%xmm1, %%xmm3             ;\n"
  253|       |
  254|       |		/* store ysubx */
  255|    704|		"movq $0x7ffffffffffff, %%rax    ;\n"
  256|    704|		"movd %%xmm0, %%rcx              ;\n"
  257|    704|		"movd %%xmm0, %%r8               ;\n"
  258|    704|		"movd %%xmm1, %%rsi              ;\n"
  259|    704|		"pshufd $0xee, %%xmm0, %%xmm0    ;\n"
  260|    704|		"pshufd $0xee, %%xmm1, %%xmm1    ;\n"
  261|    704|		"movd %%xmm0, %%rdx              ;\n"
  262|    704|		"movd %%xmm1, %%rdi              ;\n"
  263|    704|		"shrdq $51, %%rdx, %%r8          ;\n"
  264|    704|		"shrdq $38, %%rsi, %%rdx         ;\n"
  265|    704|		"shrdq $25, %%rdi, %%rsi         ;\n"
  266|    704|		"shrq $12, %%rdi                 ;\n"
  267|    704|		"andq %%rax, %%rcx               ;\n"
  268|    704|		"andq %%rax, %%r8                ;\n"
  269|    704|		"andq %%rax, %%rdx               ;\n"
  270|    704|		"andq %%rax, %%rsi               ;\n"
  271|    704|		"andq %%rax, %%rdi               ;\n"
  272|    704|		"movq %%rcx, 0(%2)               ;\n"
  273|    704|		"movq %%r8, 8(%2)                ;\n"
  274|    704|		"movq %%rdx, 16(%2)              ;\n"
  275|    704|		"movq %%rsi, 24(%2)              ;\n"
  276|    704|		"movq %%rdi, 32(%2)              ;\n"
  277|       |
  278|       |		/* store xaddy */
  279|    704|		"movq $0x7ffffffffffff, %%rax    ;\n"
  280|    704|		"movd %%xmm2, %%rcx              ;\n"
  281|    704|		"movd %%xmm2, %%r8               ;\n"
  282|    704|		"movd %%xmm3, %%rsi              ;\n"
  283|    704|		"pshufd $0xee, %%xmm2, %%xmm2    ;\n"
  284|    704|		"pshufd $0xee, %%xmm3, %%xmm3    ;\n"
  285|    704|		"movd %%xmm2, %%rdx              ;\n"
  286|    704|		"movd %%xmm3, %%rdi              ;\n"
  287|    704|		"shrdq $51, %%rdx, %%r8          ;\n"
  288|    704|		"shrdq $38, %%rsi, %%rdx         ;\n"
  289|    704|		"shrdq $25, %%rdi, %%rsi         ;\n"
  290|    704|		"shrq $12, %%rdi                 ;\n"
  291|    704|		"andq %%rax, %%rcx               ;\n"
  292|    704|		"andq %%rax, %%r8                ;\n"
  293|    704|		"andq %%rax, %%rdx               ;\n"
  294|    704|		"andq %%rax, %%rsi               ;\n"
  295|    704|		"andq %%rax, %%rdi               ;\n"
  296|    704|		"movq %%rcx, 40(%2)              ;\n"
  297|    704|		"movq %%r8, 48(%2)               ;\n"
  298|    704|		"movq %%rdx, 56(%2)              ;\n"
  299|    704|		"movq %%rsi, 64(%2)              ;\n"
  300|    704|		"movq %%rdi, 72(%2)              ;\n"
  301|       |
  302|       |		/* extract t2d */
  303|    704|		"movq $0x7ffffffffffff, %%rax    ;\n"
  304|    704|		"movd %%xmm4, %%rcx              ;\n"
  305|    704|		"movd %%xmm4, %%r8               ;\n"
  306|    704|		"movd %%xmm5, %%rsi              ;\n"
  307|    704|		"pshufd $0xee, %%xmm4, %%xmm4    ;\n"
  308|    704|		"pshufd $0xee, %%xmm5, %%xmm5    ;\n"
  309|    704|		"movd %%xmm4, %%rdx              ;\n"
  310|    704|		"movd %%xmm5, %%rdi              ;\n"
  311|    704|		"shrdq $51, %%rdx, %%r8          ;\n"
  312|    704|		"shrdq $38, %%rsi, %%rdx         ;\n"
  313|    704|		"shrdq $25, %%rdi, %%rsi         ;\n"
  314|    704|		"shrq $12, %%rdi                 ;\n"
  315|    704|		"andq %%rax, %%rcx               ;\n"
  316|    704|		"andq %%rax, %%r8                ;\n"
  317|    704|		"andq %%rax, %%rdx               ;\n"
  318|    704|		"andq %%rax, %%rsi               ;\n"
  319|    704|		"andq %%rax, %%rdi               ;\n"
  320|       |
  321|       |		/* conditionally negate t2d */
  322|    704|		"movq %3, %%rax                  ;\n"
  323|    704|		"movq $0xfffffffffffda, %%r9     ;\n"
  324|    704|		"movq $0xffffffffffffe, %%r10    ;\n"
  325|    704|		"movq %%r10, %%r11               ;\n"
  326|    704|		"movq %%r10, %%r12               ;\n"
  327|    704|		"movq %%r10, %%r13               ;\n"
  328|    704|		"subq %%rcx, %%r9                ;\n"
  329|    704|		"subq %%r8, %%r10                ;\n"
  330|    704|		"subq %%rdx, %%r11               ;\n"
  331|    704|		"subq %%rsi, %%r12               ;\n"
  332|    704|		"subq %%rdi, %%r13               ;\n"
  333|    704|		"cmpq $1, %%rax                  ;\n"
  334|    704|		"cmove %%r9, %%rcx               ;\n"
  335|    704|		"cmove %%r10, %%r8               ;\n"
  336|    704|		"cmove %%r11, %%rdx              ;\n"
  337|    704|		"cmove %%r12, %%rsi              ;\n"
  338|    704|		"cmove %%r13, %%rdi              ;\n"
  339|       |
  340|       |		/* store t2d */
  341|    704|		"movq %%rcx, 80(%2)              ;\n"
  342|    704|		"movq %%r8, 88(%2)               ;\n"
  343|    704|		"movq %%rdx, 96(%2)              ;\n"
  344|    704|		"movq %%rsi, 104(%2)             ;\n"
  345|    704|		"movq %%rdi, 112(%2)             ;\n"
  346|    704|		:
  347|    704|		: "m"(u), "r"(&table[pos * 8]), "r"(t), "m"(sign) /* %0 = u, %1 = table, %2 = t, %3 = sign */
  348|    704|		:
  349|    704|			"%rax", "%rcx", "%rdx", "%rdi", "%rsi", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", 
  350|    704|			"%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm14", "%xmm14",
  351|    704|			"cc", "memory"
  352|    704|	);
  353|    704|}

ed25519_tor.c:ge25519_unpack_negative_vartime:
  192|      1|ge25519_unpack_negative_vartime(ge25519 *r, const unsigned char p[32]) {
  193|      1|	static const unsigned char zero[32] = {0};
  194|      1|	static const bignum25519 one = {1};
  195|      1|	unsigned char parity = p[31] >> 7;
  196|      1|	unsigned char check[32];
  197|      1|	bignum25519 t, root, num, den, d3;
  198|       |
  199|      1|	curve25519_expand(r->y, p);
  200|      1|	curve25519_copy(r->z, one);
  201|      1|	curve25519_square(num, r->y); /* x = y^2 */
  202|      1|	curve25519_mul(den, num, ge25519_ecd); /* den = dy^2 */
  203|      1|	curve25519_sub_reduce(num, num, r->z); /* x = y^1 - 1 */
  204|      1|	curve25519_add(den, den, r->z); /* den = dy^2 + 1 */
  205|       |
  206|       |	/* Computation of sqrt(num/den) */
  207|       |	/* 1.: computation of num^((p-5)/8)*den^((7p-35)/8) = (num*den^7)^((p-5)/8) */
  208|      1|	curve25519_square(t, den);
  209|      1|	curve25519_mul(d3, t, den);
  210|      1|	curve25519_square(r->x, d3);
  211|      1|	curve25519_mul(r->x, r->x, den);
  212|      1|	curve25519_mul(r->x, r->x, num);
  213|      1|	curve25519_pow_two252m3(r->x, r->x);
  214|       |
  215|       |	/* 2. computation of r->x = num * den^3 * (num*den^7)^((p-5)/8) */
  216|      1|	curve25519_mul(r->x, r->x, d3);
  217|      1|	curve25519_mul(r->x, r->x, num);
  218|       |
  219|       |	/* 3. Check if either of the roots works: */
  220|      1|	curve25519_square(t, r->x);
  221|      1|	curve25519_mul(t, t, den);
  222|      1|	curve25519_sub_reduce(root, t, num);
  223|      1|	curve25519_contract(check, root);
  224|      1|	if (!ed25519_verify(check, zero, 32)) {
  ------------------
  |  Branch (224:6): [True: 1, False: 0]
  ------------------
  225|      1|		curve25519_add_reduce(t, t, num);
  226|      1|		curve25519_contract(check, t);
  227|      1|		if (!ed25519_verify(check, zero, 32))
  ------------------
  |  Branch (227:7): [True: 0, False: 1]
  ------------------
  228|      0|			return 0;
  229|      1|		curve25519_mul(r->x, r->x, ge25519_sqrtneg1);
  230|      1|	}
  231|       |
  232|      1|	curve25519_contract(check, r->x);
  233|      1|	if ((check[0] & 1) == parity) {
  ------------------
  |  Branch (233:6): [True: 0, False: 1]
  ------------------
  234|      0|		curve25519_copy(t, r->x);
  235|      0|		curve25519_neg(r->x, t);
  236|      0|	}
  237|      1|	curve25519_mul(r->t, r->x, r->y);
  238|      1|	return 1;
  239|      1|}
ed25519_tor.c:ge25519_p1p1_to_full:
   13|     88|ge25519_p1p1_to_full(ge25519 *r, const ge25519_p1p1 *p) {
   14|     88|	curve25519_mul(r->x, p->x, p->t);
   15|     88|	curve25519_mul(r->y, p->y, p->z);
   16|     88|	curve25519_mul(r->z, p->z, p->t);
   17|     88|	curve25519_mul(r->t, p->x, p->y);
   18|     88|}
ed25519_tor.c:ge25519_double:
  116|     12|ge25519_double(ge25519 *r, const ge25519 *p) {
  117|     12|	ge25519_p1p1 t;
  118|     12|	ge25519_double_p1p1(&t, p);
  119|     12|	ge25519_p1p1_to_full(r, &t);
  120|     12|}
ed25519_tor.c:ge25519_double_p1p1:
   54|    295|ge25519_double_p1p1(ge25519_p1p1 *r, const ge25519 *p) {
   55|    295|	bignum25519 a,b,c;
   56|       |
   57|    295|	curve25519_square(a, p->x);
   58|    295|	curve25519_square(b, p->y);
   59|    295|	curve25519_square(c, p->z);
   60|    295|	curve25519_add_reduce(c, c, c);
   61|    295|	curve25519_add(r->x, p->x, p->y);
   62|    295|	curve25519_square(r->x, r->x);
   63|    295|	curve25519_add(r->y, b, a);
   64|    295|	curve25519_sub(r->z, b, a);
   65|    295|	curve25519_sub_after_basic(r->x, r->x, r->y);
   66|    295|	curve25519_sub_after_basic(r->t, c, r->z);
   67|    295|}
ed25519_tor.c:ge25519_scalarmult_base_niels:
  335|     11|ge25519_scalarmult_base_niels(ge25519 *r, const uint8_t basepoint_table[256][96], const bignum256modm s) {
  336|     11|	signed char b[64];
  337|     11|	uint32_t i;
  338|     11|	ge25519_niels t;
  339|     11|        memset(&t, 0, sizeof(t));
  340|       |
  341|     11|	contract256_window4_modm(b, s);
  342|       |
  343|     11|	ge25519_scalarmult_base_choose_niels(&t, basepoint_table, 0, b[1]);
  344|     11|	curve25519_sub_reduce(r->x, t.xaddy, t.ysubx);
  345|     11|	curve25519_add_reduce(r->y, t.xaddy, t.ysubx);
  346|     11|	memset(r->z, 0, sizeof(bignum25519));
  347|     11|	curve25519_copy(r->t, t.t2d);
  348|     11|	r->z[0] = 2;
  349|    352|	for (i = 3; i < 64; i += 2) {
  ------------------
  |  Branch (349:14): [True: 341, False: 11]
  ------------------
  350|    341|		ge25519_scalarmult_base_choose_niels(&t, basepoint_table, i / 2, b[i]);
  351|    341|		ge25519_nielsadd2(r, &t);
  352|    341|	}
  353|     11|	ge25519_double_partial(r, r);
  354|     11|	ge25519_double_partial(r, r);
  355|     11|	ge25519_double_partial(r, r);
  356|     11|	ge25519_double(r, r);
  357|     11|	ge25519_scalarmult_base_choose_niels(&t, basepoint_table, 0, b[0]);
  358|     11|	curve25519_mul(t.t2d, t.t2d, ge25519_ecd);
  359|     11|	ge25519_nielsadd2(r, &t);
  360|    352|	for(i = 2; i < 64; i += 2) {
  ------------------
  |  Branch (360:13): [True: 341, False: 11]
  ------------------
  361|    341|		ge25519_scalarmult_base_choose_niels(&t, basepoint_table, i / 2, b[i]);
  362|    341|		ge25519_nielsadd2(r, &t);
  363|    341|	}
  364|     11|}
ed25519_tor.c:ge25519_nielsadd2:
  130|    693|ge25519_nielsadd2(ge25519 *r, const ge25519_niels *q) {
  131|    693|	bignum25519 a,b,c,e,f,g,h;
  132|       |
  133|    693|	curve25519_sub(a, r->y, r->x);
  134|    693|	curve25519_add(b, r->y, r->x);
  135|    693|	curve25519_mul(a, a, q->ysubx);
  136|    693|	curve25519_mul(e, b, q->xaddy);
  137|    693|	curve25519_add(h, e, a);
  138|    693|	curve25519_sub(e, e, a);
  139|    693|	curve25519_mul(c, r->t, q->t2d);
  140|    693|	curve25519_add(f, r->z, r->z);
  141|    693|	curve25519_add_after_basic(g, f, c);
  142|    693|	curve25519_sub_after_basic(f, f, c);
  143|    693|	curve25519_mul(r->x, e, f);
  144|    693|	curve25519_mul(r->y, h, g);
  145|    693|	curve25519_mul(r->z, g, f);
  146|    693|	curve25519_mul(r->t, e, h);
  147|    693|}
ed25519_tor.c:ge25519_double_partial:
  109|     33|ge25519_double_partial(ge25519 *r, const ge25519 *p) {
  110|     33|	ge25519_p1p1 t;
  111|     33|	ge25519_double_p1p1(&t, p);
  112|     33|	ge25519_p1p1_to_partial(r, &t);
  113|     33|}
ed25519_tor.c:ge25519_p1p1_to_partial:
    6|    283|ge25519_p1p1_to_partial(ge25519 *r, const ge25519_p1p1 *p) {
    7|    283|	curve25519_mul(r->x, p->x, p->t);
    8|    283|	curve25519_mul(r->y, p->y, p->z);
    9|    283|	curve25519_mul(r->z, p->z, p->t);
   10|    283|}
ed25519_tor.c:ge25519_pack:
  180|      3|ge25519_pack(unsigned char r[32], const ge25519 *p) {
  181|      3|	bignum25519 tx, ty, zi;
  182|      3|	unsigned char parity[32];
  183|      3|	curve25519_recip(zi, p->z);
  184|      3|	curve25519_mul(tx, p->x, zi);
  185|      3|	curve25519_mul(ty, p->y, zi);
  186|      3|	curve25519_contract(r, ty);
  187|      3|	curve25519_contract(parity, tx);
  188|      3|	r[31] ^= ((parity[0] & 1) << 7);
  189|      3|}
ed25519_tor.c:ge25519_double_scalarmult_vartime:
  253|      1|ge25519_double_scalarmult_vartime(ge25519 *r, const ge25519 *p1, const bignum256modm s1, const bignum256modm s2) {
  254|      1|	signed char slide1[256], slide2[256];
  255|      1|	ge25519_pniels pre1[S1_TABLE_SIZE];
  256|      1|	ge25519 d1;
  257|      1|	ge25519_p1p1 t;
  258|      1|	int32_t i;
  259|       |
  260|      1|	contract256_slidingwindow_modm(slide1, s1, S1_SWINDOWSIZE);
  ------------------
  |  |  246|      1|#define S1_SWINDOWSIZE 5
  ------------------
  261|      1|	contract256_slidingwindow_modm(slide2, s2, S2_SWINDOWSIZE);
  ------------------
  |  |  248|      1|#define S2_SWINDOWSIZE 7
  ------------------
  262|       |
  263|      1|	ge25519_double(&d1, p1);
  264|      1|	ge25519_full_to_pniels(pre1, p1);
  265|      8|	for (i = 0; i < S1_TABLE_SIZE - 1; i++)
  ------------------
  |  |  247|      8|#define S1_TABLE_SIZE (1<<(S1_SWINDOWSIZE-2))
  |  |  ------------------
  |  |  |  |  246|      8|#define S1_SWINDOWSIZE 5
  |  |  ------------------
  ------------------
  |  Branch (265:14): [True: 7, False: 1]
  ------------------
  266|      7|		ge25519_pnielsadd(&pre1[i+1], &d1, &pre1[i]);
  267|       |
  268|       |	/* set neutral */
  269|      1|	memset(r, 0, sizeof(ge25519));
  270|      1|	r->y[0] = 1;
  271|      1|	r->z[0] = 1;
  272|       |
  273|      1|	i = 255;
  274|      7|	while ((i >= 0) && !(slide1[i] | slide2[i]))
  ------------------
  |  Branch (274:9): [True: 7, False: 0]
  |  Branch (274:21): [True: 6, False: 1]
  ------------------
  275|      6|		i--;
  276|       |
  277|    251|	for (; i >= 0; i--) {
  ------------------
  |  Branch (277:9): [True: 250, False: 1]
  ------------------
  278|    250|		ge25519_double_p1p1(&t, r);
  279|       |
  280|    250|		if (slide1[i]) {
  ------------------
  |  Branch (280:7): [True: 45, False: 205]
  ------------------
  281|     45|			ge25519_p1p1_to_full(r, &t);
  282|     45|			ge25519_pnielsadd_p1p1(&t, r, &pre1[abs(slide1[i]) / 2], (unsigned char)slide1[i] >> 7);
  283|     45|		}
  284|       |
  285|    250|		if (slide2[i]) {
  ------------------
  |  Branch (285:7): [True: 31, False: 219]
  ------------------
  286|     31|			ge25519_p1p1_to_full(r, &t);
  287|     31|			ge25519_nielsadd2_p1p1(&t, r, &ge25519_niels_sliding_multiples[abs(slide2[i]) / 2], (unsigned char)slide2[i] >> 7);
  288|     31|		}
  289|       |
  290|    250|		ge25519_p1p1_to_partial(r, &t);
  291|    250|	}
  292|      1|}
ed25519_tor.c:ge25519_full_to_pniels:
   21|      1|ge25519_full_to_pniels(ge25519_pniels *p, const ge25519 *r) {
   22|      1|	curve25519_sub(p->ysubx, r->y, r->x);
   23|      1|	curve25519_add(p->xaddy, r->y, r->x);
   24|      1|	curve25519_copy(p->z, r->z);
   25|      1|	curve25519_mul(p->t2d, r->t, ge25519_ec2d);
   26|      1|}
ed25519_tor.c:ge25519_pnielsadd:
  150|      7|ge25519_pnielsadd(ge25519_pniels *r, const ge25519 *p, const ge25519_pniels *q) {
  151|      7|	bignum25519 a,b,c,x,y,z,t;
  152|       |
  153|      7|	curve25519_sub(a, p->y, p->x);
  154|      7|	curve25519_add(b, p->y, p->x);
  155|      7|	curve25519_mul(a, a, q->ysubx);
  156|      7|	curve25519_mul(x, b, q->xaddy);
  157|      7|	curve25519_add(y, x, a);
  158|      7|	curve25519_sub(x, x, a);
  159|      7|	curve25519_mul(c, p->t, q->t2d);
  160|      7|	curve25519_mul(t, p->z, q->z);
  161|      7|	curve25519_add(t, t, t);
  162|      7|	curve25519_add_after_basic(z, t, c);
  163|      7|	curve25519_sub_after_basic(t, t, c);
  164|      7|	curve25519_mul(r->xaddy, x, t);
  165|      7|	curve25519_mul(r->ysubx, y, z);
  166|      7|	curve25519_mul(r->z, z, t);
  167|      7|	curve25519_mul(r->t2d, x, y);
  168|      7|	curve25519_copy(y, r->ysubx);
  169|      7|	curve25519_sub(r->ysubx, r->ysubx, r->xaddy);
  170|      7|	curve25519_add(r->xaddy, r->xaddy, y);
  171|      7|	curve25519_mul(r->t2d, r->t2d, ge25519_ec2d);
  172|      7|}
ed25519_tor.c:ge25519_pnielsadd_p1p1:
   89|     45|ge25519_pnielsadd_p1p1(ge25519_p1p1 *r, const ge25519 *p, const ge25519_pniels *q, unsigned char signbit) {
   90|     45|	const bignum25519 *qb = (const bignum25519 *)q;
   91|     45|	bignum25519 *rb = (bignum25519 *)r;
   92|     45|	bignum25519 a,b,c;
   93|       |
   94|     45|	curve25519_sub(a, p->y, p->x);
   95|     45|	curve25519_add(b, p->y, p->x);
   96|     45|	curve25519_mul(a, a, qb[signbit]); /* ysubx for +, xaddy for - */
   97|     45|	curve25519_mul(r->x, b, qb[signbit^1]); /* xaddy for +, ysubx for - */
   98|     45|	curve25519_add(r->y, r->x, a);
   99|     45|	curve25519_sub(r->x, r->x, a);
  100|     45|	curve25519_mul(c, p->t, q->t2d);
  101|     45|	curve25519_mul(r->t, p->z, q->z);
  102|     45|	curve25519_add_reduce(r->t, r->t, r->t);
  103|     45|	curve25519_copy(r->z, r->t);
  104|     45|	curve25519_add(rb[2+signbit], rb[2+signbit], c); /* z for +, t for - */
  105|     45|	curve25519_sub(rb[2+(signbit^1)], rb[2+(signbit^1)], c); /* t for +, z for - */
  106|     45|}
ed25519_tor.c:ge25519_nielsadd2_p1p1:
   70|     31|ge25519_nielsadd2_p1p1(ge25519_p1p1 *r, const ge25519 *p, const ge25519_niels *q, unsigned char signbit) {
   71|     31|	const bignum25519 *qb = (const bignum25519 *)q;
   72|     31|	bignum25519 *rb = (bignum25519 *)r;
   73|     31|	bignum25519 a,b,c;
   74|       |
   75|     31|	curve25519_sub(a, p->y, p->x);
   76|     31|	curve25519_add(b, p->y, p->x);
   77|     31|	curve25519_mul(a, a, qb[signbit]); /* x for +, y for - */
   78|     31|	curve25519_mul(r->x, b, qb[signbit^1]); /* y for +, x for - */
   79|     31|	curve25519_add(r->y, r->x, a);
   80|     31|	curve25519_sub(r->x, r->x, a);
   81|     31|	curve25519_mul(c, p->t, q->t2d);
   82|     31|	curve25519_add_reduce(r->t, p->z, p->z);
   83|     31|	curve25519_copy(r->z, r->t);
   84|     31|	curve25519_add(rb[2+signbit], rb[2+signbit], c); /* z for +, t for - */
   85|     31|	curve25519_sub(rb[2+(signbit^1)], rb[2+(signbit^1)], c); /* t for +, z for - */
   86|     31|}

ed25519_tor.c:U8TO64_LE:
  110|     84|static inline uint64_t U8TO64_LE(const unsigned char *p) {
  111|     84|	return
  112|     84|	(((uint64_t)(p[0])      ) |
  113|     84|	 ((uint64_t)(p[1]) <<  8) |
  114|     84|	 ((uint64_t)(p[2]) << 16) |
  115|     84|	 ((uint64_t)(p[3]) << 24) |
  116|     84|	 ((uint64_t)(p[4]) << 32) |
  117|     84|	 ((uint64_t)(p[5]) << 40) |
  118|     84|	 ((uint64_t)(p[6]) << 48) |
  119|     84|	 ((uint64_t)(p[7]) << 56));
  120|     84|}
ed25519_tor.c:U64TO8_LE:
  122|      4|static inline void U64TO8_LE(unsigned char *p, const uint64_t v) {
  123|      4|	p[0] = (unsigned char)(v      );
  124|      4|	p[1] = (unsigned char)(v >>  8);
  125|      4|	p[2] = (unsigned char)(v >> 16);
  126|      4|	p[3] = (unsigned char)(v >> 24);
  127|      4|	p[4] = (unsigned char)(v >> 32);
  128|      4|	p[5] = (unsigned char)(v >> 40);
  129|      4|	p[6] = (unsigned char)(v >> 48);
  130|      4|	p[7] = (unsigned char)(v >> 56);
  131|      4|}

ed25519_tor.c:ed25519_verify:
   77|      3|ed25519_verify(const unsigned char *x, const unsigned char *y, size_t len) {
   78|      3|	size_t differentbits = 0;
   79|     99|	while (len--)
  ------------------
  |  Branch (79:9): [True: 96, False: 3]
  ------------------
   80|     96|		differentbits |= (*x++ ^ *y++);
   81|       |        /*coverity[overflow]*/
   82|      3|	return (int) (1 & ((differentbits - 1) >> 8));
   83|      3|}

ed25519_tor.c:ed25519_hash:
   38|      1|{
   39|      1|  crypto_digest512((char *)hash, (const char *)in, inlen,
   40|      1|		   DIGEST_SHA512);
   41|      1|}
ed25519_tor.c:ed25519_hash_init:
   21|      3|{
   22|      3|  ctx->ctx = crypto_digest512_new(DIGEST_SHA512);
   23|      3|}
ed25519_tor.c:ed25519_hash_update:
   26|      8|{
   27|      8|  crypto_digest_add_bytes(ctx->ctx, (const char *)in, inlen);
   28|      8|}
ed25519_tor.c:ed25519_hash_final:
   31|      3|{
   32|      3|  crypto_digest_get_digest(ctx->ctx, (char *)hash, DIGEST512_LEN);
  ------------------
  |  |   25|      3|#define DIGEST512_LEN 64
  ------------------
   33|      3|  crypto_digest_free(ctx->ctx);
  ------------------
  |  |  129|      3|  FREE_AND_NULL(crypto_digest_t, crypto_digest_free_, (d))
  |  |  ------------------
  |  |  |  |   85|      3|  do {                                                                  \
  |  |  |  |   86|      3|    /* only evaluate (var) once. */                                     \
  |  |  |  |   87|      3|    typename **tmp__free__ptr ## freefn = &(var);                       \
  |  |  |  |   88|      3|    freefn(*tmp__free__ptr ## freefn);                                  \
  |  |  |  |   89|      3|    (*tmp__free__ptr ## freefn) = NULL;                                 \
  |  |  |  |   90|      3|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:12): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   34|       |  ctx->ctx = NULL;
   35|      3|}

curved25519_scalarmult_basepoint_donna:
  114|      9|ED25519_FN(curved25519_scalarmult_basepoint) (curved25519_key pk, const curved25519_key e) {
  115|      9|  curved25519_key ec;
  116|      9|  bignum256modm s;
  117|      9|  bignum25519 ALIGN(16) yplusz, zminusy;
  118|      9|  ge25519 ALIGN(16) p;
  119|      9|  size_t i;
  120|       |
  121|       |  /* clamp */
  122|    297|  for (i = 0; i < 32; i++) ec[i] = e[i];
  ------------------
  |  Branch (122:15): [True: 288, False: 9]
  ------------------
  123|      9|  ec[0] &= 248;
  124|      9|  ec[31] &= 127;
  125|      9|  ec[31] |= 64;
  126|       |
  127|      9|  expand_raw256_modm(s, ec);
  128|       |
  129|       |  /* scalar * basepoint */
  130|      9|  ge25519_scalarmult_base_niels(&p, ge25519_niels_base_multiples, s);
  131|       |
  132|       |  /* u = (y + z) / (z - y) */
  133|      9|  curve25519_add(yplusz, p.y, p.z);
  134|      9|  curve25519_sub(zminusy, p.z, p.y);
  135|      9|  curve25519_recip(zminusy, zminusy);
  136|      9|  curve25519_mul(yplusz, yplusz, zminusy);
  137|      9|  curve25519_contract(pk, yplusz);
  138|      9|}
ed25519_donna_seckey_expand:
  169|      1|{
  170|      1|  ed25519_extsk(sk, skseed);
  171|       |
  172|      1|  return 0;
  173|      1|}
ed25519_donna_pubkey:
  177|      1|{
  178|      1|  bignum256modm a = {0};
  179|      1|  ge25519 ALIGN(16) A = {{0}, {0}, {0}, {0}};
  180|       |
  181|       |  /* A = aB */
  182|      1|  expand256_modm(a, sk, 32);
  183|      1|  ge25519_scalarmult_base_niels(&A, ge25519_niels_base_multiples, a);
  184|      1|  ge25519_pack(pk, &A);
  185|       |
  186|      1|  return 0;
  187|      1|}
ed25519_donna_open:
  202|      1|{
  203|       |  /* Wrap the ed25519-donna routine, since it is also used by the batch
  204|       |   * verification code.
  205|       |   */
  206|      1|  return ED25519_FN(ed25519_sign_open)(m, mlen, pk, signature);
  ------------------
  |  |   35|      1|#define ED25519_FN(fn)         ED25519_FN2(fn,ED25519_SUFFIX)
  |  |  ------------------
  |  |  |  |   34|      1|#define ED25519_FN2(fn,suffix) ED25519_FN3(fn,suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|      1|#define ED25519_FN3(fn,suffix) fn##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|      1|}
ed25519_donna_sign:
  212|      1|{
  213|      1|  ed25519_hash_context ctx;
  214|      1|  bignum256modm r = {0}, S, a;
  215|      1|  ge25519 ALIGN(16) R = {{0}, {0}, {0}, {0}};
  216|      1|  hash_512bits hashr, hram;
  217|       |
  218|       |  /* This is equivalent to the removed `ED25519_FN(ed25519_sign)` routine,
  219|       |   * except that the key expansion step is omitted as sk already is in expanded
  220|       |   * form.
  221|       |   */
  222|       |
  223|       |  /* r = H(aExt[32..64], m) */
  224|      1|  ed25519_hash_init(&ctx);
  225|      1|  ed25519_hash_update(&ctx, sk + 32, 32);
  226|      1|  ed25519_hash_update(&ctx, m, mlen);
  227|      1|  ed25519_hash_final(&ctx, hashr);
  228|      1|  expand256_modm(r, hashr, 64);
  229|       |
  230|       |  /* R = rB */
  231|      1|  ge25519_scalarmult_base_niels(&R, ge25519_niels_base_multiples, r);
  232|      1|  ge25519_pack(sig, &R);
  233|       |
  234|       |  /* S = H(R,A,m).. */
  235|      1|  ed25519_hram(hram, sig, pk, m, mlen);
  236|      1|  expand256_modm(S, hram, 64);
  237|       |
  238|       |  /* S = H(R,A,m)a */
  239|      1|  expand256_modm(a, sk, 32);
  240|      1|  mul256_modm(S, S, a);
  241|       |
  242|       |  /* S = (r + H(R,A,m)a) */
  243|      1|  add256_modm(S, S, r);
  244|       |
  245|       |  /* S = (r + H(R,A,m)a) mod L */
  246|      1|  contract256_modm(sig + 32, S);
  247|       |
  248|      1|  return 0;
  249|      1|}
ed25519_tor.c:ed25519_hram:
   73|      2|ed25519_hram(hash_512bits hram, const ed25519_signature RS, const ed25519_public_key pk, const unsigned char *m, size_t mlen) {
   74|      2|  ed25519_hash_context ctx;
   75|      2|  ed25519_hash_init(&ctx);
   76|      2|  ed25519_hash_update(&ctx, RS, 32);
   77|      2|  ed25519_hash_update(&ctx, pk, 32);
   78|      2|  ed25519_hash_update(&ctx, m, mlen);
   79|      2|  ed25519_hash_final(&ctx, hram);
   80|      2|}
ed25519_tor.c:ed25519_sign_open_donna:
   83|      1|ED25519_FN(ed25519_sign_open) (const unsigned char *m, size_t mlen, const ed25519_public_key pk, const ed25519_signature RS) {
   84|      1|  ge25519 ALIGN(16) R, A;
   85|      1|  hash_512bits hash;
   86|      1|  bignum256modm hram, S;
   87|      1|  unsigned char checkR[32];
   88|       |
   89|      1|  if ((RS[63] & 224) || !ge25519_unpack_negative_vartime(&A, pk))
  ------------------
  |  Branch (89:7): [True: 0, False: 1]
  |  Branch (89:25): [True: 0, False: 1]
  ------------------
   90|      0|    return -1;
   91|       |
   92|       |  /* hram = H(R,A,m) */
   93|      1|  ed25519_hram(hash, RS, pk, m, mlen);
   94|      1|  expand256_modm(hram, hash, 64);
   95|       |
   96|       |  /* S */
   97|      1|  expand256_modm(S, RS + 32, 32);
   98|       |
   99|       |  /* SB - H(R,A,m)A */
  100|      1|  ge25519_double_scalarmult_vartime(&R, &A, hram, S);
  101|      1|  ge25519_pack(checkR, &R);
  102|       |
  103|       |  /* check that R = SB - H(R,A,m)A */
  104|      1|  return ed25519_verify(RS, checkR, 32) ? 0 : -1;
  ------------------
  |  Branch (104:10): [True: 1, False: 0]
  ------------------
  105|      1|}
ed25519_tor.c:ed25519_extsk:
   65|      1|ed25519_extsk(hash_512bits extsk, const ed25519_secret_key sk) {
   66|      1|  ed25519_hash(extsk, sk, 32);
   67|      1|  extsk[0] &= 248;
   68|      1|  extsk[31] &= 127;
   69|      1|  extsk[31] |= 64;
   70|      1|}

ed25519_tor.c:expand256_modm:
  153|      6|expand256_modm(bignum256modm out, const unsigned char *in, size_t len) {
  154|      6|	unsigned char work[64] = {0};
  155|      6|	bignum256modm_element_t x[16];
  156|      6|	bignum256modm q1;
  157|       |
  158|      6|	memcpy(work, in, len);
  159|      6|	x[0] = U8TO64_LE(work +  0);
  160|      6|	x[1] = U8TO64_LE(work +  8);
  161|      6|	x[2] = U8TO64_LE(work + 16);
  162|      6|	x[3] = U8TO64_LE(work + 24);
  163|      6|	x[4] = U8TO64_LE(work + 32);
  164|      6|	x[5] = U8TO64_LE(work + 40);
  165|      6|	x[6] = U8TO64_LE(work + 48);
  166|      6|	x[7] = U8TO64_LE(work + 56);
  167|       |
  168|       |	/* r1 = (x mod 256^(32+1)) = x mod (2^8)(31+1) = x & ((1 << 264) - 1) */
  169|      6|	out[0] = (                         x[0]) & 0xffffffffffffff;
  170|      6|	out[1] = ((x[ 0] >> 56) | (x[ 1] <<  8)) & 0xffffffffffffff;
  171|      6|	out[2] = ((x[ 1] >> 48) | (x[ 2] << 16)) & 0xffffffffffffff;
  172|      6|	out[3] = ((x[ 2] >> 40) | (x[ 3] << 24)) & 0xffffffffffffff;
  173|      6|	out[4] = ((x[ 3] >> 32) | (x[ 4] << 32)) & 0x0000ffffffffff;
  174|       |
  175|       |	/* under 252 bits, no need to reduce */
  176|      6|	if (len < 32)
  ------------------
  |  Branch (176:6): [True: 0, False: 6]
  ------------------
  177|      0|		return;
  178|       |
  179|       |	/* q1 = x >> 248 = 264 bits */
  180|      6|	q1[0] = ((x[ 3] >> 56) | (x[ 4] <<  8)) & 0xffffffffffffff;
  181|      6|	q1[1] = ((x[ 4] >> 48) | (x[ 5] << 16)) & 0xffffffffffffff;
  182|      6|	q1[2] = ((x[ 5] >> 40) | (x[ 6] << 24)) & 0xffffffffffffff;
  183|      6|	q1[3] = ((x[ 6] >> 32) | (x[ 7] << 32)) & 0xffffffffffffff;
  184|      6|	q1[4] = ((x[ 7] >> 24)                );
  185|       |
  186|      6|	barrett_reduce256_modm(out, q1, out);
  187|      6|}
ed25519_tor.c:barrett_reduce256_modm:
   66|      7|barrett_reduce256_modm(bignum256modm r, const bignum256modm q1, const bignum256modm r1) {
   67|      7|	bignum256modm q3, r2;
   68|      7|	uint128_t c, mul;
   69|      7|	bignum256modm_element_t f, b, pb;
   70|       |
   71|       |	/* q1 = x >> 248 = 264 bits = 5 56 bit elements
   72|       |	   q2 = mu * q1
   73|       |	   q3 = (q2 / 256(32+1)) = q2 / (2^8)^(32+1) = q2 >> 264 */
   74|      7|	mul64x64_128(c, modm_mu[0], q1[3])                 mul64x64_128(mul, modm_mu[3], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[2]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[1]) add128(c, mul) shr128(f, c, 56);
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[3])                 mul64x64_128(mul, modm_mu[3], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[2]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[1]) add128(c, mul) shr128(f, c, 56);
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[3])                 mul64x64_128(mul, modm_mu[3], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[2]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[1]) add128(c, mul) shr128(f, c, 56);
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[3])                 mul64x64_128(mul, modm_mu[3], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[2]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[1]) add128(c, mul) shr128(f, c, 56);
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[3])                 mul64x64_128(mul, modm_mu[3], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[2]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[1]) add128(c, mul) shr128(f, c, 56);
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[3])                 mul64x64_128(mul, modm_mu[3], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[2]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[1]) add128(c, mul) shr128(f, c, 56);
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[3])                 mul64x64_128(mul, modm_mu[3], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[2]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[1]) add128(c, mul) shr128(f, c, 56);
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[3])                 mul64x64_128(mul, modm_mu[3], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[2]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[1]) add128(c, mul) shr128(f, c, 56);
  ------------------
  |  |   78|      7|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
   75|      7|	mul64x64_128(c, modm_mu[0], q1[4]) add128_64(c, f) mul64x64_128(mul, modm_mu[4], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[1]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[4]) add128_64(c, f) mul64x64_128(mul, modm_mu[4], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[1]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[2]) add128(c, mul)
  ------------------
  |  |   81|      7|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[4]) add128_64(c, f) mul64x64_128(mul, modm_mu[4], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[1]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[4]) add128_64(c, f) mul64x64_128(mul, modm_mu[4], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[1]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[4]) add128_64(c, f) mul64x64_128(mul, modm_mu[4], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[1]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[4]) add128_64(c, f) mul64x64_128(mul, modm_mu[4], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[1]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[4]) add128_64(c, f) mul64x64_128(mul, modm_mu[4], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[1]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[4]) add128_64(c, f) mul64x64_128(mul, modm_mu[4], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[1]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[4]) add128_64(c, f) mul64x64_128(mul, modm_mu[4], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[1]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[0], q1[4]) add128_64(c, f) mul64x64_128(mul, modm_mu[4], q1[0]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[1]) add128(c, mul) mul64x64_128(mul, modm_mu[1], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
   76|      7|	f = lo128(c); q3[0] = (f >> 40) & 0xffff; shr128(f, c, 56);
  ------------------
  |  |   82|      7|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); q3[0] = (f >> 40) & 0xffff; shr128(f, c, 56);
  ------------------
  |  |   78|      7|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
   77|      7|	mul64x64_128(c, modm_mu[4], q1[1]) add128_64(c, f) mul64x64_128(mul, modm_mu[1], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[1]) add128_64(c, f) mul64x64_128(mul, modm_mu[1], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[2]) add128(c, mul)
  ------------------
  |  |   81|      7|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[1]) add128_64(c, f) mul64x64_128(mul, modm_mu[1], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[1]) add128_64(c, f) mul64x64_128(mul, modm_mu[1], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[1]) add128_64(c, f) mul64x64_128(mul, modm_mu[1], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[1]) add128_64(c, f) mul64x64_128(mul, modm_mu[1], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[1]) add128_64(c, f) mul64x64_128(mul, modm_mu[1], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[1]) add128_64(c, f) mul64x64_128(mul, modm_mu[1], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[2], q1[3]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
   78|      7|	f = lo128(c); q3[0] |= (f << 16) & 0xffffffffffffff; q3[1] = (f >> 40) & 0xffff; shr128(f, c, 56);
  ------------------
  |  |   82|      7|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); q3[0] |= (f << 16) & 0xffffffffffffff; q3[1] = (f >> 40) & 0xffff; shr128(f, c, 56);
  ------------------
  |  |   78|      7|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
   79|      7|	mul64x64_128(c, modm_mu[4], q1[2]) add128_64(c, f) mul64x64_128(mul, modm_mu[2], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[3]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[2]) add128_64(c, f) mul64x64_128(mul, modm_mu[2], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[3]) add128(c, mul)
  ------------------
  |  |   81|      7|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[2]) add128_64(c, f) mul64x64_128(mul, modm_mu[2], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[3]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[2]) add128_64(c, f) mul64x64_128(mul, modm_mu[2], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[3]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[2]) add128_64(c, f) mul64x64_128(mul, modm_mu[2], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[3]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[2]) add128_64(c, f) mul64x64_128(mul, modm_mu[2], q1[4]) add128(c, mul) mul64x64_128(mul, modm_mu[3], q1[3]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
   80|      7|	f = lo128(c); q3[1] |= (f << 16) & 0xffffffffffffff; q3[2] = (f >> 40) & 0xffff; shr128(f, c, 56);
  ------------------
  |  |   82|      7|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); q3[1] |= (f << 16) & 0xffffffffffffff; q3[2] = (f >> 40) & 0xffff; shr128(f, c, 56);
  ------------------
  |  |   78|      7|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
   81|      7|	mul64x64_128(c, modm_mu[4], q1[3]) add128_64(c, f) mul64x64_128(mul, modm_mu[3], q1[4]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[3]) add128_64(c, f) mul64x64_128(mul, modm_mu[3], q1[4]) add128(c, mul)
  ------------------
  |  |   81|      7|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[3]) add128_64(c, f) mul64x64_128(mul, modm_mu[3], q1[4]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[3]) add128_64(c, f) mul64x64_128(mul, modm_mu[3], q1[4]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
   82|      7|	f = lo128(c); q3[2] |= (f << 16) & 0xffffffffffffff; q3[3] = (f >> 40) & 0xffff; shr128(f, c, 56);
  ------------------
  |  |   82|      7|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); q3[2] |= (f << 16) & 0xffffffffffffff; q3[3] = (f >> 40) & 0xffff; shr128(f, c, 56);
  ------------------
  |  |   78|      7|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
   83|      7|	mul64x64_128(c, modm_mu[4], q1[4]) add128_64(c, f)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_mu[4], q1[4]) add128_64(c, f)
  ------------------
  |  |   81|      7|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
   84|      7|	f = lo128(c); q3[3] |= (f << 16) & 0xffffffffffffff; q3[4] = (f >> 40) & 0xffff; shr128(f, c, 56);
  ------------------
  |  |   82|      7|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); q3[3] |= (f << 16) & 0xffffffffffffff; q3[4] = (f >> 40) & 0xffff; shr128(f, c, 56);
  ------------------
  |  |   78|      7|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
   85|      7|	q3[4] |= (f << 16);
   86|       |
   87|      7|	mul64x64_128(c, modm_m[0], q3[0]) 
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
   88|      7|	r2[0] = lo128(c) & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      7|		#define lo128(a) ((uint64_t)a)
  ------------------
              	r2[0] = lo128(c) & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      7|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
   89|      7|	mul64x64_128(c, modm_m[0], q3[1]) add128_64(c, f) mul64x64_128(mul, modm_m[1], q3[0]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[1]) add128_64(c, f) mul64x64_128(mul, modm_m[1], q3[0]) add128(c, mul)
  ------------------
  |  |   81|      7|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[1]) add128_64(c, f) mul64x64_128(mul, modm_m[1], q3[0]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[1]) add128_64(c, f) mul64x64_128(mul, modm_m[1], q3[0]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
   90|      7|	r2[1] = lo128(c) & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      7|		#define lo128(a) ((uint64_t)a)
  ------------------
              	r2[1] = lo128(c) & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      7|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
   91|      7|	mul64x64_128(c, modm_m[0], q3[2]) add128_64(c, f) mul64x64_128(mul, modm_m[2], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[1]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[2]) add128_64(c, f) mul64x64_128(mul, modm_m[2], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[1]) add128(c, mul)
  ------------------
  |  |   81|      7|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[2]) add128_64(c, f) mul64x64_128(mul, modm_m[2], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[1]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[2]) add128_64(c, f) mul64x64_128(mul, modm_m[2], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[1]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[2]) add128_64(c, f) mul64x64_128(mul, modm_m[2], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[1]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[2]) add128_64(c, f) mul64x64_128(mul, modm_m[2], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[1]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
   92|      7|	r2[2] = lo128(c) & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      7|		#define lo128(a) ((uint64_t)a)
  ------------------
              	r2[2] = lo128(c) & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      7|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
   93|      7|	mul64x64_128(c, modm_m[0], q3[3]) add128_64(c, f) mul64x64_128(mul, modm_m[3], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[2]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[1]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[3]) add128_64(c, f) mul64x64_128(mul, modm_m[3], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[2]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[1]) add128(c, mul)
  ------------------
  |  |   81|      7|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[3]) add128_64(c, f) mul64x64_128(mul, modm_m[3], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[2]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[1]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[3]) add128_64(c, f) mul64x64_128(mul, modm_m[3], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[2]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[1]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[3]) add128_64(c, f) mul64x64_128(mul, modm_m[3], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[2]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[1]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[3]) add128_64(c, f) mul64x64_128(mul, modm_m[3], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[2]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[1]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[3]) add128_64(c, f) mul64x64_128(mul, modm_m[3], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[2]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[1]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[3]) add128_64(c, f) mul64x64_128(mul, modm_m[3], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[2]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[1]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
   94|      7|	r2[3] = lo128(c) & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      7|		#define lo128(a) ((uint64_t)a)
  ------------------
              	r2[3] = lo128(c) & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      7|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
   95|      7|	mul64x64_128(c, modm_m[0], q3[4]) add128_64(c, f) mul64x64_128(mul, modm_m[4], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[3], q3[1]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[3]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[4]) add128_64(c, f) mul64x64_128(mul, modm_m[4], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[3], q3[1]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[3]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[2]) add128(c, mul)
  ------------------
  |  |   81|      7|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[4]) add128_64(c, f) mul64x64_128(mul, modm_m[4], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[3], q3[1]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[3]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[4]) add128_64(c, f) mul64x64_128(mul, modm_m[4], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[3], q3[1]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[3]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[4]) add128_64(c, f) mul64x64_128(mul, modm_m[4], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[3], q3[1]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[3]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[4]) add128_64(c, f) mul64x64_128(mul, modm_m[4], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[3], q3[1]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[3]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[4]) add128_64(c, f) mul64x64_128(mul, modm_m[4], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[3], q3[1]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[3]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[4]) add128_64(c, f) mul64x64_128(mul, modm_m[4], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[3], q3[1]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[3]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[4]) add128_64(c, f) mul64x64_128(mul, modm_m[4], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[3], q3[1]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[3]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[2]) add128(c, mul)
  ------------------
  |  |   75|      7|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, modm_m[0], q3[4]) add128_64(c, f) mul64x64_128(mul, modm_m[4], q3[0]) add128(c, mul) mul64x64_128(mul, modm_m[3], q3[1]) add128(c, mul) mul64x64_128(mul, modm_m[1], q3[3]) add128(c, mul) mul64x64_128(mul, modm_m[2], q3[2]) add128(c, mul)
  ------------------
  |  |   80|      7|		#define add128(a,b) a += b;
  ------------------
   96|      7|	r2[4] = lo128(c) & 0x0000ffffffffff;
  ------------------
  |  |   82|      7|		#define lo128(a) ((uint64_t)a)
  ------------------
   97|       |
   98|      7|	pb = 0;
   99|      7|	pb += r2[0]; b = lt_modm(r1[0], pb); r[0] = (r1[0] - pb + (b << 56)); pb = b;
  100|      7|	pb += r2[1]; b = lt_modm(r1[1], pb); r[1] = (r1[1] - pb + (b << 56)); pb = b;
  101|      7|	pb += r2[2]; b = lt_modm(r1[2], pb); r[2] = (r1[2] - pb + (b << 56)); pb = b;
  102|      7|	pb += r2[3]; b = lt_modm(r1[3], pb); r[3] = (r1[3] - pb + (b << 56)); pb = b;
  103|      7|	pb += r2[4]; b = lt_modm(r1[4], pb); r[4] = (r1[4] - pb + (b << 40)); 
  104|       |
  105|      7|	reduce256_modm(r);
  106|      7|	reduce256_modm(r);
  107|      7|}
ed25519_tor.c:lt_modm:
   38|    110|lt_modm(bignum256modm_element_t a, bignum256modm_element_t b) {
   39|    110|	return (a - b) >> 63;
   40|    110|}
ed25519_tor.c:reduce256_modm:
   43|     15|reduce256_modm(bignum256modm r) {
   44|     15|	bignum256modm t;
   45|     15|	bignum256modm_element_t b = 0, pb, mask;
   46|       |
   47|       |	/* t = r - m */
   48|     15|	pb = 0;
   49|     15|	pb += modm_m[0]; b = lt_modm(r[0], pb); t[0] = (r[0] - pb + (b << 56)); pb = b;
   50|     15|	pb += modm_m[1]; b = lt_modm(r[1], pb); t[1] = (r[1] - pb + (b << 56)); pb = b;
   51|     15|	pb += modm_m[2]; b = lt_modm(r[2], pb); t[2] = (r[2] - pb + (b << 56)); pb = b;
   52|     15|	pb += modm_m[3]; b = lt_modm(r[3], pb); t[3] = (r[3] - pb + (b << 56)); pb = b;
   53|     15|	pb += modm_m[4]; b = lt_modm(r[4], pb); t[4] = (r[4] - pb + (b << 32)); 
   54|       |
   55|       |	/* keep r if r was smaller than m */
   56|     15|	mask = b - 1;
   57|       |
   58|     15|	r[0] ^= mask & (r[0] ^ t[0]);
   59|     15|	r[1] ^= mask & (r[1] ^ t[1]);
   60|     15|	r[2] ^= mask & (r[2] ^ t[2]);
   61|     15|	r[3] ^= mask & (r[3] ^ t[3]);
   62|     15|	r[4] ^= mask & (r[4] ^ t[4]);
   63|     15|}
ed25519_tor.c:mul256_modm:
  124|      1|mul256_modm(bignum256modm r, const bignum256modm x, const bignum256modm y) {
  125|      1|	bignum256modm q1, r1;
  126|      1|	uint128_t c, mul;
  127|      1|	bignum256modm_element_t f;
  128|       |
  129|      1|	mul64x64_128(c, x[0], y[0])
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
  130|      1|	f = lo128(c); r1[0] = f & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      1|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); r1[0] = f & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      1|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  131|      1|	mul64x64_128(c, x[0], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[0]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[0]) add128(c, mul) 
  ------------------
  |  |   81|      1|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, x[0], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[0]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[0]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
  132|      1|	f = lo128(c); r1[1] = f & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      1|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); r1[1] = f & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      1|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  133|      1|	mul64x64_128(c, x[0], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[1]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[1]) add128(c, mul) 
  ------------------
  |  |   81|      1|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, x[0], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[1]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[1]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, x[0], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[1]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[1]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
  134|      1|	f = lo128(c); r1[2] = f & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      1|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); r1[2] = f & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      1|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  135|      1|	mul64x64_128(c, x[0], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[2]) add128(c, mul) mul64x64_128(mul, x[2], y[1]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[2]) add128(c, mul) mul64x64_128(mul, x[2], y[1]) add128(c, mul) 
  ------------------
  |  |   81|      1|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, x[0], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[2]) add128(c, mul) mul64x64_128(mul, x[2], y[1]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[2]) add128(c, mul) mul64x64_128(mul, x[2], y[1]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, x[0], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[2]) add128(c, mul) mul64x64_128(mul, x[2], y[1]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[2]) add128(c, mul) mul64x64_128(mul, x[2], y[1]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, x[0], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[2]) add128(c, mul) mul64x64_128(mul, x[2], y[1]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[0]) add128(c, mul) mul64x64_128(mul, x[1], y[2]) add128(c, mul) mul64x64_128(mul, x[2], y[1]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
  136|      1|	f = lo128(c); r1[3] = f & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      1|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); r1[3] = f & 0xffffffffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      1|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  137|      1|	mul64x64_128(c, x[0], y[4]) add128_64(c, f) mul64x64_128(mul, x[4], y[0]) add128(c, mul) mul64x64_128(mul, x[3], y[1]) add128(c, mul) mul64x64_128(mul, x[1], y[3]) add128(c, mul) mul64x64_128(mul, x[2], y[2]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[4]) add128_64(c, f) mul64x64_128(mul, x[4], y[0]) add128(c, mul) mul64x64_128(mul, x[3], y[1]) add128(c, mul) mul64x64_128(mul, x[1], y[3]) add128(c, mul) mul64x64_128(mul, x[2], y[2]) add128(c, mul) 
  ------------------
  |  |   81|      1|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, x[0], y[4]) add128_64(c, f) mul64x64_128(mul, x[4], y[0]) add128(c, mul) mul64x64_128(mul, x[3], y[1]) add128(c, mul) mul64x64_128(mul, x[1], y[3]) add128(c, mul) mul64x64_128(mul, x[2], y[2]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[4]) add128_64(c, f) mul64x64_128(mul, x[4], y[0]) add128(c, mul) mul64x64_128(mul, x[3], y[1]) add128(c, mul) mul64x64_128(mul, x[1], y[3]) add128(c, mul) mul64x64_128(mul, x[2], y[2]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, x[0], y[4]) add128_64(c, f) mul64x64_128(mul, x[4], y[0]) add128(c, mul) mul64x64_128(mul, x[3], y[1]) add128(c, mul) mul64x64_128(mul, x[1], y[3]) add128(c, mul) mul64x64_128(mul, x[2], y[2]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[4]) add128_64(c, f) mul64x64_128(mul, x[4], y[0]) add128(c, mul) mul64x64_128(mul, x[3], y[1]) add128(c, mul) mul64x64_128(mul, x[1], y[3]) add128(c, mul) mul64x64_128(mul, x[2], y[2]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, x[0], y[4]) add128_64(c, f) mul64x64_128(mul, x[4], y[0]) add128(c, mul) mul64x64_128(mul, x[3], y[1]) add128(c, mul) mul64x64_128(mul, x[1], y[3]) add128(c, mul) mul64x64_128(mul, x[2], y[2]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[4]) add128_64(c, f) mul64x64_128(mul, x[4], y[0]) add128(c, mul) mul64x64_128(mul, x[3], y[1]) add128(c, mul) mul64x64_128(mul, x[1], y[3]) add128(c, mul) mul64x64_128(mul, x[2], y[2]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, x[0], y[4]) add128_64(c, f) mul64x64_128(mul, x[4], y[0]) add128(c, mul) mul64x64_128(mul, x[3], y[1]) add128(c, mul) mul64x64_128(mul, x[1], y[3]) add128(c, mul) mul64x64_128(mul, x[2], y[2]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[0], y[4]) add128_64(c, f) mul64x64_128(mul, x[4], y[0]) add128(c, mul) mul64x64_128(mul, x[3], y[1]) add128(c, mul) mul64x64_128(mul, x[1], y[3]) add128(c, mul) mul64x64_128(mul, x[2], y[2]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
  138|      1|	f = lo128(c); r1[4] = f & 0x0000ffffffffff; q1[0] = (f >> 24) & 0xffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      1|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); r1[4] = f & 0x0000ffffffffff; q1[0] = (f >> 24) & 0xffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      1|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  139|      1|	mul64x64_128(c, x[4], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[4]) add128(c, mul) mul64x64_128(mul, x[2], y[3]) add128(c, mul) mul64x64_128(mul, x[3], y[2]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[4], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[4]) add128(c, mul) mul64x64_128(mul, x[2], y[3]) add128(c, mul) mul64x64_128(mul, x[3], y[2]) add128(c, mul) 
  ------------------
  |  |   81|      1|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, x[4], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[4]) add128(c, mul) mul64x64_128(mul, x[2], y[3]) add128(c, mul) mul64x64_128(mul, x[3], y[2]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[4], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[4]) add128(c, mul) mul64x64_128(mul, x[2], y[3]) add128(c, mul) mul64x64_128(mul, x[3], y[2]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, x[4], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[4]) add128(c, mul) mul64x64_128(mul, x[2], y[3]) add128(c, mul) mul64x64_128(mul, x[3], y[2]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[4], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[4]) add128(c, mul) mul64x64_128(mul, x[2], y[3]) add128(c, mul) mul64x64_128(mul, x[3], y[2]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, x[4], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[4]) add128(c, mul) mul64x64_128(mul, x[2], y[3]) add128(c, mul) mul64x64_128(mul, x[3], y[2]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[4], y[1]) add128_64(c, f) mul64x64_128(mul, x[1], y[4]) add128(c, mul) mul64x64_128(mul, x[2], y[3]) add128(c, mul) mul64x64_128(mul, x[3], y[2]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
  140|      1|	f = lo128(c); q1[0] |= (f << 32) & 0xffffffffffffff; q1[1] = (f >> 24) & 0xffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      1|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); q1[0] |= (f << 32) & 0xffffffffffffff; q1[1] = (f >> 24) & 0xffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      1|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  141|      1|	mul64x64_128(c, x[4], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[4]) add128(c, mul) mul64x64_128(mul, x[3], y[3]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[4], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[4]) add128(c, mul) mul64x64_128(mul, x[3], y[3]) add128(c, mul) 
  ------------------
  |  |   81|      1|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, x[4], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[4]) add128(c, mul) mul64x64_128(mul, x[3], y[3]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[4], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[4]) add128(c, mul) mul64x64_128(mul, x[3], y[3]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
              	mul64x64_128(c, x[4], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[4]) add128(c, mul) mul64x64_128(mul, x[3], y[3]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[4], y[2]) add128_64(c, f) mul64x64_128(mul, x[2], y[4]) add128(c, mul) mul64x64_128(mul, x[3], y[3]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
  142|      1|	f = lo128(c); q1[1] |= (f << 32) & 0xffffffffffffff; q1[2] = (f >> 24) & 0xffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      1|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); q1[1] |= (f << 32) & 0xffffffffffffff; q1[2] = (f >> 24) & 0xffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      1|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  143|      1|	mul64x64_128(c, x[4], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[4]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[4], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[4]) add128(c, mul) 
  ------------------
  |  |   81|      1|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
              	mul64x64_128(c, x[4], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[4]) add128(c, mul) 
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[4], y[3]) add128_64(c, f) mul64x64_128(mul, x[3], y[4]) add128(c, mul) 
  ------------------
  |  |   80|      1|		#define add128(a,b) a += b;
  ------------------
  144|      1|	f = lo128(c); q1[2] |= (f << 32) & 0xffffffffffffff; q1[3] = (f >> 24) & 0xffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      1|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); q1[2] |= (f << 32) & 0xffffffffffffff; q1[3] = (f >> 24) & 0xffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      1|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  145|      1|	mul64x64_128(c, x[4], y[4]) add128_64(c, f)
  ------------------
  |  |   75|      1|		#define mul64x64_128(out,a,b) out = (uint128_t)a * b;
  ------------------
              	mul64x64_128(c, x[4], y[4]) add128_64(c, f)
  ------------------
  |  |   81|      1|		#define add128_64(a,b) a += (uint64_t)b;
  ------------------
  146|      1|	f = lo128(c); q1[3] |= (f << 32) & 0xffffffffffffff; q1[4] = (f >> 24) & 0xffffffff; shr128(f, c, 56);
  ------------------
  |  |   82|      1|		#define lo128(a) ((uint64_t)a)
  ------------------
              	f = lo128(c); q1[3] |= (f << 32) & 0xffffffffffffff; q1[4] = (f >> 24) & 0xffffffff; shr128(f, c, 56);
  ------------------
  |  |   78|      1|		#define shr128(out,in,shift) out = (uint64_t)(in >> (shift));
  ------------------
  147|      1|	q1[4] |= (f << 32);
  148|       |
  149|      1|	barrett_reduce256_modm(r, q1, r1);
  150|      1|}
ed25519_tor.c:add256_modm:
  111|      1|add256_modm(bignum256modm r, const bignum256modm x, const bignum256modm y) {
  112|      1|	bignum256modm_element_t c;
  113|       |
  114|      1|	c  = x[0] + y[0]; r[0] = c & 0xffffffffffffff; c >>= 56;
  115|      1|	c += x[1] + y[1]; r[1] = c & 0xffffffffffffff; c >>= 56;
  116|      1|	c += x[2] + y[2]; r[2] = c & 0xffffffffffffff; c >>= 56;
  117|      1|	c += x[3] + y[3]; r[3] = c & 0xffffffffffffff; c >>= 56;
  118|      1|	c += x[4] + y[4]; r[4] = c;
  119|       |
  120|      1|	reduce256_modm(r);
  121|      1|}
ed25519_tor.c:expand_raw256_modm:
  190|      9|expand_raw256_modm(bignum256modm out, const unsigned char in[32]) {
  191|      9|	bignum256modm_element_t x[4];
  192|       |
  193|      9|	x[0] = U8TO64_LE(in +  0);
  194|      9|	x[1] = U8TO64_LE(in +  8);
  195|      9|	x[2] = U8TO64_LE(in + 16);
  196|      9|	x[3] = U8TO64_LE(in + 24);
  197|       |
  198|      9|	out[0] = (                         x[0]) & 0xffffffffffffff;
  199|      9|	out[1] = ((x[ 0] >> 56) | (x[ 1] <<  8)) & 0xffffffffffffff;
  200|      9|	out[2] = ((x[ 1] >> 48) | (x[ 2] << 16)) & 0xffffffffffffff;
  201|      9|	out[3] = ((x[ 2] >> 40) | (x[ 3] << 24)) & 0xffffffffffffff;
  202|      9|	out[4] = ((x[ 3] >> 32)                ) & 0x000000ffffffff;
  203|      9|}
ed25519_tor.c:contract256_window4_modm:
  214|     11|contract256_window4_modm(signed char r[64], const bignum256modm in) {
  215|     11|	char carry;
  216|     11|	signed char *quads = r;
  217|     11|	bignum256modm_element_t i, j, v, m;
  218|       |
  219|     66|	for (i = 0; i < 5; i++) {
  ------------------
  |  Branch (219:14): [True: 55, False: 11]
  ------------------
  220|     55|		v = in[i];
  221|     55|		m = (i == 4) ? 8 : 14;
  ------------------
  |  Branch (221:7): [True: 11, False: 44]
  ------------------
  222|    759|		for (j = 0; j < m; j++) {
  ------------------
  |  Branch (222:15): [True: 704, False: 55]
  ------------------
  223|    704|			*quads++ = (v & 15);
  224|    704|			v >>= 4;
  225|    704|		}
  226|     55|	}
  227|       |
  228|       |	/* making it signed */
  229|     11|	carry = 0;
  230|    704|	for(i = 0; i < 63; i++) {
  ------------------
  |  Branch (230:13): [True: 693, False: 11]
  ------------------
  231|    693|		r[i] += carry;
  232|    693|		r[i+1] += (r[i] >> 4);
  233|    693|		r[i] &= 15;
  234|    693|		carry = (r[i] >> 3);
  235|    693|		r[i] -= (carry << 4);
  236|    693|	}
  237|     11|	r[63] += carry;
  238|     11|}
ed25519_tor.c:contract256_modm:
  206|      1|contract256_modm(unsigned char out[32], const bignum256modm in) {
  207|      1|	U64TO8_LE(out +  0, (in[0]      ) | (in[1] << 56));
  208|      1|	U64TO8_LE(out +  8, (in[1] >>  8) | (in[2] << 48));
  209|      1|	U64TO8_LE(out + 16, (in[2] >> 16) | (in[3] << 40));
  210|      1|	U64TO8_LE(out + 24, (in[3] >> 24) | (in[4] << 32));
  211|      1|}
ed25519_tor.c:contract256_slidingwindow_modm:
  241|      2|contract256_slidingwindow_modm(signed char r[256], const bignum256modm s, int windowsize) {
  242|      2|	int i,j,k,b;
  243|      2|	int m = (1 << (windowsize - 1)) - 1;
  244|      2|        const int soplen = 256;
  245|      2|	signed char *bits = r;
  246|      2|	bignum256modm_element_t v;
  247|       |
  248|       |	/* first put the binary expansion into r  */
  249|     10|	for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (249:14): [True: 8, False: 2]
  ------------------
  250|      8|		v = s[i];
  251|    456|		for (j = 0; j < 56; j++, v >>= 1)
  ------------------
  |  Branch (251:15): [True: 448, False: 8]
  ------------------
  252|    448|			*bits++ = (v & 1);
  253|      8|	}
  254|      2|	v = s[4];
  255|     66|	for (j = 0; j < 32; j++, v >>= 1)
  ------------------
  |  Branch (255:14): [True: 64, False: 2]
  ------------------
  256|     64|		*bits++ = (v & 1);
  257|       |
  258|       |	/* Making it sliding window */
  259|    514|	for (j = 0; j < soplen; j++) {
  ------------------
  |  Branch (259:14): [True: 512, False: 2]
  ------------------
  260|    512|		if (!r[j])
  ------------------
  |  Branch (260:7): [True: 436, False: 76]
  ------------------
  261|    436|			continue;
  262|       |
  263|    470|		for (b = 1; (b < (soplen - j)) && (b <= 6); b++) {
  ------------------
  |  Branch (263:15): [True: 469, False: 1]
  |  Branch (263:37): [True: 432, False: 37]
  ------------------
  264|       |			/* XXX Tor: coverity scan says that r[j+b] can
  265|       |			 * overflow, but that's not possible: b < (soplen-j)
  266|       |			 * guarantees that b + j < soplen, so b+j < 256,
  267|       |			 * so the index doesn't overflow. */
  268|    432|			if ((r[j] + (r[j + b] << b)) <= m) {
  ------------------
  |  Branch (268:8): [True: 357, False: 75]
  ------------------
  269|    357|				r[j] += r[j + b] << b;
  270|    357|				r[j + b] = 0;
  271|    357|			} else if ((r[j] - (r[j + b] << b)) >= -m) {
  ------------------
  |  Branch (271:15): [True: 37, False: 38]
  ------------------
  272|     37|				r[j] -= r[j + b] << b;
  273|    114|				for (k = j + b; k < soplen; k++) {
  ------------------
  |  Branch (273:21): [True: 114, False: 0]
  ------------------
  274|    114|					if (!r[k]) {
  ------------------
  |  Branch (274:10): [True: 37, False: 77]
  ------------------
  275|     37|						r[k] = 1;
  276|     37|						break;
  277|     37|					}
  278|     77|					r[k] = 0;
  279|     77|				}
  280|     38|			} else if (r[j + b]) {
  ------------------
  |  Branch (280:15): [True: 38, False: 0]
  ------------------
  281|     38|				break;
  282|     38|			}
  283|    432|		}
  284|     76|	}
  285|      2|}

ed25519_donna_selftest:
  184|      1|{
  185|      1|	int ret = 0;
  186|      1|	ret |= test_adds();
  187|      1|	ret |= test_subs();
  188|      1|	return (ret == 0) ? 0 : -1;
  ------------------
  |  Branch (188:9): [True: 1, False: 0]
  ------------------
  189|      1|}
ed25519_tor.c:test_adds:
    6|      1|test_adds(void) {
    7|      1|#if defined(HAVE_UINT128) && !defined(ED25519_SSE2)
    8|       |	/* largest result for each limb from a mult or square: all elements except r1 reduced, r1 overflowed as far as possible */
    9|      1|	static const bignum25519 max_bignum = {
   10|      1|		0x7ffffffffffff,0x8000000001230,0x7ffffffffffff,0x7ffffffffffff,0x7ffffffffffff
   11|      1|	};
   12|       |
   13|       |#if 0
   14|       |	/* what max_bignum should fully reduce to */
   15|       |	static const unsigned char max_bignum_raw[32] = {
   16|       |		0x12,0x00,0x00,0x00,0x00,0x00,0x88,0x91,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   17|       |		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
   18|       |	};
   19|       |#endif
   20|       |
   21|       |	/* (max_bignum + max_bignum)^2 */
   22|      1|	static const unsigned char max_bignum2_squared_raw[32] = {
   23|      1|		0x10,0x05,0x00,0x00,0x00,0x00,0x80,0xdc,0x51,0x00,0x00,0x00,0x00,0x61,0xed,0x4a,
   24|      1|		0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   25|      1|	};
   26|       |
   27|       |	/* ((max_bignum + max_bignum) + max_bignum)^2 */
   28|      1|	static const unsigned char max_bignum3_squared_raw[32] = {
   29|      1|		0x64,0x0b,0x00,0x00,0x00,0x00,0x20,0x30,0xb8,0x00,0x00,0x00,0x40,0x1a,0x96,0xe8,
   30|      1|		0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   31|      1|	};
   32|       |#else
   33|       |	/* largest result for each limb from a mult or square: all elements except r1 reduced, r1 overflowed as far as possible */
   34|       |	static const bignum25519 ALIGN(16) max_bignum = {
   35|       |		0x3ffffff,0x2000300,0x3ffffff,0x1ffffff,0x3ffffff,
   36|       |		0x1ffffff,0x3ffffff,0x1ffffff,0x3ffffff,0x1ffffff
   37|       |	};
   38|       |
   39|       |	/* what max_bignum should fully reduce to */
   40|       |	static const unsigned char max_bignum2_squared_raw[32] = {
   41|       |		0x10,0x05,0x00,0x40,0xc2,0x06,0x40,0x80,0x41,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
   42|       |		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   43|       |	};
   44|       |
   45|       |	/* (max_bignum * max_bignum) */
   46|       |	static const unsigned char max_bignum3_squared_raw[32] = {
   47|       |		0x64,0x0b,0x00,0x10,0x35,0x0f,0x90,0x60,0x13,0x05,0x00,0x00,0x00,0x00,0x00,0x00,
   48|       |		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   49|       |	};
   50|       |#endif
   51|      1|	unsigned char result[32];
   52|       |	/* static const bignum25519 ALIGN(16) zero = {0}; */
   53|      1|	bignum25519 ALIGN(16) a, b /* , c */;
   54|       |	/* size_t i; */
   55|       |
   56|       |	/* a = (max_bignum + max_bignum) */
   57|      1|	curve25519_add(a, max_bignum, max_bignum);
   58|       |
   59|       |	/* b = ((max_bignum + max_bignum) * (max_bignum + max_bignum)) */
   60|      1|	curve25519_mul(b, a, a);
   61|      1|	curve25519_contract(result, b);
   62|      1|	if (memcmp(result, max_bignum2_squared_raw, 32) != 0)
  ------------------
  |  Branch (62:6): [True: 0, False: 1]
  ------------------
   63|      0|		return -1;
   64|      1|	curve25519_square(b, a);
   65|      1|	curve25519_contract(result, b);
   66|      1|	if (memcmp(result, max_bignum2_squared_raw, 32) != 0)
  ------------------
  |  Branch (66:6): [True: 0, False: 1]
  ------------------
   67|      0|		return -1;
   68|       |
   69|       |	/* b = (max_bignum + max_bignum + max_bignum) */
   70|      1|	curve25519_add_after_basic(b, a, max_bignum);
   71|       |
   72|       |	/* a = ((max_bignum + max_bignum + max_bignum) * (max_bignum + max_bignum + max_bignum)) */
   73|      1|	curve25519_mul(a, b, b);
   74|      1|	curve25519_contract(result, a);
   75|      1|	if (memcmp(result, max_bignum3_squared_raw, 32) != 0)
  ------------------
  |  Branch (75:6): [True: 0, False: 1]
  ------------------
   76|      0|		return -1;
   77|      1|	curve25519_square(a, b);
   78|      1|	curve25519_contract(result, a);
   79|      1|	if (memcmp(result, max_bignum3_squared_raw, 32) != 0)
  ------------------
  |  Branch (79:6): [True: 0, False: 1]
  ------------------
   80|      0|		return -1;
   81|       |
   82|      1|	return 0;
   83|      1|}
ed25519_tor.c:test_subs:
   86|      1|test_subs(void) {
   87|      1|#if defined(HAVE_UINT128) && !defined(ED25519_SSE2)
   88|       |	/* largest result for each limb from a mult or square: all elements except r1 reduced, r1 overflowed as far as possible */
   89|      1|	static const bignum25519 max_bignum = {
   90|      1|		0x7ffffffffffff,0x8000000001230,0x7ffffffffffff,0x7ffffffffffff,0x7ffffffffffff
   91|      1|	};
   92|       |
   93|       |	/* what max_bignum should fully reduce to */
   94|      1|	static const unsigned char max_bignum_raw[32] = {
   95|      1|		0x12,0x00,0x00,0x00,0x00,0x00,0x88,0x91,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
   96|      1|		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
   97|      1|	};
   98|       |
   99|       |	/* (max_bignum * max_bignum) */
  100|      1|	static const unsigned char max_bignum_squared_raw[32] = {
  101|      1|		0x44,0x01,0x00,0x00,0x00,0x00,0x20,0x77,0x14,0x00,0x00,0x00,0x40,0x58,0xbb,0x52,
  102|      1|		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
  103|      1|	};
  104|       |#else
  105|       |	/* largest result for each limb from a mult or square: all elements except r1 reduced, r1 overflowed as far as possible */
  106|       |	static const bignum25519 ALIGN(16) max_bignum = {
  107|       |		0x3ffffff,0x2000300,0x3ffffff,0x1ffffff,0x3ffffff,
  108|       |		0x1ffffff,0x3ffffff,0x1ffffff,0x3ffffff,0x1ffffff
  109|       |	};
  110|       |
  111|       |	/* what max_bignum should fully reduce to */
  112|       |	static const unsigned char max_bignum_raw[32] = {
  113|       |		0x12,0x00,0x00,0x04,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  114|       |		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  115|       |	};
  116|       |
  117|       |	/* (max_bignum * max_bignum) */
  118|       |	static const unsigned char max_bignum_squared_raw[32] = {
  119|       |		0x44,0x01,0x00,0x90,0xb0,0x01,0x10,0x60,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  120|       |		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  121|       |	};
  122|       |#endif
  123|      1|	unsigned char result[32];
  124|      1|	static const bignum25519 ALIGN(16) zero = {0};
  125|      1|	bignum25519 ALIGN(16) a, b /* , c */;
  126|       |	/* size_t i; */
  127|       |
  128|       |	/* a = max_bignum - 0, which expands to 2p + max_bignum - 0 */
  129|      1|	curve25519_sub(a, max_bignum, zero);
  130|      1|	curve25519_contract(result, a);
  131|      1|	if (memcmp(result, max_bignum_raw, 32) != 0)
  ------------------
  |  Branch (131:6): [True: 0, False: 1]
  ------------------
  132|      0|		return -1;
  133|       |
  134|       |	/* b = (max_bignum * max_bignum) */
  135|      1|	curve25519_mul(b, a, a);
  136|      1|	curve25519_contract(result, b);
  137|      1|	if (memcmp(result, max_bignum_squared_raw, 32) != 0)
  ------------------
  |  Branch (137:6): [True: 0, False: 1]
  ------------------
  138|      0|		return -1;
  139|      1|	curve25519_square(b, a);
  140|      1|	curve25519_contract(result, b);
  141|      1|	if (memcmp(result, max_bignum_squared_raw, 32) != 0)
  ------------------
  |  Branch (141:6): [True: 0, False: 1]
  ------------------
  142|      0|		return -1;
  143|       |
  144|       |	/* b = ((a - 0) - 0) */
  145|      1|	curve25519_sub_after_basic(b, a, zero);
  146|      1|	curve25519_contract(result, b);
  147|      1|	if (memcmp(result, max_bignum_raw, 32) != 0)
  ------------------
  |  Branch (147:6): [True: 0, False: 1]
  ------------------
  148|      0|		return -1;
  149|       |
  150|       |	/* a = (max_bignum * max_bignum) */
  151|      1|	curve25519_mul(a, b, b);
  152|      1|	curve25519_contract(result, a);
  153|      1|	if (memcmp(result, max_bignum_squared_raw, 32) != 0)
  ------------------
  |  Branch (153:6): [True: 0, False: 1]
  ------------------
  154|      0|		return -1;
  155|      1|	curve25519_square(a, b);
  156|      1|	curve25519_contract(result, a);
  157|      1|	if (memcmp(result, max_bignum_squared_raw, 32) != 0)
  ------------------
  |  Branch (157:6): [True: 0, False: 1]
  ------------------
  158|      0|		return -1;
  159|       |
  160|       |
  161|      1|	return 0;
  162|      1|}

polyval_detect_implementation:
  450|      1|{
  451|      1|  unsigned int eax, ebx, ecx, edx;
  452|      1|  use_pclmul = false;
  453|      1|  if (__get_cpuid(1, &eax, &ebx, &ecx, &edx)) {
  ------------------
  |  Branch (453:7): [True: 1, False: 0]
  ------------------
  454|      1|    if (0 != (ecx & bit_PCLMUL)) {
  ------------------
  |  Branch (454:9): [True: 1, False: 0]
  ------------------
  455|       |      use_pclmul = true;
  456|      1|    }
  457|      1|  }
  458|      1|}

strlcpy:
   43|    610|{
   44|    610|	register char *d = dst;
   45|    610|	register const char *s = src;
   46|    610|	register size_t n = siz;
   47|       |
   48|    610|	if (n == 0)
  ------------------
  |  Branch (48:6): [True: 0, False: 610]
  ------------------
   49|      0|		return(strlen(s));
   50|  14.6k|	while (*s != '\0') {
  ------------------
  |  Branch (50:9): [True: 14.0k, False: 610]
  ------------------
   51|  14.0k|		if (n != 1) {
  ------------------
  |  Branch (51:7): [True: 14.0k, False: 0]
  ------------------
   52|  14.0k|			*d++ = *s;
   53|  14.0k|			n--;
   54|  14.0k|		}
   55|  14.0k|		s++;
   56|  14.0k|	}
   57|    610|	*d = '\0';
   58|       |
   59|    610|	return(s - src);	/* count does not include NUL */
   60|    610|}

socks5.c:trunnel_set_uint8:
   64|  1.84k|trunnel_set_uint8(void *p, uint8_t v) {
   65|  1.84k|  memcpy(p, &v, 1);
   66|  1.84k|}
socks5.c:trunnel_get_uint8:
   87|  4.77k|trunnel_get_uint8(const void *p) {
   88|  4.77k|  return *(const uint8_t*)p;
   89|  4.77k|}
socks5.c:trunnel_set_uint16:
   60|    180|trunnel_set_uint16(void *p, uint16_t v) {
   61|    180|  memcpy(p, &v, 2);
   62|    180|}
socks5.c:trunnel_set_uint32:
   56|    180|trunnel_set_uint32(void *p, uint32_t v) {
   57|    180|  memcpy(p, &v, 4);
   58|    180|}
socks5.c:trunnel_get_uint16:
   81|    936|trunnel_get_uint16(const void *p) {
   82|    936|  uint16_t x;
   83|    936|  memcpy(&x, p, 2);
   84|    936|  return x;
   85|    936|}
socks5.c:trunnel_get_uint32:
   75|    610|trunnel_get_uint32(const void *p) {
   76|    610|  uint32_t x;
   77|    610|  memcpy(&x, p, 4);
   78|    610|  return x;
   79|    610|}

trunnel_dynarray_expand:
  105|  1.08k|{
  106|  1.08k|  size_t newsize = howmanymore + *allocated_p;
  107|  1.08k|  void *newarray = NULL;
  108|  1.08k|  if (newsize < 8)
  ------------------
  |  Branch (108:7): [True: 827, False: 262]
  ------------------
  109|    827|    newsize = 8;
  110|  1.08k|  if (newsize < *allocated_p * 2)
  ------------------
  |  Branch (110:7): [True: 0, False: 1.08k]
  ------------------
  111|      0|    newsize = *allocated_p * 2;
  112|  1.08k|  if (newsize <= *allocated_p || newsize < howmanymore)
  ------------------
  |  Branch (112:7): [True: 0, False: 1.08k]
  |  Branch (112:34): [True: 0, False: 1.08k]
  ------------------
  113|      0|    return NULL;
  114|  1.08k|  newarray = trunnel_reallocarray(ptr, newsize, eltsize);
  ------------------
  |  |   14|  1.08k|#define trunnel_reallocarray tor_reallocarray
  |  |  ------------------
  |  |  |  |   67|  1.08k|  tor_reallocarray_((ptr), (sz1), (sz2))
  |  |  ------------------
  ------------------
  115|  1.08k|  if (newarray == NULL)
  ------------------
  |  Branch (115:7): [True: 0, False: 1.08k]
  ------------------
  116|      0|    return NULL;
  117|       |
  118|  1.08k|  *allocated_p = newsize;
  119|  1.08k|  return newarray;
  120|  1.08k|}
trunnel_string_setstr0:
  154|    540|{
  155|    540|  if (len == SIZE_MAX)
  ------------------
  |  Branch (155:7): [True: 0, False: 540]
  ------------------
  156|      0|    goto trunnel_alloc_failed;
  157|    540|  if (str->allocated_ <= len) {
  ------------------
  |  Branch (157:7): [True: 540, False: 0]
  ------------------
  158|    540|    TRUNNEL_DYNARRAY_EXPAND(char, str, len + 1 - str->allocated_, {});
  ------------------
  |  |  178|    540|#define TRUNNEL_DYNARRAY_EXPAND(elttype, da, howmanymore, on_fail) do { \
  |  |  179|    540|    elttype *newarray;                                               \
  |  |  180|    540|    newarray = trunnel_dynarray_expand(&(da)->allocated_,            \
  |  |  181|    540|                                       (da)->elts_, (howmanymore),   \
  |  |  182|    540|                                       sizeof(elttype));             \
  |  |  183|    540|    if (newarray == NULL) {                                          \
  |  |  ------------------
  |  |  |  Branch (183:9): [True: 0, False: 540]
  |  |  ------------------
  |  |  184|      0|      on_fail;                                                       \
  |  |  185|      0|      goto trunnel_alloc_failed;                                     \
  |  |  186|      0|    }                                                                \
  |  |  187|    540|    (da)->elts_ = newarray;                                          \
  |  |  188|    540|  } while (0)
  |  |  ------------------
  |  |  |  Branch (188:12): [Folded, False: 540]
  |  |  ------------------
  ------------------
  159|    540|  }
  160|    540|  memcpy(str->elts_, val, len);
  161|    540|  str->n_ = len;
  162|    540|  str->elts_[len] = 0;
  163|    540|  return 0;
  164|      0|trunnel_alloc_failed:
  165|      0|  *errcode_ptr = 1;
  166|      0|  return -1;
  167|    540|}

addressmap_init:
   91|      1|{
   92|      1|  addressmap = strmap_new();
   93|      1|  virtaddress_reversemap = strmap_new();
   94|      1|}
addressmap_have_mapping:
  545|    242|{
  546|    242|  addressmap_entry_t *ent;
  547|    242|  if (!(ent=strmap_get_lc(addressmap, address)))
  ------------------
  |  Branch (547:7): [True: 242, False: 0]
  ------------------
  548|    242|    return 0;
  549|      0|  if (update_expiry && ent->source==ADDRMAPSRC_TRACKEXIT)
  ------------------
  |  Branch (549:7): [True: 0, False: 0]
  |  Branch (549:24): [True: 0, False: 0]
  ------------------
  550|      0|    ent->expires=time(NULL) + update_expiry;
  551|      0|  return 1;
  552|    242|}

control_event_client_status:
 1813|    348|{
 1814|    348|  CONTROL_EVENT_STATUS_BODY(EVENT_STATUS_CLIENT, severity);
  ------------------
  |  | 1777|    348|  int r;                                                        \
  |  | 1778|    348|  do {                                                          \
  |  | 1779|    348|    va_list ap;                                                 \
  |  | 1780|    348|    if (!EVENT_IS_INTERESTING(event))                           \
  |  |  ------------------
  |  |  |  |   62|    348|  (!! (global_event_mask & EVENT_MASK_(e)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  299|    348|#define EVENT_MASK_(e)               (((uint64_t)1)<<(e))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1780:9): [True: 348, False: 0]
  |  |  ------------------
  |  | 1781|    348|      return 0;                                                 \
  |  | 1782|    348|                                                                \
  |  | 1783|    348|    va_start(ap, format);                                       \
  |  | 1784|      0|    r = control_event_status((event), (sev), format, ap);       \
  |  | 1785|      0|    va_end(ap);                                                 \
  |  | 1786|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (1786:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1815|      0|  return r;
 1816|    348|}

proto_socks.c:get_uint8:
   24|  1.91k|{
   25|  1.91k|  return *(const uint8_t*)(cp);
   26|  1.91k|}

buf_preferred_chunk_size:
  190|  1.42k|{
  191|  1.42k|  tor_assert(target <= SIZE_T_CEILING - CHUNK_OVERHEAD);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|  1.42k|  if (CHUNK_ALLOC_SIZE(target) >= MAX_CHUNK_ALLOC)
  ------------------
  |  |   89|  1.42k|#define CHUNK_ALLOC_SIZE(memlen) (CHUNK_OVERHEAD + (memlen))
  |  |  ------------------
  |  |  |  |   85|  1.42k|#define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.42k|#define CHUNK_HEADER_LEN offsetof(chunk_t, mem[0])
  |  |  |  |  ------------------
  |  |  |  |               #define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|  1.42k|#define SENTINEL_LEN 0
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                if (CHUNK_ALLOC_SIZE(target) >= MAX_CHUNK_ALLOC)
  ------------------
  |  |  184|  1.42k|#define MAX_CHUNK_ALLOC 65536
  ------------------
  |  Branch (192:7): [True: 193, False: 1.23k]
  ------------------
  193|    193|    return CHUNK_ALLOC_SIZE(target);
  ------------------
  |  |   89|    193|#define CHUNK_ALLOC_SIZE(memlen) (CHUNK_OVERHEAD + (memlen))
  |  |  ------------------
  |  |  |  |   85|    193|#define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|    193|#define CHUNK_HEADER_LEN offsetof(chunk_t, mem[0])
  |  |  |  |  ------------------
  |  |  |  |               #define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|    193|#define SENTINEL_LEN 0
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  194|  1.23k|  size_t sz = MIN_CHUNK_ALLOC;
  ------------------
  |  |  182|  1.23k|#define MIN_CHUNK_ALLOC 256
  ------------------
  195|  2.73k|  while (CHUNK_SIZE_WITH_ALLOC(sz) < target) {
  ------------------
  |  |   92|  2.73k|#define CHUNK_SIZE_WITH_ALLOC(memlen) ((memlen) - CHUNK_OVERHEAD)
  |  |  ------------------
  |  |  |  |   85|  2.73k|#define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.73k|#define CHUNK_HEADER_LEN offsetof(chunk_t, mem[0])
  |  |  |  |  ------------------
  |  |  |  |               #define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|  2.73k|#define SENTINEL_LEN 0
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (195:10): [True: 1.50k, False: 1.23k]
  ------------------
  196|  1.50k|    sz <<= 1;
  197|  1.50k|  }
  198|  1.23k|  return sz;
  199|  1.42k|}
buf_pullup:
  212|  1.91k|{
  213|  1.91k|  chunk_t *dest, *src;
  214|  1.91k|  size_t capacity;
  215|  1.91k|  if (!buf->head) {
  ------------------
  |  Branch (215:7): [True: 0, False: 1.91k]
  ------------------
  216|      0|    *head_out = NULL;
  217|      0|    *len_out = 0;
  218|      0|    return;
  219|      0|  }
  220|       |
  221|  1.91k|  check();
  ------------------
  |  |   51|  1.91k|#define check() STMT_NIL
  |  |  ------------------
  |  |  |  |  195|  1.91k|#define STMT_NIL (void)0
  |  |  ------------------
  ------------------
  222|  1.91k|  if (buf->datalen < bytes)
  ------------------
  |  Branch (222:7): [True: 0, False: 1.91k]
  ------------------
  223|      0|    bytes = buf->datalen;
  224|       |
  225|  1.91k|  capacity = bytes;
  226|  1.91k|  if (buf->head->datalen >= bytes) {
  ------------------
  |  Branch (226:7): [True: 1.91k, False: 0]
  ------------------
  227|  1.91k|    *head_out = buf->head->data;
  228|  1.91k|    *len_out = buf->head->datalen;
  229|  1.91k|    return;
  230|  1.91k|  }
  231|       |
  232|      0|  if (buf->head->memlen >= capacity) {
  ------------------
  |  Branch (232:7): [True: 0, False: 0]
  ------------------
  233|       |    /* We don't need to grow the first chunk, but we might need to repack it.*/
  234|      0|    size_t needed = capacity - buf->head->datalen;
  235|      0|    if (CHUNK_REMAINING_CAPACITY(buf->head) < needed)
  ------------------
  |  Branch (235:9): [True: 0, False: 0]
  ------------------
  236|      0|      chunk_repack(buf->head);
  237|      0|    tor_assert(CHUNK_REMAINING_CAPACITY(buf->head) >= needed);
  ------------------
  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|      0|  } else {
  239|      0|    chunk_t *newhead;
  240|      0|    size_t newsize;
  241|       |    /* We need to grow the chunk. */
  242|      0|    chunk_repack(buf->head);
  243|      0|    newsize = CHUNK_SIZE_WITH_ALLOC(buf_preferred_chunk_size(capacity));
  ------------------
  |  |   92|      0|#define CHUNK_SIZE_WITH_ALLOC(memlen) ((memlen) - CHUNK_OVERHEAD)
  |  |  ------------------
  |  |  |  |   85|      0|#define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|#define CHUNK_HEADER_LEN offsetof(chunk_t, mem[0])
  |  |  |  |  ------------------
  |  |  |  |               #define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|      0|#define SENTINEL_LEN 0
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|      0|    newhead = chunk_grow(buf->head, newsize);
  245|      0|    tor_assert(newhead->memlen >= capacity);
  ------------------
  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|      0|    if (newhead != buf->head) {
  ------------------
  |  Branch (246:9): [True: 0, False: 0]
  ------------------
  247|      0|      if (buf->tail == buf->head)
  ------------------
  |  Branch (247:11): [True: 0, False: 0]
  ------------------
  248|      0|        buf->tail = newhead;
  249|      0|      buf->head = newhead;
  250|      0|    }
  251|      0|  }
  252|       |
  253|      0|  dest = buf->head;
  254|      0|  while (dest->datalen < bytes) {
  ------------------
  |  Branch (254:10): [True: 0, False: 0]
  ------------------
  255|      0|    size_t n = bytes - dest->datalen;
  256|      0|    src = dest->next;
  257|      0|    tor_assert(src);
  ------------------
  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  258|      0|    if (n >= src->datalen) {
  ------------------
  |  Branch (258:9): [True: 0, False: 0]
  ------------------
  259|      0|      memcpy(CHUNK_WRITE_PTR(dest), src->data, src->datalen);
  260|      0|      dest->datalen += src->datalen;
  261|      0|      dest->next = src->next;
  262|      0|      if (buf->tail == src)
  ------------------
  |  Branch (262:11): [True: 0, False: 0]
  ------------------
  263|      0|        buf->tail = dest;
  264|      0|      buf_chunk_free_unchecked(src);
  265|      0|    } else {
  266|      0|      memcpy(CHUNK_WRITE_PTR(dest), src->data, n);
  267|      0|      dest->datalen += n;
  268|      0|      src->data += n;
  269|      0|      src->datalen -= n;
  270|      0|      tor_assert(dest->datalen == bytes);
  ------------------
  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  271|      0|    }
  272|      0|  }
  273|       |
  274|      0|  check();
  ------------------
  |  |   51|      0|#define check() STMT_NIL
  |  |  ------------------
  |  |  |  |  195|      0|#define STMT_NIL (void)0
  |  |  ------------------
  ------------------
  275|      0|  *head_out = buf->head->data;
  276|      0|  *len_out = buf->head->datalen;
  277|      0|}
buf_new_with_data:
  286|  1.42k|{
  287|       |  /* Validate arguments */
  288|  1.42k|  if (!cp || sz <= 0 || sz > BUF_MAX_LEN) {
  ------------------
  |  |   33|  1.42k|#define BUF_MAX_LEN (INT_MAX - 1)
  ------------------
  |  Branch (288:7): [True: 0, False: 1.42k]
  |  Branch (288:14): [True: 0, False: 1.42k]
  |  Branch (288:25): [True: 0, False: 1.42k]
  ------------------
  289|      0|    return NULL;
  290|      0|  }
  291|       |
  292|  1.42k|  tor_assert(sz < SSIZE_T_CEILING);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|       |
  294|       |  /* Allocate a buffer */
  295|  1.42k|  buf_t *buf = buf_new_with_capacity(sz);
  296|  1.42k|  tor_assert(buf);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  297|  1.42k|  buf_assert_ok(buf);
  298|  1.42k|  tor_assert(!buf->head);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  299|       |
  300|       |  /* Allocate a chunk that is sz bytes long */
  301|  1.42k|  buf->head = chunk_new_with_alloc_size(CHUNK_ALLOC_SIZE(sz));
  ------------------
  |  |   89|  1.42k|#define CHUNK_ALLOC_SIZE(memlen) (CHUNK_OVERHEAD + (memlen))
  |  |  ------------------
  |  |  |  |   85|  1.42k|#define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.42k|#define CHUNK_HEADER_LEN offsetof(chunk_t, mem[0])
  |  |  |  |  ------------------
  |  |  |  |               #define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|  1.42k|#define SENTINEL_LEN 0
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  302|  1.42k|  buf->tail = buf->head;
  303|  1.42k|  tor_assert(buf->head);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  304|  1.42k|  buf_assert_ok(buf);
  305|  1.42k|  tor_assert(buf_allocation(buf) >= sz);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|       |
  307|       |  /* Copy the data and size the buffers */
  308|  1.42k|  tor_assert(sz <= buf_slack(buf));
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  309|  1.42k|  tor_assert(sz <= CHUNK_REMAINING_CAPACITY(buf->head));
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  310|  1.42k|  memcpy(&buf->head->mem[0], cp, sz);
  311|  1.42k|  buf->datalen = sz;
  312|  1.42k|  buf->head->datalen = sz;
  313|  1.42k|  buf->head->data = &buf->head->mem[0];
  314|  1.42k|  buf_assert_ok(buf);
  315|       |
  316|       |  /* Make sure everything is large enough */
  317|  1.42k|  tor_assert(buf_allocation(buf) >= sz);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  1.42k|  tor_assert(buf_allocation(buf) >= buf_datalen(buf) + buf_slack(buf));
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|       |  /* Does the buffer implementation allocate more than the requested size?
  320|       |   * (for example, by rounding up). If so, these checks will fail. */
  321|  1.42k|  tor_assert(buf_datalen(buf) == sz);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|  1.42k|  tor_assert(buf_slack(buf) == 0);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  323|       |
  324|  1.42k|  return buf;
  325|  1.42k|}
buf_drain:
  331|    974|{
  332|    974|  tor_assert(buf->datalen >= n);
  ------------------
  |  |  103|    974|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    974|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    974|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    974|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    974|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    974|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 974, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    974|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    974|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 974, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    974|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    974|    else                                        \
  |  |  |  |  |  |  |  |   80|    974|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    974|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    974|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    974|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    974|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    974|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  333|  1.32k|  while (n) {
  ------------------
  |  Branch (333:10): [True: 974, False: 351]
  ------------------
  334|    974|    tor_assert(buf->head);
  ------------------
  |  |  103|    974|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    974|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    974|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    974|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    974|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    974|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 974, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    974|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    974|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 974, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    974|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    974|    else                                        \
  |  |  |  |  |  |  |  |   80|    974|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    974|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    974|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    974|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    974|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    974|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  335|    974|    if (buf->head->datalen > n) {
  ------------------
  |  Branch (335:9): [True: 623, False: 351]
  ------------------
  336|    623|      buf->head->datalen -= n;
  337|    623|      buf->head->data += n;
  338|    623|      buf->datalen -= n;
  339|    623|      return;
  340|    623|    } else {
  341|    351|      chunk_t *victim = buf->head;
  342|    351|      n -= victim->datalen;
  343|    351|      buf->datalen -= victim->datalen;
  344|    351|      buf->head = victim->next;
  345|    351|      if (buf->tail == victim)
  ------------------
  |  Branch (345:11): [True: 351, False: 0]
  ------------------
  346|    351|        buf->tail = NULL;
  347|    351|      buf_chunk_free_unchecked(victim);
  348|    351|    }
  349|    974|  }
  350|    351|  check();
  ------------------
  |  |   51|    351|#define check() STMT_NIL
  |  |  ------------------
  |  |  |  |  195|    351|#define STMT_NIL (void)0
  |  |  ------------------
  ------------------
  351|    351|}
buf_new_with_capacity:
  357|  1.42k|{
  358|  1.42k|  buf_t *b = buf_new();
  359|  1.42k|  b->default_chunk_size = buf_preferred_chunk_size(size);
  360|  1.42k|  return b;
  361|  1.42k|}
buf_new:
  366|  1.42k|{
  367|  1.42k|  buf_t *buf = tor_malloc_zero(sizeof(buf_t));
  ------------------
  |  |   63|  1.42k|#define tor_malloc_zero(size)  tor_malloc_zero_(size)
  ------------------
  368|  1.42k|  buf->magic = BUFFER_MAGIC;
  ------------------
  |  |   90|  1.42k|#define BUFFER_MAGIC 0xB0FFF312u
  ------------------
  369|  1.42k|  buf->default_chunk_size = 4096;
  370|  1.42k|  return buf;
  371|  1.42k|}
buf_clear:
  382|  2.24k|{
  383|  2.24k|  chunk_t *chunk, *next;
  384|  2.24k|  buf->datalen = 0;
  385|  3.31k|  for (chunk = buf->head; chunk; chunk = next) {
  ------------------
  |  Branch (385:27): [True: 1.07k, False: 2.24k]
  ------------------
  386|  1.07k|    next = chunk->next;
  387|  1.07k|    buf_chunk_free_unchecked(chunk);
  388|  1.07k|  }
  389|       |  buf->head = buf->tail = NULL;
  390|  2.24k|}
buf_datalen__real:
  395|  9.41k|{
  396|  9.41k|  return buf->datalen;
  397|  9.41k|}
buf_allocation:
  402|  4.26k|{
  403|  4.26k|  size_t total = 0;
  404|  4.26k|  const chunk_t *chunk;
  405|  8.53k|  for (chunk = buf->head; chunk; chunk = chunk->next) {
  ------------------
  |  Branch (405:27): [True: 4.26k, False: 4.26k]
  ------------------
  406|       |    total += CHUNK_ALLOC_SIZE(chunk->memlen);
  ------------------
  |  |   89|  4.26k|#define CHUNK_ALLOC_SIZE(memlen) (CHUNK_OVERHEAD + (memlen))
  |  |  ------------------
  |  |  |  |   85|  4.26k|#define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  4.26k|#define CHUNK_HEADER_LEN offsetof(chunk_t, mem[0])
  |  |  |  |  ------------------
  |  |  |  |               #define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|  4.26k|#define SENTINEL_LEN 0
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  407|  4.26k|  }
  408|  4.26k|  return total;
  409|  4.26k|}
buf_slack:
  415|  4.26k|{
  416|  4.26k|  if (!buf->tail)
  ------------------
  |  Branch (416:7): [True: 0, False: 4.26k]
  ------------------
  417|      0|    return 0;
  418|  4.26k|  else
  419|  4.26k|    return CHUNK_REMAINING_CAPACITY(buf->tail);
  420|  4.26k|}
buf_free_:
  425|  1.42k|{
  426|  1.42k|  if (!buf)
  ------------------
  |  Branch (426:7): [True: 0, False: 1.42k]
  ------------------
  427|      0|    return;
  428|       |
  429|  1.42k|  buf_clear(buf);
  430|  1.42k|  buf->magic = 0xdeadbeef;
  431|       |  tor_free(buf);
  ------------------
  |  |   47|  1.42k|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|  1.42k|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|  1.42k|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|  1.42k|                                                 struct event *), \
  |  |   51|  1.42k|                   "use tor_event_free for struct event *");   \
  |  |   52|  1.42k|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|  1.42k|#define raw_free    free
  |  |  ------------------
  |  |   53|  1.42k|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|  1.42k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  ------------------
  ------------------
  432|  1.42k|}
buf_assert_ok:
  911|  4.26k|{
  912|  4.26k|  tor_assert(buf);
  ------------------
  |  |  103|  4.26k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  4.26k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  4.26k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  4.26k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  4.26k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  4.26k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 4.26k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  4.26k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  4.26k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 4.26k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  4.26k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  4.26k|    else                                        \
  |  |  |  |  |  |  |  |   80|  4.26k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  4.26k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  4.26k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  4.26k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  4.26k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  4.26k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  913|  4.26k|  tor_assert(buf->magic == BUFFER_MAGIC);
  ------------------
  |  |  103|  4.26k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  4.26k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  4.26k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  4.26k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  4.26k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  4.26k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 4.26k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  4.26k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  4.26k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 4.26k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  4.26k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  4.26k|    else                                        \
  |  |  |  |  |  |  |  |   80|  4.26k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  4.26k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  4.26k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  4.26k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  4.26k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  4.26k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  914|       |
  915|  4.26k|  if (! buf->head) {
  ------------------
  |  Branch (915:7): [True: 1.42k, False: 2.84k]
  ------------------
  916|  1.42k|    tor_assert(!buf->tail);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  917|  1.42k|    tor_assert(buf->datalen == 0);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  918|  2.84k|  } else {
  919|  2.84k|    chunk_t *ch;
  920|  2.84k|    size_t total = 0;
  921|  2.84k|    tor_assert(buf->tail);
  ------------------
  |  |  103|  2.84k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  2.84k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.84k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  2.84k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.84k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  2.84k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  2.84k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  2.84k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  2.84k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  2.84k|    else                                        \
  |  |  |  |  |  |  |  |   80|  2.84k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  2.84k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  2.84k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  2.84k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  2.84k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  2.84k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  922|  5.69k|    for (ch = buf->head; ch; ch = ch->next) {
  ------------------
  |  Branch (922:26): [True: 2.84k, False: 2.84k]
  ------------------
  923|  2.84k|      total += ch->datalen;
  924|  2.84k|      tor_assert(ch->datalen <= ch->memlen);
  ------------------
  |  |  103|  2.84k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  2.84k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.84k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  2.84k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.84k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  2.84k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  2.84k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  2.84k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  2.84k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  2.84k|    else                                        \
  |  |  |  |  |  |  |  |   80|  2.84k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  2.84k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  2.84k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  2.84k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  2.84k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  2.84k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  925|  2.84k|      tor_assert(ch->datalen <= BUF_MAX_LEN);
  ------------------
  |  |  103|  2.84k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  2.84k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.84k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  2.84k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.84k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  2.84k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  2.84k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  2.84k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  2.84k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  2.84k|    else                                        \
  |  |  |  |  |  |  |  |   80|  2.84k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  2.84k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  2.84k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  2.84k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  2.84k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  2.84k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  926|  2.84k|      tor_assert(ch->data >= &ch->mem[0]);
  ------------------
  |  |  103|  2.84k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  2.84k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.84k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  2.84k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.84k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  2.84k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  2.84k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  2.84k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  2.84k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  2.84k|    else                                        \
  |  |  |  |  |  |  |  |   80|  2.84k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  2.84k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  2.84k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  2.84k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  2.84k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  2.84k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  2.84k|      tor_assert(ch->data <= &ch->mem[0]+ch->memlen);
  ------------------
  |  |  103|  2.84k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  2.84k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.84k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  2.84k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.84k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  2.84k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  2.84k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  2.84k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  2.84k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  2.84k|    else                                        \
  |  |  |  |  |  |  |  |   80|  2.84k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  2.84k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  2.84k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  2.84k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  2.84k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  2.84k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  928|  2.84k|      if (ch->data == &ch->mem[0]+ch->memlen) {
  ------------------
  |  Branch (928:11): [True: 0, False: 2.84k]
  ------------------
  929|       |        /* LCOV_EXCL_START */
  930|      0|        static int warned = 0;
  931|      0|        if (! warned) {
  ------------------
  |  Branch (931:13): [True: 0, False: 0]
  ------------------
  932|      0|          log_warn(LD_BUG, "Invariant violation in buf.c related to #15083");
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  933|      0|          warned = 1;
  934|      0|        }
  935|       |        /* LCOV_EXCL_STOP */
  936|      0|      }
  937|  2.84k|      tor_assert(ch->data+ch->datalen <= &ch->mem[0] + ch->memlen);
  ------------------
  |  |  103|  2.84k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  2.84k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.84k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  2.84k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.84k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  2.84k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  2.84k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  2.84k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  2.84k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  2.84k|    else                                        \
  |  |  |  |  |  |  |  |   80|  2.84k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  2.84k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  2.84k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  2.84k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  2.84k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  2.84k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  938|  2.84k|      if (!ch->next)
  ------------------
  |  Branch (938:11): [True: 2.84k, False: 0]
  ------------------
  939|  2.84k|        tor_assert(ch == buf->tail);
  ------------------
  |  |  103|  2.84k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  2.84k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.84k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  2.84k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.84k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  2.84k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  2.84k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  2.84k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  2.84k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  2.84k|    else                                        \
  |  |  |  |  |  |  |  |   80|  2.84k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  2.84k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  2.84k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  2.84k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  2.84k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  2.84k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  940|  2.84k|    }
  941|  2.84k|    tor_assert(buf->datalen == total);
  ------------------
  |  |  103|  2.84k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  2.84k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  2.84k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  2.84k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.84k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  2.84k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  2.84k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  2.84k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  2.84k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  2.84k|    else                                        \
  |  |  |  |  |  |  |  |   80|  2.84k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  2.84k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  2.84k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  2.84k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  2.84k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  2.84k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  942|  2.84k|  }
  943|  4.26k|}
buffers.c:buf_chunk_free_unchecked:
  130|  1.42k|{
  131|  1.42k|  if (!chunk)
  ------------------
  |  Branch (131:7): [True: 0, False: 1.42k]
  ------------------
  132|      0|    return;
  133|  1.42k|#ifdef DEBUG_CHUNK_ALLOC
  134|  1.42k|  tor_assert(CHUNK_ALLOC_SIZE(chunk->memlen) == chunk->DBG_alloc);
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  135|  1.42k|#endif
  136|  1.42k|  tor_assert(total_bytes_allocated_in_chunks >=
  ------------------
  |  |  103|  1.42k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.42k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.42k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.42k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.42k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.42k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.42k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.42k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.42k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.42k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.42k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.42k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.42k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.42k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.42k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  137|  1.42k|             CHUNK_ALLOC_SIZE(chunk->memlen));
  138|  1.42k|  total_bytes_allocated_in_chunks -= CHUNK_ALLOC_SIZE(chunk->memlen);
  ------------------
  |  |   89|  1.42k|#define CHUNK_ALLOC_SIZE(memlen) (CHUNK_OVERHEAD + (memlen))
  |  |  ------------------
  |  |  |  |   85|  1.42k|#define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.42k|#define CHUNK_HEADER_LEN offsetof(chunk_t, mem[0])
  |  |  |  |  ------------------
  |  |  |  |               #define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|  1.42k|#define SENTINEL_LEN 0
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|       |  tor_free(chunk);
  ------------------
  |  |   47|  1.42k|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|  1.42k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|  1.42k|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|  1.42k|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|  1.42k|                                                 struct event *), \
  |  |   51|  1.42k|                   "use tor_event_free for struct event *");   \
  |  |   52|  1.42k|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|  1.42k|#define raw_free    free
  |  |  ------------------
  |  |   53|  1.42k|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|  1.42k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  1.42k|#define STMT_END })
  |  |  ------------------
  ------------------
  140|  1.42k|}
buffers.c:chunk_new_with_alloc_size:
  143|  1.42k|{
  144|  1.42k|  chunk_t *ch;
  145|  1.42k|  ch = tor_malloc(alloc);
  ------------------
  |  |   62|  1.42k|#define tor_malloc(size)       tor_malloc_(size)
  ------------------
  146|  1.42k|  ch->next = NULL;
  147|  1.42k|  ch->datalen = 0;
  148|  1.42k|#ifdef DEBUG_CHUNK_ALLOC
  149|  1.42k|  ch->DBG_alloc = alloc;
  150|  1.42k|#endif
  151|  1.42k|  ch->memlen = CHUNK_SIZE_WITH_ALLOC(alloc);
  ------------------
  |  |   92|  1.42k|#define CHUNK_SIZE_WITH_ALLOC(memlen) ((memlen) - CHUNK_OVERHEAD)
  |  |  ------------------
  |  |  |  |   85|  1.42k|#define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.42k|#define CHUNK_HEADER_LEN offsetof(chunk_t, mem[0])
  |  |  |  |  ------------------
  |  |  |  |               #define CHUNK_OVERHEAD (CHUNK_HEADER_LEN + SENTINEL_LEN)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|  1.42k|#define SENTINEL_LEN 0
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  152|  1.42k|  total_bytes_allocated_in_chunks += alloc;
  153|  1.42k|  ch->data = &ch->mem[0];
  154|  1.42k|  CHUNK_SET_SENTINEL(ch, alloc);
  ------------------
  |  |  104|  1.42k|#define CHUNK_SET_SENTINEL(chunk, alloclen) STMT_NIL
  |  |  ------------------
  |  |  |  |  195|  1.42k|#define STMT_NIL (void)0
  |  |  ------------------
  ------------------
  155|  1.42k|  return ch;
  156|  1.42k|}

buffers.c:CHUNK_REMAINING_CAPACITY:
  111|  5.69k|{
  112|  5.69k|  return (chunk->mem + chunk->memlen) - (chunk->data + chunk->datalen);
  113|  5.69k|}

tor_compress_init:
  697|      2|{
  698|      2|  atomic_counter_init(&total_compress_allocation);
  699|       |
  700|      2|  tor_zlib_init();
  701|      2|  tor_lzma_init();
  702|      2|  tor_zstd_init();
  703|       |
  704|      2|  return 0;
  705|      2|}
compress.c:subsys_compress_initialize:
  721|      1|{
  722|      1|  return tor_compress_init();
  723|      1|}

tor_lzma_init:
  396|      2|{
  397|      2|  atomic_counter_init(&total_lzma_allocation);
  398|      2|}

tor_zlib_init:
  307|      2|{
  308|      2|  atomic_counter_init(&total_zlib_allocation);
  309|      2|}

tor_zstd_init:
  508|      2|{
  509|      2|  atomic_counter_init(&total_zstd_allocation);
  510|      2|}

config_mgr_new:
  146|      1|{
  147|      1|  config_mgr_t *mgr = tor_malloc_zero(sizeof(config_mgr_t));
  ------------------
  |  |   63|      1|#define tor_malloc_zero(size)  tor_malloc_zero_(size)
  ------------------
  148|      1|  mgr->subconfigs = smartlist_new();
  149|      1|  mgr->all_vars = smartlist_new();
  150|      1|  mgr->all_abbrevs = smartlist_new();
  151|      1|  mgr->all_deprecations = smartlist_new();
  152|       |
  153|      1|  config_mgr_register_fmt(mgr, toplevel_fmt, IDX_TOPLEVEL);
  ------------------
  |  |  140|      1|#define IDX_TOPLEVEL (-1)
  ------------------
  154|      1|  mgr->toplevel = toplevel_fmt;
  155|       |
  156|      1|  return mgr;
  157|      1|}
config_mgr_add_format:
  218|      3|{
  219|      3|  tor_assert(mgr);
  ------------------
  |  |  103|      3|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      3|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      3|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      3|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      3|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      3|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      3|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      3|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      3|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      3|    else                                        \
  |  |  |  |  |  |  |  |   80|      3|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      3|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      3|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      3|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      3|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      3|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  220|      3|  int idx = smartlist_len(mgr->subconfigs);
  ------------------
  |  |   81|      3|#define smartlist_len(sl) ((sl)->num_used)
  ------------------
  221|      3|  config_mgr_register_fmt(mgr, fmt, idx);
  222|      3|  smartlist_add(mgr->subconfigs, (void *)fmt);
  223|      3|  return idx;
  224|      3|}
config_mgr_freeze:
  286|      1|{
  287|      1|  static uint64_t mgr_count = 0;
  288|       |
  289|      1|  smartlist_sort(mgr->all_vars, managed_var_cmp);
  290|      1|  memcpy(&mgr->toplevel_magic, &mgr->toplevel->magic,
  291|      1|         sizeof(struct_magic_decl_t));
  292|      1|  uint64_t magic_input[3] = { mgr->toplevel_magic.magic_val,
  293|      1|                              (uint64_t) (uintptr_t) mgr,
  294|      1|                              ++mgr_count };
  295|      1|  mgr->toplevel_magic.magic_val =
  296|      1|    (uint32_t)siphash24g(magic_input, sizeof(magic_input));
  297|       |  mgr->frozen = true;
  298|      1|}
config_new:
  388|      1|{
  389|      1|  tor_assert(mgr->frozen);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  390|      1|  void *opts = tor_malloc_zero(mgr->toplevel->size);
  ------------------
  |  |   63|      1|#define tor_malloc_zero(size)  tor_malloc_zero_(size)
  ------------------
  391|      1|  struct_set_magic(opts, &mgr->toplevel_magic);
  392|      1|  config_suite_t **suitep = config_mgr_get_suite_ptr(mgr, opts);
  393|      1|  if (suitep) {
  ------------------
  |  Branch (393:7): [True: 1, False: 0]
  ------------------
  394|      1|    *suitep = config_suite_new();
  395|      3|    SMARTLIST_FOREACH_BEGIN(mgr->subconfigs, const config_format_t *, fmt) {
  ------------------
  |  |   79|      1|  STMT_BEGIN                                                    \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   80|      1|    int var ## _sl_idx, var ## _sl_len=(sl)->num_used;          \
  |  |   81|      1|    type var;                                                   \
  |  |   82|      4|    for (var ## _sl_idx = 0; var ## _sl_idx < var ## _sl_len;   \
  |  |  ------------------
  |  |  |  Branch (82:30): [True: 3, False: 1]
  |  |  ------------------
  |  |   83|      3|         ++var ## _sl_idx) {                                    \
  |  |   84|      3|      var = (sl)->list[var ## _sl_idx];
  ------------------
  396|      3|      void *obj = tor_malloc_zero(fmt->size);
  ------------------
  |  |   63|      3|#define tor_malloc_zero(size)  tor_malloc_zero_(size)
  ------------------
  397|      3|      struct_set_magic(obj, &fmt->magic);
  398|      3|      smartlist_add((*suitep)->configs, obj);
  399|      3|    } SMARTLIST_FOREACH_END(fmt);
  ------------------
  |  |  100|      3|    var = NULL;                                 \
  |  |  101|      3|    (void) var ## _sl_idx;                      \
  |  |  102|      3|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  400|      1|  }
  401|      1|  CONFIG_CHECK(mgr, opts);
  ------------------
  |  |  381|      1|#define CONFIG_CHECK(mgr, cfg) STMT_BEGIN                               \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  382|      1|    config_mgr_assert_magic_ok((mgr), (cfg));                           \
  |  |  383|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  402|      1|  return opts;
  403|      1|}
confmgt.c:config_mgr_register_fmt:
  164|      4|{
  165|      4|  int i;
  166|       |
  167|      4|  tor_assertf(!mgr->frozen,
  ------------------
  |  |  105|      4|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  ------------------
  |  |  |  |  204|      4|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  106|      4|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  ------------------
  |  |  |  |   83|      4|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      4|  ( {                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:3): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      4|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |   77|      4|    if (e)                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (77:9): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      4|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |   79|      4|    else                                        \
  |  |  |  |  |  |   80|      4|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |   81|      4|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |   82|      4|  } )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      4|  } else {                                                              \
  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  110|      0|    tor_abort_();                                                        \
  |  |  111|      4|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|      4|#define STMT_END })
  |  |  ------------------
  ------------------
  168|      4|              "Tried to add a format to a configuration manager after "
  169|      4|              "it had been frozen.");
  170|       |
  171|      4|  if (object_idx != IDX_TOPLEVEL) {
  ------------------
  |  |  140|      4|#define IDX_TOPLEVEL (-1)
  ------------------
  |  Branch (171:7): [True: 3, False: 1]
  ------------------
  172|      3|    tor_assertf(! fmt->has_config_suite,
  ------------------
  |  |  105|      3|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  ------------------
  |  |  |  |  204|      3|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  106|      3|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  ------------------
  |  |  |  |   83|      3|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      3|  ( {                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:3): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      3|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |   77|      3|    if (e)                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (77:9): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      3|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |   79|      3|    else                                        \
  |  |  |  |  |  |   80|      3|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |   81|      3|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |   82|      3|  } )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      3|  } else {                                                              \
  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  110|      0|    tor_abort_();                                                        \
  |  |  111|      3|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|      3|#define STMT_END })
  |  |  ------------------
  ------------------
  173|      3|          "Tried to register a toplevel format in a non-toplevel position");
  174|      3|  }
  175|      4|  if (fmt->config_suite_offset) {
  ------------------
  |  Branch (175:7): [True: 1, False: 3]
  ------------------
  176|      1|    tor_assertf(fmt->has_config_suite,
  ------------------
  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  ------------------
  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      1|  } else {                                                              \
  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  110|      0|    tor_abort_();                                                        \
  |  |  111|      1|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  177|      1|                "config_suite_offset was set, but has_config_suite was not.");
  178|      1|  }
  179|       |
  180|      4|  tor_assertf(fmt != mgr->toplevel &&
  ------------------
  |  |  105|      4|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  ------------------
  |  |  |  |  204|      4|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  106|      4|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  ------------------
  |  |  |  |   83|      4|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      4|  ( {                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:3): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      4|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |   77|     12|    if (e)                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (77:9): [True: 4, False: 0]
  |  |  |  |  |  |  |  Branch (77:9): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      4|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |   79|      4|    else                                        \
  |  |  |  |  |  |   80|      4|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |   81|      4|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |   82|      4|  } )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      4|  } else {                                                              \
  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  110|      0|    tor_abort_();                                                        \
  |  |  111|      4|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|      4|#define STMT_END })
  |  |  ------------------
  ------------------
  181|      4|              ! smartlist_contains(mgr->subconfigs, fmt),
  182|      4|              "Tried to register an already-registered format.");
  183|       |
  184|       |  /* register variables */
  185|    463|  for (i = 0; fmt->vars[i].member.name; ++i) {
  ------------------
  |  Branch (185:15): [True: 459, False: 4]
  ------------------
  186|    459|    managed_var_t *mv = tor_malloc_zero(sizeof(managed_var_t));
  ------------------
  |  |   63|    459|#define tor_malloc_zero(size)  tor_malloc_zero_(size)
  ------------------
  187|    459|    mv->cvar = &fmt->vars[i];
  188|    459|    mv->object_idx = object_idx;
  189|    459|    smartlist_add(mgr->all_vars, mv);
  190|    459|  }
  191|       |
  192|       |  /* register abbrevs */
  193|      4|  if (fmt->abbrevs) {
  ------------------
  |  Branch (193:7): [True: 1, False: 3]
  ------------------
  194|     55|    for (i = 0; fmt->abbrevs[i].abbreviated; ++i) {
  ------------------
  |  Branch (194:17): [True: 54, False: 1]
  ------------------
  195|     54|      smartlist_add(mgr->all_abbrevs, (void*)&fmt->abbrevs[i]);
  196|     54|    }
  197|      1|  }
  198|       |
  199|       |  /* register deprecations. */
  200|      4|  if (fmt->deprecations) {
  ------------------
  |  Branch (200:7): [True: 1, False: 3]
  ------------------
  201|      1|    const config_deprecation_t *d;
  202|      6|    for (d = fmt->deprecations; d->name; ++d) {
  ------------------
  |  Branch (202:33): [True: 5, False: 1]
  ------------------
  203|      5|      smartlist_add(mgr->all_deprecations, (void*)d);
  204|      5|    }
  205|      1|  }
  206|      4|}
confmgt.c:config_mgr_get_suite_ptr:
  230|      2|{
  231|      2|  if (! mgr->toplevel->has_config_suite)
  ------------------
  |  Branch (231:7): [True: 0, False: 2]
  ------------------
  232|      0|    return NULL;
  233|      2|  return STRUCT_VAR_P(toplevel, mgr->toplevel->config_suite_offset);
  ------------------
  |  |  232|      2|#define STRUCT_VAR_P(st, off) ((void*) ( ((char*)(st)) + (off) ) )
  ------------------
  234|      2|}
confmgt.c:managed_var_cmp:
  273|  3.11k|{
  274|  3.11k|  const managed_var_t *mv1 = *(const managed_var_t**)a;
  275|  3.11k|  const managed_var_t *mv2 = *(const managed_var_t**)b;
  276|       |
  277|  3.11k|  return strcasecmp(mv1->cvar->member.name, mv2->cvar->member.name);
  278|  3.11k|}
confmgt.c:config_suite_new:
   87|      1|{
   88|      1|  config_suite_t *suite = tor_malloc_zero(sizeof(config_suite_t));
  ------------------
  |  |   63|      1|#define tor_malloc_zero(size)  tor_malloc_zero_(size)
  ------------------
   89|      1|  suite->configs = smartlist_new();
   90|      1|  return suite;
   91|      1|}
confmgt.c:config_mgr_assert_magic_ok:
  358|      1|{
  359|      1|  tor_assert(mgr);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|      1|  tor_assert(options);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  361|      1|  tor_assert(mgr->frozen);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  362|      1|  struct_check_magic(options, &mgr->toplevel_magic);
  363|       |
  364|      1|  config_suite_t **suitep = config_mgr_get_suite_ptr(mgr, (void*)options);
  365|      1|  if (suitep == NULL) {
  ------------------
  |  Branch (365:7): [True: 0, False: 1]
  ------------------
  366|      0|    tor_assert(smartlist_len(mgr->subconfigs) == 0);
  ------------------
  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  367|      0|    return;
  368|      0|  }
  369|       |
  370|      1|  tor_assert(smartlist_len((*suitep)->configs) ==
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  371|      1|             smartlist_len(mgr->subconfigs));
  372|      3|  SMARTLIST_FOREACH_BEGIN(mgr->subconfigs, const config_format_t *, fmt) {
  ------------------
  |  |   79|      1|  STMT_BEGIN                                                    \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   80|      1|    int var ## _sl_idx, var ## _sl_len=(sl)->num_used;          \
  |  |   81|      1|    type var;                                                   \
  |  |   82|      4|    for (var ## _sl_idx = 0; var ## _sl_idx < var ## _sl_len;   \
  |  |  ------------------
  |  |  |  Branch (82:30): [True: 3, False: 1]
  |  |  ------------------
  |  |   83|      3|         ++var ## _sl_idx) {                                    \
  |  |   84|      3|      var = (sl)->list[var ## _sl_idx];
  ------------------
  373|      3|    void *obj = smartlist_get((*suitep)->configs, fmt_sl_idx);
  ------------------
  |  |   82|      3|#define smartlist_get(sl, idx) ((sl)->list[idx])
  ------------------
  374|      3|    tor_assert(obj);
  ------------------
  |  |  103|      3|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      3|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      3|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      3|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      3|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      3|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      3|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      3|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      3|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      3|    else                                        \
  |  |  |  |  |  |  |  |   80|      3|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      3|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      3|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      3|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      3|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      3|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  375|      3|    struct_check_magic(obj, &fmt->magic);
  376|       |  } SMARTLIST_FOREACH_END(fmt);
  ------------------
  |  |  100|      3|    var = NULL;                                 \
  |  |  101|      3|    (void) var ## _sl_idx;                      \
  |  |  102|      3|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  377|      1|}

struct_set_magic:
   49|      4|{
   50|      4|  tor_assert(decl);
  ------------------
  |  |  103|      4|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      4|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      4|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      4|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      4|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      4|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      4|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      4|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      4|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      4|    else                                        \
  |  |  |  |  |  |  |  |   80|      4|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      4|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      4|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      4|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      4|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      4|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   51|      4|  if (magic_is_null(decl))
  ------------------
  |  Branch (51:7): [True: 0, False: 4]
  ------------------
   52|      0|    return;
   53|       |
   54|      4|  tor_assert(object);
  ------------------
  |  |  103|      4|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      4|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      4|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      4|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      4|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      4|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      4|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      4|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      4|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      4|    else                                        \
  |  |  |  |  |  |  |  |   80|      4|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      4|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      4|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      4|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      4|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      4|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   55|      4|  uint32_t *ptr = STRUCT_VAR_P(object, decl->magic_offset);
  ------------------
  |  |  232|      4|#define STRUCT_VAR_P(st, off) ((void*) ( ((char*)(st)) + (off) ) )
  ------------------
   56|      4|  *ptr = decl->magic_val;
   57|      4|}
struct_check_magic:
   64|      4|{
   65|      4|  tor_assert(decl);
  ------------------
  |  |  103|      4|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      4|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      4|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      4|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      4|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      4|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      4|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      4|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      4|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      4|    else                                        \
  |  |  |  |  |  |  |  |   80|      4|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      4|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      4|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      4|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      4|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      4|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   66|      4|  if (magic_is_null(decl))
  ------------------
  |  Branch (66:7): [True: 0, False: 4]
  ------------------
   67|      0|    return;
   68|       |
   69|      4|  tor_assert(object);
  ------------------
  |  |  103|      4|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      4|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      4|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      4|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      4|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      4|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      4|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      4|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      4|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      4|    else                                        \
  |  |  |  |  |  |  |  |   80|      4|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      4|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      4|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      4|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      4|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      4|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   70|       |
   71|      4|  const uint32_t *ptr = STRUCT_VAR_P(object, decl->magic_offset);
  ------------------
  |  |  232|      4|#define STRUCT_VAR_P(st, off) ((void*) ( ((char*)(st)) + (off) ) )
  ------------------
   72|      4|  tor_assertf(*ptr == decl->magic_val,
  ------------------
  |  |  105|      4|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  ------------------
  |  |  |  |  204|      4|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  106|      4|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  ------------------
  |  |  |  |   83|      4|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      4|  ( {                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (75:3): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      4|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |   77|      4|    if (e)                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (77:9): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      4|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |   79|      4|    else                                        \
  |  |  |  |  |  |   80|      4|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |   81|      4|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |   82|      4|  } )
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      4|  } else {                                                              \
  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  110|      0|    tor_abort_();                                                        \
  |  |  111|      4|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|      4|#define STMT_END })
  |  |  ------------------
  ------------------
   73|      4|              "Bad magic number on purported %s object. "
   74|      4|              "Expected %"PRIu32"x but got %"PRIu32"x.",
   75|      4|              decl->typename, decl->magic_val, *ptr);
   76|      4|}
structvar.c:magic_is_null:
   38|      8|{
   39|      8|  return decl->typename == NULL &&
  ------------------
  |  Branch (39:10): [True: 0, False: 8]
  ------------------
   40|      0|    decl->magic_offset == 0 &&
  ------------------
  |  Branch (40:5): [True: 0, False: 0]
  ------------------
   41|      0|    decl->magic_val == 0;
  ------------------
  |  Branch (41:5): [True: 0, False: 0]
  ------------------
   42|      8|}

strmap_new__real:
  171|      3|  {                                                                     \
  172|      3|    maptype *result;                                                    \
  173|      3|    result = tor_malloc(sizeof(maptype));                               \
  ------------------
  |  |   62|      3|#define tor_malloc(size)       tor_malloc_(size)
  ------------------
  174|      3|    HT_INIT(prefix##_impl, &result->head);                              \
  ------------------
  |  |  151|      3|#define HT_INIT(name, head)          name##_HT_INIT(head)
  ------------------
  175|      3|    return result;                                                      \
  176|      3|  }                                                                     \
strmap_get_lc:
  394|    242|{
  395|    242|  void *v;
  396|    242|  char *lc_key = tor_strdup(key);
  ------------------
  |  |   68|    242|#define tor_strdup(s)          tor_strdup_(s)
  ------------------
  397|    242|  tor_strlower(lc_key);
  398|    242|  v = strmap_get(map,lc_key);
  399|       |  tor_free(lc_key);
  ------------------
  |  |   47|    242|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|    242|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|    242|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|    242|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|    242|                                                 struct event *), \
  |  |   51|    242|                   "use tor_event_free for struct event *");   \
  |  |   52|    242|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|    242|#define raw_free    free
  |  |  ------------------
  |  |   53|    242|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|    242|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    242|#define STMT_END })
  |  |  ------------------
  ------------------
  400|    242|  return v;
  401|    242|}
map.c:strmap_entry_hash:
   54|    242|{
   55|    242|  return (unsigned) siphash24g(a->key, strlen(a->key));
   56|    242|}
map.c:strmap_assign_tmp_key:
  130|    242|{
  131|    242|  ent->key = (char*)key;
  132|    242|}

smartlist_sort:
  335|      1|{
  336|      1|  if (!sl->num_used)
  ------------------
  |  Branch (336:7): [True: 0, False: 1]
  ------------------
  337|      0|    return;
  338|      1|  qsort(sl->list, sl->num_used, sizeof(void*),
  339|      1|        (int (*)(const void *,const void*))compare);
  340|      1|}

curve25519_impl:
   67|      8|{
   68|      8|  uint8_t bp[CURVE25519_PUBKEY_LEN];
   69|      8|  int r;
   70|      8|  memcpy(bp, point, CURVE25519_PUBKEY_LEN);
  ------------------
  |  |   20|      8|#define CURVE25519_PUBKEY_LEN 32
  ------------------
   71|       |  /* Clear the high bit, in case our backend foolishly looks at it. */
   72|      8|  bp[31] &= 0x7f;
   73|      8|#ifdef USE_CURVE25519_DONNA
   74|      8|  r = curve25519_donna(output, secret, bp);
   75|       |#elif defined(USE_CURVE25519_NACL)
   76|       |  r = crypto_scalarmult_curve25519(output, secret, bp);
   77|       |#else
   78|       |#error "No implementation of curve25519 is available."
   79|       |#endif /* defined(USE_CURVE25519_DONNA) || ... */
   80|      8|  memwipe(bp, 0, sizeof(bp));
   81|      8|  return r;
   82|      8|}
curve25519_basepoint_impl:
   91|     17|{
   92|     17|  int r = 0;
   93|     17|  if (BUG(curve25519_use_ed == -1)) {
  ------------------
  |  |  212|     17|  (ASSERT_PREDICT_UNLIKELY_(cond) ?                                     \
  |  |  ------------------
  |  |  |  |   75|     17|  ( {                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:3): [True: 0, False: 17]
  |  |  |  |  ------------------
  |  |  |  |   76|     17|    int tor__assert_tmp_value__;                \
  |  |  |  |   77|     17|    if (e)                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:9): [True: 0, False: 17]
  |  |  |  |  ------------------
  |  |  |  |   78|     17|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |   79|     17|    else                                        \
  |  |  |  |   80|     17|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |   81|     17|    tor__assert_tmp_value__;                    \
  |  |  |  |   82|     17|  } )
  |  |  ------------------
  |  |  |  Branch (212:3): [True: 0, False: 17]
  |  |  ------------------
  |  |  213|     17|  (tor_bug_occurred_(SHORT_FILE__,__LINE__,__func__,"!("#cond")",0,NULL),1) \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  214|     17|   : 0)
  ------------------
   94|       |    /* LCOV_EXCL_START - Only reached if we forgot to call curve25519_init() */
   95|      0|    pick_curve25519_basepoint_impl();
   96|       |    /* LCOV_EXCL_STOP */
   97|      0|  }
   98|       |
   99|       |  /* TODO: Someone should benchmark curved25519_scalarmult_basepoint versus
  100|       |   * an optimized NaCl build to see which should be used when compiled with
  101|       |   * NaCl available.  I suspected that the ed25519 optimization always wins.
  102|       |   */
  103|     17|  if (PREDICT_LIKELY(curve25519_use_ed == 1)) {
  ------------------
  |  |  174|     17|#define PREDICT_LIKELY(exp) __builtin_expect(!!(exp), 1)
  |  |  ------------------
  |  |  |  Branch (174:29): [True: 9, False: 8]
  |  |  ------------------
  ------------------
  104|      9|    curved25519_scalarmult_basepoint_donna(output, secret);
  105|      9|    r = 0;
  106|      9|  } else {
  107|      8|    static const uint8_t basepoint[32] = {9};
  108|      8|    r = curve25519_impl(output, secret, basepoint);
  109|      8|  }
  110|     17|  return r;
  111|     17|}
curve25519_init:
  364|      1|{
  365|      1|  pick_curve25519_basepoint_impl();
  366|      1|}
crypto_curve25519.c:pick_curve25519_basepoint_impl:
  345|      1|{
  346|      1|  curve25519_use_ed = 1;
  347|       |
  348|      1|  if (curve25519_basepoint_spot_check() == 0)
  ------------------
  |  Branch (348:7): [True: 1, False: 0]
  ------------------
  349|      1|    return;
  350|       |
  351|       |  /* LCOV_EXCL_START
  352|       |   * only reachable if our basepoint implementation broken */
  353|      0|  log_warn(LD_BUG|LD_CRYPTO, "The ed25519-based curve25519 basepoint "
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  354|      0|           "multiplication seems broken; using the curve25519 "
  355|      0|           "implementation.");
  356|      0|  curve25519_use_ed = 0;
  357|       |  /* LCOV_EXCL_STOP */
  358|      0|}
crypto_curve25519.c:curve25519_basepoint_spot_check:
  279|      1|{
  280|      1|  static const uint8_t alicesk[32] = {
  281|      1|    0x77,0x07,0x6d,0x0a,0x73,0x18,0xa5,0x7d,
  282|      1|    0x3c,0x16,0xc1,0x72,0x51,0xb2,0x66,0x45,
  283|      1|    0xdf,0x4c,0x2f,0x87,0xeb,0xc0,0x99,0x2a,
  284|      1|    0xb1,0x77,0xfb,0xa5,0x1d,0xb9,0x2c,0x2a
  285|      1|  };
  286|      1|  static const uint8_t alicepk[32] = {
  287|      1|    0x85,0x20,0xf0,0x09,0x89,0x30,0xa7,0x54,
  288|      1|    0x74,0x8b,0x7d,0xdc,0xb4,0x3e,0xf7,0x5a,
  289|      1|    0x0d,0xbf,0x3a,0x0d,0x26,0x38,0x1a,0xf4,
  290|      1|    0xeb,0xa4,0xa9,0x8e,0xaa,0x9b,0x4e,0x6a
  291|      1|  };
  292|      1|  const int loop_max=8;
  293|      1|  int save_use_ed = curve25519_use_ed;
  294|      1|  unsigned char e1[32], e2[32];
  295|      1|  unsigned char x[32],y[32];
  296|      1|  int i;
  297|      1|  int r=0;
  298|       |
  299|      1|  memset(x, 0, sizeof(x));
  300|      1|  memset(y, 0, sizeof(y));
  301|      1|  memset(e1, 0, sizeof(e1));
  302|      1|  memset(e2, 0, sizeof(e2));
  303|      1|  e1[0]=5;
  304|      1|  e2[0]=5;
  305|       |
  306|       |  /* Check the most basic possible sanity via the test secret/public key pair
  307|       |   * used in "Cryptography in NaCl - 2. Secret keys and public keys".  This
  308|       |   * may catch catastrophic failures on systems where Curve25519 is expensive,
  309|       |   * without requiring a ton of key generation.
  310|       |   */
  311|      1|  curve25519_use_ed = 1;
  312|      1|  r |= curve25519_basepoint_impl(x, alicesk);
  313|      1|  if (fast_memneq(x, alicepk, 32))
  ------------------
  |  |   42|      1|#define fast_memneq(a,b,c) (0!=memcmp((a),(b),(c)))
  |  |  ------------------
  |  |  |  Branch (42:28): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  314|      0|    goto fail;
  315|       |
  316|       |  /* Ok, the optimization appears to produce passable results, try a few more
  317|       |   * values, maybe there's something subtle wrong.
  318|       |   */
  319|      9|  for (i = 0; i < loop_max; ++i) {
  ------------------
  |  Branch (319:15): [True: 8, False: 1]
  ------------------
  320|      8|    curve25519_use_ed = 0;
  321|      8|    r |= curve25519_basepoint_impl(x, e1);
  322|      8|    curve25519_use_ed = 1;
  323|      8|    r |= curve25519_basepoint_impl(y, e2);
  324|      8|    if (fast_memneq(x,y,32))
  ------------------
  |  |   42|      8|#define fast_memneq(a,b,c) (0!=memcmp((a),(b),(c)))
  |  |  ------------------
  |  |  |  Branch (42:28): [True: 0, False: 8]
  |  |  ------------------
  ------------------
  325|      0|      goto fail;
  326|      8|    memcpy(e1, x, 32);
  327|      8|    memcpy(e2, x, 32);
  328|      8|  }
  329|       |
  330|      1|  goto end;
  331|       | // LCOV_EXCL_START -- we can only hit this code if there is a bug in our
  332|       | // curve25519-basepoint implementation.
  333|      1| fail:
  334|      0|  r = -1;
  335|       | // LCOV_EXCL_STOP
  336|      1| end:
  337|      1|  curve25519_use_ed = save_use_ed;
  338|      1|  return r;
  339|      0|}

crypto_dh_init:
   52|      2|{
   53|      2|#ifdef ENABLE_OPENSSL
   54|      2|  crypto_dh_init_openssl();
   55|      2|#endif
   56|       |#ifdef ENABLE_NSS
   57|       |  crypto_dh_init_nss();
   58|       |#endif
   59|      2|}

crypto_dh_init_openssl:
  140|      2|{
  141|      2|  if (dh_param_p && dh_param_g && dh_param_p_tls)
  ------------------
  |  Branch (141:7): [True: 1, False: 1]
  |  Branch (141:21): [True: 1, False: 0]
  |  Branch (141:35): [True: 1, False: 0]
  ------------------
  142|      1|    return;
  143|       |
  144|      1|  tor_assert(dh_param_g == NULL);
  ------------------
  |  |  103|      2|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      2|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      2|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|      1|  tor_assert(dh_param_p == NULL);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  146|      1|  tor_assert(dh_param_p_tls == NULL);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  147|       |
  148|      1|  crypto_set_dh_generator();
  149|      1|  dh_param_p = bignum_from_hex(OAKLEY_PRIME_2);
  150|      1|  dh_param_p_tls = bignum_from_hex(TLS_DH_PRIME);
  151|       |
  152|       |  /* Checks below are disabled unless we change the hardcoded DH parameters. */
  153|       |#if 0
  154|       |  tor_assert(0 == crypto_validate_dh_params(dh_param_p, dh_param_g));
  155|       |  tor_assert(0 == crypto_validate_dh_params(dh_param_p_tls, dh_param_g));
  156|       |#endif
  157|      1|}
crypto_dh_openssl.c:crypto_set_dh_generator:
  121|      1|{
  122|      1|  BIGNUM *generator;
  123|      1|  int r;
  124|       |
  125|      1|  if (dh_param_g)
  ------------------
  |  Branch (125:7): [True: 0, False: 1]
  ------------------
  126|      0|    return;
  127|       |
  128|      1|  generator = BN_new();
  129|      1|  tor_assert(generator);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|       |
  131|      1|  r = BN_set_word(generator, DH_GENERATOR);
  132|      1|  tor_assert(r);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|       |
  134|      1|  dh_param_g = generator;
  135|      1|}
crypto_dh_openssl.c:bignum_from_hex:
  106|      2|{
  107|      2|  BIGNUM *result = BN_new();
  108|      2|  tor_assert(result);
  ------------------
  |  |  103|      2|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      2|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      2|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      2|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      2|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      2|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      2|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      2|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      2|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      2|    else                                        \
  |  |  |  |  |  |  |  |   80|      2|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      2|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      2|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      2|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      2|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      2|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|       |
  110|      2|  int r = BN_hex2bn(&result, hex);
  111|      2|  tor_assert(r);
  ------------------
  |  |  103|      2|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      2|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      2|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      2|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      2|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      2|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      2|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      2|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      2|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      2|    else                                        \
  |  |  |  |  |  |  |  |   80|      2|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      2|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      2|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      2|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      2|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      2|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|      2|  tor_assert(result);
  ------------------
  |  |  103|      2|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      2|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      2|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      2|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      2|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      2|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      2|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      2|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      2|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      2|    else                                        \
  |  |  |  |  |  |  |  |   80|      2|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      2|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      2|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      2|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      2|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      2|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|      2|  return result;
  114|      2|}

crypto_digest_algorithm_get_length:
   87|      3|{
   88|      3|  switch (alg) {
   89|      0|    case DIGEST_SHA1:
  ------------------
  |  Branch (89:5): [True: 0, False: 3]
  ------------------
   90|      0|      return DIGEST_LEN;
  ------------------
  |  |   20|      0|#define DIGEST_LEN 20
  ------------------
   91|      0|    case DIGEST_SHA256:
  ------------------
  |  Branch (91:5): [True: 0, False: 3]
  ------------------
   92|      0|      return DIGEST256_LEN;
  ------------------
  |  |   23|      0|#define DIGEST256_LEN 32
  ------------------
   93|      3|    case DIGEST_SHA512:
  ------------------
  |  Branch (93:5): [True: 3, False: 0]
  ------------------
   94|      3|      return DIGEST512_LEN;
  ------------------
  |  |   25|      3|#define DIGEST512_LEN 64
  ------------------
   95|      0|    case DIGEST_SHA3_256:
  ------------------
  |  Branch (95:5): [True: 0, False: 3]
  ------------------
   96|      0|      return DIGEST256_LEN;
  ------------------
  |  |   23|      0|#define DIGEST256_LEN 32
  ------------------
   97|      0|    case DIGEST_SHA3_512:
  ------------------
  |  Branch (97:5): [True: 0, False: 3]
  ------------------
   98|      0|      return DIGEST512_LEN;
  ------------------
  |  |   25|      0|#define DIGEST512_LEN 64
  ------------------
   99|      0|    default:
  ------------------
  |  Branch (99:5): [True: 0, False: 3]
  ------------------
  100|      0|      tor_assert(0);              // LCOV_EXCL_LINE
  ------------------
  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|      0|      return 0; /* Unreachable */ // LCOV_EXCL_LINE
  102|      3|  }
  103|      3|}

crypto_digest512:
   87|      1|{
   88|      1|  tor_assert(m);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|      1|  tor_assert(digest);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|      1|  tor_assert(algorithm == DIGEST_SHA512 || algorithm == DIGEST_SHA3_512);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      2|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|       |
   92|      1|  int ret = 0;
   93|      1|  if (algorithm == DIGEST_SHA512) {
  ------------------
  |  Branch (93:7): [True: 1, False: 0]
  ------------------
   94|      1|    ret = (SHA512((const unsigned char*)m,len,(unsigned char*)digest)
   95|      1|           != NULL);
   96|      1|  } else {
   97|       |#ifdef OPENSSL_HAS_SHA3
   98|       |    unsigned int dlen = DIGEST512_LEN;
   99|       |    ret = EVP_Digest(m, len, (uint8_t*)digest, &dlen, EVP_sha3_512(), NULL);
  100|       |#else
  101|      0|    ret = (sha3_512((uint8_t*)digest, DIGEST512_LEN, (const uint8_t*)m, len)
  ------------------
  |  |   25|      0|#define DIGEST512_LEN 64
  ------------------
  102|      0|           > -1);
  103|      0|#endif /* defined(OPENSSL_HAS_SHA3) */
  104|      0|  }
  105|       |
  106|      1|  if (!ret)
  ------------------
  |  Branch (106:7): [True: 0, False: 1]
  ------------------
  107|      0|    return -1;
  108|      1|  return 0;
  109|      1|}
crypto_digest512_new:
  255|      3|{
  256|      3|  tor_assert(algorithm == DIGEST_SHA512 || algorithm == DIGEST_SHA3_512);
  ------------------
  |  |  103|      3|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      3|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      3|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      3|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      3|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      3|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      3|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      6|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      3|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      3|    else                                        \
  |  |  |  |  |  |  |  |   80|      3|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      3|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      3|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      3|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      3|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      3|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|      3|  return crypto_digest_new_internal(algorithm);
  258|      3|}
crypto_digest_free_:
  264|      3|{
  265|      3|  if (!digest)
  ------------------
  |  Branch (265:7): [True: 0, False: 3]
  ------------------
  266|      0|    return;
  267|       |#ifdef OPENSSL_HAS_SHA3
  268|       |  if (digest->algorithm == DIGEST_SHA3_256 ||
  269|       |      digest->algorithm == DIGEST_SHA3_512) {
  270|       |    if (digest->d.md) {
  271|       |      EVP_MD_CTX_free(digest->d.md);
  272|       |    }
  273|       |  }
  274|       |#endif /* defined(OPENSSL_HAS_SHA3) */
  275|      3|  size_t bytes = crypto_digest_alloc_bytes(digest->algorithm);
  276|      3|  memwipe(digest, 0, bytes);
  277|       |  tor_free(digest);
  ------------------
  |  |   47|      3|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|      3|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|      3|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|      3|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|      3|                                                 struct event *), \
  |  |   51|      3|                   "use tor_event_free for struct event *");   \
  |  |   52|      3|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|      3|#define raw_free    free
  |  |  ------------------
  |  |   53|      3|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|      3|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      3|#define STMT_END })
  |  |  ------------------
  ------------------
  278|      3|}
crypto_digest_add_bytes:
  288|      8|{
  289|      8|  tor_assert(digest);
  ------------------
  |  |  103|      8|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      8|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      8|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      8|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      8|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      8|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 8, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      8|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      8|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 8, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      8|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      8|    else                                        \
  |  |  |  |  |  |  |  |   80|      8|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      8|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      8|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      8|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      8|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      8|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|      8|  tor_assert(data);
  ------------------
  |  |  103|      8|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      8|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      8|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      8|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      8|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      8|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 8, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      8|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      8|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 8, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      8|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      8|    else                                        \
  |  |  |  |  |  |  |  |   80|      8|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      8|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      8|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      8|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      8|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      8|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  291|       |  /* Using the SHA*_*() calls directly means we don't support doing
  292|       |   * SHA in hardware. But so far the delay of getting the question
  293|       |   * to the hardware, and hearing the answer, is likely higher than
  294|       |   * just doing it ourselves. Hashes are fast.
  295|       |   */
  296|      8|  switch (digest->algorithm) {
  297|      0|    case DIGEST_SHA1:
  ------------------
  |  Branch (297:5): [True: 0, False: 8]
  ------------------
  298|      0|      SHA1_Update(&digest->d.sha1, (void*)data, len);
  299|      0|      break;
  300|      0|    case DIGEST_SHA256:
  ------------------
  |  Branch (300:5): [True: 0, False: 8]
  ------------------
  301|      0|      SHA256_Update(&digest->d.sha2, (void*)data, len);
  302|      0|      break;
  303|      8|    case DIGEST_SHA512:
  ------------------
  |  Branch (303:5): [True: 8, False: 0]
  ------------------
  304|      8|      SHA512_Update(&digest->d.sha512, (void*)data, len);
  305|      8|      break;
  306|       |#ifdef OPENSSL_HAS_SHA3
  307|       |    case DIGEST_SHA3_256: FALLTHROUGH;
  308|       |    case DIGEST_SHA3_512: {
  309|       |      int r = EVP_DigestUpdate(digest->d.md, data, len);
  310|       |      tor_assert(r);
  311|       |  }
  312|       |      break;
  313|       |#else /* !defined(OPENSSL_HAS_SHA3) */
  314|      0|    case DIGEST_SHA3_256: FALLTHROUGH;
  ------------------
  |  |   77|      0|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  |  Branch (314:5): [True: 0, False: 8]
  ------------------
  315|      0|    case DIGEST_SHA3_512:
  ------------------
  |  Branch (315:5): [True: 0, False: 8]
  ------------------
  316|      0|      keccak_digest_update(&digest->d.sha3, (const uint8_t *)data, len);
  317|      0|      break;
  318|      0|#endif /* defined(OPENSSL_HAS_SHA3) */
  319|      0|    default:
  ------------------
  |  Branch (319:5): [True: 0, False: 8]
  ------------------
  320|       |      /* LCOV_EXCL_START */
  321|      0|      tor_fragile_assert();
  ------------------
  |  |  278|      0|#define tor_fragile_assert() tor_assert_nonfatal_unreached_once()
  |  |  ------------------
  |  |  |  |  193|      0|#define tor_assert_nonfatal_unreached_once() STMT_BEGIN                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  194|      0|  static int warning_logged__ = 0;                                      \
  |  |  |  |  195|      0|  tor_bug_increment_count_();                                           \
  |  |  |  |  196|      0|  if (!warning_logged__) {                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (196:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  197|      0|    warning_logged__ = 1;                                               \
  |  |  |  |  198|      0|    tor_bug_occurred_(SHORT_FILE__, __LINE__, __func__, NULL, 1, NULL); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  199|      0|  }                                                                     \
  |  |  |  |  200|      0|  STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|      0|      break;
  323|       |      /* LCOV_EXCL_STOP */
  324|      8|  }
  325|      8|}
crypto_digest_get_digest:
  337|      3|{
  338|      3|  unsigned char r[DIGEST512_LEN];
  339|      3|  tor_assert(digest);
  ------------------
  |  |  103|      3|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      3|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      3|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      3|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      3|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      3|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      3|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      3|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      3|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      3|    else                                        \
  |  |  |  |  |  |  |  |   80|      3|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      3|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      3|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      3|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      3|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      3|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  340|      3|  tor_assert(out);
  ------------------
  |  |  103|      3|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      3|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      3|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      3|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      3|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      3|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      3|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      3|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      3|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      3|    else                                        \
  |  |  |  |  |  |  |  |   80|      3|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      3|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      3|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      3|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      3|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      3|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  341|      3|  tor_assert(out_len <= crypto_digest_algorithm_get_length(digest->algorithm));
  ------------------
  |  |  103|      3|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      3|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      3|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      3|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      3|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      3|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      3|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      3|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      3|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      3|    else                                        \
  |  |  |  |  |  |  |  |   80|      3|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      3|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      3|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      3|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      3|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      3|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  342|       |
  343|       |  /* The SHA-3 code handles copying into a temporary ctx, and also can handle
  344|       |   * short output buffers by truncating appropriately. */
  345|      3|  if (digest->algorithm == DIGEST_SHA3_256 ||
  ------------------
  |  Branch (345:7): [True: 0, False: 3]
  ------------------
  346|      3|      digest->algorithm == DIGEST_SHA3_512) {
  ------------------
  |  Branch (346:7): [True: 0, False: 3]
  ------------------
  347|       |#ifdef OPENSSL_HAS_SHA3
  348|       |    unsigned dlen = (unsigned)
  349|       |      crypto_digest_algorithm_get_length(digest->algorithm);
  350|       |    EVP_MD_CTX *tmp = EVP_MD_CTX_new();
  351|       |    EVP_MD_CTX_copy(tmp, digest->d.md);
  352|       |    memset(r, 0xff, sizeof(r));
  353|       |    int res = EVP_DigestFinal(tmp, r, &dlen);
  354|       |    EVP_MD_CTX_free(tmp);
  355|       |    tor_assert(res == 1);
  356|       |    goto done;
  357|       |#else /* !defined(OPENSSL_HAS_SHA3) */
  358|       |    /* Tiny-Keccak handles copying into a temporary ctx, and also can handle
  359|       |     * short output buffers by truncating appropriately. */
  360|      0|    keccak_digest_sum(&digest->d.sha3, (uint8_t *)out, out_len);
  361|      0|    return;
  362|      0|#endif /* defined(OPENSSL_HAS_SHA3) */
  363|      0|  }
  364|       |
  365|      3|  const size_t alloc_bytes = crypto_digest_alloc_bytes(digest->algorithm);
  366|      3|  crypto_digest_t tmpenv;
  367|       |  /* memcpy into a temporary ctx, since SHA*_Final clears the context */
  368|      3|  memcpy(&tmpenv, digest, alloc_bytes);
  369|      3|  switch (digest->algorithm) {
  370|      0|    case DIGEST_SHA1:
  ------------------
  |  Branch (370:5): [True: 0, False: 3]
  ------------------
  371|      0|      SHA1_Final(r, &tmpenv.d.sha1);
  372|      0|      break;
  373|      0|    case DIGEST_SHA256:
  ------------------
  |  Branch (373:5): [True: 0, False: 3]
  ------------------
  374|      0|      SHA256_Final(r, &tmpenv.d.sha2);
  375|      0|      break;
  376|      3|    case DIGEST_SHA512:
  ------------------
  |  Branch (376:5): [True: 3, False: 0]
  ------------------
  377|      3|      SHA512_Final(r, &tmpenv.d.sha512);
  378|      3|      break;
  379|       |//LCOV_EXCL_START
  380|      0|    case DIGEST_SHA3_256: FALLTHROUGH;
  ------------------
  |  |   77|      0|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  |  Branch (380:5): [True: 0, False: 3]
  ------------------
  381|      0|    case DIGEST_SHA3_512:
  ------------------
  |  Branch (381:5): [True: 0, False: 3]
  ------------------
  382|      0|    default:
  ------------------
  |  Branch (382:5): [True: 0, False: 3]
  ------------------
  383|      0|      log_warn(LD_BUG, "Handling unexpected algorithm %d", digest->algorithm);
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  384|       |      /* This is fatal, because it should never happen. */
  385|      0|      tor_assert_unreached();
  ------------------
  |  |  115|      0|  STMT_BEGIN {                                                  \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  116|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__,     \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  117|      0|                          "line should be unreached", NULL);    \
  |  |  118|      0|    tor_abort_();                                               \
  |  |  119|      0|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
  386|      0|      break;
  387|       |//LCOV_EXCL_STOP
  388|      3|  }
  389|       |#ifdef OPENSSL_HAS_SHA3
  390|       | done:
  391|       |#endif
  392|      3|  memcpy(out, r, out_len);
  393|      3|  memwipe(r, 0, sizeof(r));
  394|      3|}
crypto_digest_openssl.c:crypto_digest_new_internal:
  185|      3|{
  186|      3|  crypto_digest_t *r = tor_malloc(crypto_digest_alloc_bytes(algorithm));
  ------------------
  |  |   62|      3|#define tor_malloc(size)       tor_malloc_(size)
  ------------------
  187|      3|  r->algorithm = algorithm;
  188|       |
  189|      3|  switch (algorithm)
  190|      3|    {
  191|      0|    case DIGEST_SHA1:
  ------------------
  |  Branch (191:5): [True: 0, False: 3]
  ------------------
  192|      0|      SHA1_Init(&r->d.sha1);
  193|      0|      break;
  194|      0|    case DIGEST_SHA256:
  ------------------
  |  Branch (194:5): [True: 0, False: 3]
  ------------------
  195|      0|      SHA256_Init(&r->d.sha2);
  196|      0|      break;
  197|      3|    case DIGEST_SHA512:
  ------------------
  |  Branch (197:5): [True: 3, False: 0]
  ------------------
  198|      3|      SHA512_Init(&r->d.sha512);
  199|      3|      break;
  200|       |#ifdef OPENSSL_HAS_SHA3
  201|       |    case DIGEST_SHA3_256:
  202|       |      r->d.md = EVP_MD_CTX_new();
  203|       |      if (!EVP_DigestInit(r->d.md, EVP_sha3_256())) {
  204|       |        crypto_digest_free(r);
  205|       |        return NULL;
  206|       |      }
  207|       |      break;
  208|       |    case DIGEST_SHA3_512:
  209|       |      r->d.md = EVP_MD_CTX_new();
  210|       |      if (!EVP_DigestInit(r->d.md, EVP_sha3_512())) {
  211|       |        crypto_digest_free(r);
  212|       |        return NULL;
  213|       |      }
  214|       |      break;
  215|       |#else /* !defined(OPENSSL_HAS_SHA3) */
  216|      0|    case DIGEST_SHA3_256:
  ------------------
  |  Branch (216:5): [True: 0, False: 3]
  ------------------
  217|      0|      keccak_digest_init(&r->d.sha3, 256);
  218|      0|      break;
  219|      0|    case DIGEST_SHA3_512:
  ------------------
  |  Branch (219:5): [True: 0, False: 3]
  ------------------
  220|      0|      keccak_digest_init(&r->d.sha3, 512);
  221|      0|      break;
  222|      0|#endif /* defined(OPENSSL_HAS_SHA3) */
  223|      0|    default:
  ------------------
  |  Branch (223:5): [True: 0, False: 3]
  ------------------
  224|      0|      tor_assert_unreached();
  ------------------
  |  |  115|      0|  STMT_BEGIN {                                                  \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  116|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__,     \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  117|      0|                          "line should be unreached", NULL);    \
  |  |  118|      0|    tor_abort_();                                               \
  |  |  119|      0|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
  225|      3|    }
  226|       |
  227|      3|  return r;
  228|      3|}
crypto_digest_openssl.c:crypto_digest_alloc_bytes:
  149|      9|{
  150|       |  /** Helper: returns the number of bytes in the 'f' field of 'st' */
  151|      9|#define STRUCT_FIELD_SIZE(st, f) (sizeof( ((st*)0)->f ))
  152|       |  /** Gives the length of crypto_digest_t through the end of the field 'd' */
  153|      9|#define END_OF_FIELD(f) (offsetof(crypto_digest_t, f) + \
  154|      9|                         STRUCT_FIELD_SIZE(crypto_digest_t, f))
  155|      9|  switch (alg) {
  156|      0|    case DIGEST_SHA1:
  ------------------
  |  Branch (156:5): [True: 0, False: 9]
  ------------------
  157|      0|      return END_OF_FIELD(d.sha1);
  ------------------
  |  |  153|      0|#define END_OF_FIELD(f) (offsetof(crypto_digest_t, f) + \
  |  |  154|      0|                         STRUCT_FIELD_SIZE(crypto_digest_t, f))
  |  |  ------------------
  |  |  |  |  151|      0|#define STRUCT_FIELD_SIZE(st, f) (sizeof( ((st*)0)->f ))
  |  |  ------------------
  ------------------
  158|      0|    case DIGEST_SHA256:
  ------------------
  |  Branch (158:5): [True: 0, False: 9]
  ------------------
  159|      0|      return END_OF_FIELD(d.sha2);
  ------------------
  |  |  153|      0|#define END_OF_FIELD(f) (offsetof(crypto_digest_t, f) + \
  |  |  154|      0|                         STRUCT_FIELD_SIZE(crypto_digest_t, f))
  |  |  ------------------
  |  |  |  |  151|      0|#define STRUCT_FIELD_SIZE(st, f) (sizeof( ((st*)0)->f ))
  |  |  ------------------
  ------------------
  160|      9|    case DIGEST_SHA512:
  ------------------
  |  Branch (160:5): [True: 9, False: 0]
  ------------------
  161|      9|      return END_OF_FIELD(d.sha512);
  ------------------
  |  |  153|      9|#define END_OF_FIELD(f) (offsetof(crypto_digest_t, f) + \
  |  |  154|      9|                         STRUCT_FIELD_SIZE(crypto_digest_t, f))
  |  |  ------------------
  |  |  |  |  151|      9|#define STRUCT_FIELD_SIZE(st, f) (sizeof( ((st*)0)->f ))
  |  |  ------------------
  ------------------
  162|       |#ifdef OPENSSL_HAS_SHA3
  163|       |    case DIGEST_SHA3_256: FALLTHROUGH;
  164|       |    case DIGEST_SHA3_512:
  165|       |      return END_OF_FIELD(d.md);
  166|       |#else
  167|      0|    case DIGEST_SHA3_256: FALLTHROUGH;
  ------------------
  |  |   77|      0|#define FALLTHROUGH __attribute__((fallthrough))
  ------------------
  |  Branch (167:5): [True: 0, False: 9]
  ------------------
  168|      0|    case DIGEST_SHA3_512:
  ------------------
  |  Branch (168:5): [True: 0, False: 9]
  ------------------
  169|      0|      return END_OF_FIELD(d.sha3);
  ------------------
  |  |  153|      0|#define END_OF_FIELD(f) (offsetof(crypto_digest_t, f) + \
  |  |  154|      0|                         STRUCT_FIELD_SIZE(crypto_digest_t, f))
  |  |  ------------------
  |  |  |  |  151|      0|#define STRUCT_FIELD_SIZE(st, f) (sizeof( ((st*)0)->f ))
  |  |  ------------------
  ------------------
  170|      0|#endif /* defined(OPENSSL_HAS_SHA3) */
  171|      0|    default:
  ------------------
  |  Branch (171:5): [True: 0, False: 9]
  ------------------
  172|      0|      tor_assert(0); // LCOV_EXCL_LINE
  ------------------
  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|      0|      return 0;      // LCOV_EXCL_LINE
  174|      9|  }
  175|      9|#undef END_OF_FIELD
  176|      9|#undef STRUCT_FIELD_SIZE
  177|      9|}

ed25519_impl_spot_check__real:
  666|      1|{
  667|      1|  static const uint8_t alicesk[32] = {
  668|      1|    0xc5,0xaa,0x8d,0xf4,0x3f,0x9f,0x83,0x7b,
  669|      1|    0xed,0xb7,0x44,0x2f,0x31,0xdc,0xb7,0xb1,
  670|      1|    0x66,0xd3,0x85,0x35,0x07,0x6f,0x09,0x4b,
  671|      1|    0x85,0xce,0x3a,0x2e,0x0b,0x44,0x58,0xf7
  672|      1|  };
  673|      1|  static const uint8_t alicepk[32] = {
  674|      1|    0xfc,0x51,0xcd,0x8e,0x62,0x18,0xa1,0xa3,
  675|      1|    0x8d,0xa4,0x7e,0xd0,0x02,0x30,0xf0,0x58,
  676|      1|    0x08,0x16,0xed,0x13,0xba,0x33,0x03,0xac,
  677|      1|    0x5d,0xeb,0x91,0x15,0x48,0x90,0x80,0x25
  678|      1|  };
  679|      1|  static const uint8_t alicemsg[2] = { 0xaf, 0x82 };
  680|      1|  static const uint8_t alicesig[64] = {
  681|      1|    0x62,0x91,0xd6,0x57,0xde,0xec,0x24,0x02,
  682|      1|    0x48,0x27,0xe6,0x9c,0x3a,0xbe,0x01,0xa3,
  683|      1|    0x0c,0xe5,0x48,0xa2,0x84,0x74,0x3a,0x44,
  684|      1|    0x5e,0x36,0x80,0xd7,0xdb,0x5a,0xc3,0xac,
  685|      1|    0x18,0xff,0x9b,0x53,0x8d,0x16,0xf2,0x90,
  686|      1|    0xae,0x67,0xf7,0x60,0x98,0x4d,0xc6,0x59,
  687|      1|    0x4a,0x7c,0x15,0xe9,0x71,0x6e,0xd2,0x8d,
  688|      1|    0xc0,0x27,0xbe,0xce,0xea,0x1e,0xc4,0x0a
  689|      1|  };
  690|      1|  const ed25519_impl_t *impl = get_ed_impl();
  691|      1|  uint8_t sk[ED25519_SECKEY_LEN];
  692|      1|  uint8_t pk[ED25519_PUBKEY_LEN];
  693|      1|  uint8_t sig[ED25519_SIG_LEN];
  694|      1|  int r = 0;
  695|       |
  696|       |  /* Some implementations (eg: The modified Ed25519-donna) have handy self-test
  697|       |   * code that sanity-checks the internals.  If present, use that to screen out
  698|       |   * catastrophic errors like massive compiler failure.
  699|       |   */
  700|      1|  if (impl->selftest && impl->selftest() != 0)
  ------------------
  |  Branch (700:7): [True: 1, False: 0]
  |  Branch (700:25): [True: 0, False: 1]
  ------------------
  701|      0|    goto fail;
  702|       |
  703|       |  /* Validate results versus known answer tests.  People really should be
  704|       |   * running "make test" instead of relying on this, but it's better than
  705|       |   * nothing.
  706|       |   *
  707|       |   * Test vectors taken from "EdDSA & Ed25519 - 6. Test Vectors for Ed25519
  708|       |   * (TEST3)" (draft-josefsson-eddsa-ed25519-03).
  709|       |   */
  710|       |
  711|       |  /* Key expansion, public key derivation. */
  712|      1|  if (impl->seckey_expand(sk, alicesk) < 0)
  ------------------
  |  Branch (712:7): [True: 0, False: 1]
  ------------------
  713|      0|    goto fail;
  714|      1|  if (impl->pubkey(pk, sk) < 0)
  ------------------
  |  Branch (714:7): [True: 0, False: 1]
  ------------------
  715|      0|    goto fail;
  716|      1|  if (fast_memneq(pk, alicepk, ED25519_PUBKEY_LEN))
  ------------------
  |  |   42|      1|#define fast_memneq(a,b,c) (0!=memcmp((a),(b),(c)))
  |  |  ------------------
  |  |  |  Branch (42:28): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  717|      0|    goto fail;
  718|       |
  719|       |  /* Signing, verification. */
  720|      1|  if (impl->sign(sig, alicemsg, sizeof(alicemsg), sk, pk) < 0)
  ------------------
  |  Branch (720:7): [True: 0, False: 1]
  ------------------
  721|      0|    return -1;
  722|      1|  if (fast_memneq(sig, alicesig, ED25519_SIG_LEN))
  ------------------
  |  |   42|      1|#define fast_memneq(a,b,c) (0!=memcmp((a),(b),(c)))
  |  |  ------------------
  |  |  |  Branch (42:28): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  723|      0|    return -1;
  724|      1|  if (impl->open(sig, alicemsg, sizeof(alicemsg), pk) < 0)
  ------------------
  |  Branch (724:7): [True: 0, False: 1]
  ------------------
  725|      0|    return -1;
  726|       |
  727|       |  /* XXX/yawning: Someone that's more paranoid than I am, can write "Assume
  728|       |   * ref0 is canonical, and fuzz impl against it" if they want, but I doubt
  729|       |   * that will catch anything that the known answer tests won't.
  730|       |   */
  731|      1|  goto end;
  732|       |
  733|       | // LCOV_EXCL_START -- We can only reach this if our ed25519 implementation is
  734|       | // broken.
  735|      1| fail:
  736|      0|  r = -1;
  737|       | // LCOV_EXCL_STOP
  738|      1| end:
  739|      1|  return r;
  740|      0|}
ed25519_init:
  775|      1|{
  776|      1|  pick_ed25519_impl();
  777|      1|}
crypto_ed25519.c:get_ed_impl:
  125|      1|{
  126|      1|  if (BUG(ed25519_impl == NULL)) {
  ------------------
  |  |  212|      1|  (ASSERT_PREDICT_UNLIKELY_(cond) ?                                     \
  |  |  ------------------
  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:3): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:9): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |   79|      1|    else                                        \
  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |   82|      1|  } )
  |  |  ------------------
  |  |  |  Branch (212:3): [True: 0, False: 1]
  |  |  ------------------
  |  |  213|      1|  (tor_bug_occurred_(SHORT_FILE__,__LINE__,__func__,"!("#cond")",0,NULL),1) \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  214|      1|   : 0)
  ------------------
  127|      0|    pick_ed25519_impl(); // LCOV_EXCL_LINE - We always call ed25519_init().
  128|      0|  }
  129|      1|  return ed25519_impl;
  130|      1|}
crypto_ed25519.c:pick_ed25519_impl:
  757|      1|{
  758|      1|  ed25519_impl = &impl_donna;
  759|       |
  760|      1|  if (ed25519_impl_spot_check() == 0)
  ------------------
  |  Branch (760:7): [True: 1, False: 0]
  ------------------
  761|      1|    return;
  762|       |
  763|       |  /* LCOV_EXCL_START
  764|       |   * unreachable unless ed25519_donna is broken */
  765|      0|  log_warn(LD_CRYPTO, "The Ed25519-donna implementation seems broken; using "
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  766|      0|           "the ref10 implementation.");
  767|      0|  ed25519_impl = &impl_ref10;
  768|       |  /* LCOV_EXCL_STOP */
  769|      0|}

crypto_init_siphash_key:
   46|      1|{
   47|      1|  struct sipkey key;
   48|      1|  if (have_seeded_siphash)
  ------------------
  |  Branch (48:7): [True: 0, False: 1]
  ------------------
   49|      0|    return 0;
   50|       |
   51|      1|  crypto_rand((char*) &key, sizeof(key));
   52|      1|  siphash_set_global_key(&key);
   53|      1|  have_seeded_siphash = 1;
   54|      1|  return 0;
   55|      1|}
crypto_early_init:
   61|      2|{
   62|      2|  if (!crypto_early_initialized_) {
  ------------------
  |  Branch (62:7): [True: 1, False: 1]
  ------------------
   63|       |
   64|      1|    crypto_early_initialized_ = 1;
   65|       |
   66|      1|#ifdef ENABLE_OPENSSL
   67|      1|    crypto_openssl_early_init();
   68|      1|#endif
   69|       |#ifdef ENABLE_NSS
   70|       |    crypto_nss_early_init(0);
   71|       |#endif
   72|       |
   73|      1|    polyval_detect_implementation();
   74|       |
   75|      1|    if (crypto_seed_rng() < 0)
  ------------------
  |  Branch (75:9): [True: 0, False: 1]
  ------------------
   76|      0|      return -1;
   77|      1|    if (crypto_init_siphash_key() < 0)
  ------------------
  |  Branch (77:9): [True: 0, False: 1]
  ------------------
   78|      0|      return -1;
   79|       |
   80|      1|    crypto_rand_fast_init();
   81|       |
   82|      1|    curve25519_init();
   83|      1|    ed25519_init();
   84|      1|  }
   85|      2|  return 0;
   86|      2|}
crypto_global_init:
   92|      1|{
   93|      1|  if (!crypto_global_initialized_) {
  ------------------
  |  Branch (93:7): [True: 1, False: 0]
  ------------------
   94|      1|    if (crypto_early_init() < 0)
  ------------------
  |  Branch (94:9): [True: 0, False: 1]
  ------------------
   95|      0|      return -1;
   96|       |
   97|      1|    crypto_global_initialized_ = 1;
   98|       |
   99|      1|    crypto_dh_init();
  100|       |
  101|      1|#ifdef ENABLE_OPENSSL
  102|      1|    if (crypto_openssl_late_init(useAccel, accelName, accelDir) < 0)
  ------------------
  |  Branch (102:9): [True: 0, False: 1]
  ------------------
  103|      0|      return -1;
  104|       |#else
  105|       |    (void)useAccel;
  106|       |    (void)accelName;
  107|       |    (void)accelDir;
  108|       |#endif /* defined(ENABLE_OPENSSL) */
  109|       |#ifdef ENABLE_NSS
  110|       |    if (crypto_nss_late_init() < 0)
  111|       |      return -1;
  112|       |#endif
  113|      1|  }
  114|      1|  return 0;
  115|      1|}
crypto_init.c:subsys_crypto_initialize:
  230|      1|{
  231|      1|  if (crypto_early_init() < 0)
  ------------------
  |  Branch (231:7): [True: 0, False: 1]
  ------------------
  232|      0|    return -1;
  233|      1|  crypto_dh_init();
  234|      1|  return 0;
  235|      1|}

parse_openssl_version_str:
   77|      1|{
   78|      1|  const char *end_of_version = NULL;
   79|       |  /* The output should be something like "OpenSSL 1.0.0b 10 May 2012. Let's
   80|       |     trim that down. */
   81|      1|  if (!strcmpstart(raw_version, "OpenSSL ")) {
  ------------------
  |  Branch (81:7): [True: 1, False: 0]
  ------------------
   82|      1|    raw_version += strlen("OpenSSL ");
   83|      1|    end_of_version = strchr(raw_version, ' ');
   84|      1|  }
   85|       |
   86|      1|  if (end_of_version)
  ------------------
  |  Branch (86:7): [True: 1, False: 0]
  ------------------
   87|      1|    return tor_strndup(raw_version,
  ------------------
  |  |   69|      1|#define tor_strndup(s, n)      tor_strndup_(s, n)
  ------------------
   88|      1|                      end_of_version-raw_version);
   89|      0|  else
   90|      0|    return tor_strdup(raw_version);
  ------------------
  |  |   68|      0|#define tor_strdup(s)          tor_strdup_(s)
  ------------------
   91|      1|}
crypto_openssl_get_version_str:
   97|      1|{
   98|      1|  const int query = OPENSSL_VERSION;
  ------------------
  |  |  188|      1|#define OPENSSL_VERSION 0
  ------------------
   99|       |
  100|      1|  if (crypto_openssl_version_str == NULL) {
  ------------------
  |  Branch (100:7): [True: 1, False: 0]
  ------------------
  101|      1|    const char *raw_version = OpenSSL_version(query);
  102|      1|    crypto_openssl_version_str = parse_openssl_version_str(raw_version);
  103|      1|  }
  104|      1|  return crypto_openssl_version_str;
  105|      1|}
crypto_openssl_early_init:
  146|      1|{
  147|      1|    OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS |
  ------------------
  |  | 2915|      1|#define OPENSSL_INIT_LOAD_SSL_STRINGS 0x00200000L
  ------------------
  148|      1|                     OPENSSL_INIT_LOAD_CRYPTO_STRINGS |
  ------------------
  |  |  548|      1|#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
  ------------------
  149|      1|                     OPENSSL_INIT_ADD_ALL_CIPHERS |
  ------------------
  |  |  549|      1|#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
  ------------------
  150|      1|                     OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
  ------------------
  |  |  550|      1|#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
  ------------------
  151|       |
  152|      1|    setup_openssl_threading();
  153|       |
  154|      1|    unsigned long version_num = tor_OpenSSL_version_num();
  ------------------
  |  |   29|      1|#define tor_OpenSSL_version_num() OpenSSL_version_num()
  ------------------
  155|      1|    const char *version_str = crypto_openssl_get_version_str();
  156|      1|    if (version_num == OPENSSL_VERSION_NUMBER &&
  ------------------
  |  |  116|      2|    ( (OPENSSL_VERSION_MAJOR<<28)        \
  |  |  ------------------
  |  |  |  |   31|      1|# define OPENSSL_VERSION_MAJOR  4
  |  |  ------------------
  |  |  117|      2|      |(OPENSSL_VERSION_MINOR<<20)       \
  |  |  ------------------
  |  |  |  |   34|      1|# define OPENSSL_VERSION_MINOR  2
  |  |  ------------------
  |  |  118|      2|      |(OPENSSL_VERSION_PATCH<<4)        \
  |  |  ------------------
  |  |  |  |   37|      1|# define OPENSSL_VERSION_PATCH  0
  |  |  ------------------
  |  |  119|      2|      |0x0L )
  ------------------
  |  Branch (156:9): [True: 1, False: 0]
  ------------------
  157|      1|        !strcmp(version_str, OPENSSL_VERSION_TEXT)) {
  ------------------
  |  |  110|      1|# define OPENSSL_VERSION_TEXT "OpenSSL 4.2.0-dev "
  ------------------
  |  Branch (157:9): [True: 0, False: 1]
  ------------------
  158|      0|      log_info(LD_CRYPTO, "OpenSSL version matches version from headers "
  ------------------
  |  |  274|      0|  log_fn_(LOG_INFO, domain, __FUNCTION__, args, ##__VA_ARGS__)
  ------------------
  159|      0|                 "(%lx: %s).", version_num, version_str);
  160|      1|    } else if ((version_num & 0xffff0000) ==
  ------------------
  |  Branch (160:16): [True: 1, False: 0]
  ------------------
  161|      1|               (OPENSSL_VERSION_NUMBER & 0xffff0000)) {
  ------------------
  |  |  116|      1|    ( (OPENSSL_VERSION_MAJOR<<28)        \
  |  |  ------------------
  |  |  |  |   31|      1|# define OPENSSL_VERSION_MAJOR  4
  |  |  ------------------
  |  |  117|      1|      |(OPENSSL_VERSION_MINOR<<20)       \
  |  |  ------------------
  |  |  |  |   34|      1|# define OPENSSL_VERSION_MINOR  2
  |  |  ------------------
  |  |  118|      1|      |(OPENSSL_VERSION_PATCH<<4)        \
  |  |  ------------------
  |  |  |  |   37|      1|# define OPENSSL_VERSION_PATCH  0
  |  |  ------------------
  |  |  119|      1|      |0x0L )
  ------------------
  162|      1|      log_notice(LD_CRYPTO,
  ------------------
  |  |  276|      1|  log_fn_(LOG_NOTICE, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  166|      1|               (unsigned long)OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT,
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      1|    ( (OPENSSL_VERSION_MAJOR<<28)        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|      1|# define OPENSSL_VERSION_MAJOR  4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      1|      |(OPENSSL_VERSION_MINOR<<20)       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|      1|# define OPENSSL_VERSION_MINOR  2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      1|      |(OPENSSL_VERSION_PATCH<<4)        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   37|      1|# define OPENSSL_VERSION_PATCH  0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      1|      |0x0L )
  |  |  |  |  ------------------
  |  |  |  |                              (unsigned long)OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT,
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      1|# define OPENSSL_VERSION_TEXT "OpenSSL 4.2.0-dev "
  |  |  |  |  ------------------
  |  |  |  |  167|      1|               version_num, version_str);
  |  |  ------------------
  ------------------
  163|      1|               "We compiled with OpenSSL %lx: %s and we "
  164|      1|               "are running with OpenSSL %lx: %s. "
  165|      1|               "These two versions should be binary compatible.",
  166|      1|               (unsigned long)OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT,
  167|      1|               version_num, version_str);
  168|      1|    } else {
  169|      0|      log_warn(LD_CRYPTO, "OpenSSL version from headers does not match the "
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  |  |                 log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  172|      0|               (unsigned long)OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT,
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      0|    ( (OPENSSL_VERSION_MAJOR<<28)        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   31|      0|# define OPENSSL_VERSION_MAJOR  4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|      |(OPENSSL_VERSION_MINOR<<20)       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   34|      0|# define OPENSSL_VERSION_MINOR  2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  118|      0|      |(OPENSSL_VERSION_PATCH<<4)        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   37|      0|# define OPENSSL_VERSION_PATCH  0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|      |0x0L )
  |  |  |  |  ------------------
  |  |  |  |                              (unsigned long)OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT,
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|# define OPENSSL_VERSION_TEXT "OpenSSL 4.2.0-dev "
  |  |  |  |  ------------------
  |  |  |  |  173|      0|               version_num, version_str);
  |  |  ------------------
  ------------------
  170|      0|               "version we're running with. If you get weird crashes, that "
  171|      0|               "might be why. (Compiled with %lx: %s; running with %lx: %s).",
  172|      0|               (unsigned long)OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT,
  173|      0|               version_num, version_str);
  174|      0|    }
  175|       |
  176|      1|    crypto_force_rand_ssleay();
  177|      1|}
crypto_openssl_late_init:
  303|      1|{
  304|      1|#ifndef LIBRESSL_VERSION_NUMBER
  305|      1|  if (tor_OpenSSL_version_num() < OPENSSL_V_SERIES(3,0,0)) {
  ------------------
  |  |   29|      1|#define tor_OpenSSL_version_num() OpenSSL_version_num()
  ------------------
                if (tor_OpenSSL_version_num() < OPENSSL_V_SERIES(3,0,0)) {
  ------------------
  |  |   50|      1|  OPENSSL_VER((a),(b),(c),0,0)
  |  |  ------------------
  |  |  |  |   32|      1|  (((a)<<28) |                                                \
  |  |  |  |   33|      1|   ((b)<<20) |                                                \
  |  |  |  |   34|      1|   ((c)<<12) |                                                \
  |  |  |  |   35|      1|   ((d)<< 4) |                                                \
  |  |  |  |   36|      1|    (e))
  |  |  ------------------
  ------------------
  |  Branch (305:7): [True: 0, False: 1]
  ------------------
  306|      0|    log_warn(LD_CRYPTO, "Running with OpenSSL version \"%s\", "
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  |  |                 log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  310|      0|             OPENSSL_VERSION_TEXT);
  |  |  |  |  ------------------
  |  |  |  |  |  |  110|      0|# define OPENSSL_VERSION_TEXT "OpenSSL 4.2.0-dev "
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|      0|             "which is no longer maintained by the OpenSSL project. "
  308|      0|             "We recommend that you upgrade to OpenSSL 3.0 or later. "
  309|      0|             "OpenSSL >=3.5 would be ideal.",
  310|      0|             OPENSSL_VERSION_TEXT);
  311|      0|  }
  312|      1|#endif
  313|       |
  314|      1|  if (useAccel > 0) {
  ------------------
  |  Branch (314:7): [True: 0, False: 1]
  ------------------
  315|      0|    if (crypto_openssl_init_engines(accelName, accelDir) < 0)
  ------------------
  |  Branch (315:9): [True: 0, False: 0]
  ------------------
  316|      0|      return -1;
  317|      1|  } else {
  318|      1|    log_info(LD_CRYPTO, "NOT using OpenSSL engine support.");
  ------------------
  |  |  274|      1|  log_fn_(LOG_INFO, domain, __FUNCTION__, args, ##__VA_ARGS__)
  ------------------
  319|      1|  }
  320|       |
  321|      1|  if (crypto_force_rand_ssleay()) {
  ------------------
  |  Branch (321:7): [True: 0, False: 1]
  ------------------
  322|      0|    if (crypto_seed_rng() < 0)
  ------------------
  |  Branch (322:9): [True: 0, False: 0]
  ------------------
  323|      0|      return -1;
  324|      0|  }
  325|       |
  326|      1|  return 0;
  327|      1|}
crypto_openssl_mgt.c:setup_openssl_threading:
  131|      1|{
  132|      1|  return 0;
  133|      1|}

crypto_strongest_rand_raw:
  292|      1|{
  293|      1|  static const size_t sanity_min_size = 16;
  294|      1|  static const int max_attempts = 3;
  295|      1|  tor_assert(out_len <= MAX_STRONGEST_RAND_SIZE);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  296|       |
  297|       |  /* For buffers >= 16 bytes (128 bits), we sanity check the output by
  298|       |   * zero filling the buffer and ensuring that it actually was at least
  299|       |   * partially modified.
  300|       |   *
  301|       |   * Checking that any individual byte is non-zero seems like it would
  302|       |   * fail too often (p = out_len * 1/256) for comfort, but this is an
  303|       |   * "adjust according to taste" sort of check.
  304|       |   */
  305|      1|  memwipe(out, 0, out_len);
  306|      1|  for (int i = 0; i < max_attempts; i++) {
  ------------------
  |  Branch (306:19): [True: 1, False: 0]
  ------------------
  307|       |    /* Try to use the syscall/OS favored mechanism to get strong entropy. */
  308|      1|    if (crypto_strongest_rand_syscall(out, out_len) != 0) {
  ------------------
  |  Branch (308:9): [True: 0, False: 1]
  ------------------
  309|       |      /* Try to use the less-favored mechanism to get strong entropy. */
  310|      0|      if (crypto_strongest_rand_fallback(out, out_len) != 0) {
  ------------------
  |  Branch (310:11): [True: 0, False: 0]
  ------------------
  311|       |        /* Welp, we tried.  Hopefully the calling code terminates the process
  312|       |         * since we're basically boned without good entropy.
  313|       |         */
  314|      0|        log_warn(LD_CRYPTO,
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  315|      0|                 "Cannot get strong entropy: no entropy source found.");
  316|      0|        return -1;
  317|      0|      }
  318|      0|    }
  319|       |
  320|      1|    if ((out_len < sanity_min_size) || !safe_mem_is_zero((char*)out, out_len))
  ------------------
  |  Branch (320:9): [True: 0, False: 1]
  |  Branch (320:40): [True: 1, False: 0]
  ------------------
  321|      1|      return 0;
  322|      1|  }
  323|       |
  324|       |  /* LCOV_EXCL_START
  325|       |   *
  326|       |   * We tried max_attempts times to fill a buffer >= 128 bits long,
  327|       |   * and each time it returned all '0's.  Either the system entropy
  328|       |   * source is busted, or the user should go out and buy a ticket to
  329|       |   * every lottery on the planet.
  330|       |   */
  331|      0|  log_warn(LD_CRYPTO, "Strong OS entropy returned all zero buffer.");
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  332|       |
  333|      0|  return -1;
  334|       |  /* LCOV_EXCL_STOP */
  335|      1|}
crypto_seed_rng:
  455|      1|{
  456|      1|  int seeded = 0;
  457|       |#ifdef ENABLE_NSS
  458|       |  if (crypto_seed_nss_rng() < 0)
  459|       |    return -1;
  460|       |  ++seeded;
  461|       |#endif
  462|      1|#ifdef ENABLE_OPENSSL
  463|      1|  if (crypto_seed_openssl_rng() < 0)
  ------------------
  |  Branch (463:7): [True: 0, False: 1]
  ------------------
  464|      0|    return -1;
  465|      1|  ++seeded;
  466|      1|#endif
  467|      1|  tor_assert(seeded);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  468|      1|  return 0;
  469|      1|}
crypto_rand__real:
  480|      2|{
  481|      2|  crypto_rand_unmocked(to, n);
  482|      2|}
crypto_rand_unmocked:
  493|      2|{
  494|      2|  if (n == 0)
  ------------------
  |  Branch (494:7): [True: 0, False: 2]
  ------------------
  495|      0|    return;
  496|       |
  497|      2|  tor_assert(n < INT_MAX);
  ------------------
  |  |  103|      2|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      2|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      2|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      2|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      2|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      2|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      2|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      2|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      2|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      2|    else                                        \
  |  |  |  |  |  |  |  |   80|      2|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      2|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      2|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      2|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      2|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      2|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  498|      2|  tor_assert(to);
  ------------------
  |  |  103|      2|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      2|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      2|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      2|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      2|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      2|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      2|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      2|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      2|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      2|    else                                        \
  |  |  |  |  |  |  |  |   80|      2|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      2|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      2|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      2|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      2|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      2|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  499|       |
  500|       |#ifdef ENABLE_NSS
  501|       |  SECStatus s = PK11_GenerateRandom((unsigned char*)to, (int)n);
  502|       |  if (s != SECSuccess) {
  503|       |    /* NSS rather sensibly might refuse to generate huge amounts of random
  504|       |     * data at once.  Unfortunately, our unit test do this in a couple of
  505|       |     * places.  To solve this issue, we use our XOF to stretch a shorter
  506|       |     * output when a longer one is needed.
  507|       |     *
  508|       |     * Yes, this is secure. */
  509|       |
  510|       |    /* This is longer than it needs to be; 1600 bits == 200 bytes is the
  511|       |     * state-size of SHA3. */
  512|       |#define BUFLEN 512
  513|       |    tor_assert(PR_GetError() == SEC_ERROR_INVALID_ARGS && n > BUFLEN);
  514|       |    unsigned char buf[BUFLEN];
  515|       |    s = PK11_GenerateRandom(buf, BUFLEN);
  516|       |    tor_assert(s == SECSuccess);
  517|       |    crypto_xof_t *xof = crypto_xof_new();
  518|       |    crypto_xof_add_bytes(xof, buf, BUFLEN);
  519|       |    crypto_xof_squeeze_bytes(xof, (unsigned char *)to, n);
  520|       |    crypto_xof_free(xof);
  521|       |    memwipe(buf, 0, BUFLEN);
  522|       |
  523|       |#undef BUFLEN
  524|       |  }
  525|       |#else /* !defined(ENABLE_NSS) */
  526|      2|  int r = RAND_bytes((unsigned char*)to, (int)n);
  527|       |  /* We consider a PRNG failure non-survivable. Let's assert so that we get a
  528|       |   * stack trace about where it happened.
  529|       |   */
  530|      2|  tor_assert(r == 1);
  ------------------
  |  |  103|      2|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      2|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      2|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      2|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      2|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      2|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      2|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      2|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      2|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      2|    else                                        \
  |  |  |  |  |  |  |  |   80|      2|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      2|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      2|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      2|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      2|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      2|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  531|      2|#endif
  532|      2|}
crypto_force_rand_ssleay:
  623|      2|{
  624|      2|#ifdef ENABLE_OPENSSL
  625|      2|  RAND_METHOD *default_method;
  626|      2|  default_method = RAND_OpenSSL();
  627|      2|  if (RAND_get_rand_method() != default_method) {
  ------------------
  |  Branch (627:7): [True: 0, False: 2]
  ------------------
  628|      0|    log_notice(LD_CRYPTO, "It appears that one of our engines has provided "
  ------------------
  |  |  276|      0|  log_fn_(LOG_NOTICE, domain, __FUNCTION__, args, ##__VA_ARGS__)
  ------------------
  629|      0|               "a replacement the OpenSSL RNG. Resetting it to the default "
  630|      0|               "implementation.");
  631|      0|    RAND_set_rand_method(default_method);
  632|      0|    return 1;
  633|      0|  }
  634|      2|#endif /* defined(ENABLE_OPENSSL) */
  635|      2|  return 0;
  636|      2|}
crypto_rand.c:crypto_strongest_rand_syscall:
  131|      1|{
  132|      1|  tor_assert(out_len <= MAX_STRONGEST_RAND_SIZE);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|       |
  134|       |  /* We only log at notice-level here because in the case that this function
  135|       |   * fails the crypto_strongest_rand_raw() caller will log with a warning-level
  136|       |   * message and let crypto_strongest_rand() error out and finally terminating
  137|       |   * Tor with an assertion error.
  138|       |   */
  139|       |
  140|      1|#ifdef TOR_UNIT_TESTS
  141|      1|  if (break_strongest_rng_syscall)
  ------------------
  |  Branch (141:7): [True: 0, False: 1]
  ------------------
  142|      0|    return -1;
  143|      1|#endif
  144|       |
  145|       |#if defined(_WIN32)
  146|       |  static int provider_set = 0;
  147|       |  static HCRYPTPROV provider;
  148|       |
  149|       |  if (!provider_set) {
  150|       |    if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
  151|       |                             CRYPT_VERIFYCONTEXT)) {
  152|       |      log_notice(LD_CRYPTO, "Unable to set Windows CryptoAPI provider [1].");
  153|       |      return -1;
  154|       |    }
  155|       |    provider_set = 1;
  156|       |  }
  157|       |  if (!CryptGenRandom(provider, out_len, out)) {
  158|       |    log_notice(LD_CRYPTO, "Unable get entropy from the Windows CryptoAPI.");
  159|       |    return -1;
  160|       |  }
  161|       |
  162|       |  return 0;
  163|       |#elif defined(__linux__) && defined(SYS_getrandom)
  164|      1|  static int getrandom_works = 1; /* Be optimistic about our chances... */
  165|       |
  166|       |  /* getrandom() isn't as straightforward as getentropy(), and has
  167|       |   * no glibc wrapper.
  168|       |   *
  169|       |   * As far as I can tell from getrandom(2) and the source code, the
  170|       |   * requests we issue will always succeed (though it will block on the
  171|       |   * call if /dev/urandom isn't seeded yet), since we are NOT specifying
  172|       |   * GRND_NONBLOCK and the request is <= 256 bytes.
  173|       |   *
  174|       |   * The manpage is unclear on what happens if a signal interrupts the call
  175|       |   * while the request is blocked due to lack of entropy....
  176|       |   *
  177|       |   * We optimistically assume that getrandom() is available and functional
  178|       |   * because it is the way of the future, and 2 branch mispredicts pale in
  179|       |   * comparison to the overheads involved with failing to open
  180|       |   * /dev/srandom followed by opening and reading from /dev/urandom.
  181|       |   */
  182|      1|  if (PREDICT_LIKELY(getrandom_works)) {
  ------------------
  |  |  174|      1|#define PREDICT_LIKELY(exp) __builtin_expect(!!(exp), 1)
  |  |  ------------------
  |  |  |  Branch (174:29): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  183|      1|    long ret;
  184|       |    /* A flag of '0' here means to read from '/dev/urandom', and to
  185|       |     * block if insufficient entropy is available to service the
  186|       |     * request.
  187|       |     */
  188|      1|    const unsigned int flags = 0;
  189|      1|    do {
  190|      1|      ret = syscall(SYS_getrandom, out, out_len, flags);
  191|      1|    } while (ret == -1 && ((errno == EINTR) ||(errno == EAGAIN)));
  ------------------
  |  Branch (191:14): [True: 0, False: 1]
  |  Branch (191:28): [True: 0, False: 0]
  |  Branch (191:47): [True: 0, False: 0]
  ------------------
  192|       |
  193|      1|    if (PREDICT_UNLIKELY(ret == -1)) {
  ------------------
  |  |  182|      1|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  194|       |      /* LCOV_EXCL_START we can't actually make the syscall fail in testing. */
  195|      0|      tor_assert(errno != EAGAIN);
  ------------------
  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|      0|      tor_assert(errno != EINTR);
  ------------------
  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|       |
  198|       |      /* Useful log message for errno. */
  199|      0|      if (errno == ENOSYS) {
  ------------------
  |  Branch (199:11): [True: 0, False: 0]
  ------------------
  200|      0|        log_notice(LD_CRYPTO, "Can't get entropy from getrandom()."
  ------------------
  |  |  276|      0|  log_fn_(LOG_NOTICE, domain, __FUNCTION__, args, ##__VA_ARGS__)
  ------------------
  201|      0|                   " You are running a version of Tor built to support"
  202|      0|                   " getrandom(), but the kernel doesn't implement this"
  203|      0|                   " function--probably because it is too old?"
  204|      0|                   " Trying fallback method instead.");
  205|      0|      } else {
  206|      0|        log_notice(LD_CRYPTO, "Can't get entropy from getrandom(): %s."
  ------------------
  |  |  276|      0|  log_fn_(LOG_NOTICE, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  208|      0|                   strerror(errno));
  |  |  ------------------
  ------------------
  207|      0|                              " Trying fallback method instead.",
  208|      0|                   strerror(errno));
  209|      0|      }
  210|       |
  211|      0|      getrandom_works = 0; /* Don't bother trying again. */
  212|      0|      return -1;
  213|       |      /* LCOV_EXCL_STOP */
  214|      0|    }
  215|       |
  216|      1|    tor_assert(ret == (long)out_len);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|      1|    return 0;
  218|      1|  }
  219|       |
  220|      0|  return -1; /* getrandom() previously failed unexpectedly. */
  221|       |#elif defined(HAVE_GETENTROPY)
  222|       |  /* getentropy() is what Linux's getrandom() wants to be when it grows up.
  223|       |   * the only gotcha is that requests are limited to 256 bytes.
  224|       |   */
  225|       |  return getentropy(out, out_len);
  226|       |#else
  227|       |  (void) out;
  228|       |#endif /* defined(_WIN32) || ... */
  229|       |
  230|       |  /* This platform doesn't have a supported syscall based random. */
  231|      0|  return -1;
  232|      1|}
crypto_rand.c:crypto_seed_openssl_rng:
  401|      1|{
  402|      1|  int rand_poll_ok = 0, load_entropy_ok = 0;
  403|      1|  uint8_t buf[ADD_ENTROPY];
  404|       |
  405|       |  /* OpenSSL has a RAND_poll function that knows about more kinds of
  406|       |   * entropy than we do.  We'll try calling that, *and* calling our own entropy
  407|       |   * functions.  If one succeeds, we'll accept the RNG as seeded. */
  408|      1|  rand_poll_ok = RAND_poll();
  409|      1|  if (rand_poll_ok == 0)
  ------------------
  |  Branch (409:7): [True: 0, False: 1]
  ------------------
  410|      0|    log_warn(LD_CRYPTO, "RAND_poll() failed."); // LCOV_EXCL_LINE
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
  411|       |
  412|      1|  load_entropy_ok = !crypto_strongest_rand_raw(buf, sizeof(buf));
  413|      1|  if (load_entropy_ok) {
  ------------------
  |  Branch (413:7): [True: 1, False: 0]
  ------------------
  414|      1|    RAND_seed(buf, sizeof(buf));
  415|      1|  }
  416|       |
  417|      1|  memwipe(buf, 0, sizeof(buf));
  418|       |
  419|      1|  if ((rand_poll_ok || load_entropy_ok) && RAND_status() == 1)
  ------------------
  |  Branch (419:8): [True: 1, False: 0]
  |  Branch (419:24): [True: 0, False: 0]
  |  Branch (419:44): [True: 1, False: 0]
  ------------------
  420|      1|    return 0;
  421|      0|  else
  422|      0|    return -1;
  423|      1|}

crypto_rand_fast_init:
  424|      1|{
  425|      1|  tor_threadlocal_init(&thread_rng);
  426|      1|}

memwipe:
   56|  6.53k|{
   57|  6.53k|  if (sz == 0) {
  ------------------
  |  Branch (57:7): [True: 477, False: 6.05k]
  ------------------
   58|    477|    return;
   59|    477|  }
   60|       |  /* If sz is nonzero, then mem must not be NULL. */
   61|  6.05k|  tor_assert(mem != NULL);
  ------------------
  |  |  103|  6.53k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  6.05k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  6.05k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  6.05k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  6.05k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  6.05k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 6.05k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  6.05k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  6.05k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 6.05k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  6.05k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  6.05k|    else                                        \
  |  |  |  |  |  |  |  |   80|  6.05k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  6.05k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  6.05k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  6.05k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  6.53k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  6.53k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   62|       |
   63|       |  /* Data this large is likely to be an underflow. */
   64|  6.05k|  tor_assert(sz < SIZE_T_CEILING);
  ------------------
  |  |  103|  6.05k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  6.05k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  6.05k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  6.05k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  6.05k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  6.05k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 6.05k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  6.05k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  6.05k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 6.05k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  6.05k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  6.05k|    else                                        \
  |  |  |  |  |  |  |  |   80|  6.05k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  6.05k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  6.05k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  6.05k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  6.05k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  6.05k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   65|       |
   66|       |  /* Because whole-program-optimization exists, we may not be able to just
   67|       |   * have this function call "memset".  A smart compiler could inline it, then
   68|       |   * eliminate dead memsets, and declare itself to be clever. */
   69|       |
   70|       |#if defined(SecureZeroMemory) || defined(HAVE_SECUREZEROMEMORY)
   71|       |  /* Here's what you do on windows. */
   72|       |  SecureZeroMemory(mem,sz);
   73|       |#elif defined(HAVE_RTLSECUREZEROMEMORY)
   74|       |  RtlSecureZeroMemory(mem,sz);
   75|       |#elif defined(HAVE_EXPLICIT_BZERO)
   76|       |  /* The BSDs provide this. */
   77|  6.05k|  explicit_bzero(mem, sz);
   78|       |#elif defined(HAVE_MEMSET_S)
   79|       |  /* This is in the C99 standard. */
   80|       |  memset_s(mem, sz, 0, sz);
   81|       |#elif defined(ENABLE_OPENSSL)
   82|       |  /* This is a slow and ugly function from OpenSSL that fills 'mem' with junk
   83|       |   * based on the pointer value, then uses that junk to update a global
   84|       |   * variable.  It's an elaborate ruse to trick the compiler into not
   85|       |   * optimizing out the "wipe this memory" code.  Read it if you like zany
   86|       |   * programming tricks! In later versions of Tor, we should look for better
   87|       |   * not-optimized-out memory wiping stuff...
   88|       |   *
   89|       |   * ...or maybe not.  In practice, there are pure-asm implementations of
   90|       |   * OPENSSL_cleanse() on most platforms, which ought to do the job.
   91|       |   **/
   92|       |
   93|       |  OPENSSL_cleanse(mem, sz);
   94|       |#else
   95|       |  memset(mem, 0, sz);
   96|       |  asm volatile("" ::: "memory");
   97|       |#endif /* defined(SecureZeroMemory) || defined(HAVE_SECUREZEROMEMORY) || ... */
   98|       |
   99|       |  /* Just in case some caller of memwipe() is relying on getting a buffer
  100|       |   * filled with a particular value, fill the buffer.
  101|       |   *
  102|       |   * If this function gets inlined, this memset might get eliminated, but
  103|       |   * that's okay: We only care about this particular memset in the case where
  104|       |   * the caller should have been using memset(), and the memset() wouldn't get
  105|       |   * eliminated.  In other words, this is here so that we won't break anything
  106|       |   * if somebody accidentally calls memwipe() instead of memset().
  107|       |   **/
  108|  6.05k|  memset(mem, byte, sz);
  109|  6.05k|}

tor_memeq:
  108|     59|{
  109|       |  /* Treat a and b as byte ranges. */
  110|     59|  const uint8_t *ba = a, *bb = b;
  111|     59|  uint32_t any_difference = 0;
  112|    531|  while (sz--) {
  ------------------
  |  Branch (112:10): [True: 472, False: 59]
  ------------------
  113|       |    /* Set byte_diff to all of those bits that are different in *ba and *bb,
  114|       |     * and advance both ba and bb. */
  115|    472|    const uint8_t byte_diff = *ba++ ^ *bb++;
  116|       |
  117|       |    /* Set bits in any_difference if they are set in byte_diff. */
  118|    472|    any_difference |= byte_diff;
  119|    472|  }
  120|       |
  121|       |  /* Now any_difference is 0 if there are no bits different between
  122|       |   * a and b, and is nonzero if there are bits different between a
  123|       |   * and b.  Now for paranoia's sake, let's convert it to 0 or 1.
  124|       |   *
  125|       |   * (If we say "!any_difference", the compiler might get smart enough
  126|       |   * to optimize-out our data-independence stuff above.)
  127|       |   *
  128|       |   * To unpack:
  129|       |   *
  130|       |   * If any_difference == 0:
  131|       |   *            any_difference - 1 == ~0
  132|       |   *     (any_difference - 1) >> 8 == 0x00ffffff
  133|       |   *     1 & ((any_difference - 1) >> 8) == 1
  134|       |   *
  135|       |   * If any_difference != 0:
  136|       |   *            0 < any_difference < 256, so
  137|       |   *            0 <= any_difference - 1 < 255
  138|       |   *            (any_difference - 1) >> 8 == 0
  139|       |   *            1 & ((any_difference - 1) >> 8) == 0
  140|       |   */
  141|       |
  142|       |  /*coverity[overflow]*/
  143|     59|  return 1 & ((any_difference - 1) >> 8);
  144|     59|}
safe_mem_is_zero:
  225|      1|{
  226|      1|  uint32_t total = 0;
  227|      1|  const uint8_t *ptr = mem;
  228|       |
  229|     33|  while (sz--) {
  ------------------
  |  Branch (229:10): [True: 32, False: 1]
  ------------------
  230|     32|    total |= *ptr++;
  231|     32|  }
  232|       |
  233|       |  /*coverity[overflow]*/
  234|      1|  return 1 & ((total - 1) >> 8);
  235|      1|}

configure_backtrace_handler:
  331|      1|{
  332|      1|  char version[128] = "Tor\0";
  333|       |
  334|      1|  if (tor_version) {
  ------------------
  |  Branch (334:7): [True: 1, False: 0]
  ------------------
  335|      1|    int snp_rv = 0;
  336|       |    /* We can't use strlcat() here, because it is defined in
  337|       |     * string/compat_string.h on some platforms, and string uses torerr. */
  338|      1|    snp_rv = snprintf(version, sizeof(version), "Tor %s", tor_version);
  339|       |    /* It's safe to call raw_assert() here, because raw_assert() does not
  340|       |     * call configure_backtrace_handler(). */
  341|      1|    raw_assert(snp_rv < (int)sizeof(version));
  ------------------
  |  |   20|      1|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|      1|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  342|      1|    raw_assert(snp_rv >= 0);
  ------------------
  |  |   20|      1|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|      1|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  343|      1|  }
  344|       |
  345|      1|  char *str_rv = NULL;
  346|       |  /* We can't use strlcpy() here, see the note about strlcat() above. */
  347|      1|  str_rv = strncpy(bt_version, version, sizeof(bt_version) - 1);
  348|       |  /* We must terminate bt_version, then raw_assert(), because raw_assert()
  349|       |   * uses bt_version. */
  350|      1|  bt_version[sizeof(bt_version) - 1] = 0;
  351|      1|  raw_assert(str_rv == bt_version);
  ------------------
  |  |   20|      1|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|      1|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  352|       |
  353|      1|  return install_bt_handler();
  354|      1|}
backtrace.c:lock_cb_buf:
   90|      1|{
   91|       |  /* Lock the mutex first, before even declaring the buffer. */
   92|      1|  pthread_mutex_lock(&cb_buf_mutex);
   93|       |
   94|       |  /** Static allocation of stack to dump. This is static so we avoid stack
   95|       |   * pressure. */
   96|      1|  static void *cb_buf[MAX_DEPTH];
   97|      1|  CTASSERT(SIZEOF_CB_BUF == sizeof(cb_buf));
  ------------------
  |  |   23|      1|#define CTASSERT(x) _Static_assert((x), #x)
  ------------------
   98|      1|  memset(cb_buf, 0, SIZEOF_CB_BUF);
  ------------------
  |  |   81|      1|#define SIZEOF_CB_BUF (MAX_DEPTH * sizeof(void *))
  |  |  ------------------
  |  |  |  |   79|      1|#define MAX_DEPTH 256
  |  |  ------------------
  ------------------
   99|       |
  100|      1|  return cb_buf;
  101|      1|}
backtrace.c:unlock_cb_buf:
  106|      1|{
  107|      1|  memset(cb_buf, 0, SIZEOF_CB_BUF);
  ------------------
  |  |   81|      1|#define SIZEOF_CB_BUF (MAX_DEPTH * sizeof(void *))
  |  |  ------------------
  |  |  |  |   79|      1|#define MAX_DEPTH 256
  |  |  ------------------
  ------------------
  108|      1|  pthread_mutex_unlock(&cb_buf_mutex);
  109|      1|}
backtrace.c:install_bt_handler:
  236|      1|{
  237|      1|  int i, rv=0;
  238|       |
  239|      1|  struct sigaction sa;
  240|       |
  241|      1|  memset(&sa, 0, sizeof(sa));
  242|      1|  sa.sa_sigaction = crash_handler;
  243|      1|  sa.sa_flags = SA_SIGINFO;
  244|      1|  sigfillset(&sa.sa_mask);
  245|       |
  246|      7|  for (i = 0; trap_signals[i] >= 0; ++i) {
  ------------------
  |  Branch (246:15): [True: 6, False: 1]
  ------------------
  247|      6|    if (sigaction(trap_signals[i], &sa, NULL) == -1) {
  ------------------
  |  Branch (247:9): [True: 0, False: 6]
  ------------------
  248|       |      /* LCOV_EXCL_START */
  249|      0|      rv = -errno;
  250|       |      /* LCOV_EXCL_STOP */
  251|      0|    }
  252|      6|  }
  253|       |
  254|      1|  {
  255|       |    /* Now, generate (but do not log) a backtrace.  This ensures that
  256|       |     * libc has pre-loaded the symbols we need to dump things, so that later
  257|       |     * reads won't be denied by the sandbox code */
  258|      1|    char **symbols;
  259|      1|    void **cb_buf = lock_cb_buf();
  260|      1|    size_t depth = backtrace(cb_buf, MAX_DEPTH);
  ------------------
  |  |   79|      1|#define MAX_DEPTH 256
  ------------------
  261|      1|    symbols = backtrace_symbols(cb_buf, (int) depth);
  262|      1|    if (symbols)
  ------------------
  |  Branch (262:9): [True: 1, False: 0]
  ------------------
  263|      1|      raw_free(symbols);
  ------------------
  |  |   71|      1|#define raw_free free
  ------------------
  264|      1|    unlock_cb_buf(cb_buf);
  265|      1|  }
  266|       |
  267|      1|  return rv;
  268|      1|}

tor_log_set_sigsafe_err_fds:
  124|      1|{
  125|      1|  if (n > TOR_SIGSAFE_LOG_MAX_FDS) {
  ------------------
  |  |   37|      1|#define TOR_SIGSAFE_LOG_MAX_FDS 8
  ------------------
  |  Branch (125:7): [True: 0, False: 1]
  ------------------
  126|      0|    n = TOR_SIGSAFE_LOG_MAX_FDS;
  ------------------
  |  |   37|      0|#define TOR_SIGSAFE_LOG_MAX_FDS 8
  ------------------
  127|      0|  }
  128|       |
  129|       |  /* Clear the entire array. This code mitigates against some race conditions,
  130|       |   * but there are still some races here:
  131|       |   * - err logs are disabled while the array is cleared, and
  132|       |   * - a thread can read the old value of n_sigsafe_log_fds, then read a
  133|       |   *   partially written array.
  134|       |   * We could fix these races using atomics, but atomics use the err module. */
  135|      1|  n_sigsafe_log_fds = 0;
  136|      1|  memset(sigsafe_log_fds, 0, sizeof(sigsafe_log_fds));
  137|      1|  if (fds && n > 0) {
  ------------------
  |  Branch (137:7): [True: 1, False: 0]
  |  Branch (137:14): [True: 1, False: 0]
  ------------------
  138|      1|    memcpy(sigsafe_log_fds, fds, n * sizeof(int));
  139|      1|    n_sigsafe_log_fds = n;
  140|      1|  }
  141|      1|}
tor_log_reset_sigsafe_err_fds:
  148|      1|{
  149|       |  int fds[] = { STDERR_FILENO };
  150|      1|  tor_log_set_sigsafe_err_fds(fds, 1);
  151|      1|}

torerr_sys.c:subsys_torerr_initialize:
   20|      1|{
   21|      1|  if (configure_backtrace_handler(get_version()) < 0)
  ------------------
  |  Branch (21:7): [True: 0, False: 1]
  ------------------
   22|      0|    return -1;
   23|      1|  tor_log_reset_sigsafe_err_fds();
   24|       |
   25|      1|  return 0;
   26|      1|}

tor_init_libevent_rng:
  476|      1|{
  477|      1|  int rv = 0;
  478|      1|  char buf[256];
  479|      1|  if (evutil_secure_rng_init() < 0) {
  ------------------
  |  Branch (479:7): [True: 0, False: 1]
  ------------------
  480|      0|    rv = -1;
  481|      0|  }
  482|      1|  crypto_rand(buf, 32);
  483|      1|#ifdef HAVE_EVUTIL_SECURE_RNG_ADD_BYTES
  484|      1|  evutil_secure_rng_add_bytes(buf, 32);
  485|      1|#endif
  486|      1|  evutil_secure_rng_get_bytes(buf, sizeof(buf));
  487|      1|  return rv;
  488|      1|}

evloop_sys.c:subsys_evloop_initialize:
   20|      1|{
   21|      1|  if (tor_init_libevent_rng() < 0) {
  ------------------
  |  Branch (21:7): [True: 0, False: 1]
  ------------------
   22|      0|    log_warn(LD_NET, "Problem initializing libevent RNG.");
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  ------------------
   23|      0|    return -1;
   24|      0|  }
   25|      1|  return 0;
   26|      1|}

tor_locking_init:
   30|      2|{
   31|      2|  if (!attr_initialized) {
  ------------------
  |  Branch (31:7): [True: 1, False: 1]
  ------------------
   32|      1|    pthread_mutexattr_init(&attr_recursive);
   33|      1|    pthread_mutexattr_settype(&attr_recursive, PTHREAD_MUTEX_RECURSIVE);
   34|      1|    attr_initialized = 1;
   35|      1|  }
   36|      2|}
tor_mutex_init:
   42|      1|{
   43|      1|  if (PREDICT_UNLIKELY(!attr_initialized))
  ------------------
  |  |  182|      1|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   44|      1|    tor_locking_init(); // LCOV_EXCL_LINE
   45|      1|  const int err = pthread_mutex_init(&mutex->mutex, &attr_recursive);
   46|      1|  if (PREDICT_UNLIKELY(err)) {
  ------------------
  |  |  182|      1|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 0, False: 1]
  |  |  ------------------
  ------------------
   47|       |    // LCOV_EXCL_START
   48|      0|    raw_assert_unreached_msg("Error creating a mutex.");
  ------------------
  |  |   27|      0|#define raw_assert_unreached_msg(msg) STMT_BEGIN                    \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   28|      0|    tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg));  \
  |  |   29|      0|    tor_raw_abort_();                                               \
  |  |   30|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
   49|       |    // LCOV_EXCL_STOP
   50|      0|  }
   51|      1|}
tor_mutex_acquire:
   72|    667|{
   73|    667|  int err;
   74|    667|  raw_assert(m);
  ------------------
  |  |   20|    667|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|    667|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|    667|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 667]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|    667|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    667|#define STMT_END })
  |  |  ------------------
  ------------------
   75|    667|  err = pthread_mutex_lock(&m->mutex);
   76|    667|  if (PREDICT_UNLIKELY(err)) {
  ------------------
  |  |  182|    667|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 0, False: 667]
  |  |  ------------------
  ------------------
   77|       |    // LCOV_EXCL_START
   78|      0|    raw_assert_unreached_msg("Error locking a mutex.");
  ------------------
  |  |   27|      0|#define raw_assert_unreached_msg(msg) STMT_BEGIN                    \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   28|      0|    tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg));  \
  |  |   29|      0|    tor_raw_abort_();                                               \
  |  |   30|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
   79|       |    // LCOV_EXCL_STOP
   80|      0|  }
   81|    667|}
tor_mutex_release:
   85|    667|{
   86|    667|  int err;
   87|    667|  raw_assert(m);
  ------------------
  |  |   20|    667|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|    667|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|    667|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 667]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|    667|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    667|#define STMT_END })
  |  |  ------------------
  ------------------
   88|    667|  err = pthread_mutex_unlock(&m->mutex);
   89|    667|  if (PREDICT_UNLIKELY(err)) {
  ------------------
  |  |  182|    667|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 0, False: 667]
  |  |  ------------------
  ------------------
   90|       |    // LCOV_EXCL_START
   91|      0|    raw_assert_unreached_msg("Error unlocking a mutex.");
  ------------------
  |  |   27|      0|#define raw_assert_unreached_msg(msg) STMT_BEGIN                    \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   28|      0|    tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg));  \
  |  |   29|      0|    tor_raw_abort_();                                               \
  |  |   30|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
   92|       |    // LCOV_EXCL_STOP
   93|      0|  }
   94|    667|}

esc_for_log:
   31|    106|{
   32|    106|  const char *cp;
   33|    106|  char *result, *outp;
   34|    106|  size_t len = 3;
   35|    106|  if (!s) {
  ------------------
  |  Branch (35:7): [True: 0, False: 106]
  ------------------
   36|      0|    return tor_strdup("(null)");
  ------------------
  |  |   68|      0|#define tor_strdup(s)          tor_strdup_(s)
  ------------------
   37|      0|  }
   38|       |
   39|    524|  for (cp = s; *cp; ++cp) {
  ------------------
  |  Branch (39:16): [True: 418, False: 106]
  ------------------
   40|    418|    switch (*cp) {
   41|     19|      case '\\':
  ------------------
  |  Branch (41:7): [True: 19, False: 399]
  ------------------
   42|     41|      case '\"':
  ------------------
  |  Branch (42:7): [True: 22, False: 396]
  ------------------
   43|     61|      case '\'':
  ------------------
  |  Branch (43:7): [True: 20, False: 398]
  ------------------
   44|     80|      case '\r':
  ------------------
  |  Branch (44:7): [True: 19, False: 399]
  ------------------
   45|    107|      case '\n':
  ------------------
  |  Branch (45:7): [True: 27, False: 391]
  ------------------
   46|    130|      case '\t':
  ------------------
  |  Branch (46:7): [True: 23, False: 395]
  ------------------
   47|    130|        len += 2;
   48|    130|        break;
   49|    288|      default:
  ------------------
  |  Branch (49:7): [True: 288, False: 130]
  ------------------
   50|    288|        if (TOR_ISPRINT(*cp) && ((uint8_t)*cp)<127)
  ------------------
  |  Branch (50:13): [True: 143, False: 145]
  |  Branch (50:33): [True: 143, False: 0]
  ------------------
   51|    143|          ++len;
   52|    145|        else
   53|    145|          len += 4;
   54|    288|        break;
   55|    418|    }
   56|    418|  }
   57|       |
   58|    106|  tor_assert(len <= SSIZE_MAX);
  ------------------
  |  |  103|    106|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    106|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    106|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    106|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    106|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    106|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 106, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    106|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    106|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 106, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    106|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    106|    else                                        \
  |  |  |  |  |  |  |  |   80|    106|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    106|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    106|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    106|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    106|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    106|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   59|       |
   60|    106|  result = outp = tor_malloc(len);
  ------------------
  |  |   62|    106|#define tor_malloc(size)       tor_malloc_(size)
  ------------------
   61|    106|  *outp++ = '\"';
   62|    524|  for (cp = s; *cp; ++cp) {
  ------------------
  |  Branch (62:16): [True: 418, False: 106]
  ------------------
   63|       |    /* This assertion should always succeed, since we will write at least
   64|       |     * one char here, and two chars for closing quote and nul later */
   65|    418|    tor_assert((outp-result) < (ssize_t)len-2);
  ------------------
  |  |  103|    418|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    418|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    418|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    418|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    418|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    418|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 418, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    418|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    418|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 418, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    418|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    418|    else                                        \
  |  |  |  |  |  |  |  |   80|    418|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    418|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    418|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    418|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    418|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    418|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   66|    418|    switch (*cp) {
   67|     19|      case '\\':
  ------------------
  |  Branch (67:7): [True: 19, False: 399]
  ------------------
   68|     41|      case '\"':
  ------------------
  |  Branch (68:7): [True: 22, False: 396]
  ------------------
   69|     61|      case '\'':
  ------------------
  |  Branch (69:7): [True: 20, False: 398]
  ------------------
   70|     61|        *outp++ = '\\';
   71|     61|        *outp++ = *cp;
   72|     61|        break;
   73|     27|      case '\n':
  ------------------
  |  Branch (73:7): [True: 27, False: 391]
  ------------------
   74|     27|        *outp++ = '\\';
   75|     27|        *outp++ = 'n';
   76|     27|        break;
   77|     23|      case '\t':
  ------------------
  |  Branch (77:7): [True: 23, False: 395]
  ------------------
   78|     23|        *outp++ = '\\';
   79|     23|        *outp++ = 't';
   80|     23|        break;
   81|     19|      case '\r':
  ------------------
  |  Branch (81:7): [True: 19, False: 399]
  ------------------
   82|     19|        *outp++ = '\\';
   83|     19|        *outp++ = 'r';
   84|     19|        break;
   85|    288|      default:
  ------------------
  |  Branch (85:7): [True: 288, False: 130]
  ------------------
   86|    288|        if (TOR_ISPRINT(*cp) && ((uint8_t)*cp)<127) {
  ------------------
  |  Branch (86:13): [True: 143, False: 145]
  |  Branch (86:33): [True: 143, False: 0]
  ------------------
   87|    143|          *outp++ = *cp;
   88|    145|        } else {
   89|    145|          tor_assert((outp-result) < (ssize_t)len-4);
  ------------------
  |  |  103|    145|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    145|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    145|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    145|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    145|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    145|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 145, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    145|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    145|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 145, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    145|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    145|    else                                        \
  |  |  |  |  |  |  |  |   80|    145|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    145|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    145|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    145|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    145|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    145|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|    145|          tor_snprintf(outp, 5, "\\%03o", (int)(uint8_t) *cp);
   91|    145|          outp += 4;
   92|    145|        }
   93|    288|        break;
   94|    418|    }
   95|    418|  }
   96|       |
   97|    106|  tor_assert((outp-result) <= (ssize_t)len-2);
  ------------------
  |  |  103|    106|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    106|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    106|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    106|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    106|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    106|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 106, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    106|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    106|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 106, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    106|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    106|    else                                        \
  |  |  |  |  |  |  |  |   80|    106|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    106|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    106|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    106|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    106|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    106|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   98|    106|  *outp++ = '\"';
   99|    106|  *outp++ = 0;
  100|       |
  101|    106|  return result;
  102|    106|}
escaped:
  127|    106|{
  128|    106|  static char *escaped_val_ = NULL;
  129|    106|  tor_free(escaped_val_);
  ------------------
  |  |   47|    106|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|    106|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|    106|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|    106|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|    106|                                                 struct event *), \
  |  |   51|    106|                   "use tor_event_free for struct event *");   \
  |  |   52|    106|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|    106|#define raw_free    free
  |  |  ------------------
  |  |   53|    106|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|    106|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    106|#define STMT_END })
  |  |  ------------------
  ------------------
  130|       |
  131|    106|  if (s)
  ------------------
  |  Branch (131:7): [True: 106, False: 0]
  ------------------
  132|    106|    escaped_val_ = esc_for_log(s);
  133|      0|  else
  134|      0|    escaped_val_ = NULL;
  135|       |
  136|    106|  return escaped_val_;
  137|    106|}

logv__real:
  537|    666|{
  538|    666|  char buf[10240];
  539|    666|  size_t msg_len = 0;
  540|    666|  int formatted = 0;
  541|    666|  logfile_t *lf;
  542|    666|  char *end_of_prefix=NULL;
  543|    666|  int callbacks_deferred = 0;
  544|       |
  545|       |  /* Call raw_assert, not tor_assert, since tor_assert calls log on failure. */
  546|    666|  raw_assert(format);
  ------------------
  |  |   20|    666|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|    666|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|    666|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 666]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|    666|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    666|#define STMT_END })
  |  |  ------------------
  ------------------
  547|       |  /* check that severity is sane.  Overrunning the masks array leads to
  548|       |   * interesting and hard to diagnose effects */
  549|    666|  raw_assert(severity >= LOG_ERR && severity <= LOG_DEBUG);
  ------------------
  |  |   20|    666|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|    666|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  1.33k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:11): [True: 666, False: 0]
  |  |  |  Branch (21:11): [True: 666, False: 0]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|    666|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    666|#define STMT_END })
  |  |  ------------------
  ------------------
  550|       |
  551|  1.33k|  LOCK_LOGS();
  ------------------
  |  |  176|    666|#define LOCK_LOGS() STMT_BEGIN                                          \
  |  |  ------------------
  |  |  |  |  204|    666|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  177|    666|  raw_assert(log_mutex_initialized);                                    \
  |  |  ------------------
  |  |  |  |   20|    666|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    666|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |   21|    666|    if (!(expr)) {                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (21:9): [True: 0, False: 666]
  |  |  |  |  ------------------
  |  |  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |  |  |   24|      0|    }                                                                   \
  |  |  |  |   25|    666|  STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    666|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  178|    666|  tor_mutex_acquire(&log_mutex);                                        \
  |  |  179|    666|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    666|#define STMT_END })
  |  |  ------------------
  ------------------
  552|       |
  553|  1.33k|  if ((! (domain & LD_NOCB)) && pending_cb_messages
  ------------------
  |  |  144|    666|#define LD_NOCB (UINT64_C(1)<<62)
  ------------------
  |  Branch (553:7): [True: 666, False: 0]
  |  Branch (553:33): [True: 666, False: 0]
  ------------------
  554|    666|      && smartlist_len(pending_cb_messages))
  ------------------
  |  |   81|    666|#define smartlist_len(sl) ((sl)->num_used)
  |  |  ------------------
  |  |  |  Branch (81:27): [True: 0, False: 666]
  |  |  ------------------
  ------------------
  555|      0|    flush_pending_log_callbacks();
  556|       |
  557|  1.33k|  if (queue_startup_messages &&
  ------------------
  |  Branch (557:7): [True: 1, False: 665]
  ------------------
  558|      1|      pending_startup_messages_len < MAX_STARTUP_MSG_LEN) {
  ------------------
  |  |  173|      1|#define MAX_STARTUP_MSG_LEN (1<<16)
  ------------------
  |  Branch (558:7): [True: 1, False: 0]
  ------------------
  559|      1|    end_of_prefix =
  560|      1|      format_msg(buf, sizeof(buf), domain, severity, funcname, suffix,
  561|      1|      format, ap, &msg_len);
  562|      1|    formatted = 1;
  563|       |
  564|      1|    smartlist_add(pending_startup_messages,
  565|      1|      pending_log_message_new(severity,domain,buf,end_of_prefix));
  566|      1|    pending_startup_messages_len += msg_len;
  567|      1|  }
  568|       |
  569|  1.33k|  for (lf = logfiles; lf; lf = lf->next) {
  ------------------
  |  Branch (569:23): [True: 0, False: 666]
  ------------------
  570|      0|    if (! logfile_wants_message(lf, severity, domain))
  ------------------
  |  Branch (570:9): [True: 0, False: 0]
  ------------------
  571|      0|      continue;
  572|       |
  573|      0|    if (!formatted) {
  ------------------
  |  Branch (573:9): [True: 0, False: 0]
  ------------------
  574|      0|      end_of_prefix =
  575|      0|        format_msg(buf, sizeof(buf), domain, severity, funcname, suffix,
  576|      0|                   format, ap, &msg_len);
  577|      0|      formatted = 1;
  578|      0|    }
  579|       |
  580|      0|    logfile_deliver(lf, buf, msg_len, end_of_prefix, domain, severity,
  581|      0|      &callbacks_deferred);
  582|      0|  }
  583|  1.33k|  UNLOCK_LOGS();
  ------------------
  |  |  181|    666|#define UNLOCK_LOGS() STMT_BEGIN                                        \
  |  |  ------------------
  |  |  |  |  204|    666|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  182|    666|  raw_assert(log_mutex_initialized);                                    \
  |  |  ------------------
  |  |  |  |   20|    666|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    666|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |   21|    666|    if (!(expr)) {                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (21:9): [True: 0, False: 666]
  |  |  |  |  ------------------
  |  |  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |  |  |   24|      0|    }                                                                   \
  |  |  |  |   25|    666|  STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    666|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|    666|  tor_mutex_release(&log_mutex);                                        \
  |  |  184|    666|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    666|#define STMT_END })
  |  |  ------------------
  ------------------
  584|    666|}
log_fn_:
  708|  2.09k|{
  709|  2.09k|  va_list ap;
  710|  2.09k|  if ((domain & LD_BUG) && (severity >= LOG_WARN))
  ------------------
  |  |   86|  2.09k|#define LD_BUG      (UINT64_C(1)<<12)
  ------------------
                if ((domain & LD_BUG) && (severity >= LOG_WARN))
  ------------------
  |  |   24|      0|#define LOG_WARN LOG_WARNING
  ------------------
  |  Branch (710:7): [True: 0, False: 2.09k]
  |  Branch (710:28): [True: 0, False: 0]
  ------------------
  711|      0|    tor_bug_increment_count_();
  712|  2.09k|  if (severity > log_global_min_severity_)
  ------------------
  |  Branch (712:7): [True: 1.42k, False: 666]
  ------------------
  713|  1.42k|    return;
  714|  2.09k|  va_start(ap,format);
  715|    666|  logv(severity, domain, fn, NULL, format, ap);
  716|       |  va_end(ap);
  717|    666|}
init_logging:
  917|      1|{
  918|      1|  if (!log_mutex_initialized) {
  ------------------
  |  Branch (918:7): [True: 1, False: 0]
  ------------------
  919|      1|    tor_mutex_init(&log_mutex);
  920|      1|    tor_bug_init_counter();
  921|      1|    log_mutex_initialized = 1;
  922|      1|  }
  923|      1|#ifdef __GNUC__
  924|      1|  if (strchr(__PRETTY_FUNCTION__, '(')) {
  ------------------
  |  Branch (924:7): [True: 1, False: 0]
  ------------------
  925|      1|    pretty_fn_has_parens = 1;
  926|      1|  }
  927|      1|#endif
  928|      1|  if (pending_cb_messages == NULL)
  ------------------
  |  Branch (928:7): [True: 1, False: 0]
  ------------------
  929|      1|    pending_cb_messages = smartlist_new();
  930|      1|  if (disable_startup_queue)
  ------------------
  |  Branch (930:7): [True: 0, False: 1]
  ------------------
  931|      0|    queue_startup_messages = 0;
  932|      1|  if (pending_startup_messages == NULL && queue_startup_messages) {
  ------------------
  |  Branch (932:7): [True: 1, False: 0]
  |  Branch (932:43): [True: 1, False: 0]
  ------------------
  933|      1|    pending_startup_messages = smartlist_new();
  934|      1|  }
  935|      1|}
flush_log_messages_from_startup:
 1065|      1|{
 1066|      1|  logfile_t *lf;
 1067|       |
 1068|      1|  LOCK_LOGS();
  ------------------
  |  |  176|      1|#define LOCK_LOGS() STMT_BEGIN                                          \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  177|      1|  raw_assert(log_mutex_initialized);                                    \
  |  |  ------------------
  |  |  |  |   20|      1|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |   21|      1|    if (!(expr)) {                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (21:9): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |  |  |   24|      0|    }                                                                   \
  |  |  |  |   25|      1|  STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  178|      1|  tor_mutex_acquire(&log_mutex);                                        \
  |  |  179|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
 1069|      1|  queue_startup_messages = 0;
 1070|      1|  pending_startup_messages_len = 0;
 1071|      1|  if (! pending_startup_messages)
  ------------------
  |  Branch (1071:7): [True: 0, False: 1]
  ------------------
 1072|      0|    goto out;
 1073|       |
 1074|      1|  SMARTLIST_FOREACH_BEGIN(pending_startup_messages, pending_log_message_t *,
  ------------------
  |  |   79|      1|  STMT_BEGIN                                                    \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   80|      1|    int var ## _sl_idx, var ## _sl_len=(sl)->num_used;          \
  |  |   81|      1|    type var;                                                   \
  |  |   82|      2|    for (var ## _sl_idx = 0; var ## _sl_idx < var ## _sl_len;   \
  |  |  ------------------
  |  |  |  Branch (82:30): [True: 1, False: 1]
  |  |  ------------------
  |  |   83|      1|         ++var ## _sl_idx) {                                    \
  |  |   84|      1|      var = (sl)->list[var ## _sl_idx];
  ------------------
 1075|      1|                          msg) {
 1076|      1|    int callbacks_deferred = 0;
 1077|      1|    for (lf = logfiles; lf; lf = lf->next) {
  ------------------
  |  Branch (1077:25): [True: 0, False: 1]
  ------------------
 1078|      0|      if (! logfile_wants_message(lf, msg->severity, msg->domain))
  ------------------
  |  Branch (1078:11): [True: 0, False: 0]
  ------------------
 1079|      0|        continue;
 1080|       |
 1081|       |      /* We configure a temporary startup log that goes to stdout, so we
 1082|       |       * shouldn't replay to stdout/stderr*/
 1083|      0|      if (lf->fd == STDOUT_FILENO || lf->fd == STDERR_FILENO) {
  ------------------
  |  Branch (1083:11): [True: 0, False: 0]
  |  Branch (1083:38): [True: 0, False: 0]
  ------------------
 1084|      0|        continue;
 1085|      0|      }
 1086|       |
 1087|      0|      logfile_deliver(lf, msg->fullmsg, strlen(msg->fullmsg), msg->msg,
 1088|      0|                      msg->domain, msg->severity, &callbacks_deferred);
 1089|      0|    }
 1090|      1|    pending_log_message_free(msg);
  ------------------
  |  |  432|      1|  FREE_AND_NULL(pending_log_message_t, pending_log_message_free_, (msg))
  |  |  ------------------
  |  |  |  |   85|      1|  do {                                                                  \
  |  |  |  |   86|      1|    /* only evaluate (var) once. */                                     \
  |  |  |  |   87|      1|    typename **tmp__free__ptr ## freefn = &(var);                       \
  |  |  |  |   88|      1|    freefn(*tmp__free__ptr ## freefn);                                  \
  |  |  |  |   89|      1|    (*tmp__free__ptr ## freefn) = NULL;                                 \
  |  |  |  |   90|      1|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:12): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1091|      1|  } SMARTLIST_FOREACH_END(msg);
  ------------------
  |  |  100|      1|    var = NULL;                                 \
  |  |  101|      1|    (void) var ## _sl_idx;                      \
  |  |  102|      1|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
 1092|      1|  smartlist_free(pending_startup_messages);
  ------------------
  |  |   40|      1|#define smartlist_free(sl) FREE_AND_NULL(smartlist_t, smartlist_free_, (sl))
  |  |  ------------------
  |  |  |  |   85|      1|  do {                                                                  \
  |  |  |  |   86|      1|    /* only evaluate (var) once. */                                     \
  |  |  |  |   87|      1|    typename **tmp__free__ptr ## freefn = &(var);                       \
  |  |  |  |   88|      1|    freefn(*tmp__free__ptr ## freefn);                                  \
  |  |  |  |   89|      1|    (*tmp__free__ptr ## freefn) = NULL;                                 \
  |  |  |  |   90|      1|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:12): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1093|      1|  pending_startup_messages = NULL;
 1094|       |
 1095|      1| out:
 1096|      1|  UNLOCK_LOGS();
  ------------------
  |  |  181|      1|#define UNLOCK_LOGS() STMT_BEGIN                                        \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |  182|      1|  raw_assert(log_mutex_initialized);                                    \
  |  |  ------------------
  |  |  |  |   20|      1|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |   21|      1|    if (!(expr)) {                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (21:9): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |  |  |   24|      0|    }                                                                   \
  |  |  |  |   25|      1|  STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  183|      1|  tor_mutex_release(&log_mutex);                                        \
  |  |  184|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
 1097|      1|}
log.c:format_msg:
  335|      1|{
  336|      1|  size_t n;
  337|      1|  int r;
  338|      1|  char *end_of_prefix;
  339|      1|  char *buf_end;
  340|       |
  341|      1|  raw_assert(buf_len >= 16); /* prevent integer underflow and stupidity */
  ------------------
  |  |   20|      1|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|      1|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  342|      1|  buf_len -= 2; /* subtract 2 characters so we have room for \n\0 */
  343|      1|  buf_end = buf+buf_len; /* point *after* the last char we can write to */
  344|       |
  345|      1|  n = log_prefix_(buf, buf_len, severity);
  346|      1|  end_of_prefix = buf+n;
  347|       |
  348|      1|  if (log_domains_are_logged) {
  ------------------
  |  Branch (348:7): [True: 0, False: 1]
  ------------------
  349|      0|    char *cp = buf+n;
  350|      0|    if (cp == buf_end) goto format_msg_no_room_for_domains;
  ------------------
  |  Branch (350:9): [True: 0, False: 0]
  ------------------
  351|      0|    *cp++ = '{';
  352|      0|    if (cp == buf_end) goto format_msg_no_room_for_domains;
  ------------------
  |  Branch (352:9): [True: 0, False: 0]
  ------------------
  353|      0|    cp = domain_to_string(domain, cp, (buf+buf_len-cp));
  354|      0|    if (cp == buf_end) goto format_msg_no_room_for_domains;
  ------------------
  |  Branch (354:9): [True: 0, False: 0]
  ------------------
  355|      0|    *cp++ = '}';
  356|      0|    if (cp == buf_end) goto format_msg_no_room_for_domains;
  ------------------
  |  Branch (356:9): [True: 0, False: 0]
  ------------------
  357|      0|    *cp++ = ' ';
  358|      0|    if (cp == buf_end) goto format_msg_no_room_for_domains;
  ------------------
  |  Branch (358:9): [True: 0, False: 0]
  ------------------
  359|      0|    end_of_prefix = cp;
  360|      0|    n = cp-buf;
  361|      0|  format_msg_no_room_for_domains:
  362|       |    /* This will leave end_of_prefix and n unchanged, and thus cause
  363|       |     * whatever log domain string we had written to be clobbered. */
  364|      0|    ;
  365|      0|  }
  366|       |
  367|      1|  if (funcname && should_log_function_name(domain, severity)) {
  ------------------
  |  Branch (367:7): [True: 1, False: 0]
  |  Branch (367:19): [True: 0, False: 1]
  ------------------
  368|      0|    r = tor_snprintf(buf+n, buf_len-n,
  369|      0|                     pretty_fn_has_parens ? "%s: " : "%s(): ",
  ------------------
  |  Branch (369:22): [True: 0, False: 0]
  ------------------
  370|      0|                     funcname);
  371|      0|    if (r<0)
  ------------------
  |  Branch (371:9): [True: 0, False: 0]
  ------------------
  372|      0|      n = strlen(buf);
  373|      0|    else
  374|      0|      n += r;
  375|      0|  }
  376|       |
  377|      1|  if (domain == LD_BUG && buf_len-n > 6) {
  ------------------
  |  |   86|      2|#define LD_BUG      (UINT64_C(1)<<12)
  ------------------
  |  Branch (377:7): [True: 0, False: 1]
  |  Branch (377:27): [True: 0, False: 0]
  ------------------
  378|      0|    memcpy(buf+n, "Bug: ", 6);
  379|      0|    n += 5;
  380|      0|  }
  381|       |
  382|      1|  r = tor_vsnprintf(buf+n,buf_len-n,format,ap);
  383|      1|  if (r < 0) {
  ------------------
  |  Branch (383:7): [True: 0, False: 1]
  ------------------
  384|       |    /* The message was too long; overwrite the end of the buffer with
  385|       |     * "[...truncated]" */
  386|      0|    if (buf_len >= TRUNCATED_STR_LEN) {
  ------------------
  |  |   59|      0|#define TRUNCATED_STR_LEN 14
  ------------------
  |  Branch (386:9): [True: 0, False: 0]
  ------------------
  387|      0|      size_t offset = buf_len-TRUNCATED_STR_LEN;
  ------------------
  |  |   59|      0|#define TRUNCATED_STR_LEN 14
  ------------------
  388|       |      /* We have an extra 2 characters after buf_len to hold the \n\0,
  389|       |       * so it's safe to add 1 to the size here. */
  390|      0|      strlcpy(buf+offset, TRUNCATED_STR, buf_len-offset+1);
  ------------------
  |  |   58|      0|#define TRUNCATED_STR "[...truncated]"
  ------------------
  391|      0|    }
  392|       |    /* Set 'n' to the end of the buffer, where we'll be writing \n\0.
  393|       |     * Since we already subtracted 2 from buf_len, this is safe.*/
  394|      0|    n = buf_len;
  395|      1|  } else {
  396|      1|    n += r;
  397|      1|    if (suffix) {
  ------------------
  |  Branch (397:9): [True: 0, False: 1]
  ------------------
  398|      0|      size_t suffix_len = strlen(suffix);
  399|      0|      if (buf_len-n >= suffix_len) {
  ------------------
  |  Branch (399:11): [True: 0, False: 0]
  ------------------
  400|      0|        memcpy(buf+n, suffix, suffix_len);
  401|      0|        n += suffix_len;
  402|      0|      }
  403|      0|    }
  404|      1|  }
  405|       |
  406|      1|  if (domain == LD_BUG &&
  ------------------
  |  |   86|      2|#define LD_BUG      (UINT64_C(1)<<12)
  ------------------
  |  Branch (406:7): [True: 0, False: 1]
  ------------------
  407|      0|      buf_len - n > strlen(tor_bug_suffix)+1) {
  ------------------
  |  Branch (407:7): [True: 0, False: 0]
  ------------------
  408|      0|    memcpy(buf+n, tor_bug_suffix, strlen(tor_bug_suffix));
  409|      0|    n += strlen(tor_bug_suffix);
  410|      0|  }
  411|       |
  412|      1|  buf[n]='\n';
  413|      1|  buf[n+1]='\0';
  414|      1|  *msg_len_out = n+1;
  415|      1|  return end_of_prefix;
  416|      1|}
log.c:log_prefix_:
  259|      1|{
  260|      1|  time_t t;
  261|      1|  struct timeval now;
  262|      1|  struct tm tm;
  263|      1|  size_t n;
  264|      1|  int r, ms;
  265|       |
  266|      1|  tor_gettimeofday(&now);
  267|      1|  t = (time_t)now.tv_sec;
  268|      1|  ms = (int)now.tv_usec / 1000;
  269|      1|  if (log_time_granularity >= 1000) {
  ------------------
  |  Branch (269:7): [True: 0, False: 1]
  ------------------
  270|      0|    t -= t % (log_time_granularity / 1000);
  271|      0|    ms = 0;
  272|      1|  } else {
  273|      1|    ms -= ((int)now.tv_usec / 1000) % log_time_granularity;
  274|      1|  }
  275|       |
  276|      1|  n = strftime(buf, buf_len, "%b %d %H:%M:%S",
  277|      1|               tor_localtime_r_msg(&t, &tm, NULL));
  278|      1|  r = tor_snprintf(buf+n, buf_len-n, ".%.3i [%s] ", ms,
  279|      1|                   sev_to_string(severity));
  280|       |
  281|      1|  if (r<0)
  ------------------
  |  Branch (281:7): [True: 0, False: 1]
  ------------------
  282|      0|    return buf_len-1;
  283|      1|  else
  284|      1|    return n+r;
  285|      1|}
log.c:should_log_function_name:
  106|      1|{
  107|      1|  switch (severity) {
  108|      0|    case LOG_DEBUG:
  ------------------
  |  Branch (108:5): [True: 0, False: 1]
  ------------------
  109|      0|    case LOG_INFO:
  ------------------
  |  Branch (109:5): [True: 0, False: 1]
  ------------------
  110|       |      /* All debugging messages occur in interesting places. */
  111|      0|      return (domain & LD_NOFUNCNAME) == 0;
  ------------------
  |  |  147|      0|#define LD_NOFUNCNAME (UINT64_C(1)<<63)
  ------------------
  112|      1|    case LOG_NOTICE:
  ------------------
  |  Branch (112:5): [True: 1, False: 0]
  ------------------
  113|      1|    case LOG_WARN:
  ------------------
  |  |   24|      1|#define LOG_WARN LOG_WARNING
  ------------------
  |  Branch (113:5): [True: 0, False: 1]
  ------------------
  114|      1|    case LOG_ERR:
  ------------------
  |  Branch (114:5): [True: 0, False: 1]
  ------------------
  115|       |      /* We care about places where bugs occur. */
  116|      1|      return (domain & (LD_BUG|LD_NOFUNCNAME)) == LD_BUG;
  ------------------
  |  |   86|      1|#define LD_BUG      (UINT64_C(1)<<12)
  ------------------
                    return (domain & (LD_BUG|LD_NOFUNCNAME)) == LD_BUG;
  ------------------
  |  |  147|      1|#define LD_NOFUNCNAME (UINT64_C(1)<<63)
  ------------------
                    return (domain & (LD_BUG|LD_NOFUNCNAME)) == LD_BUG;
  ------------------
  |  |   86|      1|#define LD_BUG      (UINT64_C(1)<<12)
  ------------------
  117|      0|    default:
  ------------------
  |  Branch (117:5): [True: 0, False: 1]
  ------------------
  118|       |      /* Call raw_assert, not tor_assert, since tor_assert calls
  119|       |       * log on failure. */
  120|      0|      raw_assert(0); return 0; // LCOV_EXCL_LINE
  ------------------
  |  |   20|      0|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|      0|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, Folded]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
  121|      1|  }
  122|      1|}
log.c:pending_log_message_new:
  422|      1|{
  423|      1|  pending_log_message_t *m = tor_malloc(sizeof(pending_log_message_t));
  ------------------
  |  |   62|      1|#define tor_malloc(size)       tor_malloc_(size)
  ------------------
  424|      1|  m->severity = severity;
  425|      1|  m->domain = domain;
  426|      1|  m->fullmsg = fullmsg ? tor_strdup(fullmsg) : NULL;
  ------------------
  |  |   68|      1|#define tor_strdup(s)          tor_strdup_(s)
  ------------------
  |  Branch (426:16): [True: 1, False: 0]
  ------------------
  427|      1|  m->msg = tor_strdup(shortmsg);
  ------------------
  |  |   68|      1|#define tor_strdup(s)          tor_strdup_(s)
  ------------------
  428|      1|  return m;
  429|      1|}
log.c:pending_log_message_free_:
  437|      1|{
  438|      1|  if (!msg)
  ------------------
  |  Branch (438:7): [True: 0, False: 1]
  ------------------
  439|      0|    return;
  440|      1|  tor_free(msg->msg);
  ------------------
  |  |   47|      1|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|      1|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|      1|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|      1|                                                 struct event *), \
  |  |   51|      1|                   "use tor_event_free for struct event *");   \
  |  |   52|      1|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|      1|#define raw_free    free
  |  |  ------------------
  |  |   53|      1|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  441|      1|  tor_free(msg->fullmsg);
  ------------------
  |  |   47|      1|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|      1|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|      1|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|      1|                                                 struct event *), \
  |  |   51|      1|                   "use tor_event_free for struct event *");   \
  |  |   52|      1|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|      1|#define raw_free    free
  |  |  ------------------
  |  |   53|      1|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  442|       |  tor_free(msg);
  ------------------
  |  |   47|      1|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|      1|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|      1|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|      1|                                                 struct event *), \
  |  |   51|      1|                   "use tor_event_free for struct event *");   \
  |  |   52|      1|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|      1|#define raw_free    free
  |  |  ------------------
  |  |   53|      1|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|      1|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      1|#define STMT_END })
  |  |  ------------------
  ------------------
  443|      1|}
log.c:sev_to_string:
   90|      1|{
   91|      1|  switch (severity) {
   92|      0|    case LOG_DEBUG:   return "debug";
  ------------------
  |  Branch (92:5): [True: 0, False: 1]
  ------------------
   93|      0|    case LOG_INFO:    return "info";
  ------------------
  |  Branch (93:5): [True: 0, False: 1]
  ------------------
   94|      1|    case LOG_NOTICE:  return "notice";
  ------------------
  |  Branch (94:5): [True: 1, False: 0]
  ------------------
   95|      0|    case LOG_WARN:    return "warn";
  ------------------
  |  |   24|      0|#define LOG_WARN LOG_WARNING
  ------------------
  |  Branch (95:5): [True: 0, False: 1]
  ------------------
   96|      0|    case LOG_ERR:     return "err";
  ------------------
  |  Branch (96:5): [True: 0, False: 1]
  ------------------
   97|      0|    default:     /* Call raw_assert, not tor_assert, since tor_assert
  ------------------
  |  Branch (97:5): [True: 0, False: 1]
  ------------------
   98|       |                  * calls log on failure. */
   99|      0|                 raw_assert_unreached(); return "UNKNOWN"; // LCOV_EXCL_LINE
  ------------------
  |  |   26|      0|#define raw_assert_unreached(expr) raw_assert(0)
  |  |  ------------------
  |  |  |  |   20|      0|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |   21|      0|    if (!(expr)) {                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (21:9): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |  |  |   24|      0|    }                                                                   \
  |  |  |  |   25|      0|  STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|      1|  }
  101|      1|}

subsysmgr.c:debug_logging_enabled:
  218|     13|{
  219|     13|  return PREDICT_UNLIKELY(log_global_min_severity_ == LOG_DEBUG);
  ------------------
  |  |  182|     13|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  ------------------
  220|     13|}
proto_socks.c:debug_logging_enabled:
  218|    520|{
  219|    520|  return PREDICT_UNLIKELY(log_global_min_severity_ == LOG_DEBUG);
  ------------------
  |  |  182|    520|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  ------------------
  220|    520|}

log_sys.c:subsys_logging_initialize:
   21|      1|{
   22|      1|  init_logging(0);
   23|      1|  the_store = metrics_store_new();
   24|      1|  return 0;
   25|      1|}

rate_limit_log:
   43|    242|{
   44|    242|  int n;
   45|    242|  if ((n = rate_limit_is_ready(lim, now))) {
  ------------------
  |  Branch (45:7): [True: 1, False: 241]
  ------------------
   46|      1|    time_t started_limiting = lim->started_limiting;
   47|      1|    lim->started_limiting = 0;
   48|      1|    if (n == 1) {
  ------------------
  |  Branch (48:9): [True: 1, False: 0]
  ------------------
   49|      1|      return tor_strdup("");
  ------------------
  |  |   68|      1|#define tor_strdup(s)          tor_strdup_(s)
  ------------------
   50|      1|    } else {
   51|      0|      char *cp=NULL;
   52|      0|      const char *opt_over = (n >= RATELIM_TOOMANY) ? "over " : "";
  ------------------
  |  |   57|      0|#define RATELIM_TOOMANY (16*1000*1000)
  ------------------
  |  Branch (52:30): [True: 0, False: 0]
  ------------------
   53|      0|      unsigned difference = (unsigned)(now - started_limiting);
   54|      0|      difference = round_to_next_multiple_of(difference, 60);
   55|      0|      tor_asprintf(&cp,
   56|      0|                   " [%s%d similar message(s) suppressed in last %d seconds]",
   57|      0|                   opt_over, n-1, (int)difference);
   58|      0|      return cp;
   59|      0|    }
   60|    241|  } else {
   61|    241|    if (lim->started_limiting == 0) {
  ------------------
  |  Branch (61:9): [True: 1, False: 240]
  ------------------
   62|      1|      lim->started_limiting = now;
   63|      1|    }
   64|       |    return NULL;
   65|    241|  }
   66|    242|}
ratelim.c:rate_limit_is_ready:
   23|    242|{
   24|    242|  if (lim->rate + lim->last_allowed <= now) {
  ------------------
  |  Branch (24:7): [True: 1, False: 241]
  ------------------
   25|      1|    int res = lim->n_calls_since_last_time + 1;
   26|      1|    lim->last_allowed = now;
   27|      1|    lim->n_calls_since_last_time = 0;
   28|      1|    return res;
   29|    241|  } else {
   30|    241|    if (lim->n_calls_since_last_time <= RATELIM_TOOMANY) {
  ------------------
  |  |   57|    241|#define RATELIM_TOOMANY (16*1000*1000)
  ------------------
  |  Branch (30:9): [True: 241, False: 0]
  ------------------
   31|    241|      ++lim->n_calls_since_last_time;
   32|    241|    }
   33|       |
   34|    241|    return 0;
   35|    241|  }
   36|    242|}

tor_set_failed_assertion_callback:
   65|      1|{
   66|      1|  failed_assertion_cb = fn;
   67|      1|}
tor_bug_init_counter:
  109|      1|{
  110|      1|  atomic_counter_init(&total_bug_reached);
  111|      1|}

tor_malloc_:
   33|  14.3k|{
   34|  14.3k|  void *result;
   35|       |
   36|  14.3k|  raw_assert(size < SIZE_T_CEILING);
  ------------------
  |  |   20|  14.3k|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|  14.3k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  14.3k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 14.3k]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|  14.3k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  14.3k|#define STMT_END })
  |  |  ------------------
  ------------------
   37|       |
   38|       |#ifndef MALLOC_ZERO_WORKS
   39|       |  /* Some libc mallocs don't work when size==0. Override them. */
   40|       |  if (size==0) {
   41|       |    size=1;
   42|       |  }
   43|       |#endif /* !defined(MALLOC_ZERO_WORKS) */
   44|       |
   45|  14.3k|  result = raw_malloc(size);
  ------------------
  |  |   76|  14.3k|#define raw_malloc  malloc
  ------------------
   46|       |
   47|  14.3k|  if (PREDICT_UNLIKELY(result == NULL)) {
  ------------------
  |  |  182|  14.3k|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 0, False: 14.3k]
  |  |  ------------------
  ------------------
   48|       |    /* LCOV_EXCL_START */
   49|       |    /* If these functions die within a worker process, they won't call
   50|       |     * spawn_exit, but that's ok, since the parent will run out of memory soon
   51|       |     * anyway. */
   52|      0|    raw_assert_unreached_msg("Out of memory on malloc(). Dying.");
  ------------------
  |  |   27|      0|#define raw_assert_unreached_msg(msg) STMT_BEGIN                    \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   28|      0|    tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg));  \
  |  |   29|      0|    tor_raw_abort_();                                               \
  |  |   30|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
   53|       |    /* LCOV_EXCL_STOP */
   54|      0|  }
   55|  14.3k|  return result;
   56|  14.3k|}
tor_malloc_zero_:
   64|  6.68k|{
   65|       |  /* You may ask yourself, "wouldn't it be smart to use calloc instead of
   66|       |   * malloc+memset?  Perhaps libc's calloc knows some nifty optimization trick
   67|       |   * we don't!"  Indeed it does, but its optimizations are only a big win when
   68|       |   * we're allocating something very big (it knows if it just got the memory
   69|       |   * from the OS in a pre-zeroed state).  We don't want to use tor_malloc_zero
   70|       |   * for big stuff, so we don't bother with calloc. */
   71|  6.68k|  void *result = tor_malloc_(size);
   72|  6.68k|  memset(result, 0, size);
   73|  6.68k|  return result;
   74|  6.68k|}
size_mul_check:
   87|  4.54k|{
   88|       |  /* This first check is equivalent to
   89|       |     (x < SQRT_SIZE_MAX_P1 && y < SQRT_SIZE_MAX_P1)
   90|       |
   91|       |     Rationale: if either one of x or y is >= SQRT_SIZE_MAX_P1, then it
   92|       |     will have some bit set in its most significant half.
   93|       |   */
   94|  4.54k|  return ((x|y) < SQRT_SIZE_MAX_P1 ||
  ------------------
  |  |   81|  9.09k|#define SQRT_SIZE_MAX_P1 (((size_t)1) << (sizeof(size_t)*4))
  ------------------
  |  Branch (94:11): [True: 4.54k, False: 0]
  ------------------
   95|      0|          y == 0 ||
  ------------------
  |  Branch (95:11): [True: 0, False: 0]
  ------------------
   96|      0|          x <= SIZE_MAX / y);
  ------------------
  |  Branch (96:11): [True: 0, False: 0]
  ------------------
   97|  4.54k|}
tor_calloc_:
  108|  3.37k|{
  109|  3.37k|  raw_assert(size_mul_check(nmemb, size));
  ------------------
  |  |   20|  3.37k|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|  3.37k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  3.37k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 3.37k]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|  3.37k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  3.37k|#define STMT_END })
  |  |  ------------------
  ------------------
  110|  3.37k|  return tor_malloc_zero_((nmemb * size));
  111|  3.37k|}
tor_realloc_:
  119|  1.17k|{
  120|  1.17k|  void *result;
  121|       |
  122|  1.17k|  raw_assert(size < SIZE_T_CEILING);
  ------------------
  |  |   20|  1.17k|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|  1.17k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  1.17k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 1.17k]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|  1.17k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  1.17k|#define STMT_END })
  |  |  ------------------
  ------------------
  123|       |
  124|       |#ifndef MALLOC_ZERO_WORKS
  125|       |  /* Some libc mallocs don't work when size==0. Override them. */
  126|       |  if (size==0) {
  127|       |    size=1;
  128|       |  }
  129|       |#endif /* !defined(MALLOC_ZERO_WORKS) */
  130|       |
  131|  1.17k|  result = raw_realloc(ptr, size);
  ------------------
  |  |   77|  1.17k|#define raw_realloc realloc
  ------------------
  132|       |
  133|  1.17k|  if (PREDICT_UNLIKELY(result == NULL)) {
  ------------------
  |  |  182|  1.17k|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 0, False: 1.17k]
  |  |  ------------------
  ------------------
  134|       |    /* LCOV_EXCL_START */
  135|      0|    raw_assert_unreached_msg("Out of memory on realloc(). Dying.");
  ------------------
  |  |   27|      0|#define raw_assert_unreached_msg(msg) STMT_BEGIN                    \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   28|      0|    tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg));  \
  |  |   29|      0|    tor_raw_abort_();                                               \
  |  |   30|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
  136|       |    /* LCOV_EXCL_STOP */
  137|      0|  }
  138|  1.17k|  return result;
  139|  1.17k|}
tor_reallocarray_:
  147|  1.17k|{
  148|       |  /* XXXX we can make this return 0, but we would need to check all the
  149|       |   * reallocarray users. */
  150|  1.17k|  raw_assert(size_mul_check(sz1, sz2));
  ------------------
  |  |   20|  1.17k|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|  1.17k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  1.17k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 1.17k]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|  1.17k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  1.17k|#define STMT_END })
  |  |  ------------------
  ------------------
  151|       |
  152|  1.17k|  return tor_realloc(ptr, (sz1 * sz2));
  ------------------
  |  |   65|  1.17k|#define tor_realloc(ptr, size) tor_realloc_(ptr, size)
  ------------------
  153|  1.17k|}
tor_strdup_:
  161|    303|{
  162|    303|  char *duplicate;
  163|    303|  raw_assert(s);
  ------------------
  |  |   20|    303|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|    303|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|    303|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 303]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|    303|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    303|#define STMT_END })
  |  |  ------------------
  ------------------
  164|       |
  165|    303|  duplicate = raw_strdup(s);
  ------------------
  |  |   79|    303|#define raw_strdup  strdup
  ------------------
  166|       |
  167|    303|  if (PREDICT_UNLIKELY(duplicate == NULL)) {
  ------------------
  |  |  182|    303|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 0, False: 303]
  |  |  ------------------
  ------------------
  168|       |    /* LCOV_EXCL_START */
  169|      0|    raw_assert_unreached_msg("Out of memory on strdup(). Dying.");
  ------------------
  |  |   27|      0|#define raw_assert_unreached_msg(msg) STMT_BEGIN                    \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   28|      0|    tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg));  \
  |  |   29|      0|    tor_raw_abort_();                                               \
  |  |   30|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
  170|       |    /* LCOV_EXCL_STOP */
  171|      0|  }
  172|    303|  return duplicate;
  173|    303|}
tor_strndup_:
  183|  4.63k|{
  184|  4.63k|  char *duplicate;
  185|  4.63k|  raw_assert(s);
  ------------------
  |  |   20|  4.63k|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|  4.63k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  4.63k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 4.63k]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|  4.63k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  4.63k|#define STMT_END })
  |  |  ------------------
  ------------------
  186|  4.63k|  raw_assert(n < SIZE_T_CEILING);
  ------------------
  |  |   20|  4.63k|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|  4.63k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  4.63k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 4.63k]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|  4.63k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  4.63k|#define STMT_END })
  |  |  ------------------
  ------------------
  187|  4.63k|  duplicate = tor_malloc_((n+1));
  188|       |  /* Performance note: Ordinarily we prefer strlcpy to strncpy.  But
  189|       |   * this function gets called a whole lot, and platform strncpy is
  190|       |   * much faster than strlcpy when strlen(s) is much longer than n.
  191|       |   */
  192|  4.63k|  strncpy(duplicate, s, n);
  193|  4.63k|  duplicate[n]='\0';
  194|  4.63k|  return duplicate;
  195|  4.63k|}
tor_memdup_nulterm_:
  214|    133|{
  215|    133|  char *duplicate;
  216|    133|  raw_assert(len < SIZE_T_CEILING+1);
  ------------------
  |  |   20|    133|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|    133|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|    133|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 133]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|    133|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    133|#define STMT_END })
  |  |  ------------------
  ------------------
  217|    133|  raw_assert(mem);
  ------------------
  |  |   20|    133|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|    133|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|    133|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 133]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|    133|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    133|#define STMT_END })
  |  |  ------------------
  ------------------
  218|    133|  duplicate = tor_malloc_(len+1);
  219|    133|  memcpy(duplicate, mem, len);
  220|    133|  duplicate[len] = '\0';
  221|    133|  return duplicate;
  222|    133|}
tor_free_:
  228|  4.84k|{
  229|       |  tor_free(mem);
  ------------------
  |  |   47|  4.84k|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|  4.84k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|  4.84k|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|  4.84k|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|  4.84k|                                                 struct event *), \
  |  |   51|  4.84k|                   "use tor_event_free for struct event *");   \
  |  |   52|  4.84k|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|  4.84k|#define raw_free    free
  |  |  ------------------
  |  |   53|  4.84k|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|  4.84k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  4.84k|#define STMT_END })
  |  |  ------------------
  ------------------
  230|  4.84k|}

metrics_store_new:
   75|      1|{
   76|      1|  metrics_store_t *store = tor_malloc_zero(sizeof(*store));
  ------------------
  |  |   63|      1|#define tor_malloc_zero(size)  tor_malloc_zero_(size)
  ------------------
   77|       |
   78|      1|  store->entries = strmap_new();
   79|       |
   80|      1|  return store;
   81|      1|}

tor_addr_to_str:
  329|    328|{
  330|    328|  const char *ptr;
  331|    328|  tor_assert(addr && dest);
  ------------------
  |  |  103|    328|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    328|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    328|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    328|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    328|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    328|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 328, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    328|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    984|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 328, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 328, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    328|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    328|    else                                        \
  |  |  |  |  |  |  |  |   80|    328|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    328|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    328|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    328|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    328|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    328|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  332|       |
  333|    328|  switch (tor_addr_family(addr)) {
  334|    162|    case AF_INET:
  ------------------
  |  Branch (334:5): [True: 162, False: 166]
  ------------------
  335|       |      /* Shortest addr x.x.x.x + \0 */
  336|    162|      if (len < 8)
  ------------------
  |  Branch (336:11): [True: 0, False: 162]
  ------------------
  337|      0|        return NULL;
  338|    162|      ptr = tor_inet_ntop(AF_INET, &addr->addr.in_addr, dest, len);
  339|    162|      break;
  340|    166|    case AF_INET6:
  ------------------
  |  Branch (340:5): [True: 166, False: 162]
  ------------------
  341|       |      /* Shortest addr [ :: ] + \0 */
  342|    166|      if (len < (3u + (decorate ? 2 : 0)))
  ------------------
  |  Branch (342:11): [True: 0, False: 166]
  |  Branch (342:24): [True: 166, False: 0]
  ------------------
  343|      0|        return NULL;
  344|       |
  345|    166|      if (decorate)
  ------------------
  |  Branch (345:11): [True: 166, False: 0]
  ------------------
  346|    166|        ptr = tor_inet_ntop(AF_INET6, &addr->addr.in6_addr, dest+1, len-2);
  347|      0|      else
  348|      0|        ptr = tor_inet_ntop(AF_INET6, &addr->addr.in6_addr, dest, len);
  349|       |
  350|    166|      if (ptr && decorate) {
  ------------------
  |  Branch (350:11): [True: 166, False: 0]
  |  Branch (350:18): [True: 166, False: 0]
  ------------------
  351|    166|        *dest = '[';
  352|    166|        memcpy(dest+strlen(dest), "]", 2);
  353|    166|        tor_assert(ptr == dest+1);
  ------------------
  |  |  103|    166|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    166|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    166|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    166|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    166|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    166|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 166, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    166|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    166|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 166, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    166|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    166|    else                                        \
  |  |  |  |  |  |  |  |   80|    166|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    166|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    166|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    166|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    166|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    166|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  354|    166|        ptr = dest;
  355|    166|      }
  356|    166|      break;
  357|    166|    case AF_UNIX:
  ------------------
  |  Branch (357:5): [True: 0, False: 328]
  ------------------
  358|      0|      tor_snprintf(dest, len, "AF_UNIX");
  359|      0|      ptr = dest;
  360|      0|      break;
  361|      0|    default:
  ------------------
  |  Branch (361:5): [True: 0, False: 328]
  ------------------
  362|      0|      return NULL;
  363|    328|  }
  364|    328|  return ptr;
  365|    328|}
tor_addr_from_ipv4n:
  890|    187|{
  891|    187|  tor_assert(dest);
  ------------------
  |  |  103|    187|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    187|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    187|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    187|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    187|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    187|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 187, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    187|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    187|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 187, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    187|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    187|    else                                        \
  |  |  |  |  |  |  |  |   80|    187|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    187|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    187|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    187|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    187|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    187|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  892|    187|  memset(dest, 0, sizeof(tor_addr_t));
  893|       |  dest->family = AF_INET;
  894|    187|  dest->addr.in_addr.s_addr = v4addr;
  895|    187|}
tor_addr_from_ipv6_bytes:
  901|    237|{
  902|    237|  tor_assert(dest);
  ------------------
  |  |  103|    237|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    237|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    237|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    237|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    237|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    237|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 237, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    237|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    237|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 237, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    237|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    237|    else                                        \
  |  |  |  |  |  |  |  |   80|    237|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    237|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    237|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    237|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    237|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    237|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  903|    237|  tor_assert(ipv6_bytes);
  ------------------
  |  |  103|    237|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    237|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    237|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    237|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    237|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    237|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 237, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    237|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    237|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 237, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    237|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    237|    else                                        \
  |  |  |  |  |  |  |  |   80|    237|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    237|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    237|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    237|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    237|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    237|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  904|    237|  memset(dest, 0, sizeof(tor_addr_t));
  905|    237|  dest->family = AF_INET6;
  906|       |  memcpy(dest->addr.in6_addr.s6_addr, ipv6_bytes, 16);
  907|    237|}
tor_addr_from_in6:
  912|     71|{
  913|       |  tor_addr_from_ipv6_bytes(dest, in6->s6_addr);
  914|     71|}
tor_addr_parse:
 1350|    207|{
 1351|    207|  return tor_addr_parse_impl(addr, src, 1);
 1352|    207|}
string_is_valid_ipv4_address:
 2134|    923|{
 2135|    923|  struct in_addr addr;
 2136|       |
 2137|       |  return (tor_inet_pton(AF_INET,string,&addr) == 1);
 2138|    923|}
string_is_valid_ipv6_address:
 2145|    474|{
 2146|    474|  struct in6_addr addr;
 2147|       |
 2148|       |  return (tor_inet_pton(AF_INET6,string,&addr) == 1);
 2149|    474|}
string_is_valid_dest:
 2156|    650|{
 2157|    650|  char *tmp = NULL;
 2158|    650|  int retval;
 2159|    650|  size_t len;
 2160|       |
 2161|    650|  if (string == NULL)
  ------------------
  |  Branch (2161:7): [True: 0, False: 650]
  ------------------
 2162|      0|    return 0;
 2163|       |
 2164|    650|  len = strlen(string);
 2165|       |
 2166|    650|  if (len == 0)
  ------------------
  |  Branch (2166:7): [True: 20, False: 630]
  ------------------
 2167|     20|    return 0;
 2168|       |
 2169|    630|  if (string[0] == '[' && string[len - 1] == ']')
  ------------------
  |  Branch (2169:7): [True: 173, False: 457]
  |  Branch (2169:27): [True: 166, False: 7]
  ------------------
 2170|    166|    string = tmp = tor_strndup(string + 1, len - 2);
  ------------------
  |  |   69|    166|#define tor_strndup(s, n)      tor_strndup_(s, n)
  ------------------
 2171|       |
 2172|    630|  retval = string_is_valid_ipv4_address(string) ||
  ------------------
  |  Branch (2172:12): [True: 156, False: 474]
  ------------------
 2173|    474|    string_is_valid_ipv6_address(string) ||
  ------------------
  |  Branch (2173:5): [True: 180, False: 294]
  ------------------
 2174|    294|    string_is_valid_nonrfc_hostname(string);
  ------------------
  |  Branch (2174:5): [True: 93, False: 201]
  ------------------
 2175|       |
 2176|    630|  tor_free(tmp);
  ------------------
  |  |   47|    630|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|    630|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|    630|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|    630|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|    630|                                                 struct event *), \
  |  |   51|    630|                   "use tor_event_free for struct event *");   \
  |  |   52|    630|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|    630|#define raw_free    free
  |  |  ------------------
  |  |   53|    630|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|    630|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    630|#define STMT_END })
  |  |  ------------------
  ------------------
 2177|       |
 2178|    630|  return retval;
 2179|    650|}
string_is_valid_nonrfc_hostname:
 2189|    294|{
 2190|    294|  int result = 1;
 2191|    294|  int has_trailing_dot;
 2192|    294|  char *last_label;
 2193|    294|  smartlist_t *components;
 2194|       |
 2195|    294|  if (!string || strlen(string) == 0)
  ------------------
  |  Branch (2195:7): [True: 0, False: 294]
  |  Branch (2195:18): [True: 1, False: 293]
  ------------------
 2196|      1|    return 0;
 2197|       |
 2198|    293|  if (string_is_valid_ipv4_address(string))
  ------------------
  |  Branch (2198:7): [True: 0, False: 293]
  ------------------
 2199|      0|    return 0;
 2200|       |
 2201|    293|  components = smartlist_new();
 2202|       |
 2203|    293|  smartlist_split_string(components,string,".",0,0);
 2204|       |
 2205|    293|  if (BUG(smartlist_len(components) == 0)) {
  ------------------
  |  |  212|    293|  (ASSERT_PREDICT_UNLIKELY_(cond) ?                                     \
  |  |  ------------------
  |  |  |  |   75|    293|  ( {                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (75:3): [True: 0, False: 293]
  |  |  |  |  ------------------
  |  |  |  |   76|    293|    int tor__assert_tmp_value__;                \
  |  |  |  |   77|    293|    if (e)                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:9): [True: 0, False: 293]
  |  |  |  |  ------------------
  |  |  |  |   78|    293|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |   79|    293|    else                                        \
  |  |  |  |   80|    293|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |   81|    293|    tor__assert_tmp_value__;                    \
  |  |  |  |   82|    293|  } )
  |  |  ------------------
  |  |  |  Branch (212:3): [True: 0, False: 293]
  |  |  ------------------
  |  |  213|    293|  (tor_bug_occurred_(SHORT_FILE__,__LINE__,__func__,"!("#cond")",0,NULL),1) \
  |  |  ------------------
  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  ------------------
  |  |  214|    293|   : 0)
  ------------------
 2206|       |    // LCOV_EXCL_START should be impossible given the earlier checks.
 2207|      0|    smartlist_free(components);
  ------------------
  |  |   40|      0|#define smartlist_free(sl) FREE_AND_NULL(smartlist_t, smartlist_free_, (sl))
  |  |  ------------------
  |  |  |  |   85|      0|  do {                                                                  \
  |  |  |  |   86|      0|    /* only evaluate (var) once. */                                     \
  |  |  |  |   87|      0|    typename **tmp__free__ptr ## freefn = &(var);                       \
  |  |  |  |   88|      0|    freefn(*tmp__free__ptr ## freefn);                                  \
  |  |  |  |   89|      0|    (*tmp__free__ptr ## freefn) = NULL;                                 \
  |  |  |  |   90|      0|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2208|      0|    return 0;
 2209|       |    // LCOV_EXCL_STOP
 2210|      0|  }
 2211|       |
 2212|       |  /* Allow a single terminating '.' used rarely to indicate domains
 2213|       |   * are FQDNs rather than relative. */
 2214|    293|  last_label = (char *)smartlist_get(components,
  ------------------
  |  |   82|    293|#define smartlist_get(sl, idx) ((sl)->list[idx])
  ------------------
 2215|    293|                                     smartlist_len(components) - 1);
 2216|    293|  has_trailing_dot = (last_label[0] == '\0');
 2217|    293|  if (has_trailing_dot) {
  ------------------
  |  Branch (2217:7): [True: 45, False: 248]
  ------------------
 2218|     45|    smartlist_pop_last(components);
 2219|     45|    tor_free(last_label);
  ------------------
  |  |   47|     45|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|     45|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|     45|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|     45|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|     45|                                                 struct event *), \
  |  |   51|     45|                   "use tor_event_free for struct event *");   \
  |  |   52|     45|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|     45|#define raw_free    free
  |  |  ------------------
  |  |   53|     45|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|     45|  STMT_END
  |  |  ------------------
  |  |  |  |  205|     45|#define STMT_END })
  |  |  ------------------
  ------------------
 2220|     45|    last_label = NULL;
 2221|     45|  }
 2222|       |
 2223|    561|  SMARTLIST_FOREACH_BEGIN(components, char *, c) {
  ------------------
  |  |   79|    293|  STMT_BEGIN                                                    \
  |  |  ------------------
  |  |  |  |  204|    293|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   80|    293|    int var ## _sl_idx, var ## _sl_len=(sl)->num_used;          \
  |  |   81|    293|    type var;                                                   \
  |  |   82|    654|    for (var ## _sl_idx = 0; var ## _sl_idx < var ## _sl_len;   \
  |  |  ------------------
  |  |  |  Branch (82:30): [True: 561, False: 93]
  |  |  ------------------
  |  |   83|    561|         ++var ## _sl_idx) {                                    \
  |  |   84|    561|      var = (sl)->list[var ## _sl_idx];
  ------------------
 2224|    561|    if ((c[0] == '-') || (*c == '_')) {
  ------------------
  |  Branch (2224:9): [True: 1, False: 560]
  |  Branch (2224:26): [True: 1, False: 559]
  ------------------
 2225|      2|      result = 0;
 2226|      2|      break;
 2227|      2|    }
 2228|       |
 2229|  2.26k|    do {
 2230|  2.26k|      result = (TOR_ISALNUM(*c) || (*c == '-') || (*c == '_'));
  ------------------
  |  Branch (2230:17): [True: 1.63k, False: 633]
  |  Branch (2230:36): [True: 199, False: 434]
  |  Branch (2230:51): [True: 236, False: 198]
  ------------------
 2231|  2.26k|      c++;
 2232|  2.26k|    } while (result && *c);
  ------------------
  |  Branch (2232:14): [True: 2.06k, False: 198]
  |  Branch (2232:24): [True: 1.70k, False: 361]
  ------------------
 2233|       |
 2234|    559|    if (result == 0) {
  ------------------
  |  Branch (2234:9): [True: 198, False: 361]
  ------------------
 2235|    198|      break;
 2236|    198|    }
 2237|    559|  } SMARTLIST_FOREACH_END(c);
  ------------------
  |  |  100|    361|    var = NULL;                                 \
  |  |  101|    361|    (void) var ## _sl_idx;                      \
  |  |  102|    361|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|    293|#define STMT_END })
  |  |  ------------------
  ------------------
 2238|       |
 2239|  3.43k|  SMARTLIST_FOREACH_BEGIN(components, char *, c) {
  ------------------
  |  |   79|    293|  STMT_BEGIN                                                    \
  |  |  ------------------
  |  |  |  |  204|    293|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   80|    293|    int var ## _sl_idx, var ## _sl_len=(sl)->num_used;          \
  |  |   81|    293|    type var;                                                   \
  |  |   82|  3.72k|    for (var ## _sl_idx = 0; var ## _sl_idx < var ## _sl_len;   \
  |  |  ------------------
  |  |  |  Branch (82:30): [True: 3.43k, False: 293]
  |  |  ------------------
  |  |   83|  3.43k|         ++var ## _sl_idx) {                                    \
  |  |   84|  3.43k|      var = (sl)->list[var ## _sl_idx];
  ------------------
 2240|  3.43k|    tor_free(c);
  ------------------
  |  |   47|  3.43k|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|  3.43k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|  3.43k|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|  3.43k|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|  3.43k|                                                 struct event *), \
  |  |   51|  3.43k|                   "use tor_event_free for struct event *");   \
  |  |   52|  3.43k|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|  3.43k|#define raw_free    free
  |  |  ------------------
  |  |   53|  3.43k|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|  3.43k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  3.43k|#define STMT_END })
  |  |  ------------------
  ------------------
 2241|  3.43k|  } SMARTLIST_FOREACH_END(c);
  ------------------
  |  |  100|  3.43k|    var = NULL;                                 \
  |  |  101|  3.43k|    (void) var ## _sl_idx;                      \
  |  |  102|  3.43k|  } STMT_END
  |  |  ------------------
  |  |  |  |  205|    293|#define STMT_END })
  |  |  ------------------
  ------------------
 2242|       |
 2243|    293|  smartlist_free(components);
  ------------------
  |  |   40|    293|#define smartlist_free(sl) FREE_AND_NULL(smartlist_t, smartlist_free_, (sl))
  |  |  ------------------
  |  |  |  |   85|    293|  do {                                                                  \
  |  |  |  |   86|    293|    /* only evaluate (var) once. */                                     \
  |  |  |  |   87|    293|    typename **tmp__free__ptr ## freefn = &(var);                       \
  |  |  |  |   88|    293|    freefn(*tmp__free__ptr ## freefn);                                  \
  |  |  |  |   89|    293|    (*tmp__free__ptr ## freefn) = NULL;                                 \
  |  |  |  |   90|    293|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:12): [Folded, False: 293]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2244|       |
 2245|    293|  return result;
 2246|    293|}
address.c:tor_addr_parse_impl:
 1297|    207|{
 1298|       |  /* Holds substring of IPv6 address after removing square brackets */
 1299|    207|  char *tmp = NULL;
 1300|    207|  int result = -1;
 1301|    207|  struct in_addr in_tmp;
 1302|    207|  struct in6_addr in6_tmp;
 1303|    207|  int brackets_detected = 0;
 1304|       |
 1305|    207|  tor_assert(addr && src);
  ------------------
  |  |  103|    207|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    207|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    207|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    207|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    207|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    207|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 207, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    207|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    621|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 207, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 207, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    207|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    207|    else                                        \
  |  |  |  |  |  |  |  |   80|    207|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    207|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    207|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    207|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    207|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    207|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1306|       |
 1307|    207|  size_t len = strlen(src);
 1308|       |
 1309|    207|  if (len && src[0] == '[' && src[len - 1] == ']') {
  ------------------
  |  Branch (1309:7): [True: 178, False: 29]
  |  Branch (1309:14): [True: 71, False: 107]
  |  Branch (1309:31): [True: 62, False: 9]
  ------------------
 1310|     62|    brackets_detected = 1;
 1311|     62|    src = tmp = tor_strndup(src+1, strlen(src)-2);
  ------------------
  |  |   69|     62|#define tor_strndup(s, n)      tor_strndup_(s, n)
  ------------------
 1312|     62|  }
 1313|       |
 1314|       |  /* Try to parse an IPv6 address if it has brackets, or if IPv6 addresses
 1315|       |   * without brackets are allowed */
 1316|    207|  if (brackets_detected || allow_ipv6_without_brackets) {
  ------------------
  |  Branch (1316:7): [True: 62, False: 145]
  |  Branch (1316:28): [True: 145, False: 0]
  ------------------
 1317|    207|    if (tor_inet_pton(AF_INET6, src, &in6_tmp) > 0) {
  ------------------
  |  Branch (1317:9): [True: 71, False: 136]
  ------------------
 1318|     71|      result = AF_INET6;
 1319|     71|      tor_addr_from_in6(addr, &in6_tmp);
 1320|     71|    }
 1321|    207|  }
 1322|       |
 1323|       |  /* Try to parse an IPv4 address without brackets */
 1324|    207|  if (!brackets_detected) {
  ------------------
  |  Branch (1324:7): [True: 145, False: 62]
  ------------------
 1325|    145|    if (tor_inet_pton(AF_INET, src, &in_tmp) > 0) {
  ------------------
  |  Branch (1325:9): [True: 25, False: 120]
  ------------------
 1326|     25|      result = AF_INET;
 1327|     25|      tor_addr_from_in(addr, &in_tmp);
  ------------------
  |  |  334|     25|  tor_addr_from_ipv4n((dest), (in)->s_addr);
  ------------------
 1328|     25|    }
 1329|    145|  }
 1330|       |
 1331|       |  /* Clear the address on error, to avoid returning uninitialised or partly
 1332|       |   * parsed data.
 1333|       |   */
 1334|    207|  if (result == -1) {
  ------------------
  |  Branch (1334:7): [True: 111, False: 96]
  ------------------
 1335|    111|    memset(addr, 0, sizeof(tor_addr_t));
 1336|    111|  }
 1337|       |
 1338|       |  tor_free(tmp);
  ------------------
  |  |   47|    207|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|    207|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|    207|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|    207|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|    207|                                                 struct event *), \
  |  |   51|    207|                   "use tor_event_free for struct event *");   \
  |  |   52|    207|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|    207|#define raw_free    free
  |  |  ------------------
  |  |   53|    207|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|    207|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    207|#define STMT_END })
  |  |  ------------------
  ------------------
 1339|    207|  return result;
 1340|    207|}

address.c:tor_addr_family:
  190|    328|{
  191|    328|  return a->family;
  192|    328|}

tor_inet_aton:
   41|  1.06k|{
   42|  1.06k|  unsigned a, b, c, d;
   43|  1.06k|  char more;
   44|  1.06k|  bool is_octal = false;
   45|  1.06k|  smartlist_t *sl = NULL;
   46|       |
   47|  1.06k|  if (tor_sscanf(str, "%3u.%3u.%3u.%3u%c", &a, &b, &c, &d, &more) != 4)
  ------------------
  |  Branch (47:7): [True: 862, False: 206]
  ------------------
   48|    862|    return 0;
   49|       |
   50|       |  /* Parse the octets and check them for leading zeros. */
   51|    206|  sl = smartlist_new();
   52|    206|  smartlist_split_string(sl, str, ".", 0, 0);
   53|    206|  SMARTLIST_FOREACH(sl, const char *, octet, {
  ------------------
  |  |  113|    818|  SMARTLIST_FOREACH_BEGIN(sl,type,var) {                        \
  |  |  ------------------
  |  |  |  |   79|    206|  STMT_BEGIN                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    206|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |   80|    206|    int var ## _sl_idx, var ## _sl_len=(sl)->num_used;          \
  |  |  |  |   81|    206|    type var;                                                   \
  |  |  |  |   82|  1.01k|    for (var ## _sl_idx = 0; var ## _sl_idx < var ## _sl_len;   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:30): [True: 818, False: 201]
  |  |  |  |  ------------------
  |  |  |  |   83|    818|         ++var ## _sl_idx) {                                    \
  |  |  |  |   84|    818|      var = (sl)->list[var ## _sl_idx];
  |  |  ------------------
  |  |  114|  2.08k|    cmd;                                                        \
  |  |  ------------------
  |  |  |  Branch (114:5): [True: 446, False: 372]
  |  |  |  Branch (114:5): [True: 5, False: 441]
  |  |  |  Branch (114:5): [True: 5, False: 813]
  |  |  ------------------
  |  |  115|    813|  } SMARTLIST_FOREACH_END(var)
  |  |  ------------------
  |  |  |  |  100|    813|    var = NULL;                                 \
  |  |  |  |  101|    813|    (void) var ## _sl_idx;                      \
  |  |  |  |  102|    813|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    206|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   54|    206|    is_octal = (strlen(octet) > 1 && octet[0] == '0');
   55|    206|    if (is_octal) {
   56|    206|        break;
   57|    206|    }
   58|    206|  });
   59|    206|  SMARTLIST_FOREACH(sl, char *, octet, tor_free(octet));
  ------------------
  |  |  113|    824|  SMARTLIST_FOREACH_BEGIN(sl,type,var) {                        \
  |  |  ------------------
  |  |  |  |   79|    206|  STMT_BEGIN                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    206|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |   80|    206|    int var ## _sl_idx, var ## _sl_len=(sl)->num_used;          \
  |  |  |  |   81|    206|    type var;                                                   \
  |  |  |  |   82|  1.03k|    for (var ## _sl_idx = 0; var ## _sl_idx < var ## _sl_len;   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:30): [True: 824, False: 206]
  |  |  |  |  ------------------
  |  |  |  |   83|    824|         ++var ## _sl_idx) {                                    \
  |  |  |  |   84|    824|      var = (sl)->list[var ## _sl_idx];
  |  |  ------------------
  |  |  114|    824|    cmd;                                                        \
  |  |  115|    824|  } SMARTLIST_FOREACH_END(var)
  |  |  ------------------
  |  |  |  |  100|    824|    var = NULL;                                 \
  |  |  |  |  101|    824|    (void) var ## _sl_idx;                      \
  |  |  |  |  102|    824|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    206|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|    206|  smartlist_free(sl);
  ------------------
  |  |   40|    206|#define smartlist_free(sl) FREE_AND_NULL(smartlist_t, smartlist_free_, (sl))
  |  |  ------------------
  |  |  |  |   85|    206|  do {                                                                  \
  |  |  |  |   86|    206|    /* only evaluate (var) once. */                                     \
  |  |  |  |   87|    206|    typename **tmp__free__ptr ## freefn = &(var);                       \
  |  |  |  |   88|    206|    freefn(*tmp__free__ptr ## freefn);                                  \
  |  |  |  |   89|    206|    (*tmp__free__ptr ## freefn) = NULL;                                 \
  |  |  |  |   90|    206|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:12): [Folded, False: 206]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   61|       |
   62|    206|  if (is_octal)
  ------------------
  |  Branch (62:7): [True: 5, False: 201]
  ------------------
   63|      5|    return 0;
   64|       |
   65|    201|  if (a > 255) return 0;
  ------------------
  |  Branch (65:7): [True: 5, False: 196]
  ------------------
   66|    196|  if (b > 255) return 0;
  ------------------
  |  Branch (66:7): [True: 3, False: 193]
  ------------------
   67|    193|  if (c > 255) return 0;
  ------------------
  |  Branch (67:7): [True: 5, False: 188]
  ------------------
   68|    188|  if (d > 255) return 0;
  ------------------
  |  Branch (68:7): [True: 7, False: 181]
  ------------------
   69|    181|  addr->s_addr = htonl((a<<24) | (b<<16) | (c<<8) | d);
   70|    181|  return 1;
   71|    188|}
tor_inet_ntoa:
   80|    162|{
   81|       |  uint32_t a = ntohl(in->s_addr);
   82|    162|  return tor_snprintf(buf, buf_len, "%d.%d.%d.%d",
   83|    162|                      (int)(uint8_t)((a>>24)&0xff),
   84|    162|                      (int)(uint8_t)((a>>16)&0xff),
   85|    162|                      (int)(uint8_t)((a>>8 )&0xff),
   86|    162|                      (int)(uint8_t)((a    )&0xff));
   87|    162|}
tor_inet_ntop:
   99|    328|{
  100|    328|  if (af == AF_INET) {
  ------------------
  |  Branch (100:7): [True: 162, False: 166]
  ------------------
  101|    162|    if (tor_inet_ntoa(src, dst, len) < 0)
  ------------------
  |  Branch (101:9): [True: 0, False: 162]
  ------------------
  102|      0|      return NULL;
  103|    162|    else
  104|    162|      return dst;
  105|    166|  } else if (af == AF_INET6) {
  ------------------
  |  Branch (105:14): [True: 166, False: 0]
  ------------------
  106|    166|    const struct in6_addr *addr = src;
  107|    166|    char buf[64], *cp;
  108|    166|    int longestGapLen = 0, longestGapPos = -1, i,
  109|    166|      curGapPos = -1, curGapLen = 0;
  110|    166|    uint16_t words[8];
  111|  1.49k|    for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (111:17): [True: 1.32k, False: 166]
  ------------------
  112|  1.32k|      words[i] = (((uint16_t)addr->s6_addr[2*i])<<8) + addr->s6_addr[2*i+1];
  113|  1.32k|    }
  114|    166|    if (words[0] == 0 && words[1] == 0 && words[2] == 0 && words[3] == 0 &&
  ------------------
  |  Branch (114:9): [True: 128, False: 38]
  |  Branch (114:26): [True: 109, False: 19]
  |  Branch (114:43): [True: 84, False: 25]
  |  Branch (114:60): [True: 71, False: 13]
  ------------------
  115|     71|        words[4] == 0 && ((words[5] == 0 && words[6] && words[7]) ||
  ------------------
  |  Branch (115:9): [True: 48, False: 23]
  |  Branch (115:28): [True: 23, False: 25]
  |  Branch (115:45): [True: 22, False: 1]
  |  Branch (115:57): [True: 16, False: 6]
  ------------------
  116|     32|                          (words[5] == 0xffff))) {
  ------------------
  |  Branch (116:27): [True: 3, False: 29]
  ------------------
  117|       |      /* This is an IPv4 address. */
  118|     19|      if (words[5] == 0) {
  ------------------
  |  Branch (118:11): [True: 16, False: 3]
  ------------------
  119|     16|        tor_snprintf(buf, sizeof(buf), "::%d.%d.%d.%d",
  120|     16|                     addr->s6_addr[12], addr->s6_addr[13],
  121|     16|                     addr->s6_addr[14], addr->s6_addr[15]);
  122|     16|      } else {
  123|      3|        tor_snprintf(buf, sizeof(buf), "::%x:%d.%d.%d.%d", words[5],
  124|      3|                     addr->s6_addr[12], addr->s6_addr[13],
  125|      3|                     addr->s6_addr[14], addr->s6_addr[15]);
  126|      3|      }
  127|     19|      if ((strlen(buf) + 1) > len) /* +1 for \0 */
  ------------------
  |  Branch (127:11): [True: 0, False: 19]
  ------------------
  128|      0|        return NULL;
  129|     19|      strlcpy(dst, buf, len);
  130|     19|      return dst;
  131|     19|    }
  132|    147|    i = 0;
  133|  1.00k|    while (i < 8) {
  ------------------
  |  Branch (133:12): [True: 855, False: 147]
  ------------------
  134|    855|      if (words[i] == 0) {
  ------------------
  |  Branch (134:11): [True: 210, False: 645]
  ------------------
  135|    210|        curGapPos = i++;
  136|    210|        curGapLen = 1;
  137|    531|        while (i<8 && words[i] == 0) {
  ------------------
  |  Branch (137:16): [True: 493, False: 38]
  |  Branch (137:23): [True: 321, False: 172]
  ------------------
  138|    321|          ++i; ++curGapLen;
  139|    321|        }
  140|    210|        if (curGapLen > longestGapLen) {
  ------------------
  |  Branch (140:13): [True: 149, False: 61]
  ------------------
  141|    149|          longestGapPos = curGapPos;
  142|    149|          longestGapLen = curGapLen;
  143|    149|        }
  144|    645|      } else {
  145|    645|        ++i;
  146|    645|      }
  147|    855|    }
  148|    147|    if (longestGapLen<=1)
  ------------------
  |  Branch (148:9): [True: 36, False: 111]
  ------------------
  149|     36|      longestGapPos = -1;
  150|       |
  151|    147|    cp = buf;
  152|  1.02k|    for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (152:17): [True: 876, False: 147]
  ------------------
  153|    876|      if (words[i] == 0 && longestGapPos == i) {
  ------------------
  |  Branch (153:11): [True: 231, False: 645]
  |  Branch (153:28): [True: 111, False: 120]
  ------------------
  154|    111|        if (i == 0)
  ------------------
  |  Branch (154:13): [True: 86, False: 25]
  ------------------
  155|     86|          *cp++ = ':';
  156|    111|        *cp++ = ':';
  157|    522|        while (i < 8 && words[i] == 0)
  ------------------
  |  Branch (157:16): [True: 515, False: 7]
  |  Branch (157:25): [True: 411, False: 104]
  ------------------
  158|    411|          ++i;
  159|    111|        --i; /* to compensate for loop increment. */
  160|    765|      } else {
  161|    765|        tor_snprintf(cp, sizeof(buf)-(cp-buf), "%x", (unsigned)words[i]);
  162|    765|        cp += strlen(cp);
  163|    765|        if (i != 7)
  ------------------
  |  Branch (163:13): [True: 625, False: 140]
  ------------------
  164|    625|          *cp++ = ':';
  165|    765|      }
  166|    876|    }
  167|    147|    *cp = '\0';
  168|    147|    if ((strlen(buf) + 1) > len) /* +1 for \0 */
  ------------------
  |  Branch (168:9): [True: 0, False: 147]
  ------------------
  169|      0|      return NULL;
  170|    147|    strlcpy(dst, buf, len);
  171|    147|    return dst;
  172|    147|  } else {
  173|       |    return NULL;
  174|      0|  }
  175|    328|}
tor_inet_pton:
  188|  1.74k|{
  189|  1.74k|  if (af == AF_INET) {
  ------------------
  |  Branch (189:7): [True: 1.06k, False: 681]
  ------------------
  190|  1.06k|    return tor_inet_aton(src, dst);
  191|  1.06k|  } else if (af == AF_INET6) {
  ------------------
  |  Branch (191:14): [True: 681, False: 0]
  ------------------
  192|    681|    ssize_t len = strlen(src);
  193|       |
  194|       |    /* Reject if src has needless trailing ':'. */
  195|    681|    if (len > 2 && src[len - 1] == ':' && src[len - 2] != ':') {
  ------------------
  |  Branch (195:9): [True: 538, False: 143]
  |  Branch (195:20): [True: 38, False: 500]
  |  Branch (195:43): [True: 15, False: 23]
  ------------------
  196|     15|      return 0;
  197|     15|    }
  198|       |
  199|    666|    struct in6_addr *out = dst;
  200|    666|    uint16_t words[8];
  201|    666|    int gapPos = -1, i, setWords=0;
  202|    666|    const char *dot = strchr(src, '.');
  203|    666|    const char *eow; /* end of words. */
  204|    666|    memset(words, 0xf8, sizeof(words));
  205|    666|    if (dot == src)
  ------------------
  |  Branch (205:9): [True: 34, False: 632]
  ------------------
  206|     34|      return 0;
  207|    632|    else if (!dot)
  ------------------
  |  Branch (207:14): [True: 466, False: 166]
  ------------------
  208|    466|      eow = src+strlen(src);
  209|    166|    else {
  210|    166|      unsigned byte1,byte2,byte3,byte4;
  211|    166|      char more;
  212|    547|      for (eow = dot-1; eow > src && TOR_ISDIGIT(*eow); --eow)
  ------------------
  |  Branch (212:25): [True: 423, False: 124]
  |  Branch (212:38): [True: 381, False: 42]
  ------------------
  213|    381|        ;
  214|    166|      if (*eow != ':')
  ------------------
  |  Branch (214:11): [True: 83, False: 83]
  ------------------
  215|     83|        return 0;
  216|     83|      ++eow;
  217|       |
  218|       |      /* We use "scanf" because some platform inet_aton()s are too lax
  219|       |       * about IPv4 addresses of the form "1.2.3" */
  220|     83|      if (tor_sscanf(eow, "%3u.%3u.%3u.%3u%c",
  ------------------
  |  Branch (220:11): [True: 8, False: 75]
  ------------------
  221|     83|                     &byte1,&byte2,&byte3,&byte4,&more) != 4)
  222|      8|        return 0;
  223|       |
  224|     75|      if (byte1 > 255 || byte2 > 255 || byte3 > 255 || byte4 > 255)
  ------------------
  |  Branch (224:11): [True: 3, False: 72]
  |  Branch (224:26): [True: 2, False: 70]
  |  Branch (224:41): [True: 3, False: 67]
  |  Branch (224:56): [True: 3, False: 64]
  ------------------
  225|     11|        return 0;
  226|       |
  227|     64|      words[6] = (byte1<<8) | byte2;
  228|     64|      words[7] = (byte3<<8) | byte4;
  229|     64|      setWords += 2;
  230|     64|    }
  231|       |
  232|    530|    i = 0;
  233|  1.93k|    while (src < eow) {
  ------------------
  |  Branch (233:12): [True: 1.60k, False: 328]
  ------------------
  234|  1.60k|      if (i > 7)
  ------------------
  |  Branch (234:11): [True: 1, False: 1.60k]
  ------------------
  235|      1|        return 0;
  236|  1.60k|      if (TOR_ISXDIGIT(*src)) {
  ------------------
  |  Branch (236:11): [True: 1.24k, False: 361]
  ------------------
  237|  1.24k|        char *next;
  238|  1.24k|        long r = strtol(src, &next, 16);
  239|  1.24k|        if (next == NULL || next == src) {
  ------------------
  |  Branch (239:13): [True: 0, False: 1.24k]
  |  Branch (239:29): [True: 0, False: 1.24k]
  ------------------
  240|       |          /* The 'next == src' error case can happen on versions of openbsd
  241|       |           * which treat "0xfoo" as an error, rather than as "0" followed by
  242|       |           * "xfoo". */
  243|      0|          return 0;
  244|      0|        }
  245|       |
  246|  1.24k|        len = *next == '\0' ? eow - src : next - src;
  ------------------
  |  Branch (246:15): [True: 254, False: 991]
  ------------------
  247|  1.24k|        if (len > 4)
  ------------------
  |  Branch (247:13): [True: 17, False: 1.22k]
  ------------------
  248|     17|          return 0;
  249|  1.22k|        if (len > 1 && !TOR_ISXDIGIT(src[1]))
  ------------------
  |  Branch (249:13): [True: 853, False: 375]
  |  Branch (249:24): [True: 1, False: 852]
  ------------------
  250|      1|          return 0; /* 0x is not valid */
  251|       |
  252|  1.22k|        tor_assert(r >= 0);
  ------------------
  |  |  103|  1.22k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.22k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.22k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.22k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.22k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.22k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.22k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.22k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.22k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.22k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.22k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.22k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.22k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.22k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.22k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.22k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.22k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.22k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|  1.22k|        tor_assert(r < 65536);
  ------------------
  |  |  103|  1.22k|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|  1.22k|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|  1.22k|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|  1.22k|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.22k|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|  1.22k|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1.22k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|  1.22k|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|  1.22k|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1.22k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|  1.22k|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|  1.22k|    else                                        \
  |  |  |  |  |  |  |  |   80|  1.22k|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|  1.22k|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|  1.22k|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|  1.22k|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|  1.22k|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|  1.22k|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  1.22k|        words[i++] = (uint16_t)r;
  255|  1.22k|        setWords++;
  256|  1.22k|        src = next;
  257|  1.22k|        if (*src != ':' && src != eow)
  ------------------
  |  Branch (257:13): [True: 283, False: 944]
  |  Branch (257:28): [True: 38, False: 245]
  ------------------
  258|     38|          return 0;
  259|  1.18k|        ++src;
  260|  1.18k|      } else if (*src == ':' && i > 0 && gapPos == -1) {
  ------------------
  |  Branch (260:18): [True: 264, False: 97]
  |  Branch (260:33): [True: 58, False: 206]
  |  Branch (260:42): [True: 53, False: 5]
  ------------------
  261|     53|        gapPos = i;
  262|     53|        ++src;
  263|    308|      } else if (*src == ':' && i == 0 && src+1 < eow && src[1] == ':' &&
  ------------------
  |  Branch (263:18): [True: 211, False: 97]
  |  Branch (263:33): [True: 206, False: 5]
  |  Branch (263:43): [True: 172, False: 34]
  |  Branch (263:58): [True: 164, False: 8]
  ------------------
  264|    164|                 gapPos == -1) {
  ------------------
  |  Branch (264:18): [True: 163, False: 1]
  ------------------
  265|    163|        gapPos = i;
  266|    163|        src += 2;
  267|    163|      } else {
  268|    145|        return 0;
  269|    145|      }
  270|  1.60k|    }
  271|       |
  272|    328|    if (setWords > 8 ||
  ------------------
  |  Branch (272:9): [True: 1, False: 327]
  ------------------
  273|    327|        (setWords == 8 && gapPos != -1) ||
  ------------------
  |  Branch (273:10): [True: 49, False: 278]
  |  Branch (273:27): [True: 4, False: 45]
  ------------------
  274|    323|        (setWords < 8 && gapPos == -1))
  ------------------
  |  Branch (274:10): [True: 278, False: 45]
  |  Branch (274:26): [True: 72, False: 206]
  ------------------
  275|     77|      return 0;
  276|       |
  277|    251|    if (gapPos >= 0) {
  ------------------
  |  Branch (277:9): [True: 206, False: 45]
  ------------------
  278|    206|      int nToMove = setWords - (dot ? 2 : 0) - gapPos;
  ------------------
  |  Branch (278:33): [True: 30, False: 176]
  ------------------
  279|    206|      int gapLen = 8 - setWords;
  280|    206|      tor_assert(nToMove >= 0);
  ------------------
  |  |  103|    206|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|    206|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|    206|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|    206|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    206|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|    206|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 206, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|    206|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|    206|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 206, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|    206|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|    206|    else                                        \
  |  |  |  |  |  |  |  |   80|    206|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|    206|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|    206|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|    206|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|    206|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|    206|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|    206|      memmove(&words[gapPos+gapLen], &words[gapPos],
  282|    206|              sizeof(uint16_t)*nToMove);
  283|    206|      memset(&words[gapPos], 0, sizeof(uint16_t)*gapLen);
  284|    206|    }
  285|  2.25k|    for (i = 0; i < 8; ++i) {
  ------------------
  |  Branch (285:17): [True: 2.00k, False: 251]
  ------------------
  286|  2.00k|      out->s6_addr[2*i  ] = words[i] >> 8;
  287|  2.00k|      out->s6_addr[2*i+1] = words[i] & 0xff;
  288|  2.00k|    }
  289|       |
  290|    251|    return 1;
  291|    251|  } else {
  292|      0|    return -1;
  293|      0|  }
  294|  1.74k|}

network_sys.c:subsys_network_initialize:
   22|      1|{
   23|      1|  if (network_init() < 0)
  ------------------
  |  Branch (23:7): [True: 0, False: 1]
  ------------------
   24|      0|    return -1;
   25|       |
   26|      1|  return 0;
   27|      1|}

network_init:
   42|      1|{
   43|       |#ifdef _WIN32
   44|       |  /* This silly exercise is necessary before windows will allow
   45|       |   * gethostbyname to work. */
   46|       |  WSADATA WSAData;
   47|       |  int r;
   48|       |  r = WSAStartup(0x101,&WSAData);
   49|       |  if (r) {
   50|       |    log_warn(LD_NET,"Error initializing windows network layer: code was %d",r);
   51|       |    return -1;
   52|       |  }
   53|       |  if (sizeof(SOCKET) != sizeof(tor_socket_t)) {
   54|       |    log_warn(LD_BUG,"The tor_socket_t type does not match SOCKET in size; Tor "
   55|       |             "might not work. (Sizes are %d and %d respectively.)",
   56|       |             (int)sizeof(tor_socket_t), (int)sizeof(SOCKET));
   57|       |  }
   58|       |  /* WSAData.iMaxSockets might show the max sockets we're allowed to use.
   59|       |   * We might use it to complain if we're trying to be a server but have
   60|       |   * too few sockets available. */
   61|       |#endif /* defined(_WIN32) */
   62|      1|  return 0;
   63|      1|}

process_init:
  142|      1|{
  143|      1|  processes = smartlist_new();
  144|       |
  145|       |#ifdef _WIN32
  146|       |  process_win32_init();
  147|       |#endif
  148|      1|}

process_sys.c:subsys_process_initialize:
   16|      1|{
   17|      1|  process_init();
   18|      1|  return 0;
   19|      1|}

smartlist_new__real:
   27|    507|{
   28|    507|  smartlist_t *sl = tor_malloc(sizeof(smartlist_t));
  ------------------
  |  |   62|    507|#define tor_malloc(size)       tor_malloc_(size)
  ------------------
   29|    507|  sl->num_used = 0;
   30|    507|  sl->capacity = SMARTLIST_DEFAULT_CAPACITY;
  ------------------
  |  |   21|    507|#define SMARTLIST_DEFAULT_CAPACITY 16
  ------------------
   31|    507|  sl->list = tor_calloc(sizeof(void *), sl->capacity);
  ------------------
  |  |   64|    507|#define tor_calloc(nmemb,size) tor_calloc_(nmemb, size)
  ------------------
   32|    507|  return sl;
   33|    507|}
smartlist_free___real:
   40|    500|{
   41|    500|  if (!sl)
  ------------------
  |  Branch (41:7): [True: 0, False: 500]
  ------------------
   42|      0|    return;
   43|    500|  tor_free(sl->list);
  ------------------
  |  |   47|    500|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|    500|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|    500|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|    500|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|    500|                                                 struct event *), \
  |  |   51|    500|                   "use tor_event_free for struct event *");   \
  |  |   52|    500|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|    500|#define raw_free    free
  |  |  ------------------
  |  |   53|    500|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|    500|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    500|#define STMT_END })
  |  |  ------------------
  ------------------
   44|       |  tor_free(sl);
  ------------------
  |  |   47|    500|#define tor_free(p) STMT_BEGIN                                 \
  |  |  ------------------
  |  |  |  |  204|    500|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   48|    500|    typeof(&(p)) tor_free__tmpvar = &(p);                      \
  |  |   49|    500|    _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \
  |  |   50|    500|                                                 struct event *), \
  |  |   51|    500|                   "use tor_event_free for struct event *");   \
  |  |   52|    500|    raw_free(*tor_free__tmpvar);                               \
  |  |  ------------------
  |  |  |  |   78|    500|#define raw_free    free
  |  |  ------------------
  |  |   53|    500|    *tor_free__tmpvar=NULL;                                    \
  |  |   54|    500|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    500|#define STMT_END })
  |  |  ------------------
  ------------------
   45|    500|}
smartlist_add:
  118|  4.82k|{
  119|  4.82k|  smartlist_ensure_capacity(sl, ((size_t) sl->num_used)+1);
  120|  4.82k|  sl->list[sl->num_used++] = element;
  121|  4.82k|}
smartlist_pop_last:
  188|     45|{
  189|     45|  raw_assert(sl);
  ------------------
  |  |   20|     45|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|     45|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|     45|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 45]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|     45|  STMT_END
  |  |  ------------------
  |  |  |  |  205|     45|#define STMT_END })
  |  |  ------------------
  ------------------
  190|     45|  if (sl->num_used) {
  ------------------
  |  Branch (190:7): [True: 45, False: 0]
  ------------------
  191|     45|    void *tmp = sl->list[--sl->num_used];
  192|     45|    sl->list[sl->num_used] = NULL;
  193|     45|    return tmp;
  194|     45|  } else
  195|      0|    return NULL;
  196|     45|}
smartlist_contains:
  202|      4|{
  203|      4|  int i;
  204|      7|  for (i=0; i < sl->num_used; i++)
  ------------------
  |  Branch (204:13): [True: 3, False: 4]
  ------------------
  205|      3|    if (sl->list[i] == element)
  ------------------
  |  Branch (205:9): [True: 0, False: 3]
  ------------------
  206|      0|      return 1;
  207|      4|  return 0;
  208|      4|}
smartlist_core.c:smartlist_ensure_capacity:
   63|  4.82k|{
   64|       |  /* Set MAX_CAPACITY to MIN(INT_MAX, SIZE_MAX / sizeof(void*)) */
   65|  4.82k|#if (SIZE_MAX/SIZEOF_VOID_P) > INT_MAX
   66|  4.82k|#define MAX_CAPACITY (INT_MAX)
   67|       |#else
   68|       |#define MAX_CAPACITY (int)((SIZE_MAX / (sizeof(void*))))
   69|       |#endif
   70|       |
   71|  4.82k|  raw_assert(size <= MAX_CAPACITY);
  ------------------
  |  |   20|  4.82k|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|  4.82k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  4.82k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 4.82k]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|  4.82k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  4.82k|#define STMT_END })
  |  |  ------------------
  ------------------
   72|       |
   73|  4.82k|  if (size > (size_t) sl->capacity) {
  ------------------
  |  Branch (73:7): [True: 85, False: 4.74k]
  ------------------
   74|     85|    size_t higher = (size_t) sl->capacity;
   75|     85|    if (PREDICT_UNLIKELY(size > MAX_CAPACITY/2)) {
  ------------------
  |  |  182|     85|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 0, False: 85]
  |  |  ------------------
  ------------------
   76|      0|      higher = MAX_CAPACITY;
  ------------------
  |  |   66|      0|#define MAX_CAPACITY (INT_MAX)
  ------------------
   77|     85|    } else {
   78|    170|      while (size > higher)
  ------------------
  |  Branch (78:14): [True: 85, False: 85]
  ------------------
   79|     85|        higher *= 2;
   80|     85|    }
   81|     85|    sl->list = tor_reallocarray(sl->list, sizeof(void *),
  ------------------
  |  |   67|     85|  tor_reallocarray_((ptr), (sz1), (sz2))
  ------------------
   82|     85|                                ((size_t)higher));
   83|     85|    memset(sl->list + sl->capacity, 0,
   84|     85|           sizeof(void *) * (higher - sl->capacity));
   85|     85|    sl->capacity = (int) higher;
   86|     85|  }
   87|  4.82k|#undef ASSERT_CAPACITY
   88|  4.82k|#undef MAX_CAPACITY
   89|  4.82k|}

smartlist_split_string:
   39|    499|{
   40|    499|  const char *cp, *end, *next;
   41|    499|  int n = 0;
   42|       |
   43|    499|  raw_assert(sl);
  ------------------
  |  |   20|    499|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|    499|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|    499|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 499]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|    499|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    499|#define STMT_END })
  |  |  ------------------
  ------------------
   44|    499|  raw_assert(str);
  ------------------
  |  |   20|    499|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|    499|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|    499|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 499]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|    499|  STMT_END
  |  |  ------------------
  |  |  |  |  205|    499|#define STMT_END })
  |  |  ------------------
  ------------------
   45|       |
   46|    499|  cp = str;
   47|  4.30k|  while (1) {
  ------------------
  |  Branch (47:10): [True: 4.30k, Folded]
  ------------------
   48|  4.30k|    if (flags&SPLIT_SKIP_SPACE) {
  ------------------
  |  |   14|  4.30k|#define SPLIT_SKIP_SPACE   0x01
  ------------------
  |  Branch (48:9): [True: 0, False: 4.30k]
  ------------------
   49|      0|      while (TOR_ISSPACE(*cp)) ++cp;
  ------------------
  |  Branch (49:14): [True: 0, False: 0]
  ------------------
   50|      0|    }
   51|       |
   52|  4.30k|    if (max>0 && n == max-1) {
  ------------------
  |  Branch (52:9): [True: 0, False: 4.30k]
  |  Branch (52:18): [True: 0, False: 0]
  ------------------
   53|      0|      end = strchr(cp,'\0');
   54|  4.30k|    } else if (sep) {
  ------------------
  |  Branch (54:16): [True: 4.30k, False: 0]
  ------------------
   55|  4.30k|      end = strstr(cp,sep);
   56|  4.30k|      if (!end)
  ------------------
  |  Branch (56:11): [True: 499, False: 3.80k]
  ------------------
   57|    499|        end = strchr(cp,'\0');
   58|  4.30k|    } else {
   59|      0|      for (end = cp; *end && *end != '\t' && *end != ' '; ++end)
  ------------------
  |  Branch (59:22): [True: 0, False: 0]
  |  Branch (59:30): [True: 0, False: 0]
  |  Branch (59:46): [True: 0, False: 0]
  ------------------
   60|      0|        ;
   61|      0|    }
   62|       |
   63|  4.30k|    raw_assert(end);
  ------------------
  |  |   20|  4.30k|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|  4.30k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  4.30k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 4.30k]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|  4.30k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  4.30k|#define STMT_END })
  |  |  ------------------
  ------------------
   64|       |
   65|  4.30k|    if (!*end) {
  ------------------
  |  Branch (65:9): [True: 499, False: 3.80k]
  ------------------
   66|    499|      next = NULL;
   67|  3.80k|    } else if (sep) {
  ------------------
  |  Branch (67:16): [True: 3.80k, False: 0]
  ------------------
   68|  3.80k|      next = end+strlen(sep);
   69|  3.80k|    } else {
   70|      0|      next = end+1;
   71|      0|      while (*next == '\t' || *next == ' ')
  ------------------
  |  Branch (71:14): [True: 0, False: 0]
  |  Branch (71:31): [True: 0, False: 0]
  ------------------
   72|      0|        ++next;
   73|      0|    }
   74|       |
   75|  4.30k|    if (flags&SPLIT_SKIP_SPACE) {
  ------------------
  |  |   14|  4.30k|#define SPLIT_SKIP_SPACE   0x01
  ------------------
  |  Branch (75:9): [True: 0, False: 4.30k]
  ------------------
   76|      0|      while (end > cp && TOR_ISSPACE(*(end-1)))
  ------------------
  |  Branch (76:14): [True: 0, False: 0]
  |  Branch (76:26): [True: 0, False: 0]
  ------------------
   77|      0|        --end;
   78|      0|    }
   79|  4.30k|    if (end != cp || !(flags&SPLIT_IGNORE_BLANK)) {
  ------------------
  |  |   15|  2.54k|#define SPLIT_IGNORE_BLANK 0x02
  ------------------
  |  Branch (79:9): [True: 1.76k, False: 2.54k]
  |  Branch (79:22): [True: 2.54k, False: 0]
  ------------------
   80|  4.30k|      char *string = tor_strndup(cp, end-cp);
  ------------------
  |  |   69|  4.30k|#define tor_strndup(s, n)      tor_strndup_(s, n)
  ------------------
   81|  4.30k|      if (flags&SPLIT_STRIP_SPACE)
  ------------------
  |  |   16|  4.30k|#define SPLIT_STRIP_SPACE  0x04
  ------------------
  |  Branch (81:11): [True: 0, False: 4.30k]
  ------------------
   82|      0|        tor_strstrip(string, " ");
   83|  4.30k|      smartlist_add(sl, string);
   84|  4.30k|      ++n;
   85|  4.30k|    }
   86|  4.30k|    if (!next)
  ------------------
  |  Branch (86:9): [True: 499, False: 3.80k]
  ------------------
   87|    499|      break;
   88|  3.80k|    cp = next;
   89|  3.80k|  }
   90|       |
   91|    499|  return n;
   92|    499|}

escape.c:TOR_ISPRINT:
   22|    576|  static inline int TOR_##name(char c) {                                \
   23|    576|    uint8_t u = c;                                                      \
   24|    576|    return !!(TOR_##name##_TABLE[(u >> 5) & 7] & (1u << (u & 31)));     \
   25|    576|  }
address.c:TOR_ISALNUM:
   22|  2.26k|  static inline int TOR_##name(char c) {                                \
   23|  2.26k|    uint8_t u = c;                                                      \
   24|  2.26k|    return !!(TOR_##name##_TABLE[(u >> 5) & 7] & (1u << (u & 31)));     \
   25|  2.26k|  }
inaddr.c:TOR_ISDIGIT:
   22|    423|  static inline int TOR_##name(char c) {                                \
   23|    423|    uint8_t u = c;                                                      \
   24|    423|    return !!(TOR_##name##_TABLE[(u >> 5) & 7] & (1u << (u & 31)));     \
   25|    423|  }
inaddr.c:TOR_ISXDIGIT:
   22|  2.45k|  static inline int TOR_##name(char c) {                                \
   23|  2.45k|    uint8_t u = c;                                                      \
   24|  2.45k|    return !!(TOR_##name##_TABLE[(u >> 5) & 7] & (1u << (u & 31)));     \
   25|  2.45k|  }
scanf.c:TOR_ISDIGIT:
   22|  8.88k|  static inline int TOR_##name(char c) {                                \
   23|  8.88k|    uint8_t u = c;                                                      \
   24|  8.88k|    return !!(TOR_##name##_TABLE[(u >> 5) & 7] & (1u << (u & 31)));     \
   25|  8.88k|  }

tor_snprintf:
   28|  1.09k|{
   29|  1.09k|  va_list ap;
   30|  1.09k|  int r;
   31|  1.09k|  va_start(ap,format);
   32|  1.09k|  r = tor_vsnprintf(str,size,format,ap);
   33|       |  va_end(ap);
   34|  1.09k|  return r;
   35|  1.09k|}
tor_vsnprintf:
   42|  1.09k|{
   43|  1.09k|  int r;
   44|  1.09k|  if (size == 0)
  ------------------
  |  Branch (44:7): [True: 0, False: 1.09k]
  ------------------
   45|      0|    return -1; /* no place for the NUL */
   46|  1.09k|  if (size > SIZE_T_CEILING)
  ------------------
  |  |  126|  1.09k|#define SIZE_T_CEILING  ((size_t)(SSIZE_MAX-16))
  ------------------
  |  Branch (46:7): [True: 0, False: 1.09k]
  ------------------
   47|      0|    return -1;
   48|       |#if defined(_WIN32) && !defined(HAVE_VSNPRINTF)
   49|       |  r = _vsnprintf(str, size, format, args);
   50|       |#else
   51|  1.09k|  r = vsnprintf(str, size, format, args);
   52|  1.09k|#endif
   53|  1.09k|  str[size-1] = '\0';
   54|  1.09k|  if (r < 0 || r >= (ssize_t)size)
  ------------------
  |  Branch (54:7): [True: 0, False: 1.09k]
  |  Branch (54:16): [True: 0, False: 1.09k]
  ------------------
   55|      0|    return -1;
   56|  1.09k|  return r;
   57|  1.09k|}

tor_vsscanf:
  180|  1.15k|{
  181|  1.15k|  int n_matched = 0;
  182|       |
  183|  3.57k|  while (*pattern) {
  ------------------
  |  Branch (183:10): [True: 3.56k, False: 8]
  ------------------
  184|  3.56k|    if (*pattern != '%') {
  ------------------
  |  Branch (184:9): [True: 1.17k, False: 2.39k]
  ------------------
  185|  1.17k|      if (*buf == *pattern) {
  ------------------
  |  Branch (185:11): [True: 950, False: 229]
  ------------------
  186|    950|        ++buf;
  187|    950|        ++pattern;
  188|    950|        continue;
  189|    950|      } else {
  190|    229|        return n_matched;
  191|    229|      }
  192|  2.39k|    } else {
  193|  2.39k|      int width = -1;
  194|  2.39k|      int longmod = 0;
  195|  2.39k|      ++pattern;
  196|  2.39k|      if (TOR_ISDIGIT(*pattern)) {
  ------------------
  |  Branch (196:11): [True: 2.10k, False: 289]
  ------------------
  197|  2.10k|        width = digit_to_num(*pattern++);
  198|  2.10k|        while (TOR_ISDIGIT(*pattern)) {
  ------------------
  |  Branch (198:16): [True: 0, False: 2.10k]
  ------------------
  199|      0|          width *= 10;
  200|      0|          width += digit_to_num(*pattern++);
  201|      0|          if (width > MAX_SCANF_WIDTH)
  ------------------
  |  |   18|      0|#define MAX_SCANF_WIDTH 9999
  ------------------
  |  Branch (201:15): [True: 0, False: 0]
  ------------------
  202|      0|            return -1;
  203|      0|        }
  204|  2.10k|        if (!width) /* No zero-width things. */
  ------------------
  |  Branch (204:13): [True: 0, False: 2.10k]
  ------------------
  205|      0|          return -1;
  206|  2.10k|      }
  207|  2.39k|      if (*pattern == 'l') {
  ------------------
  |  Branch (207:11): [True: 0, False: 2.39k]
  ------------------
  208|      0|        longmod = 1;
  209|      0|        ++pattern;
  210|      0|      }
  211|  2.39k|      if (*pattern == 'u' || *pattern == 'x') {
  ------------------
  |  Branch (211:11): [True: 2.10k, False: 289]
  |  Branch (211:30): [True: 0, False: 289]
  ------------------
  212|  2.10k|        unsigned long u;
  213|  2.10k|        const int base = (*pattern == 'u') ? 10 : 16;
  ------------------
  |  Branch (213:26): [True: 2.10k, False: 0]
  ------------------
  214|  2.10k|        if (!*buf)
  ------------------
  |  Branch (214:13): [True: 40, False: 2.06k]
  ------------------
  215|     40|          return n_matched;
  216|  2.06k|        if (scan_unsigned(&buf, &u, width, base)<0)
  ------------------
  |  Branch (216:13): [True: 593, False: 1.46k]
  ------------------
  217|    593|          return n_matched;
  218|  1.46k|        if (longmod) {
  ------------------
  |  Branch (218:13): [True: 0, False: 1.46k]
  ------------------
  219|      0|          unsigned long *out = va_arg(ap, unsigned long *);
  220|      0|          *out = u;
  221|  1.46k|        } else {
  222|  1.46k|          unsigned *out = va_arg(ap, unsigned *);
  223|  1.46k|          if (u > UINT_MAX)
  ------------------
  |  Branch (223:15): [True: 0, False: 1.46k]
  ------------------
  224|      0|            return n_matched;
  225|  1.46k|          *out = (unsigned) u;
  226|  1.46k|        }
  227|  1.46k|        ++pattern;
  228|  1.46k|        ++n_matched;
  229|  1.46k|      } else if (*pattern == 'f') {
  ------------------
  |  Branch (229:18): [True: 0, False: 289]
  ------------------
  230|      0|        double *d = va_arg(ap, double *);
  231|      0|        if (!longmod)
  ------------------
  |  Branch (231:13): [True: 0, False: 0]
  ------------------
  232|      0|          return -1; /* float not supported */
  233|      0|        if (!*buf)
  ------------------
  |  Branch (233:13): [True: 0, False: 0]
  ------------------
  234|      0|          return n_matched;
  235|      0|        if (scan_double(&buf, d, width)<0)
  ------------------
  |  Branch (235:13): [True: 0, False: 0]
  ------------------
  236|      0|          return n_matched;
  237|      0|        ++pattern;
  238|      0|        ++n_matched;
  239|    289|      } else if (*pattern == 'd') {
  ------------------
  |  Branch (239:18): [True: 0, False: 289]
  ------------------
  240|      0|        long lng=0;
  241|      0|        if (scan_signed(&buf, &lng, width)<0)
  ------------------
  |  Branch (241:13): [True: 0, False: 0]
  ------------------
  242|      0|          return n_matched;
  243|      0|        if (longmod) {
  ------------------
  |  Branch (243:13): [True: 0, False: 0]
  ------------------
  244|      0|          long *out = va_arg(ap, long *);
  245|      0|          *out = lng;
  246|      0|        } else {
  247|      0|          int *out = va_arg(ap, int *);
  248|      0|#if LONG_MAX > INT_MAX
  249|      0|          if (lng < INT_MIN || lng > INT_MAX)
  ------------------
  |  Branch (249:15): [True: 0, False: 0]
  |  Branch (249:32): [True: 0, False: 0]
  ------------------
  250|      0|            return n_matched;
  251|      0|#endif
  252|      0|          *out = (int)lng;
  253|      0|        }
  254|      0|        ++pattern;
  255|      0|        ++n_matched;
  256|    289|      } else if (*pattern == 's') {
  ------------------
  |  Branch (256:18): [True: 0, False: 289]
  ------------------
  257|      0|        char *s = va_arg(ap, char *);
  258|      0|        if (longmod)
  ------------------
  |  Branch (258:13): [True: 0, False: 0]
  ------------------
  259|      0|          return -1;
  260|      0|        if (width < 0)
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  ------------------
  261|      0|          return -1;
  262|      0|        if (scan_string(&buf, s, width)<0)
  ------------------
  |  Branch (262:13): [True: 0, False: 0]
  ------------------
  263|      0|          return n_matched;
  264|      0|        ++pattern;
  265|      0|        ++n_matched;
  266|    289|      } else if (*pattern == 'c') {
  ------------------
  |  Branch (266:18): [True: 289, False: 0]
  ------------------
  267|    289|        char *ch = va_arg(ap, char *);
  268|    289|        if (longmod)
  ------------------
  |  Branch (268:13): [True: 0, False: 289]
  ------------------
  269|      0|          return -1;
  270|    289|        if (width != -1)
  ------------------
  |  Branch (270:13): [True: 0, False: 289]
  ------------------
  271|      0|          return -1;
  272|    289|        if (!*buf)
  ------------------
  |  Branch (272:13): [True: 281, False: 8]
  ------------------
  273|    281|          return n_matched;
  274|      8|        *ch = *buf++;
  275|      8|        ++pattern;
  276|      8|        ++n_matched;
  277|      8|      } else if (*pattern == '%') {
  ------------------
  |  Branch (277:18): [True: 0, False: 0]
  ------------------
  278|      0|        if (*buf != '%')
  ------------------
  |  Branch (278:13): [True: 0, False: 0]
  ------------------
  279|      0|          return n_matched;
  280|      0|        if (longmod)
  ------------------
  |  Branch (280:13): [True: 0, False: 0]
  ------------------
  281|      0|          return -1;
  282|      0|        ++buf;
  283|      0|        ++pattern;
  284|      0|      } else {
  285|      0|        return -1; /* Unrecognized pattern component. */
  286|      0|      }
  287|  2.39k|    }
  288|  3.56k|  }
  289|       |
  290|      8|  return n_matched;
  291|  1.15k|}
tor_sscanf:
  310|  1.15k|{
  311|  1.15k|  int r;
  312|  1.15k|  va_list ap;
  313|  1.15k|  va_start(ap, pattern);
  314|  1.15k|  r = tor_vsscanf(buf, pattern, ap);
  315|       |  va_end(ap);
  316|  1.15k|  return r;
  317|  1.15k|}
scanf.c:digit_to_num:
   24|  4.74k|{
   25|  4.74k|  int num = ((int)d) - (int)'0';
   26|  4.74k|  raw_assert(num <= 9 && num >= 0);
  ------------------
  |  |   20|  4.74k|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|  4.74k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  9.48k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:11): [True: 4.74k, False: 0]
  |  |  |  Branch (21:11): [True: 4.74k, False: 0]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|  4.74k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  4.74k|#define STMT_END })
  |  |  ------------------
  ------------------
   27|  4.74k|  return num;
   28|  4.74k|}
scanf.c:scan_unsigned:
   36|  2.06k|{
   37|  2.06k|  unsigned long result = 0;
   38|  2.06k|  int scanned_so_far = 0;
   39|  2.06k|  const int hex = base==16;
   40|  2.06k|  raw_assert(base == 10 || base == 16);
  ------------------
  |  |   20|  2.06k|#define raw_assert(expr) STMT_BEGIN                                     \
  |  |  ------------------
  |  |  |  |  204|  2.06k|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   21|  2.06k|    if (!(expr)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (21:11): [True: 2.06k, False: 0]
  |  |  |  Branch (21:11): [True: 0, False: 0]
  |  |  ------------------
  |  |   22|      0|      tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL);   \
  |  |   23|      0|      tor_raw_abort_();                                                 \
  |  |   24|      0|    }                                                                   \
  |  |   25|  2.06k|  STMT_END
  |  |  ------------------
  |  |  |  |  205|  2.06k|#define STMT_END })
  |  |  ------------------
  ------------------
   41|  2.06k|  if (!bufp || !*bufp || !out)
  ------------------
  |  Branch (41:7): [True: 0, False: 2.06k]
  |  Branch (41:16): [True: 0, False: 2.06k]
  |  Branch (41:26): [True: 0, False: 2.06k]
  ------------------
   42|      0|    return -1;
   43|  2.06k|  if (width<0)
  ------------------
  |  Branch (43:7): [True: 0, False: 2.06k]
  ------------------
   44|      0|    width=MAX_SCANF_WIDTH;
  ------------------
  |  |   18|      0|#define MAX_SCANF_WIDTH 9999
  ------------------
   45|       |
   46|  4.70k|  while (**bufp && (hex?TOR_ISXDIGIT(**bufp):TOR_ISDIGIT(**bufp))
  ------------------
  |  Branch (46:10): [True: 4.39k, False: 308]
  |  Branch (46:20): [True: 2.68k, False: 1.70k]
  |  Branch (46:21): [True: 0, False: 4.39k]
  ------------------
   47|  2.68k|         && scanned_so_far < width) {
  ------------------
  |  Branch (47:13): [True: 2.63k, False: 46]
  ------------------
   48|  2.63k|    unsigned digit = hex?hex_decode_digit(*(*bufp)++):digit_to_num(*(*bufp)++);
  ------------------
  |  Branch (48:22): [True: 0, False: 2.63k]
  ------------------
   49|       |    // Check for overflow beforehand, without actually causing any overflow
   50|       |    // This preserves functionality on compilers that don't wrap overflow
   51|       |    // (i.e. that trap or optimise away overflow)
   52|       |    // result * base + digit > ULONG_MAX
   53|       |    // result * base > ULONG_MAX - digit
   54|  2.63k|    if (result > (ULONG_MAX - digit)/base)
  ------------------
  |  Branch (54:9): [True: 0, False: 2.63k]
  ------------------
   55|      0|      return -1; /* Processing this digit would overflow */
   56|  2.63k|    result = result * base + digit;
   57|  2.63k|    ++scanned_so_far;
   58|  2.63k|  }
   59|       |
   60|  2.06k|  if (!scanned_so_far) /* No actual digits scanned */
  ------------------
  |  Branch (60:7): [True: 593, False: 1.46k]
  ------------------
   61|    593|    return -1;
   62|       |
   63|  1.46k|  *out = result;
   64|  1.46k|  return 0;
   65|  2.06k|}

tor_strlower:
  130|    242|{
  131|  4.38k|  while (*s) {
  ------------------
  |  Branch (131:10): [True: 4.13k, False: 242]
  ------------------
  132|  4.13k|    *s = TOR_TOLOWER(*s);
  ------------------
  |  |   36|  4.13k|#define TOR_TOLOWER(c) (TOR_TOLOWER_TABLE[(uint8_t)c])
  ------------------
  133|  4.13k|    ++s;
  134|  4.13k|  }
  135|    242|}
strcmpstart:
  218|      1|{
  219|      1|  size_t n = strlen(s2);
  220|      1|  return strncmp(s1, s2, n);
  221|      1|}

tor_get_thread_id:
  101|      1|{
  102|      1|  union {
  103|      1|    pthread_t thr;
  104|      1|    unsigned long id;
  105|      1|  } r;
  106|      1|  r.thr = pthread_self();
  107|      1|  return r.id;
  108|      1|}
tor_threadlocal_init:
  228|      1|{
  229|      1|  int err = pthread_key_create(&threadlocal->key, NULL);
  230|      1|  return err ? -1 : 0;
  ------------------
  |  Branch (230:10): [True: 0, False: 1]
  ------------------
  231|      1|}
tor_threads_init:
  256|      1|{
  257|      1|  if (!threads_initialized) {
  ------------------
  |  Branch (257:7): [True: 1, False: 0]
  ------------------
  258|      1|    tor_locking_init();
  259|      1|    const int ret1 = pthread_attr_init(&attr_detached);
  260|      1|    tor_assert(ret1 == 0);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|       |#ifndef PTHREAD_CREATE_DETACHED
  262|       |#define PTHREAD_CREATE_DETACHED 1
  263|       |#endif
  264|      1|    const int ret2 =
  265|      1|      pthread_attr_setdetachstate(&attr_detached, PTHREAD_CREATE_DETACHED);
  266|      1|    tor_assert(ret2 == 0);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  267|      1|    threads_initialized = 1;
  268|      1|  }
  269|      1|  set_main_thread();
  270|      1|}

set_main_thread:
   52|      1|{
   53|      1|  main_thread_id = tor_get_thread_id();
   54|      1|}
compat_threads.c:subsys_threads_initialize:
  125|      1|{
  126|      1|  tor_threads_init();
  127|      1|  return 0;
  128|      1|}

config.c:atomic_counter_init:
  128|      1|{
  129|       |  atomic_init(&counter->val, 0);
  130|      1|}
config.c:atomic_counter_exchange:
  168|      1|{
  169|       |  return atomic_exchange(&counter->val, newval);
  170|      1|}
compress.c:atomic_counter_init:
  128|      2|{
  129|       |  atomic_init(&counter->val, 0);
  130|      2|}
compress_lzma.c:atomic_counter_init:
  128|      2|{
  129|       |  atomic_init(&counter->val, 0);
  130|      2|}
compress_zlib.c:atomic_counter_init:
  128|      2|{
  129|       |  atomic_init(&counter->val, 0);
  130|      2|}
compress_zstd.c:atomic_counter_init:
  128|      2|{
  129|       |  atomic_init(&counter->val, 0);
  130|      2|}
util_bug.c:atomic_counter_init:
  128|      1|{
  129|       |  atomic_init(&counter->val, 0);
  130|      1|}

monotime_get:
  400|      1|{
  401|      1|#ifdef TOR_UNIT_TESTS
  402|      1|  if (monotime_mocking_enabled) {
  ------------------
  |  Branch (402:7): [True: 0, False: 1]
  ------------------
  403|      0|    out->ts_.tv_sec = (time_t) (mock_time_nsec / ONE_BILLION);
  ------------------
  |  |   78|      0|#define ONE_BILLION ((int64_t) (1000 * 1000 * 1000))
  ------------------
  404|      0|    out->ts_.tv_nsec = (int) (mock_time_nsec % ONE_BILLION);
  ------------------
  |  |   78|      0|#define ONE_BILLION ((int64_t) (1000 * 1000 * 1000))
  ------------------
  405|      0|    return;
  406|      0|  }
  407|      1|#endif /* defined(TOR_UNIT_TESTS) */
  408|      1|  int r = clock_gettime(CLOCK_MONOTONIC, &out->ts_);
  409|      1|  tor_assert(r == 0);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  410|      1|}
monotime_coarse_get:
  415|      1|{
  416|      1|#ifdef TOR_UNIT_TESTS
  417|      1|  if (monotime_mocking_enabled) {
  ------------------
  |  Branch (417:7): [True: 0, False: 1]
  ------------------
  418|      0|    out->ts_.tv_sec = (time_t) (mock_time_nsec_coarse / ONE_BILLION);
  ------------------
  |  |   78|      0|#define ONE_BILLION ((int64_t) (1000 * 1000 * 1000))
  ------------------
  419|      0|    out->ts_.tv_nsec = (int) (mock_time_nsec_coarse % ONE_BILLION);
  ------------------
  |  |   78|      0|#define ONE_BILLION ((int64_t) (1000 * 1000 * 1000))
  ------------------
  420|      0|    return;
  421|      0|  }
  422|      1|#endif /* defined(TOR_UNIT_TESTS) */
  423|      1|  int r = clock_gettime(clock_monotonic_coarse, &out->ts_);
  424|      1|  if (PREDICT_UNLIKELY(r < 0) &&
  ------------------
  |  |  182|      2|#define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0)
  |  |  ------------------
  |  |  |  Branch (182:31): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  425|      1|      errno == EINVAL &&
  ------------------
  |  Branch (425:7): [True: 0, False: 0]
  ------------------
  426|      0|      clock_monotonic_coarse == CLOCK_MONOTONIC_COARSE) {
  ------------------
  |  Branch (426:7): [True: 0, False: 0]
  ------------------
  427|       |    /* We should have caught this at startup in monotime_init_internal!
  428|       |     */
  429|      0|    log_warn(LD_BUG, "Falling back to non-coarse monotonic time %s initial "
  ------------------
  |  |  278|      0|  log_fn_(LOG_WARN, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   24|      0|#define LOG_WARN LOG_WARNING
  |  |  ------------------
  |  |  |  Branch (278:51): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  430|      0|             "system start?", monotime_initialized?"after":"without");
  431|      0|    clock_monotonic_coarse = CLOCK_MONOTONIC;
  432|      0|    r = clock_gettime(clock_monotonic_coarse, &out->ts_);
  433|      0|  }
  434|       |
  435|      1|  tor_assert(r == 0);
  ------------------
  |  |  103|      1|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      1|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      1|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      1|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      1|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      1|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      1|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      1|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 1, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      1|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      1|    else                                        \
  |  |  |  |  |  |  |  |   80|      1|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      1|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      1|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      1|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      1|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      1|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  436|      1|}
monotime_init:
  752|      1|{
  753|      1|  if (!monotime_initialized) {
  ------------------
  |  Branch (753:7): [True: 1, False: 0]
  ------------------
  754|      1|    monotime_init_internal();
  755|      1|    monotime_initialized = 1;
  756|      1|    monotime_get(&initialized_at);
  757|      1|#ifdef MONOTIME_COARSE_FN_IS_DIFFERENT
  758|      1|    monotime_coarse_get(&initialized_at_coarse);
  759|      1|#endif
  760|      1|  }
  761|      1|}
compat_time.c:monotime_init_internal:
  387|      1|{
  388|      1|#ifdef CLOCK_MONOTONIC_COARSE
  389|      1|  struct timespec ts;
  390|      1|  if (clock_gettime(CLOCK_MONOTONIC_COARSE, &ts) < 0) {
  ------------------
  |  Branch (390:7): [True: 0, False: 1]
  ------------------
  391|      0|    log_info(LD_GENERAL, "CLOCK_MONOTONIC_COARSE isn't working (%s); "
  ------------------
  |  |  274|      0|  log_fn_(LOG_INFO, domain, __FUNCTION__, args, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |  392|      0|             "falling back to CLOCK_MONOTONIC.", strerror(errno));
  |  |  ------------------
  ------------------
  392|      0|             "falling back to CLOCK_MONOTONIC.", strerror(errno));
  393|       |    clock_monotonic_coarse = CLOCK_MONOTONIC;
  394|      0|  }
  395|      1|#endif /* defined(CLOCK_MONOTONIC_COARSE) */
  396|      1|}

time_sys.c:subsys_time_initialize:
   16|      1|{
   17|      1|  monotime_init();
   18|      1|  return 0;
   19|      1|}

get_version:
   39|      1|{
   40|      1|  if (the_tor_version[0] == 0) {
  ------------------
  |  Branch (40:7): [True: 1, False: 0]
  ------------------
   41|      1|    if (strlen(tor_git_revision)) {
  ------------------
  |  Branch (41:9): [True: 1, False: 0]
  ------------------
   42|      1|      snprintf(the_tor_version, sizeof(the_tor_version),
   43|      1|               "%s (git-%s)", the_short_tor_version, tor_git_revision);
   44|      1|    } else {
   45|      0|      snprintf(the_tor_version, sizeof(the_tor_version),
   46|      0|               "%s", the_short_tor_version);
   47|      0|    }
   48|      1|    the_tor_version[sizeof(the_tor_version)-1] = 0;
   49|      1|  }
   50|       |
   51|      1|  return the_tor_version;
   52|      1|}

approx_time:
   33|    242|{
   34|    242|  return cached_approx_time;
   35|    242|}
update_approx_time:
   42|      1|{
   43|      1|  cached_approx_time = now;
   44|      1|}
approx_time.c:subsys_wallclock_initialize:
   52|      1|{
   53|       |  update_approx_time(time(NULL));
   54|      1|  return 0;
   55|      1|}

tor_localtime_r_msg:
  126|      1|{
  127|      1|  struct tm *r;
  128|      1|  r = localtime_r(timep, result);
  129|      1|  return correct_tm(1, timep, result, r, err_out);
  130|      1|}
time_to_tm.c:correct_tm:
   38|      1|{
   39|      1|  const char *outcome;
   40|       |
   41|      1|  if (PREDICT_LIKELY(r)) {
  ------------------
  |  |  174|      1|#define PREDICT_LIKELY(exp) __builtin_expect(!!(exp), 1)
  |  |  ------------------
  |  |  |  Branch (174:29): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   42|       |    /* We can't strftime dates after 9999 CE, and we want to avoid dates
   43|       |     * before 1 CE (avoiding the year 0 issue and negative years). */
   44|      1|    if (r->tm_year > 8099) {
  ------------------
  |  Branch (44:9): [True: 0, False: 1]
  ------------------
   45|      0|      r->tm_year = 8099;
   46|      0|      r->tm_mon = 11;
   47|      0|      r->tm_mday = 31;
   48|      0|      r->tm_yday = 364;
   49|      0|      r->tm_wday = 6;
   50|      0|      r->tm_hour = 23;
   51|      0|      r->tm_min = 59;
   52|      0|      r->tm_sec = 59;
   53|      1|    } else if (r->tm_year < (1-1900)) {
  ------------------
  |  Branch (53:16): [True: 0, False: 1]
  ------------------
   54|      0|      r->tm_year = (1-1900);
   55|      0|      r->tm_mon = 0;
   56|      0|      r->tm_mday = 1;
   57|      0|      r->tm_yday = 0;
   58|      0|      r->tm_wday = 0;
   59|      0|      r->tm_hour = 0;
   60|      0|      r->tm_min = 0;
   61|      0|      r->tm_sec = 0;
   62|      0|    }
   63|      1|    return r;
   64|      1|  }
   65|       |
   66|       |  /* If we get here, gmtime or localtime returned NULL. It might have done
   67|       |   * this because of overrun or underrun, or it might have done it because of
   68|       |   * some other weird issue. */
   69|      0|  if (timep) {
  ------------------
  |  Branch (69:7): [True: 0, False: 0]
  ------------------
   70|      0|    if (*timep < 0) {
  ------------------
  |  Branch (70:9): [True: 0, False: 0]
  ------------------
   71|      0|      r = resultbuf;
   72|      0|      r->tm_year = 70; /* 1970 CE */
   73|      0|      r->tm_mon = 0;
   74|      0|      r->tm_mday = 1;
   75|      0|      r->tm_yday = 0;
   76|      0|      r->tm_wday = 0;
   77|      0|      r->tm_hour = 0;
   78|      0|      r->tm_min = 0 ;
   79|      0|      r->tm_sec = 0;
   80|      0|      outcome = "Rounding up to 1970";
   81|      0|      goto done;
   82|      0|    } else if (*timep >= INT32_MAX) {
  ------------------
  |  Branch (82:16): [True: 0, False: 0]
  ------------------
   83|       |      /* Rounding down to INT32_MAX isn't so great, but keep in mind that we
   84|       |       * only do it if gmtime/localtime tells us NULL. */
   85|      0|      r = resultbuf;
   86|      0|      r->tm_year = 137; /* 2037 CE */
   87|      0|      r->tm_mon = 11;
   88|      0|      r->tm_mday = 31;
   89|      0|      r->tm_yday = 364;
   90|      0|      r->tm_wday = 6;
   91|      0|      r->tm_hour = 23;
   92|      0|      r->tm_min = 59;
   93|      0|      r->tm_sec = 59;
   94|      0|      outcome = "Rounding down to 2037";
   95|      0|      goto done;
   96|      0|    }
   97|      0|  }
   98|       |
   99|       |  /* If we get here, then gmtime/localtime failed without getting an extreme
  100|       |   * value for *timep */
  101|       |  /* LCOV_EXCL_START */
  102|      0|  r = resultbuf;
  103|      0|  memset(resultbuf, 0, sizeof(struct tm));
  104|      0|  outcome="can't recover";
  105|       |  /* LCOV_EXCL_STOP */
  106|      0| done:
  107|      0|  if (err_out) {
  ------------------
  |  Branch (107:7): [True: 0, False: 0]
  ------------------
  108|      0|    tor_asprintf(err_out, "%s(%"PRId64") failed with error %s: %s",
  109|      0|                 islocal?"localtime":"gmtime",
  ------------------
  |  Branch (109:18): [True: 0, False: 0]
  ------------------
  110|      0|                 timep?((int64_t)*timep):0,
  ------------------
  |  Branch (110:18): [True: 0, False: 0]
  ------------------
  111|       |                 strerror(errno),
  112|      0|                 outcome);
  113|      0|  }
  114|      0|  return r;
  115|      0|}

tor_gettimeofday__real:
   43|      1|{
   44|       |#ifdef _WIN32
   45|       |  /* Epoch bias copied from perl: number of units between windows epoch and
   46|       |   * Unix epoch. */
   47|       |#define EPOCH_BIAS UINT64_C(116444736000000000)
   48|       |#define UNITS_PER_SEC UINT64_C(10000000)
   49|       |#define USEC_PER_SEC UINT64_C(1000000)
   50|       |#define UNITS_PER_USEC UINT64_C(10)
   51|       |  union {
   52|       |    uint64_t ft_64;
   53|       |    FILETIME ft_ft;
   54|       |  } ft;
   55|       |  /* number of 100-nsec units since Jan 1, 1601 */
   56|       |  GetSystemTimeAsFileTime(&ft.ft_ft);
   57|       |  if (ft.ft_64 < EPOCH_BIAS) {
   58|       |    /* LCOV_EXCL_START */
   59|       |    raw_assert_unreached_msg("System time is before 1970; failing.");
   60|       |    /* LCOV_EXCL_STOP */
   61|       |  }
   62|       |  ft.ft_64 -= EPOCH_BIAS;
   63|       |  timeval->tv_sec = (unsigned) (ft.ft_64 / UNITS_PER_SEC);
   64|       |  timeval->tv_usec = (unsigned) ((ft.ft_64 / UNITS_PER_USEC) % USEC_PER_SEC);
   65|       |#elif defined(HAVE_GETTIMEOFDAY)
   66|      1|  if (gettimeofday(timeval, NULL)) {
  ------------------
  |  Branch (66:7): [True: 0, False: 1]
  ------------------
   67|       |    /* LCOV_EXCL_START */
   68|       |    /* If gettimeofday dies, we have either given a bad timezone (we didn't),
   69|       |       or segfaulted.*/
   70|      0|    raw_assert_unreached_msg("gettimeofday failed");
  ------------------
  |  |   27|      0|#define raw_assert_unreached_msg(msg) STMT_BEGIN                    \
  |  |  ------------------
  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  ------------------
  |  |   28|      0|    tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg));  \
  |  |   29|      0|    tor_raw_abort_();                                               \
  |  |   30|      0|  STMT_END
  |  |  ------------------
  |  |  |  |  205|      0|#define STMT_END })
  |  |  ------------------
  ------------------
   71|       |    /* LCOV_EXCL_STOP */
   72|      0|  }
   73|       |#elif defined(HAVE_FTIME)
   74|       |  struct timeb tb;
   75|       |  ftime(&tb);
   76|       |  timeval->tv_sec = tb.time;
   77|       |  timeval->tv_usec = tb.millitm * 1000;
   78|       |#else
   79|       |#error "No way to get time."
   80|       |#endif /* defined(_WIN32) || ... */
   81|      1|  return;
   82|      1|}

fuzz_init:
   19|      1|{
   20|      1|  addressmap_init();
   21|      1|  return 0;
   22|      1|}
fuzz_main:
   33|  1.42k|{
   34|  1.42k|  buf_t *buffer = buf_new_with_data((char*)stdin_buf, data_size);
   35|  1.42k|  if (!buffer) {
  ------------------
  |  Branch (35:7): [True: 0, False: 1.42k]
  ------------------
   36|      0|    tor_assert(data_size==0);
  ------------------
  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  ------------------
  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  ------------------
  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  ------------------
  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   37|      0|    buffer = buf_new();
   38|      0|  }
   39|       |
   40|  1.42k|  socks_request_t *request = socks_request_new();
   41|       |
   42|  1.42k|  int r = fetch_from_buf_socks(buffer, request, 0, 0);
   43|  1.42k|  log_info(LD_GENERAL, "Socks request status: %d", r);
  ------------------
  |  |  274|  1.42k|  log_fn_(LOG_INFO, domain, __FUNCTION__, args, ##__VA_ARGS__)
  ------------------
   44|       |
   45|       |  /* Reset. */
   46|  1.42k|  buf_free(buffer);
  ------------------
  |  |   28|  1.42k|#define buf_free(b) FREE_AND_NULL(buf_t, buf_free_, (b))
  |  |  ------------------
  |  |  |  |   85|  1.42k|  do {                                                                  \
  |  |  |  |   86|  1.42k|    /* only evaluate (var) once. */                                     \
  |  |  |  |   87|  1.42k|    typename **tmp__free__ptr ## freefn = &(var);                       \
  |  |  |  |   88|  1.42k|    freefn(*tmp__free__ptr ## freefn);                                  \
  |  |  |  |   89|  1.42k|    (*tmp__free__ptr ## freefn) = NULL;                                 \
  |  |  |  |   90|  1.42k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:12): [Folded, False: 1.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   47|  1.42k|  socks_request_free(request);
  ------------------
  |  |   21|  1.42k|  FREE_AND_NULL(socks_request_t, socks_request_free_, (req))
  |  |  ------------------
  |  |  |  |   85|  1.42k|  do {                                                                  \
  |  |  |  |   86|  1.42k|    /* only evaluate (var) once. */                                     \
  |  |  |  |   87|  1.42k|    typename **tmp__free__ptr ## freefn = &(var);                       \
  |  |  |  |   88|  1.42k|    freefn(*tmp__free__ptr ## freefn);                                  \
  |  |  |  |   89|  1.42k|    (*tmp__free__ptr ## freefn) = NULL;                                 \
  |  |  |  |   90|  1.42k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:12): [Folded, False: 1.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|       |
   49|  1.42k|  return 0;
   50|  1.42k|}

LLVMFuzzerTestOneInput:
  129|  1.42k|{
  130|  1.42k|  static int initialized = 0;
  131|  1.42k|  if (!initialized) {
  ------------------
  |  Branch (131:7): [True: 1, False: 1.42k]
  ------------------
  132|      1|    global_init();
  133|      1|    if (fuzz_init() < 0)
  ------------------
  |  Branch (133:9): [True: 0, False: 1]
  ------------------
  134|      0|      abort();
  135|      1|    initialized = 1;
  136|      1|  }
  137|       |
  138|  1.42k|  return fuzz_main(Data, Size);
  139|  1.42k|}
fuzzing_common.c:global_init:
   99|      1|{
  100|      1|  subsystems_init_upto(SUBSYS_LEVEL_LIBS);
  ------------------
  |  |  228|      1|#define SUBSYS_LEVEL_LIBS -10
  ------------------
  101|      1|  flush_log_messages_from_startup();
  102|       |
  103|      1|  tor_compress_init();
  104|       |
  105|      1|  if (crypto_global_init(0, NULL, NULL) < 0)
  ------------------
  |  Branch (105:7): [True: 0, False: 1]
  ------------------
  106|      0|    abort();
  107|       |
  108|      1|  {
  109|      1|    struct sipkey sipkey = { 1337, 7331 };
  110|      1|    siphash_unset_global_key();
  111|      1|    siphash_set_global_key(&sipkey);
  112|      1|  }
  113|       |
  114|       |  /* set up the options. */
  115|      1|  mock_options = options_new();
  116|      1|  MOCK(get_options, mock_get_options);
  ------------------
  |  |  115|      1|  do {                                          \
  |  |  116|      1|    (func) = (replacement);                     \
  |  |  117|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (117:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  117|       |
  118|       |  /* Make BUG() and nonfatal asserts crash */
  119|      1|  tor_set_failed_assertion_callback(abort);
  120|       |
  121|       |  /* Make protocol warnings handled correctly. */
  122|      1|  init_protocol_warning_severity_level();
  123|      1|}
fuzzing_common.c:mock_get_options:
   19|    221|{
   20|    221|  return mock_options;
   21|    221|}

domainname_new:
   33|    183|{
   34|    183|  domainname_t *val = trunnel_calloc(1, sizeof(domainname_t));
  ------------------
  |  |   10|    183|#define trunnel_calloc tor_calloc
  |  |  ------------------
  |  |  |  |   64|    183|#define tor_calloc(nmemb,size) tor_calloc_(nmemb, size)
  |  |  ------------------
  ------------------
   35|    183|  if (NULL == val)
  ------------------
  |  Branch (35:7): [True: 0, False: 183]
  ------------------
   36|      0|    return NULL;
   37|    183|  return val;
   38|    183|}
domainname_free:
   52|    633|{
   53|    633|  if (obj == NULL)
  ------------------
  |  Branch (53:7): [True: 450, False: 183]
  ------------------
   54|    450|    return;
   55|    183|  domainname_clear(obj);
   56|    183|  trunnel_memwipe(obj, sizeof(domainname_t));
  ------------------
  |  |   16|    183|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  ------------------
   57|    183|  trunnel_free_(obj);
  ------------------
  |  |   12|    183|#define trunnel_free_ tor_free_
  ------------------
   58|    183|}
domainname_getarray_name:
  110|    161|{
  111|    161|  return inp->name.elts_;
  112|    161|}
domainname_getconstarray_name:
  115|    161|{
  116|    161|  return (const char  *)domainname_getarray_name((domainname_t*)inp);
  117|    161|}
domainname_setstr0_name:
  138|    175|{
  139|    175|#if UINT8_MAX < SIZE_MAX
  140|    175|  if (len > UINT8_MAX) {
  ------------------
  |  Branch (140:7): [True: 0, False: 175]
  ------------------
  141|      0|    TRUNNEL_SET_ERROR_CODE(inp);
  ------------------
  |  |   11|      0|  do {                              \
  |  |   12|      0|    (obj)->trunnel_error_code_ = 1; \
  |  |   13|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (13:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  142|      0|    return -1;
  143|      0|  }
  144|    175|#endif
  145|    175|  return trunnel_string_setstr0(&inp->name, val, len, &inp->trunnel_error_code_);
  146|    175|}
domainname_parse:
  280|    183|{
  281|    183|  ssize_t result;
  282|    183|  *output = domainname_new();
  283|    183|  if (NULL == *output)
  ------------------
  |  Branch (283:7): [True: 0, False: 183]
  ------------------
  284|      0|    return -1;
  285|    183|  result = domainname_parse_into(*output, input, len_in);
  286|    183|  if (result < 0) {
  ------------------
  |  Branch (286:7): [True: 8, False: 175]
  ------------------
  287|      8|    domainname_free(*output);
  288|       |    *output = NULL;
  289|      8|  }
  290|    183|  return result;
  291|    183|}
socks4_client_request_new:
  294|    594|{
  295|    594|  socks4_client_request_t *val = trunnel_calloc(1, sizeof(socks4_client_request_t));
  ------------------
  |  |   10|    594|#define trunnel_calloc tor_calloc
  |  |  ------------------
  |  |  |  |   64|    594|#define tor_calloc(nmemb,size) tor_calloc_(nmemb, size)
  |  |  ------------------
  ------------------
  296|    594|  if (NULL == val)
  ------------------
  |  Branch (296:7): [True: 0, False: 594]
  ------------------
  297|      0|    return NULL;
  298|    594|  val->version = 4;
  299|    594|  val->command = CMD_BIND;
  ------------------
  |  |   12|    594|#define CMD_BIND 2
  ------------------
  300|    594|  return val;
  301|    594|}
socks4_client_request_free:
  317|    650|{
  318|    650|  if (obj == NULL)
  ------------------
  |  Branch (318:7): [True: 56, False: 594]
  ------------------
  319|     56|    return;
  320|    594|  socks4_client_request_clear(obj);
  321|    594|  trunnel_memwipe(obj, sizeof(socks4_client_request_t));
  ------------------
  |  |   16|    594|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  ------------------
  322|    594|  trunnel_free_(obj);
  ------------------
  |  |   12|    594|#define trunnel_free_ tor_free_
  ------------------
  323|    594|}
socks4_client_request_get_command:
  342|    538|{
  343|    538|  return inp->command;
  344|    538|}
socks4_client_request_get_port:
  357|    538|{
  358|    538|  return inp->port;
  359|    538|}
socks4_client_request_get_addr:
  368|    538|{
  369|    538|  return inp->addr;
  370|    538|}
socks4_client_request_get_username:
  379|    533|{
  380|    533|  return inp->username;
  381|    533|}
socks4_client_request_get_socks4a_addr_hostname:
  394|    330|{
  395|    330|  return inp->socks4a_addr_hostname;
  396|    330|}
socks4_client_request_parse:
 1679|    594|{
 1680|    594|  ssize_t result;
 1681|    594|  *output = socks4_client_request_new();
 1682|    594|  if (NULL == *output)
  ------------------
  |  Branch (1682:7): [True: 0, False: 594]
  ------------------
 1683|      0|    return -1;
 1684|    594|  result = socks4_client_request_parse_into(*output, input, len_in);
 1685|    594|  if (result < 0) {
  ------------------
  |  Branch (1685:7): [True: 56, False: 538]
  ------------------
 1686|     56|    socks4_client_request_free(*output);
 1687|       |    *output = NULL;
 1688|     56|  }
 1689|    594|  return result;
 1690|    594|}
socks5_client_userpass_auth_new:
 1935|    204|{
 1936|    204|  socks5_client_userpass_auth_t *val = trunnel_calloc(1, sizeof(socks5_client_userpass_auth_t));
  ------------------
  |  |   10|    204|#define trunnel_calloc tor_calloc
  |  |  ------------------
  |  |  |  |   64|    204|#define tor_calloc(nmemb,size) tor_calloc_(nmemb, size)
  |  |  ------------------
  ------------------
 1937|    204|  if (NULL == val)
  ------------------
  |  Branch (1937:7): [True: 0, False: 204]
  ------------------
 1938|      0|    return NULL;
 1939|    204|  val->version = 1;
 1940|    204|  return val;
 1941|    204|}
socks5_client_userpass_auth_free:
 1957|    244|{
 1958|    244|  if (obj == NULL)
  ------------------
  |  Branch (1958:7): [True: 40, False: 204]
  ------------------
 1959|     40|    return;
 1960|    204|  socks5_client_userpass_auth_clear(obj);
 1961|    204|  trunnel_memwipe(obj, sizeof(socks5_client_userpass_auth_t));
  ------------------
  |  |   16|    204|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  ------------------
 1962|    204|  trunnel_free_(obj);
  ------------------
  |  |   12|    204|#define trunnel_free_ tor_free_
  ------------------
 1963|    204|}
socks5_client_userpass_auth_get_username_len:
 1982|    164|{
 1983|    164|  return inp->username_len;
 1984|    164|}
socks5_client_userpass_auth_getarray_username:
 2030|    164|{
 2031|    164|  return inp->username.elts_;
 2032|    164|}
socks5_client_userpass_auth_getconstarray_username:
 2035|    164|{
 2036|    164|  return (const char  *)socks5_client_userpass_auth_getarray_username((socks5_client_userpass_auth_t*)inp);
 2037|    164|}
socks5_client_userpass_auth_setstr0_username:
 2058|    201|{
 2059|    201|#if UINT8_MAX < SIZE_MAX
 2060|    201|  if (len > UINT8_MAX) {
  ------------------
  |  Branch (2060:7): [True: 0, False: 201]
  ------------------
 2061|      0|    TRUNNEL_SET_ERROR_CODE(inp);
  ------------------
  |  |   11|      0|  do {                              \
  |  |   12|      0|    (obj)->trunnel_error_code_ = 1; \
  |  |   13|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (13:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2062|      0|    return -1;
 2063|      0|  }
 2064|    201|#endif
 2065|    201|  return trunnel_string_setstr0(&inp->username, val, len, &inp->trunnel_error_code_);
 2066|    201|}
socks5_client_userpass_auth_get_passwd_len:
 2074|    164|{
 2075|    164|  return inp->passwd_len;
 2076|    164|}
socks5_client_userpass_auth_getarray_passwd:
 2122|    164|{
 2123|    164|  return inp->passwd.elts_;
 2124|    164|}
socks5_client_userpass_auth_getconstarray_passwd:
 2127|    164|{
 2128|    164|  return (const char  *)socks5_client_userpass_auth_getarray_passwd((socks5_client_userpass_auth_t*)inp);
 2129|    164|}
socks5_client_userpass_auth_setstr0_passwd:
 2150|    164|{
 2151|    164|#if UINT8_MAX < SIZE_MAX
 2152|    164|  if (len > UINT8_MAX) {
  ------------------
  |  Branch (2152:7): [True: 0, False: 164]
  ------------------
 2153|      0|    TRUNNEL_SET_ERROR_CODE(inp);
  ------------------
  |  |   11|      0|  do {                              \
  |  |   12|      0|    (obj)->trunnel_error_code_ = 1; \
  |  |   13|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (13:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2154|      0|    return -1;
 2155|      0|  }
 2156|    164|#endif
 2157|    164|  return trunnel_string_setstr0(&inp->passwd, val, len, &inp->trunnel_error_code_);
 2158|    164|}
socks5_client_userpass_auth_parse:
 2350|    204|{
 2351|    204|  ssize_t result;
 2352|    204|  *output = socks5_client_userpass_auth_new();
 2353|    204|  if (NULL == *output)
  ------------------
  |  Branch (2353:7): [True: 0, False: 204]
  ------------------
 2354|      0|    return -1;
 2355|    204|  result = socks5_client_userpass_auth_parse_into(*output, input, len_in);
 2356|    204|  if (result < 0) {
  ------------------
  |  Branch (2356:7): [True: 40, False: 164]
  ------------------
 2357|     40|    socks5_client_userpass_auth_free(*output);
 2358|       |    *output = NULL;
 2359|     40|  }
 2360|    204|  return result;
 2361|    204|}
socks5_client_version_new:
 2364|    560|{
 2365|    560|  socks5_client_version_t *val = trunnel_calloc(1, sizeof(socks5_client_version_t));
  ------------------
  |  |   10|    560|#define trunnel_calloc tor_calloc
  |  |  ------------------
  |  |  |  |   64|    560|#define tor_calloc(nmemb,size) tor_calloc_(nmemb, size)
  |  |  ------------------
  ------------------
 2366|    560|  if (NULL == val)
  ------------------
  |  Branch (2366:7): [True: 0, False: 560]
  ------------------
 2367|      0|    return NULL;
 2368|    560|  val->version = 5;
 2369|    560|  return val;
 2370|    560|}
socks5_client_version_free:
 2384|    571|{
 2385|    571|  if (obj == NULL)
  ------------------
  |  Branch (2385:7): [True: 11, False: 560]
  ------------------
 2386|     11|    return;
 2387|    560|  socks5_client_version_clear(obj);
 2388|    560|  trunnel_memwipe(obj, sizeof(socks5_client_version_t));
  ------------------
  |  |   16|    560|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  ------------------
 2389|    560|  trunnel_free_(obj);
  ------------------
  |  |   12|    560|#define trunnel_free_ tor_free_
  ------------------
 2390|    560|}
socks5_client_version_get_n_methods:
 2409|    549|{
 2410|    549|  return inp->n_methods;
 2411|    549|}
socks5_client_version_get_methods:
 2426|  5.24k|{
 2427|  5.24k|  return TRUNNEL_DYNARRAY_GET(&inp->methods, idx);
  ------------------
  |  |  165|  5.24k|  (((n) >= (da)->n_ ? (trunnel_abort(),0) : 0), (da)->elts_[(n)])
  |  |  ------------------
  |  |  |  |   17|      0|#define trunnel_abort tor_abort_
  |  |  ------------------
  |  |  |  Branch (165:5): [True: 0, False: 5.24k]
  |  |  ------------------
  ------------------
 2428|  5.24k|}
socks5_client_version_parse:
 2637|    560|{
 2638|    560|  ssize_t result;
 2639|    560|  *output = socks5_client_version_new();
 2640|    560|  if (NULL == *output)
  ------------------
  |  Branch (2640:7): [True: 0, False: 560]
  ------------------
 2641|      0|    return -1;
 2642|    560|  result = socks5_client_version_parse_into(*output, input, len_in);
 2643|    560|  if (result < 0) {
  ------------------
  |  Branch (2643:7): [True: 11, False: 549]
  ------------------
 2644|     11|    socks5_client_version_free(*output);
 2645|       |    *output = NULL;
 2646|     11|  }
 2647|    560|  return result;
 2648|    560|}
socks5_server_method_new:
 2651|    536|{
 2652|    536|  socks5_server_method_t *val = trunnel_calloc(1, sizeof(socks5_server_method_t));
  ------------------
  |  |   10|    536|#define trunnel_calloc tor_calloc
  |  |  ------------------
  |  |  |  |   64|    536|#define tor_calloc(nmemb,size) tor_calloc_(nmemb, size)
  |  |  ------------------
  ------------------
 2653|    536|  if (NULL == val)
  ------------------
  |  Branch (2653:7): [True: 0, False: 536]
  ------------------
 2654|      0|    return NULL;
 2655|    536|  val->version = 5;
 2656|    536|  return val;
 2657|    536|}
socks5_server_method_free:
 2669|    536|{
 2670|    536|  if (obj == NULL)
  ------------------
  |  Branch (2670:7): [True: 0, False: 536]
  ------------------
 2671|      0|    return;
 2672|    536|  socks5_server_method_clear(obj);
 2673|    536|  trunnel_memwipe(obj, sizeof(socks5_server_method_t));
  ------------------
  |  |   16|    536|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  ------------------
 2674|    536|  trunnel_free_(obj);
  ------------------
  |  |   12|    536|#define trunnel_free_ tor_free_
  ------------------
 2675|    536|}
socks5_server_method_set_version:
 2684|    536|{
 2685|    536|  if (! ((val == 5))) {
  ------------------
  |  Branch (2685:7): [True: 0, False: 536]
  ------------------
 2686|      0|     TRUNNEL_SET_ERROR_CODE(inp);
  ------------------
  |  |   11|      0|  do {                              \
  |  |   12|      0|    (obj)->trunnel_error_code_ = 1; \
  |  |   13|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (13:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2687|      0|     return -1;
 2688|      0|  }
 2689|    536|  inp->version = val;
 2690|    536|  return 0;
 2691|    536|}
socks5_server_method_set_method:
 2699|    536|{
 2700|    536|  inp->method = val;
 2701|    536|  return 0;
 2702|    536|}
socks5_server_method_check:
 2705|  1.07k|{
 2706|  1.07k|  if (obj == NULL)
  ------------------
  |  Branch (2706:7): [True: 0, False: 1.07k]
  ------------------
 2707|      0|    return "Object was NULL";
 2708|  1.07k|  if (obj->trunnel_error_code_)
  ------------------
  |  Branch (2708:7): [True: 0, False: 1.07k]
  ------------------
 2709|      0|    return "A set function failed on this object";
 2710|  1.07k|  if (! (obj->version == 5))
  ------------------
  |  Branch (2710:7): [True: 0, False: 1.07k]
  ------------------
 2711|      0|    return "Integer out of bounds";
 2712|  1.07k|  return NULL;
 2713|  1.07k|}
socks5_server_method_encode:
 2740|    536|{
 2741|    536|  ssize_t result = 0;
 2742|    536|  size_t written = 0;
 2743|    536|  uint8_t *ptr = output;
 2744|    536|  const char *msg;
 2745|       |#ifdef TRUNNEL_CHECK_ENCODED_LEN
 2746|       |  const ssize_t encoded_len = socks5_server_method_encoded_len(obj);
 2747|       |#endif
 2748|       |
 2749|    536|  if (NULL != (msg = socks5_server_method_check(obj)))
  ------------------
  |  Branch (2749:7): [True: 0, False: 536]
  ------------------
 2750|      0|    goto check_failed;
 2751|       |
 2752|       |#ifdef TRUNNEL_CHECK_ENCODED_LEN
 2753|       |  trunnel_assert(encoded_len >= 0);
 2754|       |#endif
 2755|       |
 2756|       |  /* Encode u8 version IN [5] */
 2757|    536|  trunnel_assert(written <= avail);
  ------------------
  |  |   15|    536|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    536|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    536|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    536|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    536|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    536|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    536|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 536, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    536|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    536|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 536, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    536|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    536|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    536|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    536|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    536|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    536|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    536|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    536|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2758|    536|  if (avail - written < 1)
  ------------------
  |  Branch (2758:7): [True: 0, False: 536]
  ------------------
 2759|      0|    goto truncated;
 2760|    536|  trunnel_set_uint8(ptr, (obj->version));
 2761|    536|  written += 1; ptr += 1;
 2762|       |
 2763|       |  /* Encode u8 method */
 2764|    536|  trunnel_assert(written <= avail);
  ------------------
  |  |   15|    536|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    536|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    536|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    536|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    536|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    536|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    536|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 536, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    536|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    536|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 536, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    536|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    536|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    536|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    536|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    536|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    536|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    536|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    536|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2765|    536|  if (avail - written < 1)
  ------------------
  |  Branch (2765:7): [True: 0, False: 536]
  ------------------
 2766|      0|    goto truncated;
 2767|    536|  trunnel_set_uint8(ptr, (obj->method));
 2768|    536|  written += 1; ptr += 1;
 2769|       |
 2770|       |
 2771|    536|  trunnel_assert(ptr == output + written);
  ------------------
  |  |   15|    536|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    536|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    536|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    536|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    536|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    536|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    536|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 536, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    536|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    536|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 536, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    536|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    536|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    536|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    536|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    536|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    536|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    536|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    536|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2772|       |#ifdef TRUNNEL_CHECK_ENCODED_LEN
 2773|       |  {
 2774|       |    trunnel_assert(encoded_len >= 0);
 2775|       |    trunnel_assert((size_t)encoded_len == written);
 2776|       |  }
 2777|       |
 2778|       |#endif
 2779|       |
 2780|    536|  return written;
 2781|       |
 2782|      0| truncated:
 2783|      0|  result = -2;
 2784|      0|  goto fail;
 2785|      0| check_failed:
 2786|      0|  (void)msg;
 2787|      0|  result = -1;
 2788|      0|  goto fail;
 2789|      0| fail:
 2790|      0|  trunnel_assert(result < 0);
  ------------------
  |  |   15|      0|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2791|      0|  return result;
 2792|      0|}
socks5_server_userpass_auth_new:
 2842|    164|{
 2843|    164|  socks5_server_userpass_auth_t *val = trunnel_calloc(1, sizeof(socks5_server_userpass_auth_t));
  ------------------
  |  |   10|    164|#define trunnel_calloc tor_calloc
  |  |  ------------------
  |  |  |  |   64|    164|#define tor_calloc(nmemb,size) tor_calloc_(nmemb, size)
  |  |  ------------------
  ------------------
 2844|    164|  if (NULL == val)
  ------------------
  |  Branch (2844:7): [True: 0, False: 164]
  ------------------
 2845|      0|    return NULL;
 2846|    164|  val->version = 1;
 2847|    164|  return val;
 2848|    164|}
socks5_server_userpass_auth_free:
 2860|    164|{
 2861|    164|  if (obj == NULL)
  ------------------
  |  Branch (2861:7): [True: 0, False: 164]
  ------------------
 2862|      0|    return;
 2863|    164|  socks5_server_userpass_auth_clear(obj);
 2864|    164|  trunnel_memwipe(obj, sizeof(socks5_server_userpass_auth_t));
  ------------------
  |  |   16|    164|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  ------------------
 2865|    164|  trunnel_free_(obj);
  ------------------
  |  |   12|    164|#define trunnel_free_ tor_free_
  ------------------
 2866|    164|}
socks5_server_userpass_auth_set_version:
 2875|     25|{
 2876|     25|  if (! ((val == 1))) {
  ------------------
  |  Branch (2876:7): [True: 0, False: 25]
  ------------------
 2877|      0|     TRUNNEL_SET_ERROR_CODE(inp);
  ------------------
  |  |   11|      0|  do {                              \
  |  |   12|      0|    (obj)->trunnel_error_code_ = 1; \
  |  |   13|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (13:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2878|      0|     return -1;
 2879|      0|  }
 2880|     25|  inp->version = val;
 2881|     25|  return 0;
 2882|     25|}
socks5_server_userpass_auth_set_status:
 2890|     25|{
 2891|     25|  inp->status = val;
 2892|     25|  return 0;
 2893|     25|}
socks5_server_userpass_auth_check:
 2896|     50|{
 2897|     50|  if (obj == NULL)
  ------------------
  |  Branch (2897:7): [True: 0, False: 50]
  ------------------
 2898|      0|    return "Object was NULL";
 2899|     50|  if (obj->trunnel_error_code_)
  ------------------
  |  Branch (2899:7): [True: 0, False: 50]
  ------------------
 2900|      0|    return "A set function failed on this object";
 2901|     50|  if (! (obj->version == 1))
  ------------------
  |  Branch (2901:7): [True: 0, False: 50]
  ------------------
 2902|      0|    return "Integer out of bounds";
 2903|     50|  return NULL;
 2904|     50|}
socks5_server_userpass_auth_encode:
 2931|     25|{
 2932|     25|  ssize_t result = 0;
 2933|     25|  size_t written = 0;
 2934|     25|  uint8_t *ptr = output;
 2935|     25|  const char *msg;
 2936|       |#ifdef TRUNNEL_CHECK_ENCODED_LEN
 2937|       |  const ssize_t encoded_len = socks5_server_userpass_auth_encoded_len(obj);
 2938|       |#endif
 2939|       |
 2940|     25|  if (NULL != (msg = socks5_server_userpass_auth_check(obj)))
  ------------------
  |  Branch (2940:7): [True: 0, False: 25]
  ------------------
 2941|      0|    goto check_failed;
 2942|       |
 2943|       |#ifdef TRUNNEL_CHECK_ENCODED_LEN
 2944|       |  trunnel_assert(encoded_len >= 0);
 2945|       |#endif
 2946|       |
 2947|       |  /* Encode u8 version IN [1] */
 2948|     25|  trunnel_assert(written <= avail);
  ------------------
  |  |   15|     25|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|     25|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|     25|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|     25|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|     25|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|     25|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|     25|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 25, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|     25|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|     25|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 25, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|     25|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|     25|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|     25|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|     25|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|     25|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|     25|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|     25|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|     25|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2949|     25|  if (avail - written < 1)
  ------------------
  |  Branch (2949:7): [True: 0, False: 25]
  ------------------
 2950|      0|    goto truncated;
 2951|     25|  trunnel_set_uint8(ptr, (obj->version));
 2952|     25|  written += 1; ptr += 1;
 2953|       |
 2954|       |  /* Encode u8 status */
 2955|     25|  trunnel_assert(written <= avail);
  ------------------
  |  |   15|     25|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|     25|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|     25|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|     25|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|     25|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|     25|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|     25|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 25, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|     25|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|     25|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 25, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|     25|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|     25|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|     25|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|     25|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|     25|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|     25|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|     25|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|     25|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2956|     25|  if (avail - written < 1)
  ------------------
  |  Branch (2956:7): [True: 0, False: 25]
  ------------------
 2957|      0|    goto truncated;
 2958|     25|  trunnel_set_uint8(ptr, (obj->status));
 2959|     25|  written += 1; ptr += 1;
 2960|       |
 2961|       |
 2962|     25|  trunnel_assert(ptr == output + written);
  ------------------
  |  |   15|     25|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|     25|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|     25|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|     25|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|     25|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|     25|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|     25|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 25, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|     25|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|     25|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 25, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|     25|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|     25|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|     25|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|     25|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|     25|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|     25|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|     25|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|     25|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2963|       |#ifdef TRUNNEL_CHECK_ENCODED_LEN
 2964|       |  {
 2965|       |    trunnel_assert(encoded_len >= 0);
 2966|       |    trunnel_assert((size_t)encoded_len == written);
 2967|       |  }
 2968|       |
 2969|       |#endif
 2970|       |
 2971|     25|  return written;
 2972|       |
 2973|      0| truncated:
 2974|      0|  result = -2;
 2975|      0|  goto fail;
 2976|      0| check_failed:
 2977|      0|  (void)msg;
 2978|      0|  result = -1;
 2979|      0|  goto fail;
 2980|      0| fail:
 2981|      0|  trunnel_assert(result < 0);
  ------------------
  |  |   15|      0|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2982|      0|  return result;
 2983|      0|}
socks5_client_request_new:
 3033|    445|{
 3034|    445|  socks5_client_request_t *val = trunnel_calloc(1, sizeof(socks5_client_request_t));
  ------------------
  |  |   10|    445|#define trunnel_calloc tor_calloc
  |  |  ------------------
  |  |  |  |   64|    445|#define tor_calloc(nmemb,size) tor_calloc_(nmemb, size)
  |  |  ------------------
  ------------------
 3035|    445|  if (NULL == val)
  ------------------
  |  Branch (3035:7): [True: 0, False: 445]
  ------------------
 3036|      0|    return NULL;
 3037|    445|  val->version = 5;
 3038|    445|  val->command = CMD_BIND;
  ------------------
  |  |   12|    445|#define CMD_BIND 2
  ------------------
 3039|    445|  return val;
 3040|    445|}
socks5_client_request_free:
 3054|    526|{
 3055|    526|  if (obj == NULL)
  ------------------
  |  Branch (3055:7): [True: 81, False: 445]
  ------------------
 3056|     81|    return;
 3057|    445|  socks5_client_request_clear(obj);
 3058|    445|  trunnel_memwipe(obj, sizeof(socks5_client_request_t));
  ------------------
  |  |   16|    445|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  ------------------
 3059|    445|  trunnel_free_(obj);
  ------------------
  |  |   12|    445|#define trunnel_free_ tor_free_
  ------------------
 3060|    445|}
socks5_client_request_get_version:
 3064|    364|{
 3065|    364|  return inp->version;
 3066|    364|}
socks5_client_request_get_command:
 3079|    364|{
 3080|    364|  return inp->command;
 3081|    364|}
socks5_client_request_get_atype:
 3109|    364|{
 3110|    364|  return inp->atype;
 3111|    364|}
socks5_client_request_get_dest_addr_ipv4:
 3120|     37|{
 3121|     37|  return inp->dest_addr_ipv4;
 3122|     37|}
socks5_client_request_getarray_dest_addr_ipv6:
 3157|    166|{
 3158|    166|  return inp->dest_addr_ipv6;
 3159|    166|}
socks5_client_request_get_dest_addr_domainname:
 3167|    161|{
 3168|    161|  return inp->dest_addr_domainname;
 3169|    161|}
socks5_client_request_getconst_dest_addr_domainname:
 3172|    161|{
 3173|    161|  return socks5_client_request_get_dest_addr_domainname((socks5_client_request_t*) inp);
 3174|    161|}
socks5_client_request_get_dest_port:
 3190|    364|{
 3191|    364|  return inp->dest_port;
 3192|    364|}
socks5_client_request_parse:
 3497|    445|{
 3498|    445|  ssize_t result;
 3499|    445|  *output = socks5_client_request_new();
 3500|    445|  if (NULL == *output)
  ------------------
  |  Branch (3500:7): [True: 0, False: 445]
  ------------------
 3501|      0|    return -1;
 3502|    445|  result = socks5_client_request_parse_into(*output, input, len_in);
 3503|    445|  if (result < 0) {
  ------------------
  |  Branch (3503:7): [True: 81, False: 364]
  ------------------
 3504|     81|    socks5_client_request_free(*output);
 3505|       |    *output = NULL;
 3506|     81|  }
 3507|    445|  return result;
 3508|    445|}
socks5_server_reply_new:
 3511|    180|{
 3512|    180|  socks5_server_reply_t *val = trunnel_calloc(1, sizeof(socks5_server_reply_t));
  ------------------
  |  |   10|    180|#define trunnel_calloc tor_calloc
  |  |  ------------------
  |  |  |  |   64|    180|#define tor_calloc(nmemb,size) tor_calloc_(nmemb, size)
  |  |  ------------------
  ------------------
 3513|    180|  if (NULL == val)
  ------------------
  |  Branch (3513:7): [True: 0, False: 180]
  ------------------
 3514|      0|    return NULL;
 3515|    180|  val->version = 5;
 3516|    180|  return val;
 3517|    180|}
socks5_server_reply_free:
 3531|    180|{
 3532|    180|  if (obj == NULL)
  ------------------
  |  Branch (3532:7): [True: 0, False: 180]
  ------------------
 3533|      0|    return;
 3534|    180|  socks5_server_reply_clear(obj);
 3535|    180|  trunnel_memwipe(obj, sizeof(socks5_server_reply_t));
  ------------------
  |  |   16|    180|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  ------------------
 3536|    180|  trunnel_free_(obj);
  ------------------
  |  |   12|    180|#define trunnel_free_ tor_free_
  ------------------
 3537|    180|}
socks5_server_reply_set_version:
 3546|    180|{
 3547|    180|  if (! ((val == 5))) {
  ------------------
  |  Branch (3547:7): [True: 0, False: 180]
  ------------------
 3548|      0|     TRUNNEL_SET_ERROR_CODE(inp);
  ------------------
  |  |   11|      0|  do {                              \
  |  |   12|      0|    (obj)->trunnel_error_code_ = 1; \
  |  |   13|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (13:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3549|      0|     return -1;
 3550|      0|  }
 3551|    180|  inp->version = val;
 3552|    180|  return 0;
 3553|    180|}
socks5_server_reply_set_reply:
 3561|    180|{
 3562|    180|  inp->reply = val;
 3563|    180|  return 0;
 3564|    180|}
socks5_server_reply_set_atype:
 3587|    180|{
 3588|    180|  inp->atype = val;
 3589|    180|  return 0;
 3590|    180|}
socks5_server_reply_check:
 3674|    360|{
 3675|    360|  if (obj == NULL)
  ------------------
  |  Branch (3675:7): [True: 0, False: 360]
  ------------------
 3676|      0|    return "Object was NULL";
 3677|    360|  if (obj->trunnel_error_code_)
  ------------------
  |  Branch (3677:7): [True: 0, False: 360]
  ------------------
 3678|      0|    return "A set function failed on this object";
 3679|    360|  if (! (obj->version == 5))
  ------------------
  |  Branch (3679:7): [True: 0, False: 360]
  ------------------
 3680|      0|    return "Integer out of bounds";
 3681|    360|  if (! (obj->reserved == 0))
  ------------------
  |  Branch (3681:7): [True: 0, False: 360]
  ------------------
 3682|      0|    return "Integer out of bounds";
 3683|    360|  switch (obj->atype) {
 3684|       |
 3685|    360|    case ATYPE_IPV4:
  ------------------
  |  |   16|    360|#define ATYPE_IPV4 1
  ------------------
  |  Branch (3685:5): [True: 360, False: 0]
  ------------------
 3686|    360|      break;
 3687|       |
 3688|      0|    case ATYPE_IPV6:
  ------------------
  |  |   17|      0|#define ATYPE_IPV6 4
  ------------------
  |  Branch (3688:5): [True: 0, False: 360]
  ------------------
 3689|      0|      break;
 3690|       |
 3691|      0|    case ATYPE_DOMAINNAME:
  ------------------
  |  |   18|      0|#define ATYPE_DOMAINNAME 3
  ------------------
  |  Branch (3691:5): [True: 0, False: 360]
  ------------------
 3692|      0|      {
 3693|      0|        const char *msg;
 3694|      0|        if (NULL != (msg = domainname_check(obj->bind_addr_domainname)))
  ------------------
  |  Branch (3694:13): [True: 0, False: 0]
  ------------------
 3695|      0|          return msg;
 3696|      0|      }
 3697|      0|      break;
 3698|       |
 3699|      0|    default:
  ------------------
  |  Branch (3699:5): [True: 0, False: 360]
  ------------------
 3700|      0|        return "Bad tag for union";
 3701|      0|      break;
 3702|    360|  }
 3703|    360|  return NULL;
 3704|    360|}
socks5_server_reply_encode:
 3764|    180|{
 3765|    180|  ssize_t result = 0;
 3766|    180|  size_t written = 0;
 3767|    180|  uint8_t *ptr = output;
 3768|    180|  const char *msg;
 3769|       |#ifdef TRUNNEL_CHECK_ENCODED_LEN
 3770|       |  const ssize_t encoded_len = socks5_server_reply_encoded_len(obj);
 3771|       |#endif
 3772|       |
 3773|    180|  if (NULL != (msg = socks5_server_reply_check(obj)))
  ------------------
  |  Branch (3773:7): [True: 0, False: 180]
  ------------------
 3774|      0|    goto check_failed;
 3775|       |
 3776|       |#ifdef TRUNNEL_CHECK_ENCODED_LEN
 3777|       |  trunnel_assert(encoded_len >= 0);
 3778|       |#endif
 3779|       |
 3780|       |  /* Encode u8 version IN [5] */
 3781|    180|  trunnel_assert(written <= avail);
  ------------------
  |  |   15|    180|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    180|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    180|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    180|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    180|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    180|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    180|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    180|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    180|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    180|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    180|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    180|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    180|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    180|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    180|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    180|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    180|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3782|    180|  if (avail - written < 1)
  ------------------
  |  Branch (3782:7): [True: 0, False: 180]
  ------------------
 3783|      0|    goto truncated;
 3784|    180|  trunnel_set_uint8(ptr, (obj->version));
 3785|    180|  written += 1; ptr += 1;
 3786|       |
 3787|       |  /* Encode u8 reply */
 3788|    180|  trunnel_assert(written <= avail);
  ------------------
  |  |   15|    180|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    180|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    180|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    180|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    180|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    180|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    180|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    180|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    180|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    180|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    180|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    180|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    180|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    180|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    180|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    180|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    180|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3789|    180|  if (avail - written < 1)
  ------------------
  |  Branch (3789:7): [True: 0, False: 180]
  ------------------
 3790|      0|    goto truncated;
 3791|    180|  trunnel_set_uint8(ptr, (obj->reply));
 3792|    180|  written += 1; ptr += 1;
 3793|       |
 3794|       |  /* Encode u8 reserved IN [0] */
 3795|    180|  trunnel_assert(written <= avail);
  ------------------
  |  |   15|    180|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    180|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    180|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    180|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    180|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    180|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    180|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    180|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    180|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    180|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    180|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    180|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    180|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    180|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    180|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    180|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    180|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3796|    180|  if (avail - written < 1)
  ------------------
  |  Branch (3796:7): [True: 0, False: 180]
  ------------------
 3797|      0|    goto truncated;
 3798|    180|  trunnel_set_uint8(ptr, (obj->reserved));
 3799|    180|  written += 1; ptr += 1;
 3800|       |
 3801|       |  /* Encode u8 atype */
 3802|    180|  trunnel_assert(written <= avail);
  ------------------
  |  |   15|    180|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    180|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    180|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    180|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    180|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    180|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    180|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    180|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    180|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    180|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    180|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    180|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    180|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    180|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    180|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    180|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    180|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3803|    180|  if (avail - written < 1)
  ------------------
  |  Branch (3803:7): [True: 0, False: 180]
  ------------------
 3804|      0|    goto truncated;
 3805|    180|  trunnel_set_uint8(ptr, (obj->atype));
 3806|    180|  written += 1; ptr += 1;
 3807|       |
 3808|       |  /* Encode union bind_addr[atype] */
 3809|    180|  trunnel_assert(written <= avail);
  ------------------
  |  |   15|    180|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    180|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    180|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    180|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    180|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    180|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    180|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    180|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    180|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    180|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    180|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    180|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    180|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    180|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    180|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    180|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    180|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3810|    180|  switch (obj->atype) {
 3811|       |
 3812|    180|    case ATYPE_IPV4:
  ------------------
  |  |   16|    180|#define ATYPE_IPV4 1
  ------------------
  |  Branch (3812:5): [True: 180, False: 0]
  ------------------
 3813|       |
 3814|       |      /* Encode u32 bind_addr_ipv4 */
 3815|    180|      trunnel_assert(written <= avail);
  ------------------
  |  |   15|    180|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    180|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    180|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    180|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    180|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    180|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    180|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    180|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    180|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    180|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    180|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    180|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    180|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    180|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    180|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    180|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    180|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3816|    180|      if (avail - written < 4)
  ------------------
  |  Branch (3816:11): [True: 0, False: 180]
  ------------------
 3817|      0|        goto truncated;
 3818|    180|      trunnel_set_uint32(ptr, trunnel_htonl(obj->bind_addr_ipv4));
  ------------------
  |  |   39|    180|#define trunnel_htonl(x) htonl(x)
  ------------------
 3819|    180|      written += 4; ptr += 4;
 3820|    180|      break;
 3821|       |
 3822|      0|    case ATYPE_IPV6:
  ------------------
  |  |   17|      0|#define ATYPE_IPV6 4
  ------------------
  |  Branch (3822:5): [True: 0, False: 180]
  ------------------
 3823|       |
 3824|       |      /* Encode u8 bind_addr_ipv6[16] */
 3825|      0|      trunnel_assert(written <= avail);
  ------------------
  |  |   15|      0|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3826|      0|      if (avail - written < 16)
  ------------------
  |  Branch (3826:11): [True: 0, False: 0]
  ------------------
 3827|      0|        goto truncated;
 3828|      0|      memcpy(ptr, obj->bind_addr_ipv6, 16);
 3829|      0|      written += 16; ptr += 16;
 3830|      0|      break;
 3831|       |
 3832|      0|    case ATYPE_DOMAINNAME:
  ------------------
  |  |   18|      0|#define ATYPE_DOMAINNAME 3
  ------------------
  |  Branch (3832:5): [True: 0, False: 180]
  ------------------
 3833|       |
 3834|       |      /* Encode struct domainname bind_addr_domainname */
 3835|      0|      trunnel_assert(written <= avail);
  ------------------
  |  |   15|      0|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3836|      0|      result = domainname_encode(ptr, avail - written, obj->bind_addr_domainname);
 3837|      0|      if (result < 0)
  ------------------
  |  Branch (3837:11): [True: 0, False: 0]
  ------------------
 3838|      0|        goto fail; /* XXXXXXX !*/
 3839|      0|      written += result; ptr += result;
 3840|      0|      break;
 3841|       |
 3842|      0|    default:
  ------------------
  |  Branch (3842:5): [True: 0, False: 180]
  ------------------
 3843|      0|      trunnel_assert(0);
  ------------------
  |  |   15|      0|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [Folded, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3844|      0|      break;
 3845|    180|  }
 3846|       |
 3847|       |  /* Encode u16 bind_port */
 3848|    180|  trunnel_assert(written <= avail);
  ------------------
  |  |   15|    180|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    180|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    180|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    180|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    180|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    180|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    180|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    180|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    180|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    180|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    180|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    180|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    180|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    180|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    180|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    180|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    180|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3849|    180|  if (avail - written < 2)
  ------------------
  |  Branch (3849:7): [True: 0, False: 180]
  ------------------
 3850|      0|    goto truncated;
 3851|    180|  trunnel_set_uint16(ptr, trunnel_htons(obj->bind_port));
  ------------------
  |  |   40|    180|#define trunnel_htons(x) htons(x)
  ------------------
 3852|    180|  written += 2; ptr += 2;
 3853|       |
 3854|       |
 3855|    180|  trunnel_assert(ptr == output + written);
  ------------------
  |  |   15|    180|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    180|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    180|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    180|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    180|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    180|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    180|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    180|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    180|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 180, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    180|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    180|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    180|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    180|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    180|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    180|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    180|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    180|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3856|       |#ifdef TRUNNEL_CHECK_ENCODED_LEN
 3857|       |  {
 3858|       |    trunnel_assert(encoded_len >= 0);
 3859|       |    trunnel_assert((size_t)encoded_len == written);
 3860|       |  }
 3861|       |
 3862|       |#endif
 3863|       |
 3864|    180|  return written;
 3865|       |
 3866|      0| truncated:
 3867|      0|  result = -2;
 3868|      0|  goto fail;
 3869|      0| check_failed:
 3870|      0|  (void)msg;
 3871|      0|  result = -1;
 3872|      0|  goto fail;
 3873|      0| fail:
 3874|      0|  trunnel_assert(result < 0);
  ------------------
  |  |   15|      0|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|      0|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      0|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|      0|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|      0|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|      0|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|      0|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|      0|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|      0|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|      0|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|      0|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|      0|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|      0|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|      0|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      0|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|      0|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|      0|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3875|      0|  return result;
 3876|      0|}
socks5.c:domainname_clear:
   44|    183|{
   45|    183|  (void) obj;
   46|    183|  TRUNNEL_DYNARRAY_WIPE(&obj->name);
  ------------------
  |  |  212|    183|#define TRUNNEL_DYNARRAY_WIPE(da) do {                                  \
  |  |  213|    183|    trunnel_memwipe((da)->elts_, (da)->allocated_ * sizeof((da)->elts_[0])); \
  |  |  ------------------
  |  |  |  |   16|    183|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  |  |  ------------------
  |  |  214|    183|  } while (0)
  |  |  ------------------
  |  |  |  Branch (214:12): [Folded, False: 183]
  |  |  ------------------
  ------------------
   47|       |  TRUNNEL_DYNARRAY_CLEAR(&obj->name);
  ------------------
  |  |  204|    183|#define TRUNNEL_DYNARRAY_CLEAR(da) do {           \
  |  |  205|    183|    trunnel_free((da)->elts_);                    \
  |  |  ------------------
  |  |  |  |  141|    183|#define trunnel_free(x) ((x) ? (trunnel_free_(x),0) : (0))
  |  |  |  |  ------------------
  |  |  |  |  |  |   12|    175|#define trunnel_free_ tor_free_
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:26): [True: 175, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  206|    183|    (da)->elts_ = NULL;                           \
  |  |  207|    183|    (da)->n_ = (da)->allocated_ = 0;              \
  |  |  208|    183|  } while (0)
  |  |  ------------------
  |  |  |  Branch (208:12): [Folded, False: 183]
  |  |  ------------------
  ------------------
   48|    183|}
socks5.c:domainname_parse_into:
  252|    183|{
  253|    183|  const uint8_t *ptr = input;
  254|    183|  size_t remaining = len_in;
  255|    183|  ssize_t result = 0;
  256|    183|  (void)result;
  257|       |
  258|       |  /* Parse u8 len */
  259|    183|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    183|  do {                                                           \
  |  |   26|    183|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 1, False: 182]
  |  |  ------------------
  |  |   27|      1|      goto label;                                                \
  |  |   28|      1|    }                                                            \
  |  |   29|    183|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 182]
  |  |  ------------------
  ------------------
  260|    182|  obj->len = (trunnel_get_uint8(ptr));
  261|    182|  remaining -= 1; ptr += 1;
  262|       |
  263|       |  /* Parse char name[len] */
  264|    182|  CHECK_REMAINING(obj->len, truncated);
  ------------------
  |  |   25|    182|  do {                                                           \
  |  |   26|    182|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 7, False: 175]
  |  |  ------------------
  |  |   27|      7|      goto label;                                                \
  |  |   28|      7|    }                                                            \
  |  |   29|    182|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 175]
  |  |  ------------------
  ------------------
  265|    175|  if (domainname_setstr0_name(obj, (const char*)ptr, obj->len))
  ------------------
  |  Branch (265:7): [True: 0, False: 175]
  ------------------
  266|      0|    goto fail;
  267|    175|  ptr += obj->len; remaining -= obj->len;
  268|    175|  trunnel_assert(ptr + remaining == input + len_in);
  ------------------
  |  |   15|    175|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    175|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    175|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    175|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    175|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    175|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    175|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 175, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    175|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    175|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 175, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    175|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    175|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    175|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    175|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    175|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    175|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    175|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    175|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  269|    175|  return len_in - remaining;
  270|       |
  271|      8| truncated:
  272|      8|  return -2;
  273|      0| fail:
  274|      0|  result = -1;
  275|      0|  return result;
  276|    175|}
socks5.c:socks4_client_request_clear:
  307|    594|{
  308|    594|  (void) obj;
  309|    594|  trunnel_wipestr(obj->username);
  ------------------
  |  |  151|    594|#define trunnel_wipestr(s) do {                 \
  |  |  152|    594|    if (s)                                      \
  |  |  ------------------
  |  |  |  Branch (152:9): [True: 555, False: 39]
  |  |  ------------------
  |  |  153|    594|      trunnel_memwipe(s, strlen(s));            \
  |  |  ------------------
  |  |  |  |   16|    555|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  |  |  ------------------
  |  |  154|    594|  } while (0)
  |  |  ------------------
  |  |  |  Branch (154:12): [Folded, False: 594]
  |  |  ------------------
  ------------------
  310|    594|  trunnel_free(obj->username);
  ------------------
  |  |  141|    594|#define trunnel_free(x) ((x) ? (trunnel_free_(x),0) : (0))
  |  |  ------------------
  |  |  |  |   12|    555|#define trunnel_free_ tor_free_
  |  |  ------------------
  |  |  |  Branch (141:26): [True: 555, False: 39]
  |  |  ------------------
  ------------------
  311|    594|  trunnel_wipestr(obj->socks4a_addr_hostname);
  ------------------
  |  |  151|    594|#define trunnel_wipestr(s) do {                 \
  |  |  152|    594|    if (s)                                      \
  |  |  ------------------
  |  |  |  Branch (152:9): [True: 333, False: 261]
  |  |  ------------------
  |  |  153|    594|      trunnel_memwipe(s, strlen(s));            \
  |  |  ------------------
  |  |  |  |   16|    333|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  |  |  ------------------
  |  |  154|    594|  } while (0)
  |  |  ------------------
  |  |  |  Branch (154:12): [Folded, False: 594]
  |  |  ------------------
  ------------------
  312|    594|  trunnel_free(obj->socks4a_addr_hostname);
  ------------------
  |  |  141|    594|#define trunnel_free(x) ((x) ? (trunnel_free_(x),0) : (0))
  |  |  ------------------
  |  |  |  |   12|    333|#define trunnel_free_ tor_free_
  |  |  ------------------
  |  |  |  Branch (141:26): [True: 333, False: 261]
  |  |  ------------------
  ------------------
  313|    594|}
socks5.c:socks4_client_request_parse_into:
 1344|    594|{
 1345|    594|  const uint8_t *ptr = input;
 1346|    594|  size_t remaining = len_in;
 1347|    594|  ssize_t result = 0;
 1348|    594|  (void)result;
 1349|       |
 1350|       |  /* Parse u8 version IN [4] */
 1351|    594|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    594|  do {                                                           \
  |  |   26|    594|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 0, False: 594]
  |  |  ------------------
  |  |   27|      0|      goto label;                                                \
  |  |   28|      0|    }                                                            \
  |  |   29|    594|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 594]
  |  |  ------------------
  ------------------
 1352|    594|  obj->version = (trunnel_get_uint8(ptr));
 1353|    594|  remaining -= 1; ptr += 1;
 1354|    594|  if (! (obj->version == 4))
  ------------------
  |  Branch (1354:7): [True: 0, False: 594]
  ------------------
 1355|      0|    goto fail;
 1356|       |
 1357|       |  /* Parse u8 command IN [CMD_BIND, CMD_CONNECT, CMD_RESOLVE, CMD_RESOLVE_PTR] */
 1358|    594|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    594|  do {                                                           \
  |  |   26|    594|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 0, False: 594]
  |  |  ------------------
  |  |   27|      0|      goto label;                                                \
  |  |   28|      0|    }                                                            \
  |  |   29|    594|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 594]
  |  |  ------------------
  ------------------
 1359|    594|  obj->command = (trunnel_get_uint8(ptr));
 1360|    594|  remaining -= 1; ptr += 1;
 1361|    594|  if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR))
  ------------------
  |  |   12|  1.18k|#define CMD_BIND 2
  ------------------
                if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR))
  ------------------
  |  |   11|  1.18k|#define CMD_CONNECT 1
  ------------------
                if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR))
  ------------------
  |  |   14|  1.08k|#define CMD_RESOLVE 240
  ------------------
                if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR))
  ------------------
  |  |   15|     27|#define CMD_RESOLVE_PTR 241
  ------------------
  |  Branch (1361:10): [True: 6, False: 588]
  |  Branch (1361:38): [True: 94, False: 494]
  |  Branch (1361:69): [True: 467, False: 27]
  |  Branch (1361:100): [True: 5, False: 22]
  ------------------
 1362|     22|    goto fail;
 1363|       |
 1364|       |  /* Parse u16 port */
 1365|    572|  CHECK_REMAINING(2, truncated);
  ------------------
  |  |   25|    572|  do {                                                           \
  |  |   26|    572|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 0, False: 572]
  |  |  ------------------
  |  |   27|      0|      goto label;                                                \
  |  |   28|      0|    }                                                            \
  |  |   29|    572|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 572]
  |  |  ------------------
  ------------------
 1366|    572|  obj->port = trunnel_ntohs(trunnel_get_uint16(ptr));
  ------------------
  |  |   42|    572|#define trunnel_ntohs(x) ntohs(x)
  ------------------
 1367|    572|  remaining -= 2; ptr += 2;
 1368|       |
 1369|       |  /* Parse u32 addr */
 1370|    572|  CHECK_REMAINING(4, truncated);
  ------------------
  |  |   25|    572|  do {                                                           \
  |  |   26|    572|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 0, False: 572]
  |  |  ------------------
  |  |   27|      0|      goto label;                                                \
  |  |   28|      0|    }                                                            \
  |  |   29|    572|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 572]
  |  |  ------------------
  ------------------
 1371|    572|  obj->addr = trunnel_ntohl(trunnel_get_uint32(ptr));
  ------------------
  |  |   41|    572|#define trunnel_ntohl(x) ntohl(x)
  ------------------
 1372|    572|  remaining -= 4; ptr += 4;
 1373|       |
 1374|       |  /* Parse nulterm username */
 1375|    572|  {
 1376|    572|    uint8_t *eos = (uint8_t*)memchr(ptr, 0, remaining);
 1377|    572|    size_t memlen;
 1378|    572|    if (eos == NULL)
  ------------------
  |  Branch (1378:9): [True: 17, False: 555]
  ------------------
 1379|     17|      goto truncated;
 1380|    555|    trunnel_assert(eos >= ptr);
  ------------------
  |  |   15|    555|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    572|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    555|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    555|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    555|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    555|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    555|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 555, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    555|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    555|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 555, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    555|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    555|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    555|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    555|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    555|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    555|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    572|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    572|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1381|    555|    trunnel_assert((size_t)(eos - ptr) < SIZE_MAX - 1);
  ------------------
  |  |   15|    555|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    555|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    555|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    555|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    555|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    555|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    555|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 555, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    555|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    555|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 555, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    555|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    555|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    555|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    555|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    555|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    555|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    555|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    555|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1382|    555|    memlen = ((size_t)(eos - ptr)) + 1;
 1383|    555|    if (!(obj->username = trunnel_malloc(memlen)))
  ------------------
  |  |    9|    555|#define trunnel_malloc tor_malloc
  |  |  ------------------
  |  |  |  |   62|    555|#define tor_malloc(size)       tor_malloc_(size)
  |  |  ------------------
  ------------------
  |  Branch (1383:9): [True: 0, False: 555]
  ------------------
 1384|      0|      goto fail;
 1385|    555|    memcpy(obj->username, ptr, memlen);
 1386|    555|    remaining -= memlen; ptr += memlen;
 1387|    555|  }
 1388|       |
 1389|       |  /* Parse union socks4a_addr[addr] */
 1390|      0|  switch (obj->addr) {
 1391|       |
 1392|     29|    case 1:
  ------------------
  |  Branch (1392:5): [True: 29, False: 526]
  ------------------
 1393|     29|    case 2:
  ------------------
  |  Branch (1393:5): [True: 0, False: 555]
  ------------------
 1394|     30|    case 3:
  ------------------
  |  Branch (1394:5): [True: 1, False: 554]
  ------------------
 1395|     33|    case 4:
  ------------------
  |  Branch (1395:5): [True: 3, False: 552]
  ------------------
 1396|     34|    case 5:
  ------------------
  |  Branch (1396:5): [True: 1, False: 554]
  ------------------
 1397|     34|    case 6:
  ------------------
  |  Branch (1397:5): [True: 0, False: 555]
  ------------------
 1398|     39|    case 7:
  ------------------
  |  Branch (1398:5): [True: 5, False: 550]
  ------------------
 1399|     39|    case 8:
  ------------------
  |  Branch (1399:5): [True: 0, False: 555]
  ------------------
 1400|     43|    case 9:
  ------------------
  |  Branch (1400:5): [True: 4, False: 551]
  ------------------
 1401|     43|    case 10:
  ------------------
  |  Branch (1401:5): [True: 0, False: 555]
  ------------------
 1402|     43|    case 11:
  ------------------
  |  Branch (1402:5): [True: 0, False: 555]
  ------------------
 1403|     43|    case 12:
  ------------------
  |  Branch (1403:5): [True: 0, False: 555]
  ------------------
 1404|     43|    case 13:
  ------------------
  |  Branch (1404:5): [True: 0, False: 555]
  ------------------
 1405|     43|    case 14:
  ------------------
  |  Branch (1405:5): [True: 0, False: 555]
  ------------------
 1406|     52|    case 15:
  ------------------
  |  Branch (1406:5): [True: 9, False: 546]
  ------------------
 1407|     54|    case 16:
  ------------------
  |  Branch (1407:5): [True: 2, False: 553]
  ------------------
 1408|     55|    case 17:
  ------------------
  |  Branch (1408:5): [True: 1, False: 554]
  ------------------
 1409|     57|    case 18:
  ------------------
  |  Branch (1409:5): [True: 2, False: 553]
  ------------------
 1410|     57|    case 19:
  ------------------
  |  Branch (1410:5): [True: 0, False: 555]
  ------------------
 1411|     57|    case 20:
  ------------------
  |  Branch (1411:5): [True: 0, False: 555]
  ------------------
 1412|     57|    case 21:
  ------------------
  |  Branch (1412:5): [True: 0, False: 555]
  ------------------
 1413|     57|    case 22:
  ------------------
  |  Branch (1413:5): [True: 0, False: 555]
  ------------------
 1414|     57|    case 23:
  ------------------
  |  Branch (1414:5): [True: 0, False: 555]
  ------------------
 1415|     57|    case 24:
  ------------------
  |  Branch (1415:5): [True: 0, False: 555]
  ------------------
 1416|     57|    case 25:
  ------------------
  |  Branch (1416:5): [True: 0, False: 555]
  ------------------
 1417|     57|    case 26:
  ------------------
  |  Branch (1417:5): [True: 0, False: 555]
  ------------------
 1418|     57|    case 27:
  ------------------
  |  Branch (1418:5): [True: 0, False: 555]
  ------------------
 1419|     57|    case 28:
  ------------------
  |  Branch (1419:5): [True: 0, False: 555]
  ------------------
 1420|     57|    case 29:
  ------------------
  |  Branch (1420:5): [True: 0, False: 555]
  ------------------
 1421|     57|    case 30:
  ------------------
  |  Branch (1421:5): [True: 0, False: 555]
  ------------------
 1422|     57|    case 31:
  ------------------
  |  Branch (1422:5): [True: 0, False: 555]
  ------------------
 1423|     63|    case 32:
  ------------------
  |  Branch (1423:5): [True: 6, False: 549]
  ------------------
 1424|     64|    case 33:
  ------------------
  |  Branch (1424:5): [True: 1, False: 554]
  ------------------
 1425|     64|    case 34:
  ------------------
  |  Branch (1425:5): [True: 0, False: 555]
  ------------------
 1426|     69|    case 35:
  ------------------
  |  Branch (1426:5): [True: 5, False: 550]
  ------------------
 1427|     69|    case 36:
  ------------------
  |  Branch (1427:5): [True: 0, False: 555]
  ------------------
 1428|     70|    case 37:
  ------------------
  |  Branch (1428:5): [True: 1, False: 554]
  ------------------
 1429|     70|    case 38:
  ------------------
  |  Branch (1429:5): [True: 0, False: 555]
  ------------------
 1430|     71|    case 39:
  ------------------
  |  Branch (1430:5): [True: 1, False: 554]
  ------------------
 1431|     71|    case 40:
  ------------------
  |  Branch (1431:5): [True: 0, False: 555]
  ------------------
 1432|     75|    case 41:
  ------------------
  |  Branch (1432:5): [True: 4, False: 551]
  ------------------
 1433|     76|    case 42:
  ------------------
  |  Branch (1433:5): [True: 1, False: 554]
  ------------------
 1434|     77|    case 43:
  ------------------
  |  Branch (1434:5): [True: 1, False: 554]
  ------------------
 1435|     80|    case 44:
  ------------------
  |  Branch (1435:5): [True: 3, False: 552]
  ------------------
 1436|     84|    case 45:
  ------------------
  |  Branch (1436:5): [True: 4, False: 551]
  ------------------
 1437|     93|    case 46:
  ------------------
  |  Branch (1437:5): [True: 9, False: 546]
  ------------------
 1438|     95|    case 47:
  ------------------
  |  Branch (1438:5): [True: 2, False: 553]
  ------------------
 1439|    110|    case 48:
  ------------------
  |  Branch (1439:5): [True: 15, False: 540]
  ------------------
 1440|    115|    case 49:
  ------------------
  |  Branch (1440:5): [True: 5, False: 550]
  ------------------
 1441|    122|    case 50:
  ------------------
  |  Branch (1441:5): [True: 7, False: 548]
  ------------------
 1442|    131|    case 51:
  ------------------
  |  Branch (1442:5): [True: 9, False: 546]
  ------------------
 1443|    134|    case 52:
  ------------------
  |  Branch (1443:5): [True: 3, False: 552]
  ------------------
 1444|    136|    case 53:
  ------------------
  |  Branch (1444:5): [True: 2, False: 553]
  ------------------
 1445|    136|    case 54:
  ------------------
  |  Branch (1445:5): [True: 0, False: 555]
  ------------------
 1446|    137|    case 55:
  ------------------
  |  Branch (1446:5): [True: 1, False: 554]
  ------------------
 1447|    141|    case 56:
  ------------------
  |  Branch (1447:5): [True: 4, False: 551]
  ------------------
 1448|    141|    case 57:
  ------------------
  |  Branch (1448:5): [True: 0, False: 555]
  ------------------
 1449|    146|    case 58:
  ------------------
  |  Branch (1449:5): [True: 5, False: 550]
  ------------------
 1450|    146|    case 59:
  ------------------
  |  Branch (1450:5): [True: 0, False: 555]
  ------------------
 1451|    146|    case 60:
  ------------------
  |  Branch (1451:5): [True: 0, False: 555]
  ------------------
 1452|    146|    case 61:
  ------------------
  |  Branch (1452:5): [True: 0, False: 555]
  ------------------
 1453|    147|    case 62:
  ------------------
  |  Branch (1453:5): [True: 1, False: 554]
  ------------------
 1454|    147|    case 63:
  ------------------
  |  Branch (1454:5): [True: 0, False: 555]
  ------------------
 1455|    152|    case 64:
  ------------------
  |  Branch (1455:5): [True: 5, False: 550]
  ------------------
 1456|    156|    case 65:
  ------------------
  |  Branch (1456:5): [True: 4, False: 551]
  ------------------
 1457|    156|    case 66:
  ------------------
  |  Branch (1457:5): [True: 0, False: 555]
  ------------------
 1458|    157|    case 67:
  ------------------
  |  Branch (1458:5): [True: 1, False: 554]
  ------------------
 1459|    157|    case 68:
  ------------------
  |  Branch (1459:5): [True: 0, False: 555]
  ------------------
 1460|    157|    case 69:
  ------------------
  |  Branch (1460:5): [True: 0, False: 555]
  ------------------
 1461|    157|    case 70:
  ------------------
  |  Branch (1461:5): [True: 0, False: 555]
  ------------------
 1462|    157|    case 71:
  ------------------
  |  Branch (1462:5): [True: 0, False: 555]
  ------------------
 1463|    157|    case 72:
  ------------------
  |  Branch (1463:5): [True: 0, False: 555]
  ------------------
 1464|    157|    case 73:
  ------------------
  |  Branch (1464:5): [True: 0, False: 555]
  ------------------
 1465|    157|    case 74:
  ------------------
  |  Branch (1465:5): [True: 0, False: 555]
  ------------------
 1466|    157|    case 75:
  ------------------
  |  Branch (1466:5): [True: 0, False: 555]
  ------------------
 1467|    157|    case 76:
  ------------------
  |  Branch (1467:5): [True: 0, False: 555]
  ------------------
 1468|    157|    case 77:
  ------------------
  |  Branch (1468:5): [True: 0, False: 555]
  ------------------
 1469|    157|    case 78:
  ------------------
  |  Branch (1469:5): [True: 0, False: 555]
  ------------------
 1470|    157|    case 79:
  ------------------
  |  Branch (1470:5): [True: 0, False: 555]
  ------------------
 1471|    157|    case 80:
  ------------------
  |  Branch (1471:5): [True: 0, False: 555]
  ------------------
 1472|    157|    case 81:
  ------------------
  |  Branch (1472:5): [True: 0, False: 555]
  ------------------
 1473|    157|    case 82:
  ------------------
  |  Branch (1473:5): [True: 0, False: 555]
  ------------------
 1474|    157|    case 83:
  ------------------
  |  Branch (1474:5): [True: 0, False: 555]
  ------------------
 1475|    157|    case 84:
  ------------------
  |  Branch (1475:5): [True: 0, False: 555]
  ------------------
 1476|    158|    case 85:
  ------------------
  |  Branch (1476:5): [True: 1, False: 554]
  ------------------
 1477|    158|    case 86:
  ------------------
  |  Branch (1477:5): [True: 0, False: 555]
  ------------------
 1478|    158|    case 87:
  ------------------
  |  Branch (1478:5): [True: 0, False: 555]
  ------------------
 1479|    158|    case 88:
  ------------------
  |  Branch (1479:5): [True: 0, False: 555]
  ------------------
 1480|    159|    case 89:
  ------------------
  |  Branch (1480:5): [True: 1, False: 554]
  ------------------
 1481|    160|    case 90:
  ------------------
  |  Branch (1481:5): [True: 1, False: 554]
  ------------------
 1482|    161|    case 91:
  ------------------
  |  Branch (1482:5): [True: 1, False: 554]
  ------------------
 1483|    161|    case 92:
  ------------------
  |  Branch (1483:5): [True: 0, False: 555]
  ------------------
 1484|    161|    case 93:
  ------------------
  |  Branch (1484:5): [True: 0, False: 555]
  ------------------
 1485|    161|    case 94:
  ------------------
  |  Branch (1485:5): [True: 0, False: 555]
  ------------------
 1486|    161|    case 95:
  ------------------
  |  Branch (1486:5): [True: 0, False: 555]
  ------------------
 1487|    162|    case 96:
  ------------------
  |  Branch (1487:5): [True: 1, False: 554]
  ------------------
 1488|    163|    case 97:
  ------------------
  |  Branch (1488:5): [True: 1, False: 554]
  ------------------
 1489|    163|    case 98:
  ------------------
  |  Branch (1489:5): [True: 0, False: 555]
  ------------------
 1490|    163|    case 99:
  ------------------
  |  Branch (1490:5): [True: 0, False: 555]
  ------------------
 1491|    163|    case 100:
  ------------------
  |  Branch (1491:5): [True: 0, False: 555]
  ------------------
 1492|    164|    case 101:
  ------------------
  |  Branch (1492:5): [True: 1, False: 554]
  ------------------
 1493|    164|    case 102:
  ------------------
  |  Branch (1493:5): [True: 0, False: 555]
  ------------------
 1494|    173|    case 103:
  ------------------
  |  Branch (1494:5): [True: 9, False: 546]
  ------------------
 1495|    173|    case 104:
  ------------------
  |  Branch (1495:5): [True: 0, False: 555]
  ------------------
 1496|    173|    case 105:
  ------------------
  |  Branch (1496:5): [True: 0, False: 555]
  ------------------
 1497|    173|    case 106:
  ------------------
  |  Branch (1497:5): [True: 0, False: 555]
  ------------------
 1498|    173|    case 107:
  ------------------
  |  Branch (1498:5): [True: 0, False: 555]
  ------------------
 1499|    173|    case 108:
  ------------------
  |  Branch (1499:5): [True: 0, False: 555]
  ------------------
 1500|    173|    case 109:
  ------------------
  |  Branch (1500:5): [True: 0, False: 555]
  ------------------
 1501|    177|    case 110:
  ------------------
  |  Branch (1501:5): [True: 4, False: 551]
  ------------------
 1502|    177|    case 111:
  ------------------
  |  Branch (1502:5): [True: 0, False: 555]
  ------------------
 1503|    177|    case 112:
  ------------------
  |  Branch (1503:5): [True: 0, False: 555]
  ------------------
 1504|    177|    case 113:
  ------------------
  |  Branch (1504:5): [True: 0, False: 555]
  ------------------
 1505|    177|    case 114:
  ------------------
  |  Branch (1505:5): [True: 0, False: 555]
  ------------------
 1506|    177|    case 115:
  ------------------
  |  Branch (1506:5): [True: 0, False: 555]
  ------------------
 1507|    178|    case 116:
  ------------------
  |  Branch (1507:5): [True: 1, False: 554]
  ------------------
 1508|    178|    case 117:
  ------------------
  |  Branch (1508:5): [True: 0, False: 555]
  ------------------
 1509|    178|    case 118:
  ------------------
  |  Branch (1509:5): [True: 0, False: 555]
  ------------------
 1510|    178|    case 119:
  ------------------
  |  Branch (1510:5): [True: 0, False: 555]
  ------------------
 1511|    178|    case 120:
  ------------------
  |  Branch (1511:5): [True: 0, False: 555]
  ------------------
 1512|    180|    case 121:
  ------------------
  |  Branch (1512:5): [True: 2, False: 553]
  ------------------
 1513|    219|    case 122:
  ------------------
  |  Branch (1513:5): [True: 39, False: 516]
  ------------------
 1514|    220|    case 123:
  ------------------
  |  Branch (1514:5): [True: 1, False: 554]
  ------------------
 1515|    221|    case 124:
  ------------------
  |  Branch (1515:5): [True: 1, False: 554]
  ------------------
 1516|    221|    case 125:
  ------------------
  |  Branch (1516:5): [True: 0, False: 555]
  ------------------
 1517|    221|    case 126:
  ------------------
  |  Branch (1517:5): [True: 0, False: 555]
  ------------------
 1518|    242|    case 127:
  ------------------
  |  Branch (1518:5): [True: 21, False: 534]
  ------------------
 1519|    244|    case 128:
  ------------------
  |  Branch (1519:5): [True: 2, False: 553]
  ------------------
 1520|    246|    case 129:
  ------------------
  |  Branch (1520:5): [True: 2, False: 553]
  ------------------
 1521|    246|    case 130:
  ------------------
  |  Branch (1521:5): [True: 0, False: 555]
  ------------------
 1522|    247|    case 131:
  ------------------
  |  Branch (1522:5): [True: 1, False: 554]
  ------------------
 1523|    247|    case 132:
  ------------------
  |  Branch (1523:5): [True: 0, False: 555]
  ------------------
 1524|    247|    case 133:
  ------------------
  |  Branch (1524:5): [True: 0, False: 555]
  ------------------
 1525|    247|    case 134:
  ------------------
  |  Branch (1525:5): [True: 0, False: 555]
  ------------------
 1526|    247|    case 135:
  ------------------
  |  Branch (1526:5): [True: 0, False: 555]
  ------------------
 1527|    250|    case 136:
  ------------------
  |  Branch (1527:5): [True: 3, False: 552]
  ------------------
 1528|    250|    case 137:
  ------------------
  |  Branch (1528:5): [True: 0, False: 555]
  ------------------
 1529|    250|    case 138:
  ------------------
  |  Branch (1529:5): [True: 0, False: 555]
  ------------------
 1530|    251|    case 139:
  ------------------
  |  Branch (1530:5): [True: 1, False: 554]
  ------------------
 1531|    251|    case 140:
  ------------------
  |  Branch (1531:5): [True: 0, False: 555]
  ------------------
 1532|    251|    case 141:
  ------------------
  |  Branch (1532:5): [True: 0, False: 555]
  ------------------
 1533|    251|    case 142:
  ------------------
  |  Branch (1533:5): [True: 0, False: 555]
  ------------------
 1534|    252|    case 143:
  ------------------
  |  Branch (1534:5): [True: 1, False: 554]
  ------------------
 1535|    252|    case 144:
  ------------------
  |  Branch (1535:5): [True: 0, False: 555]
  ------------------
 1536|    252|    case 145:
  ------------------
  |  Branch (1536:5): [True: 0, False: 555]
  ------------------
 1537|    253|    case 146:
  ------------------
  |  Branch (1537:5): [True: 1, False: 554]
  ------------------
 1538|    253|    case 147:
  ------------------
  |  Branch (1538:5): [True: 0, False: 555]
  ------------------
 1539|    253|    case 148:
  ------------------
  |  Branch (1539:5): [True: 0, False: 555]
  ------------------
 1540|    253|    case 149:
  ------------------
  |  Branch (1540:5): [True: 0, False: 555]
  ------------------
 1541|    253|    case 150:
  ------------------
  |  Branch (1541:5): [True: 0, False: 555]
  ------------------
 1542|    253|    case 151:
  ------------------
  |  Branch (1542:5): [True: 0, False: 555]
  ------------------
 1543|    253|    case 152:
  ------------------
  |  Branch (1543:5): [True: 0, False: 555]
  ------------------
 1544|    253|    case 153:
  ------------------
  |  Branch (1544:5): [True: 0, False: 555]
  ------------------
 1545|    253|    case 154:
  ------------------
  |  Branch (1545:5): [True: 0, False: 555]
  ------------------
 1546|    253|    case 155:
  ------------------
  |  Branch (1546:5): [True: 0, False: 555]
  ------------------
 1547|    253|    case 156:
  ------------------
  |  Branch (1547:5): [True: 0, False: 555]
  ------------------
 1548|    261|    case 157:
  ------------------
  |  Branch (1548:5): [True: 8, False: 547]
  ------------------
 1549|    261|    case 158:
  ------------------
  |  Branch (1549:5): [True: 0, False: 555]
  ------------------
 1550|    262|    case 159:
  ------------------
  |  Branch (1550:5): [True: 1, False: 554]
  ------------------
 1551|    263|    case 160:
  ------------------
  |  Branch (1551:5): [True: 1, False: 554]
  ------------------
 1552|    263|    case 161:
  ------------------
  |  Branch (1552:5): [True: 0, False: 555]
  ------------------
 1553|    263|    case 162:
  ------------------
  |  Branch (1553:5): [True: 0, False: 555]
  ------------------
 1554|    263|    case 163:
  ------------------
  |  Branch (1554:5): [True: 0, False: 555]
  ------------------
 1555|    263|    case 164:
  ------------------
  |  Branch (1555:5): [True: 0, False: 555]
  ------------------
 1556|    263|    case 165:
  ------------------
  |  Branch (1556:5): [True: 0, False: 555]
  ------------------
 1557|    263|    case 166:
  ------------------
  |  Branch (1557:5): [True: 0, False: 555]
  ------------------
 1558|    263|    case 167:
  ------------------
  |  Branch (1558:5): [True: 0, False: 555]
  ------------------
 1559|    263|    case 168:
  ------------------
  |  Branch (1559:5): [True: 0, False: 555]
  ------------------
 1560|    263|    case 169:
  ------------------
  |  Branch (1560:5): [True: 0, False: 555]
  ------------------
 1561|    263|    case 170:
  ------------------
  |  Branch (1561:5): [True: 0, False: 555]
  ------------------
 1562|    263|    case 171:
  ------------------
  |  Branch (1562:5): [True: 0, False: 555]
  ------------------
 1563|    263|    case 172:
  ------------------
  |  Branch (1563:5): [True: 0, False: 555]
  ------------------
 1564|    263|    case 173:
  ------------------
  |  Branch (1564:5): [True: 0, False: 555]
  ------------------
 1565|    263|    case 174:
  ------------------
  |  Branch (1565:5): [True: 0, False: 555]
  ------------------
 1566|    264|    case 175:
  ------------------
  |  Branch (1566:5): [True: 1, False: 554]
  ------------------
 1567|    264|    case 176:
  ------------------
  |  Branch (1567:5): [True: 0, False: 555]
  ------------------
 1568|    265|    case 177:
  ------------------
  |  Branch (1568:5): [True: 1, False: 554]
  ------------------
 1569|    265|    case 178:
  ------------------
  |  Branch (1569:5): [True: 0, False: 555]
  ------------------
 1570|    265|    case 179:
  ------------------
  |  Branch (1570:5): [True: 0, False: 555]
  ------------------
 1571|    266|    case 180:
  ------------------
  |  Branch (1571:5): [True: 1, False: 554]
  ------------------
 1572|    266|    case 181:
  ------------------
  |  Branch (1572:5): [True: 0, False: 555]
  ------------------
 1573|    266|    case 182:
  ------------------
  |  Branch (1573:5): [True: 0, False: 555]
  ------------------
 1574|    267|    case 183:
  ------------------
  |  Branch (1574:5): [True: 1, False: 554]
  ------------------
 1575|    267|    case 184:
  ------------------
  |  Branch (1575:5): [True: 0, False: 555]
  ------------------
 1576|    267|    case 185:
  ------------------
  |  Branch (1576:5): [True: 0, False: 555]
  ------------------
 1577|    267|    case 186:
  ------------------
  |  Branch (1577:5): [True: 0, False: 555]
  ------------------
 1578|    267|    case 187:
  ------------------
  |  Branch (1578:5): [True: 0, False: 555]
  ------------------
 1579|    267|    case 188:
  ------------------
  |  Branch (1579:5): [True: 0, False: 555]
  ------------------
 1580|    267|    case 189:
  ------------------
  |  Branch (1580:5): [True: 0, False: 555]
  ------------------
 1581|    267|    case 190:
  ------------------
  |  Branch (1581:5): [True: 0, False: 555]
  ------------------
 1582|    268|    case 191:
  ------------------
  |  Branch (1582:5): [True: 1, False: 554]
  ------------------
 1583|    268|    case 192:
  ------------------
  |  Branch (1583:5): [True: 0, False: 555]
  ------------------
 1584|    268|    case 193:
  ------------------
  |  Branch (1584:5): [True: 0, False: 555]
  ------------------
 1585|    268|    case 194:
  ------------------
  |  Branch (1585:5): [True: 0, False: 555]
  ------------------
 1586|    269|    case 195:
  ------------------
  |  Branch (1586:5): [True: 1, False: 554]
  ------------------
 1587|    269|    case 196:
  ------------------
  |  Branch (1587:5): [True: 0, False: 555]
  ------------------
 1588|    269|    case 197:
  ------------------
  |  Branch (1588:5): [True: 0, False: 555]
  ------------------
 1589|    269|    case 198:
  ------------------
  |  Branch (1589:5): [True: 0, False: 555]
  ------------------
 1590|    270|    case 199:
  ------------------
  |  Branch (1590:5): [True: 1, False: 554]
  ------------------
 1591|    270|    case 200:
  ------------------
  |  Branch (1591:5): [True: 0, False: 555]
  ------------------
 1592|    270|    case 201:
  ------------------
  |  Branch (1592:5): [True: 0, False: 555]
  ------------------
 1593|    271|    case 202:
  ------------------
  |  Branch (1593:5): [True: 1, False: 554]
  ------------------
 1594|    271|    case 203:
  ------------------
  |  Branch (1594:5): [True: 0, False: 555]
  ------------------
 1595|    271|    case 204:
  ------------------
  |  Branch (1595:5): [True: 0, False: 555]
  ------------------
 1596|    271|    case 205:
  ------------------
  |  Branch (1596:5): [True: 0, False: 555]
  ------------------
 1597|    274|    case 206:
  ------------------
  |  Branch (1597:5): [True: 3, False: 552]
  ------------------
 1598|    274|    case 207:
  ------------------
  |  Branch (1598:5): [True: 0, False: 555]
  ------------------
 1599|    274|    case 208:
  ------------------
  |  Branch (1599:5): [True: 0, False: 555]
  ------------------
 1600|    284|    case 209:
  ------------------
  |  Branch (1600:5): [True: 10, False: 545]
  ------------------
 1601|    284|    case 210:
  ------------------
  |  Branch (1601:5): [True: 0, False: 555]
  ------------------
 1602|    284|    case 211:
  ------------------
  |  Branch (1602:5): [True: 0, False: 555]
  ------------------
 1603|    284|    case 212:
  ------------------
  |  Branch (1603:5): [True: 0, False: 555]
  ------------------
 1604|    284|    case 213:
  ------------------
  |  Branch (1604:5): [True: 0, False: 555]
  ------------------
 1605|    284|    case 214:
  ------------------
  |  Branch (1605:5): [True: 0, False: 555]
  ------------------
 1606|    284|    case 215:
  ------------------
  |  Branch (1606:5): [True: 0, False: 555]
  ------------------
 1607|    284|    case 216:
  ------------------
  |  Branch (1607:5): [True: 0, False: 555]
  ------------------
 1608|    284|    case 217:
  ------------------
  |  Branch (1608:5): [True: 0, False: 555]
  ------------------
 1609|    288|    case 218:
  ------------------
  |  Branch (1609:5): [True: 4, False: 551]
  ------------------
 1610|    288|    case 219:
  ------------------
  |  Branch (1610:5): [True: 0, False: 555]
  ------------------
 1611|    288|    case 220:
  ------------------
  |  Branch (1611:5): [True: 0, False: 555]
  ------------------
 1612|    288|    case 221:
  ------------------
  |  Branch (1612:5): [True: 0, False: 555]
  ------------------
 1613|    289|    case 222:
  ------------------
  |  Branch (1613:5): [True: 1, False: 554]
  ------------------
 1614|    291|    case 223:
  ------------------
  |  Branch (1614:5): [True: 2, False: 553]
  ------------------
 1615|    291|    case 224:
  ------------------
  |  Branch (1615:5): [True: 0, False: 555]
  ------------------
 1616|    310|    case 225:
  ------------------
  |  Branch (1616:5): [True: 19, False: 536]
  ------------------
 1617|    310|    case 226:
  ------------------
  |  Branch (1617:5): [True: 0, False: 555]
  ------------------
 1618|    310|    case 227:
  ------------------
  |  Branch (1618:5): [True: 0, False: 555]
  ------------------
 1619|    310|    case 228:
  ------------------
  |  Branch (1619:5): [True: 0, False: 555]
  ------------------
 1620|    310|    case 229:
  ------------------
  |  Branch (1620:5): [True: 0, False: 555]
  ------------------
 1621|    311|    case 230:
  ------------------
  |  Branch (1621:5): [True: 1, False: 554]
  ------------------
 1622|    313|    case 231:
  ------------------
  |  Branch (1622:5): [True: 2, False: 553]
  ------------------
 1623|    313|    case 232:
  ------------------
  |  Branch (1623:5): [True: 0, False: 555]
  ------------------
 1624|    313|    case 233:
  ------------------
  |  Branch (1624:5): [True: 0, False: 555]
  ------------------
 1625|    313|    case 234:
  ------------------
  |  Branch (1625:5): [True: 0, False: 555]
  ------------------
 1626|    313|    case 235:
  ------------------
  |  Branch (1626:5): [True: 0, False: 555]
  ------------------
 1627|    313|    case 236:
  ------------------
  |  Branch (1627:5): [True: 0, False: 555]
  ------------------
 1628|    313|    case 237:
  ------------------
  |  Branch (1628:5): [True: 0, False: 555]
  ------------------
 1629|    313|    case 238:
  ------------------
  |  Branch (1629:5): [True: 0, False: 555]
  ------------------
 1630|    314|    case 239:
  ------------------
  |  Branch (1630:5): [True: 1, False: 554]
  ------------------
 1631|    315|    case 240:
  ------------------
  |  Branch (1631:5): [True: 1, False: 554]
  ------------------
 1632|    315|    case 241:
  ------------------
  |  Branch (1632:5): [True: 0, False: 555]
  ------------------
 1633|    315|    case 242:
  ------------------
  |  Branch (1633:5): [True: 0, False: 555]
  ------------------
 1634|    316|    case 243:
  ------------------
  |  Branch (1634:5): [True: 1, False: 554]
  ------------------
 1635|    323|    case 244:
  ------------------
  |  Branch (1635:5): [True: 7, False: 548]
  ------------------
 1636|    323|    case 245:
  ------------------
  |  Branch (1636:5): [True: 0, False: 555]
  ------------------
 1637|    323|    case 246:
  ------------------
  |  Branch (1637:5): [True: 0, False: 555]
  ------------------
 1638|    323|    case 247:
  ------------------
  |  Branch (1638:5): [True: 0, False: 555]
  ------------------
 1639|    323|    case 248:
  ------------------
  |  Branch (1639:5): [True: 0, False: 555]
  ------------------
 1640|    323|    case 249:
  ------------------
  |  Branch (1640:5): [True: 0, False: 555]
  ------------------
 1641|    325|    case 250:
  ------------------
  |  Branch (1641:5): [True: 2, False: 553]
  ------------------
 1642|    327|    case 251:
  ------------------
  |  Branch (1642:5): [True: 2, False: 553]
  ------------------
 1643|    327|    case 252:
  ------------------
  |  Branch (1643:5): [True: 0, False: 555]
  ------------------
 1644|    330|    case 253:
  ------------------
  |  Branch (1644:5): [True: 3, False: 552]
  ------------------
 1645|    331|    case 254:
  ------------------
  |  Branch (1645:5): [True: 1, False: 554]
  ------------------
 1646|    350|    case 255:
  ------------------
  |  Branch (1646:5): [True: 19, False: 536]
  ------------------
 1647|       |
 1648|       |      /* Parse nulterm socks4a_addr_hostname */
 1649|    350|      {
 1650|    350|        uint8_t *eos = (uint8_t*)memchr(ptr, 0, remaining);
 1651|    350|        size_t memlen;
 1652|    350|        if (eos == NULL)
  ------------------
  |  Branch (1652:13): [True: 17, False: 333]
  ------------------
 1653|     17|          goto truncated;
 1654|    333|        trunnel_assert(eos >= ptr);
  ------------------
  |  |   15|    333|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    350|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    333|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    333|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    333|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    333|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    333|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 333, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    333|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    333|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 333, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    333|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    333|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    333|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    333|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    333|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    333|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    350|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    350|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1655|    333|        trunnel_assert((size_t)(eos - ptr) < SIZE_MAX - 1);
  ------------------
  |  |   15|    333|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    333|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    333|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    333|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    333|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    333|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    333|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 333, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    333|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    333|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 333, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    333|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    333|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    333|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    333|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    333|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    333|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    333|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    333|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1656|    333|        memlen = ((size_t)(eos - ptr)) + 1;
 1657|    333|        if (!(obj->socks4a_addr_hostname = trunnel_malloc(memlen)))
  ------------------
  |  |    9|    333|#define trunnel_malloc tor_malloc
  |  |  ------------------
  |  |  |  |   62|    333|#define tor_malloc(size)       tor_malloc_(size)
  |  |  ------------------
  ------------------
  |  Branch (1657:13): [True: 0, False: 333]
  ------------------
 1658|      0|          goto fail;
 1659|    333|        memcpy(obj->socks4a_addr_hostname, ptr, memlen);
 1660|    333|        remaining -= memlen; ptr += memlen;
 1661|    333|      }
 1662|      0|      break;
 1663|       |
 1664|    205|    default:
  ------------------
  |  Branch (1664:5): [True: 205, False: 350]
  ------------------
 1665|    205|      break;
 1666|    555|  }
 1667|    538|  trunnel_assert(ptr + remaining == input + len_in);
  ------------------
  |  |   15|    538|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    555|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    538|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    538|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    538|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    538|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    538|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 538, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    538|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    538|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 538, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    538|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    538|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    538|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    538|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    538|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    538|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    555|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    555|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1668|    538|  return len_in - remaining;
 1669|       |
 1670|     34| truncated:
 1671|     34|  return -2;
 1672|     22| fail:
 1673|     22|  result = -1;
 1674|     22|  return result;
 1675|    538|}
socks5.c:socks5_client_userpass_auth_clear:
 1947|    204|{
 1948|    204|  (void) obj;
 1949|    204|  TRUNNEL_DYNARRAY_WIPE(&obj->username);
  ------------------
  |  |  212|    204|#define TRUNNEL_DYNARRAY_WIPE(da) do {                                  \
  |  |  213|    204|    trunnel_memwipe((da)->elts_, (da)->allocated_ * sizeof((da)->elts_[0])); \
  |  |  ------------------
  |  |  |  |   16|    204|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  |  |  ------------------
  |  |  214|    204|  } while (0)
  |  |  ------------------
  |  |  |  Branch (214:12): [Folded, False: 204]
  |  |  ------------------
  ------------------
 1950|    204|  TRUNNEL_DYNARRAY_CLEAR(&obj->username);
  ------------------
  |  |  204|    204|#define TRUNNEL_DYNARRAY_CLEAR(da) do {           \
  |  |  205|    204|    trunnel_free((da)->elts_);                    \
  |  |  ------------------
  |  |  |  |  141|    204|#define trunnel_free(x) ((x) ? (trunnel_free_(x),0) : (0))
  |  |  |  |  ------------------
  |  |  |  |  |  |   12|    201|#define trunnel_free_ tor_free_
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:26): [True: 201, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  206|    204|    (da)->elts_ = NULL;                           \
  |  |  207|    204|    (da)->n_ = (da)->allocated_ = 0;              \
  |  |  208|    204|  } while (0)
  |  |  ------------------
  |  |  |  Branch (208:12): [Folded, False: 204]
  |  |  ------------------
  ------------------
 1951|    204|  TRUNNEL_DYNARRAY_WIPE(&obj->passwd);
  ------------------
  |  |  212|    204|#define TRUNNEL_DYNARRAY_WIPE(da) do {                                  \
  |  |  213|    204|    trunnel_memwipe((da)->elts_, (da)->allocated_ * sizeof((da)->elts_[0])); \
  |  |  ------------------
  |  |  |  |   16|    204|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  |  |  ------------------
  |  |  214|    204|  } while (0)
  |  |  ------------------
  |  |  |  Branch (214:12): [Folded, False: 204]
  |  |  ------------------
  ------------------
 1952|       |  TRUNNEL_DYNARRAY_CLEAR(&obj->passwd);
  ------------------
  |  |  204|    204|#define TRUNNEL_DYNARRAY_CLEAR(da) do {           \
  |  |  205|    204|    trunnel_free((da)->elts_);                    \
  |  |  ------------------
  |  |  |  |  141|    204|#define trunnel_free(x) ((x) ? (trunnel_free_(x),0) : (0))
  |  |  |  |  ------------------
  |  |  |  |  |  |   12|    164|#define trunnel_free_ tor_free_
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:26): [True: 164, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  206|    204|    (da)->elts_ = NULL;                           \
  |  |  207|    204|    (da)->n_ = (da)->allocated_ = 0;              \
  |  |  208|    204|  } while (0)
  |  |  ------------------
  |  |  |  Branch (208:12): [Folded, False: 204]
  |  |  ------------------
  ------------------
 1953|    204|}
socks5.c:socks5_client_userpass_auth_parse_into:
 2304|    204|{
 2305|    204|  const uint8_t *ptr = input;
 2306|    204|  size_t remaining = len_in;
 2307|    204|  ssize_t result = 0;
 2308|    204|  (void)result;
 2309|       |
 2310|       |  /* Parse u8 version IN [1] */
 2311|    204|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    204|  do {                                                           \
  |  |   26|    204|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 0, False: 204]
  |  |  ------------------
  |  |   27|      0|      goto label;                                                \
  |  |   28|      0|    }                                                            \
  |  |   29|    204|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 204]
  |  |  ------------------
  ------------------
 2312|    204|  obj->version = (trunnel_get_uint8(ptr));
 2313|    204|  remaining -= 1; ptr += 1;
 2314|    204|  if (! (obj->version == 1))
  ------------------
  |  Branch (2314:7): [True: 1, False: 203]
  ------------------
 2315|      1|    goto fail;
 2316|       |
 2317|       |  /* Parse u8 username_len */
 2318|    203|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    203|  do {                                                           \
  |  |   26|    203|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 0, False: 203]
  |  |  ------------------
  |  |   27|      0|      goto label;                                                \
  |  |   28|      0|    }                                                            \
  |  |   29|    203|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 203]
  |  |  ------------------
  ------------------
 2319|    203|  obj->username_len = (trunnel_get_uint8(ptr));
 2320|    203|  remaining -= 1; ptr += 1;
 2321|       |
 2322|       |  /* Parse char username[username_len] */
 2323|    203|  CHECK_REMAINING(obj->username_len, truncated);
  ------------------
  |  |   25|    203|  do {                                                           \
  |  |   26|    203|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 2, False: 201]
  |  |  ------------------
  |  |   27|      2|      goto label;                                                \
  |  |   28|      2|    }                                                            \
  |  |   29|    203|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 201]
  |  |  ------------------
  ------------------
 2324|    201|  if (socks5_client_userpass_auth_setstr0_username(obj, (const char*)ptr, obj->username_len))
  ------------------
  |  Branch (2324:7): [True: 0, False: 201]
  ------------------
 2325|      0|    goto fail;
 2326|    201|  ptr += obj->username_len; remaining -= obj->username_len;
 2327|       |
 2328|       |  /* Parse u8 passwd_len */
 2329|    201|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    201|  do {                                                           \
  |  |   26|    201|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 26, False: 175]
  |  |  ------------------
  |  |   27|     26|      goto label;                                                \
  |  |   28|     26|    }                                                            \
  |  |   29|    201|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 175]
  |  |  ------------------
  ------------------
 2330|    175|  obj->passwd_len = (trunnel_get_uint8(ptr));
 2331|    175|  remaining -= 1; ptr += 1;
 2332|       |
 2333|       |  /* Parse char passwd[passwd_len] */
 2334|    175|  CHECK_REMAINING(obj->passwd_len, truncated);
  ------------------
  |  |   25|    175|  do {                                                           \
  |  |   26|    175|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 11, False: 164]
  |  |  ------------------
  |  |   27|     11|      goto label;                                                \
  |  |   28|     11|    }                                                            \
  |  |   29|    175|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 164]
  |  |  ------------------
  ------------------
 2335|    164|  if (socks5_client_userpass_auth_setstr0_passwd(obj, (const char*)ptr, obj->passwd_len))
  ------------------
  |  Branch (2335:7): [True: 0, False: 164]
  ------------------
 2336|      0|    goto fail;
 2337|    164|  ptr += obj->passwd_len; remaining -= obj->passwd_len;
 2338|    164|  trunnel_assert(ptr + remaining == input + len_in);
  ------------------
  |  |   15|    164|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    164|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    164|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    164|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    164|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    164|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    164|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 164, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    164|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    164|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 164, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    164|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    164|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    164|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    164|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    164|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    164|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    164|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    164|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2339|    164|  return len_in - remaining;
 2340|       |
 2341|     39| truncated:
 2342|     39|  return -2;
 2343|      1| fail:
 2344|      1|  result = -1;
 2345|      1|  return result;
 2346|    164|}
socks5.c:socks5_client_version_clear:
 2376|    560|{
 2377|    560|  (void) obj;
 2378|    560|  TRUNNEL_DYNARRAY_WIPE(&obj->methods);
  ------------------
  |  |  212|    560|#define TRUNNEL_DYNARRAY_WIPE(da) do {                                  \
  |  |  213|    560|    trunnel_memwipe((da)->elts_, (da)->allocated_ * sizeof((da)->elts_[0])); \
  |  |  ------------------
  |  |  |  |   16|    560|#define trunnel_memwipe(mem, len) memwipe((mem), 0, (len))
  |  |  ------------------
  |  |  214|    560|  } while (0)
  |  |  ------------------
  |  |  |  Branch (214:12): [Folded, False: 560]
  |  |  ------------------
  ------------------
 2379|       |  TRUNNEL_DYNARRAY_CLEAR(&obj->methods);
  ------------------
  |  |  204|    560|#define TRUNNEL_DYNARRAY_CLEAR(da) do {           \
  |  |  205|    560|    trunnel_free((da)->elts_);                    \
  |  |  ------------------
  |  |  |  |  141|    560|#define trunnel_free(x) ((x) ? (trunnel_free_(x),0) : (0))
  |  |  |  |  ------------------
  |  |  |  |  |  |   12|    549|#define trunnel_free_ tor_free_
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:26): [True: 549, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  206|    560|    (da)->elts_ = NULL;                           \
  |  |  207|    560|    (da)->n_ = (da)->allocated_ = 0;              \
  |  |  208|    560|  } while (0)
  |  |  ------------------
  |  |  |  Branch (208:12): [Folded, False: 560]
  |  |  ------------------
  ------------------
 2380|    560|}
socks5.c:socks5_client_version_parse_into:
 2598|    560|{
 2599|    560|  const uint8_t *ptr = input;
 2600|    560|  size_t remaining = len_in;
 2601|    560|  ssize_t result = 0;
 2602|    560|  (void)result;
 2603|       |
 2604|       |  /* Parse u8 version IN [5] */
 2605|    560|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    560|  do {                                                           \
  |  |   26|    560|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 0, False: 560]
  |  |  ------------------
  |  |   27|      0|      goto label;                                                \
  |  |   28|      0|    }                                                            \
  |  |   29|    560|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 560]
  |  |  ------------------
  ------------------
 2606|    560|  obj->version = (trunnel_get_uint8(ptr));
 2607|    560|  remaining -= 1; ptr += 1;
 2608|    560|  if (! (obj->version == 5))
  ------------------
  |  Branch (2608:7): [True: 0, False: 560]
  ------------------
 2609|      0|    goto fail;
 2610|       |
 2611|       |  /* Parse u8 n_methods */
 2612|    560|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    560|  do {                                                           \
  |  |   26|    560|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 0, False: 560]
  |  |  ------------------
  |  |   27|      0|      goto label;                                                \
  |  |   28|      0|    }                                                            \
  |  |   29|    560|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 560]
  |  |  ------------------
  ------------------
 2613|    560|  obj->n_methods = (trunnel_get_uint8(ptr));
 2614|    560|  remaining -= 1; ptr += 1;
 2615|       |
 2616|       |  /* Parse u8 methods[n_methods] */
 2617|    560|  CHECK_REMAINING(obj->n_methods, truncated);
  ------------------
  |  |   25|    560|  do {                                                           \
  |  |   26|    560|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 11, False: 549]
  |  |  ------------------
  |  |   27|     11|      goto label;                                                \
  |  |   28|     11|    }                                                            \
  |  |   29|    560|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 549]
  |  |  ------------------
  ------------------
 2618|    549|  TRUNNEL_DYNARRAY_EXPAND(uint8_t, &obj->methods, obj->n_methods, {});
  ------------------
  |  |  178|    549|#define TRUNNEL_DYNARRAY_EXPAND(elttype, da, howmanymore, on_fail) do { \
  |  |  179|    549|    elttype *newarray;                                               \
  |  |  180|    549|    newarray = trunnel_dynarray_expand(&(da)->allocated_,            \
  |  |  181|    549|                                       (da)->elts_, (howmanymore),   \
  |  |  182|    549|                                       sizeof(elttype));             \
  |  |  183|    549|    if (newarray == NULL) {                                          \
  |  |  ------------------
  |  |  |  Branch (183:9): [True: 0, False: 549]
  |  |  ------------------
  |  |  184|      0|      on_fail;                                                       \
  |  |  185|      0|      goto trunnel_alloc_failed;                                     \
  |  |  186|      0|    }                                                                \
  |  |  187|    549|    (da)->elts_ = newarray;                                          \
  |  |  188|    549|  } while (0)
  |  |  ------------------
  |  |  |  Branch (188:12): [Folded, False: 549]
  |  |  ------------------
  ------------------
 2619|    549|  obj->methods.n_ = obj->n_methods;
 2620|    549|  if (obj->n_methods)
  ------------------
  |  Branch (2620:7): [True: 536, False: 13]
  ------------------
 2621|    536|    memcpy(obj->methods.elts_, ptr, obj->n_methods);
 2622|    549|  ptr += obj->n_methods; remaining -= obj->n_methods;
 2623|    549|  trunnel_assert(ptr + remaining == input + len_in);
  ------------------
  |  |   15|    549|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    549|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    549|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    549|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    549|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    549|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    549|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 549, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    549|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    549|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 549, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    549|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    549|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    549|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    549|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    549|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    549|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    549|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    549|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2624|    549|  return len_in - remaining;
 2625|       |
 2626|     11| truncated:
 2627|     11|  return -2;
 2628|      0| trunnel_alloc_failed:
 2629|      0|  return -1;
 2630|      0| fail:
 2631|      0|  result = -1;
 2632|      0|  return result;
 2633|    549|}
socks5.c:socks5_server_method_clear:
 2663|    536|{
 2664|    536|  (void) obj;
 2665|    536|}
socks5.c:socks5_server_userpass_auth_clear:
 2854|    164|{
 2855|    164|  (void) obj;
 2856|    164|}
socks5.c:socks5_client_request_clear:
 3046|    445|{
 3047|    445|  (void) obj;
 3048|    445|  domainname_free(obj->dest_addr_domainname);
 3049|       |  obj->dest_addr_domainname = NULL;
 3050|    445|}
socks5.c:socks5_client_request_parse_into:
 3412|    445|{
 3413|    445|  const uint8_t *ptr = input;
 3414|    445|  size_t remaining = len_in;
 3415|    445|  ssize_t result = 0;
 3416|    445|  (void)result;
 3417|       |
 3418|       |  /* Parse u8 version IN [5] */
 3419|    445|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    445|  do {                                                           \
  |  |   26|    445|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 0, False: 445]
  |  |  ------------------
  |  |   27|      0|      goto label;                                                \
  |  |   28|      0|    }                                                            \
  |  |   29|    445|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 445]
  |  |  ------------------
  ------------------
 3420|    445|  obj->version = (trunnel_get_uint8(ptr));
 3421|    445|  remaining -= 1; ptr += 1;
 3422|    445|  if (! (obj->version == 5))
  ------------------
  |  Branch (3422:7): [True: 6, False: 439]
  ------------------
 3423|      6|    goto fail;
 3424|       |
 3425|       |  /* Parse u8 command IN [CMD_BIND, CMD_CONNECT, CMD_RESOLVE, CMD_RESOLVE_PTR, CMD_UDP_ASSOCIATE] */
 3426|    439|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    439|  do {                                                           \
  |  |   26|    439|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 0, False: 439]
  |  |  ------------------
  |  |   27|      0|      goto label;                                                \
  |  |   28|      0|    }                                                            \
  |  |   29|    439|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 439]
  |  |  ------------------
  ------------------
 3427|    439|  obj->command = (trunnel_get_uint8(ptr));
 3428|    439|  remaining -= 1; ptr += 1;
 3429|    439|  if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR || obj->command == CMD_UDP_ASSOCIATE))
  ------------------
  |  |   12|    878|#define CMD_BIND 2
  ------------------
                if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR || obj->command == CMD_UDP_ASSOCIATE))
  ------------------
  |  |   11|    876|#define CMD_CONNECT 1
  ------------------
                if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR || obj->command == CMD_UDP_ASSOCIATE))
  ------------------
  |  |   14|    712|#define CMD_RESOLVE 240
  ------------------
                if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR || obj->command == CMD_UDP_ASSOCIATE))
  ------------------
  |  |   15|    695|#define CMD_RESOLVE_PTR 241
  ------------------
                if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR || obj->command == CMD_UDP_ASSOCIATE))
  ------------------
  |  |   13|     25|#define CMD_UDP_ASSOCIATE 3
  ------------------
  |  Branch (3429:10): [True: 2, False: 437]
  |  Branch (3429:38): [True: 164, False: 273]
  |  Branch (3429:69): [True: 17, False: 256]
  |  Branch (3429:100): [True: 231, False: 25]
  |  Branch (3429:135): [True: 6, False: 19]
  ------------------
 3430|     19|    goto fail;
 3431|       |
 3432|       |  /* Parse u8 reserved IN [0] */
 3433|    420|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    420|  do {                                                           \
  |  |   26|    420|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 5, False: 415]
  |  |  ------------------
  |  |   27|      5|      goto label;                                                \
  |  |   28|      5|    }                                                            \
  |  |   29|    420|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 415]
  |  |  ------------------
  ------------------
 3434|    415|  obj->reserved = (trunnel_get_uint8(ptr));
 3435|    415|  remaining -= 1; ptr += 1;
 3436|    415|  if (! (obj->reserved == 0))
  ------------------
  |  Branch (3436:7): [True: 11, False: 404]
  ------------------
 3437|     11|    goto fail;
 3438|       |
 3439|       |  /* Parse u8 atype */
 3440|    404|  CHECK_REMAINING(1, truncated);
  ------------------
  |  |   25|    404|  do {                                                           \
  |  |   26|    404|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 1, False: 403]
  |  |  ------------------
  |  |   27|      1|      goto label;                                                \
  |  |   28|      1|    }                                                            \
  |  |   29|    404|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 403]
  |  |  ------------------
  ------------------
 3441|    403|  obj->atype = (trunnel_get_uint8(ptr));
 3442|    403|  remaining -= 1; ptr += 1;
 3443|       |
 3444|       |  /* Parse union dest_addr[atype] */
 3445|    403|  switch (obj->atype) {
 3446|       |
 3447|     42|    case ATYPE_IPV4:
  ------------------
  |  |   16|     42|#define ATYPE_IPV4 1
  ------------------
  |  Branch (3447:5): [True: 42, False: 361]
  ------------------
 3448|       |
 3449|       |      /* Parse u32 dest_addr_ipv4 */
 3450|     42|      CHECK_REMAINING(4, truncated);
  ------------------
  |  |   25|     42|  do {                                                           \
  |  |   26|     42|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 4, False: 38]
  |  |  ------------------
  |  |   27|      4|      goto label;                                                \
  |  |   28|      4|    }                                                            \
  |  |   29|     42|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 38]
  |  |  ------------------
  ------------------
 3451|     38|      obj->dest_addr_ipv4 = trunnel_ntohl(trunnel_get_uint32(ptr));
  ------------------
  |  |   41|     38|#define trunnel_ntohl(x) ntohl(x)
  ------------------
 3452|     38|      remaining -= 4; ptr += 4;
 3453|     38|      break;
 3454|       |
 3455|    176|    case ATYPE_IPV6:
  ------------------
  |  |   17|    176|#define ATYPE_IPV6 4
  ------------------
  |  Branch (3455:5): [True: 176, False: 227]
  ------------------
 3456|       |
 3457|       |      /* Parse u8 dest_addr_ipv6[16] */
 3458|    176|      CHECK_REMAINING(16, truncated);
  ------------------
  |  |   25|    176|  do {                                                           \
  |  |   26|    176|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 8, False: 168]
  |  |  ------------------
  |  |   27|      8|      goto label;                                                \
  |  |   28|      8|    }                                                            \
  |  |   29|    176|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 168]
  |  |  ------------------
  ------------------
 3459|    168|      memcpy(obj->dest_addr_ipv6, ptr, 16);
 3460|    168|      remaining -= 16; ptr += 16;
 3461|    168|      break;
 3462|       |
 3463|    183|    case ATYPE_DOMAINNAME:
  ------------------
  |  |   18|    183|#define ATYPE_DOMAINNAME 3
  ------------------
  |  Branch (3463:5): [True: 183, False: 220]
  ------------------
 3464|       |
 3465|       |      /* Parse struct domainname dest_addr_domainname */
 3466|    183|      result = domainname_parse(&obj->dest_addr_domainname, ptr, remaining);
 3467|    183|      if (result < 0)
  ------------------
  |  Branch (3467:11): [True: 8, False: 175]
  ------------------
 3468|      8|        goto relay_fail;
 3469|    175|      trunnel_assert((size_t)result <= remaining);
  ------------------
  |  |   15|    175|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    183|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    175|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    175|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    175|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    175|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    175|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 175, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    175|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    175|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 175, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    175|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    175|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    175|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    175|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    175|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    175|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    183|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    183|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3470|    175|      remaining -= result; ptr += result;
 3471|    175|      break;
 3472|       |
 3473|      2|    default:
  ------------------
  |  Branch (3473:5): [True: 2, False: 401]
  ------------------
 3474|      2|      goto fail;
 3475|      2|      break;
 3476|    403|  }
 3477|       |
 3478|       |  /* Parse u16 dest_port */
 3479|    381|  CHECK_REMAINING(2, truncated);
  ------------------
  |  |   25|    381|  do {                                                           \
  |  |   26|    381|    if (remaining < (nbytes) OR_DEADCODE_DUMMY) {                \
  |  |  ------------------
  |  |  |  Branch (26:9): [True: 17, False: 364]
  |  |  ------------------
  |  |   27|     17|      goto label;                                                \
  |  |   28|     17|    }                                                            \
  |  |   29|    381|  } while (0)
  |  |  ------------------
  |  |  |  Branch (29:12): [Folded, False: 364]
  |  |  ------------------
  ------------------
 3480|    364|  obj->dest_port = trunnel_ntohs(trunnel_get_uint16(ptr));
  ------------------
  |  |   42|    364|#define trunnel_ntohs(x) ntohs(x)
  ------------------
 3481|    364|  remaining -= 2; ptr += 2;
 3482|    364|  trunnel_assert(ptr + remaining == input + len_in);
  ------------------
  |  |   15|    364|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|    364|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    364|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|    364|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    364|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|    364|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|    364|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 364, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|    364|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|    364|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 364, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|    364|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|    364|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|    364|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|    364|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|    364|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    364|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|    364|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|    364|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3483|    364|  return len_in - remaining;
 3484|       |
 3485|     35| truncated:
 3486|     35|  return -2;
 3487|      8| relay_fail:
 3488|      8|  trunnel_assert(result < 0);
  ------------------
  |  |   15|      8|#define trunnel_assert tor_assert
  |  |  ------------------
  |  |  |  |  103|      8|#define tor_assert(expr) tor_assertf(expr, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      8|#define tor_assertf(expr, fmt, ...) STMT_BEGIN                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  204|      8|#define STMT_BEGIN (void) ({
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  106|      8|  if (ASSERT_PREDICT_LIKELY_(expr)) {                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   83|      8|#define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   75|      8|  ( {                                           \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (75:3): [True: 8, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   76|      8|    int tor__assert_tmp_value__;                \
  |  |  |  |  |  |  |  |  |  |   77|      8|    if (e)                                      \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (77:9): [True: 8, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   78|      8|      tor__assert_tmp_value__ = 1;              \
  |  |  |  |  |  |  |  |  |  |   79|      8|    else                                        \
  |  |  |  |  |  |  |  |  |  |   80|      8|      tor__assert_tmp_value__ = 0;              \
  |  |  |  |  |  |  |  |  |  |   81|      8|    tor__assert_tmp_value__;                    \
  |  |  |  |  |  |  |  |  |  |   82|      8|  } )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      8|  } else {                                                              \
  |  |  |  |  |  |  108|      0|    tor_assertion_failed_(SHORT_FILE__, __LINE__, __func__, #expr,      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  298|      0|#define SHORT_FILE__ (__FILE__)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|                          fmt, ##__VA_ARGS__);                          \
  |  |  |  |  |  |  110|      0|    tor_abort_();                                                        \
  |  |  |  |  |  |  111|      8|  } STMT_END
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  205|      8|#define STMT_END })
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3489|      8|  return result;
 3490|     38| fail:
 3491|     38|  result = -1;
 3492|     38|  return result;
 3493|      8|}
socks5.c:socks5_server_reply_clear:
 3523|    180|{
 3524|    180|  (void) obj;
 3525|    180|  domainname_free(obj->bind_addr_domainname);
 3526|       |  obj->bind_addr_domainname = NULL;
 3527|    180|}

