Fuzz introspector
For issues and ideas: https://github.com/ossf/fuzz-introspector/issues
Report generation date: 2023-06-07

Project overview: pycrypto

High level conclusions

Reachability and coverage overview

Functions statically reachable by fuzzers
5.0%
46 / 882
Cyclomatic complexity statically reachable by fuzzers
6.0%
171 / 2839
Runtime code coverage of functions
13.0%
114 / 882

Warning: The number of runtime covered functions are larger than the number of reachable functions. This means that Fuzz Introspector found there are more functions covered at runtime than what is considered reachable based on the static analysis. This is a limitation in the analysis as anything covered at runtime is by definition reachable by the fuzzers.
This is likely due to a limitation in the static analysis. In this case, the count of functions covered at runtime is the true value, which means this is what should be considered "achieved" by the fuzzer.

Use the project functions table below to query all functions that were not covered at runtime.

Fuzzer details

Fuzzer: fuzz_all_or_nothing

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 2 28.5%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 5 71.4%
All colors 7 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
2 4 ...fuzz_all_or_nothing.TestOneInput call site: 00004 AllOrNothing.AllOrNothing

Runtime coverage analysis

Covered functions
148
Functions that are reachable but not covered
6
Reachable functions
6
Percentage of reachable functions covered
0.0%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/ 1
...fuzz_all_or_nothing 5

Fuzzer: fuzz_aes

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 150 68.8%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 68 31.1%
All colors 218 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
49 117 Crypto.Util.number.bytes_to_long call site: 00117 Crypto.Cipher.blockalgo.BlockAlgo._start_gcm
42 174 Crypto.Cipher.blockalgo.BlockAlgo.encrypt call site: 00174 Crypto.Cipher.blockalgo.BlockAlgo._start_ccm
13 58 Crypto.Util.number.long_to_bytes call site: 00058 Crypto.Util.Counter.new
8 105 Crypto.Cipher.blockalgo.BlockAlgo._start_PGP call site: 00105 Crypto.Cipher.blockalgo.BlockAlgo._start_eax
7 22 Crypto.Hash.CMAC._SmoothMAC.update call site: 00022 Crypto.Cipher.blockalgo._GHASH._update
7 40 Crypto.Hash.CMAC._SmoothMAC.update call site: 00040 Crypto.Cipher.blockalgo.BlockAlgo._start_ccm
5 14 Crypto.Cipher.blockalgo.BlockAlgo.__init__ call site: 00014 Crypto.Cipher.blockalgo._CBCMAC.__init__
4 89 Crypto.Util.Counter.new call site: 00089 Crypto.Util.py3compat.bstr
4 100 Crypto.Cipher.blockalgo.BlockAlgo._start_PGP call site: 00100 Crypto.Util.py3compat.b
3 167 Crypto.Cipher.blockalgo.BlockAlgo.__init__ call site: 00167 Crypto.Cipher.blockalgo.BlockAlgo.__init__
2 77 Crypto.Util.Counter._encode call site: 00077 Crypto.Util.py3compat.bchr
1 48 Crypto.Util.py3compat.bchr call site: 00048 Crypto.Util.number.long_to_bytes

Runtime coverage analysis

Covered functions
149
Functions that are reachable but not covered
53
Reachable functions
72
Percentage of reachable functions covered
26.39%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/ 1
...fuzz_aes 6
Crypto.Cipher.AES 2
Crypto.Cipher.blockalgo 36
Crypto.Hash.CMAC 19
Crypto.Util.py3compat 6
Crypto.Util.number 6
Crypto.Util.Counter 13
Crypto.Protocol.KDF 9

Fuzzer: fuzz_number

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 8 12.9%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 54 87.0%
All colors 62 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
3 3 ...fuzz_number.TestOneInput call site: 00003 .int
3 58 Crypto.Util.number.getStrongPrime call site: 00058 fdp.ConsumeIntInRange
1 22 Crypto.Util.number.getRandomInteger call site: 00022 .chr
1 43 Crypto.Util.number._rabinMillerTest call site: 00043 Crypto.Util.number.getRandomRange

Runtime coverage analysis

Covered functions
149
Functions that are reachable but not covered
25
Reachable functions
35
Percentage of reachable functions covered
28.57%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/ 1
...fuzz_number 5
Crypto.Util.number 27
Crypto.Util.py3compat 3

Fuzzer: fuzz_hash

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 5 45.4%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 6 54.5%
All colors 11 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
3 6 ...fuzz_hash.TestOneInput call site: 00006 fdp.ConsumeBytes
2 1 ...fuzz_hash.TestOneInput call site: 00001 f.new

Runtime coverage analysis

Covered functions
149
Functions that are reachable but not covered
9
Reachable functions
9
Percentage of reachable functions covered
0.0%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/ 1
...fuzz_hash 8

Analyses and suggestions

Optimal target analysis

Remaining optimal interesting functions

The following table shows a list of functions that are optimal targets. Optimal targets are identified by finding the functions that in combination, yield a high code coverage.

