Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Functions | Variables
descriptor.h File Reference
#include <key_io.h>
#include <util/strencodings.h>
#include <script/descriptor.h>
#include <test/fuzz/fuzz.h>
#include <functional>
Include dependency graph for descriptor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MockedDescriptorConverter
 Converts a mocked descriptor string to a valid one. More...
 

Functions

bool HasDeepDerivPath (const FuzzBufferType &buff, const int max_depth=MAX_DEPTH)
 Whether the buffer, if it represents a valid descriptor, contains a derivation path deeper than a given maximum depth. More...
 
bool HasTooManySubFrag (const FuzzBufferType &buff, const int max_subs=MAX_SUBS, const size_t max_nested_subs=MAX_NESTED_SUBS)
 Whether the buffer, if it represents a valid descriptor, contains a fragment with more sub-fragments than the given maximum. More...
 
bool HasTooManyWrappers (const FuzzBufferType &buff, const int max_wrappers=MAX_WRAPPERS)
 Whether the buffer, if it represents a valid descriptor, contains a fragment with more wrappers than the given maximum. More...
 

Variables

constexpr int MAX_DEPTH {2}
 Default maximum number of derivation indexes in a single derivation path when limiting its depth. More...
 
constexpr int MAX_SUBS {1'000}
 Default maximum number of sub-fragments. More...
 
constexpr size_t MAX_NESTED_SUBS {10'000}
 Maximum number of nested sub-fragments we'll allow in a descriptor. More...
 
constexpr int MAX_WRAPPERS {100}
 Default maximum number of wrappers per fragment. More...
 

Function Documentation

◆ HasDeepDerivPath()

bool HasDeepDerivPath ( const FuzzBufferType buff,
const int  max_depth = MAX_DEPTH 
)

Whether the buffer, if it represents a valid descriptor, contains a derivation path deeper than a given maximum depth.

Note this may also be hit for deriv paths in origins.

Definition at line 77 of file descriptor.cpp.

Here is the caller graph for this function:

◆ HasTooManySubFrag()

bool HasTooManySubFrag ( const FuzzBufferType buff,
const int  max_subs = MAX_SUBS,
const size_t  max_nested_subs = MAX_NESTED_SUBS 
)

Whether the buffer, if it represents a valid descriptor, contains a fragment with more sub-fragments than the given maximum.

Definition at line 91 of file descriptor.cpp.

Here is the caller graph for this function:

◆ HasTooManyWrappers()

bool HasTooManyWrappers ( const FuzzBufferType buff,
const int  max_wrappers = MAX_WRAPPERS 
)

Whether the buffer, if it represents a valid descriptor, contains a fragment with more wrappers than the given maximum.

Definition at line 115 of file descriptor.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ MAX_DEPTH

constexpr int MAX_DEPTH {2}
constexpr

Default maximum number of derivation indexes in a single derivation path when limiting its depth.

Definition at line 50 of file descriptor.h.

◆ MAX_NESTED_SUBS

constexpr size_t MAX_NESTED_SUBS {10'000}
constexpr

Maximum number of nested sub-fragments we'll allow in a descriptor.

Definition at line 61 of file descriptor.h.

◆ MAX_SUBS

constexpr int MAX_SUBS {1'000}
constexpr

Default maximum number of sub-fragments.

Definition at line 59 of file descriptor.h.

◆ MAX_WRAPPERS

constexpr int MAX_WRAPPERS {100}
constexpr

Default maximum number of wrappers per fragment.

Definition at line 71 of file descriptor.h.