20#include <xrpld/conditions/Condition.h>
21#include <xrpld/conditions/detail/PreimageSha256.h>
22#include <xrpld/conditions/detail/utils.h>
25namespace cryptoconditions {
72 auto p = parsePreamble(s, ec);
77 if (!isPrimitive(p) || !isContextSpecific(p))
100 p = parsePreamble(s, ec);
105 if (!isPrimitive(p) || !isContextSpecific(p))
117 auto cost = parseInteger<std::uint32_t>(s, p.
length, ec);
142 return std::make_unique<Condition>(type, cost, std::move(b));
168 auto const p = parsePreamble(s, ec);
174 if (!isConstructed(p) || !isContextSpecific(p))
180 if (p.length > s.
size())
Like std::vector<char> but better.
An immutable linear range of bytes.
bool empty() const noexcept
Return true if the byte range is empty.
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
std::size_t size() const noexcept
Returns the number of bytes in the storage.
std::size_t length() const noexcept
static std::unique_ptr< Condition > deserialize(Slice s, std::error_code &ec)
Load a condition from its binary form.
static constexpr std::size_t maxSerializedCondition
The largest binary condition we support.
static constexpr std::size_t maxPreimageLength
The maximum allowed length of a preimage.
constexpr std::size_t fingerprintSize
std::unique_ptr< Condition > loadSimpleSha256(Type type, Slice s, std::error_code &ec)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.