Func name Functions filename Arg count Args Function depth hitcount instr count bb count cyclomatic complexity Reachable functions Incoming references total cyclomatic complexity Unreached complexity
Crypto.SelfTest.run Crypto.SelfTest 6 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 3 0 4 7 6 122 0 383 368
Crypto.PublicKey.RSA.RSAImplementation.importKey Crypto.PublicKey.RSA 3 ['N/A', 'N/A', 'N/A'] 4 0 2 5 5 123 8 417 185
Crypto.SelfTest.Random.test__UserFriendlyRNG.RNGForkTest.runTest Crypto.SelfTest.Random.test__UserFriendlyRNG 1 ['N/A'] 4 0 13 3 4 48 0 151 124
Crypto.PublicKey.RSA._RSAobj.exportKey Crypto.PublicKey.RSA 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 6 0 1 11 7 126 12 420 97
Crypto.Util.asn1.DerSetOf._decodeFromStream Crypto.Util.asn1 2 ['N/A', 'N/A'] 11 0 7 3 4 38 31 125 69
Crypto.Signature.PKCS1_PSS.PSS_SigScheme.sign Crypto.Signature.PKCS1_PSS 2 ['N/A', 'N/A'] 3 0 1 2 4 31 2 100 51
Crypto.Random.Fortuna.FortunaAccumulator.FortunaAccumulator.random_data Crypto.Random.Fortuna.FortunaAccumulator 2 ['N/A', 'N/A'] 5 0 2 2 4 85 0 285 50
Crypto.SelfTest.Cipher.common.CipherSelfTest.runTest Crypto.SelfTest.Cipher.common 1 ['N/A'] 3 0 9 5 5 36 0 118 47
Crypto.SelfTest.Cipher.common.AEADTests.multiple_updates Crypto.SelfTest.Cipher.common 1 ['N/A'] 4 0 7 2 4 88 1 305 43

Implementing fuzzers that target the above functions will improve reachability such that it becomes:

Functions statically reachable by fuzzers
27.0%
242 / 882
Cyclomatic complexity statically reachable by fuzzers
28.9%
835 / 2839

All functions overview

If you implement fuzzers for these functions, the status of all functions in the project will be:

Func name Functions filename Args Function call depth Reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Files and Directories in report

This section shows which files and directories are considered in this report. The main reason for showing this is fuzz introspector may include more code in the reasoning than is desired. This section helps identify if too many files/directories are included, e.g. third party code, which may be irrelevant for the threat model. In the event too much is included, fuzz introspector supports a configuration file that can exclude data from the report. See the following link for more information on how to create a config file: link

Files in report

Source file Reached by Covered by
[] []
Crypto.SelfTest.Cipher.test_ARC2 [] []
Crypto.SelfTest.Random.test_rpoolcompat [] []
Crypto.Util._time [] []
Crypto.SelfTest.Util.test_Padding [] []
Crypto.Hash.RIPEMD [] []
Crypto.PublicKey._DSA [] []
Crypto.SelfTest.Cipher.test_pkcs1_oaep [] []
Crypto.SelfTest.Util.test_asn1 [] []
Crypto.SelfTest.Random.OSRNG.test_posix [] []
Crypto.Cipher.AES ['fuzz_aes'] []
Crypto.SelfTest.IO.test_PKCS8 [] []
Crypto.SelfTest.Random.OSRNG.test_fallback [] []
Crypto.SelfTest.Protocol.test_rfc1751 [] []
Crypto.Signature [] []
sys [] []
Crypto.IO._PBES [] []
Crypto.SelfTest.Random.test_random [] []
Crypto.SelfTest.Cipher.test_pkcs1_15 [] []
Crypto.SelfTest.Random.Fortuna.test_FortunaAccumulator [] []
Crypto.SelfTest.Hash.test_MD2 [] []
Crypto.SelfTest.PublicKey [] []
Crypto.SelfTest.Cipher.test_DES [] []
Crypto.SelfTest.Protocol.test_AllOrNothing [] []
Crypto.Cipher.CAST [] []
Crypto.PublicKey._slowmath [] []
Crypto.IO [] []
Crypto.PublicKey.ElGamal [] []
Crypto.Util.py3compat ['fuzz_aes', 'fuzz_number'] []
Crypto.Protocol.KDF ['fuzz_aes'] []
Crypto.Random.OSRNG.rng_base [] []
...fuzz_number ['fuzz_number'] []
Crypto.SelfTest.Util.test_number [] []
Crypto.Cipher.DES3 [] []
Crypto.Util.randpool [] []
Crypto.Random.OSRNG.fallback [] []
Crypto.SelfTest.PublicKey.test_import_RSA [] []
Crypto.Hash.MD5 [] []
Crypto.Cipher.PKCS1_v1_5 [] []
Crypto.SelfTest.Hash.test_CMAC [] []
Crypto.SelfTest.Protocol.test_KDF [] []
Crypto.SelfTest.Cipher.test_Blowfish [] []
Crypto.SelfTest.Util.test_winrandom [] []
Crypto.Random._UserFriendlyRNG [] []
multiprocessing [] []
Crypto.SelfTest.Random [] []
functools [] []
Crypto.Protocol [] []
Crypto [] []
Crypto.SelfTest.Util.test_Counter [] []
Crypto.SelfTest.Cipher.common [] []
Crypto.PublicKey.pubkey [] []
Crypto.SelfTest.Cipher [] []
Crypto.SelfTest.Hash [] []
Crypto.SelfTest.Random.OSRNG [] []
warnings [] []
Crypto.Hash.SHA1 [] []
Crypto.Protocol.AllOrNothing [] []
Crypto.SelfTest [] []
Crypto.Util.number ['fuzz_aes', 'fuzz_number'] []
Crypto.IO.PKCS8 [] []
getopt [] []
imp [] []
Crypto.Util.Padding [] []
Crypto.Signature.PKCS1_PSS [] []
Crypto.Cipher.ARC2 [] []
Crypto.SelfTest.Hash.test_RIPEMD160 [] []
Crypto.Cipher.PKCS1_OAEP [] []
Crypto.Random.OSRNG.posix [] []
Crypto.SelfTest.Hash.test_SHA1 [] []
Crypto.Random.Fortuna.SHAd256 [] []
Crypto.SelfTest.PublicKey.test_ElGamal [] []
threading [] []
Crypto.SelfTest.Signature.test_pkcs1_pss [] []
math [] []
Crypto.Util.winrandom [] []
Crypto.Util.Counter ['fuzz_aes'] []
Crypto.SelfTest.Hash.test_MD4 [] []
...fuzz_aes ['fuzz_aes'] []
Crypto.SelfTest.Hash.test_HMAC [] []
Crypto.SelfTest.Signature [] []
Crypto.SelfTest.Cipher.test_ARC4 [] []
Crypto.SelfTest.PublicKey.test_DSA [] []
Crypto.SelfTest.Random.Fortuna.test_FortunaGenerator [] []
Crypto.SelfTest.Cipher.test_AES [] []
Crypto.Random [] []
Crypto.Hash.SHA [] []
Crypto.SelfTest.Hash.test_MD5 [] []
md5 [] []
sha [] []
Crypto.Hash.CMAC ['fuzz_aes'] []
Crypto.SelfTest.Cipher.test_CAST [] []
Crypto.SelfTest.IO [] []
Crypto.SelfTest.Random.OSRNG.test_winrandom [] []
stat [] []
Crypto.Random.random [] []
Crypto.IO.PEM [] []
Crypto.Cipher.ARC4 [] []
Crypto.Util [] []
Crypto.SelfTest.PublicKey.test_RSA [] []
Crypto.SelfTest.Hash.test_SHA256 [] []
Crypto.PublicKey._RSA [] []
Crypto.SelfTest.st_common [] []
Crypto.SelfTest.Hash.test_SHA512 [] []
Crypto.SelfTest.Random.OSRNG.test_nt [] []
Crypto.Cipher.DES [] []
Crypto.pct_warnings [] []
Crypto.SelfTest.Random.OSRNG.test_generic [] []
unittest [] []
Crypto.Cipher.XOR [] []
Crypto.Random.Fortuna.FortunaAccumulator [] []
struct [] []
Crypto.SelfTest.Protocol.test_chaffing [] []
Crypto.Random.OSRNG [] []
Crypto.Random.Fortuna [] []
Crypto.SelfTest.Random.Fortuna.test_SHAd256 [] []
Crypto.SelfTest.Util [] []
Crypto.Cipher.blockalgo ['fuzz_aes'] []
binascii [] []
Crypto.SelfTest.Cipher.test_XOR [] []
Crypto.Util._number_new [] []
Crypto.SelfTest.Hash.common [] []
Crypto.SelfTest.Protocol [] []
Crypto.PublicKey.RSA [] []
Crypto.Protocol.Chaffing [] []
Crypto.SelfTest.Hash.test_SHA224 [] []
io [] []
time [] []
Crypto.SelfTest.Random.Fortuna [] []
Crypto.Cipher [] []
Crypto.SelfTest.Signature.test_pkcs1_15 [] []
Crypto.Util.RFC1751 [] []
[] []
Crypto.SelfTest.PublicKey.test_import_DSA [] []
Crypto.Hash [] []
Crypto.Signature.PKCS1_v1_5 [] []
os [] []
Crypto.PublicKey.DSA [] []
...fuzz_all_or_nothing ['fuzz_all_or_nothing'] []
pickle [] []
Crypto.SelfTest.Random.test__UserFriendlyRNG [] []
Crypto.Cipher.Blowfish [] []
hashlib [] []
Crypto.SelfTest.Hash.test_SHA384 [] []
Crypto.PublicKey [] []
Crypto.Util.asn1 [] []
Crypto.SelfTest.Cipher.test_DES3 [] []
Crypto.Hash.HMAC [] []
re [] []
atheris [] []
Crypto.Random.Fortuna.FortunaGenerator [] []
base64 [] []
...fuzz_hash ['fuzz_hash'] []

Directories in report

Directory