rippled
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
xrpl::cryptoconditions::PreimageSha256 Class Referencefinal

#include <PreimageSha256.h>

Inheritance diagram for xrpl::cryptoconditions::PreimageSha256:
Inheritance graph
[legend]
Collaboration diagram for xrpl::cryptoconditions::PreimageSha256:
Collaboration graph
[legend]

Public Member Functions

 PreimageSha256 (Buffer &&b) noexcept
 
 PreimageSha256 (Slice s) noexcept
 
Type type () const override
 Returns the type of this condition.
 
Buffer fingerprint () const override
 Returns the fulfillment's fingerprint:
 
std::uint32_t cost () const override
 Calculates the cost associated with this fulfillment.
 
Condition condition () const override
 Returns the condition associated with the given fulfillment.
 
bool validate (Slice) const override
 Validates a fulfillment.
 

Static Public Member Functions

static std::unique_ptr< Fulfillmentdeserialize (Slice s, std::error_code &ec)
 Parse the payload for a PreimageSha256 condition.
 

Static Public Attributes

static constexpr std::size_t maxPreimageLength = 128
 The maximum allowed length of a preimage.
 
static constexpr std::size_t maxSerializedFulfillment = 256
 The largest binary fulfillment we support.
 

Private Attributes

Buffer payload_
 

Detailed Description

Definition at line 17 of file PreimageSha256.h.

Constructor & Destructor Documentation

◆ PreimageSha256() [1/2]

xrpl::cryptoconditions::PreimageSha256::PreimageSha256 ( Buffer &&  b)
noexcept

Definition at line 88 of file PreimageSha256.h.

◆ PreimageSha256() [2/2]

xrpl::cryptoconditions::PreimageSha256::PreimageSha256 ( Slice  s)
noexcept

Definition at line 92 of file PreimageSha256.h.

Member Function Documentation

◆ deserialize()

static std::unique_ptr< Fulfillment > xrpl::cryptoconditions::PreimageSha256::deserialize ( Slice  s,
std::error_code ec 
)
static

Parse the payload for a PreimageSha256 condition.

Parameters
sA slice containing the DER encoded payload
ecindicates success or failure of the operation
Returns
the preimage, if successful; empty pointer otherwise.

Definition at line 38 of file PreimageSha256.h.

◆ type()

Type xrpl::cryptoconditions::PreimageSha256::type ( ) const
overridevirtual

Returns the type of this condition.

Implements xrpl::cryptoconditions::Fulfillment.

Definition at line 97 of file PreimageSha256.h.

◆ fingerprint()

Buffer xrpl::cryptoconditions::PreimageSha256::fingerprint ( ) const
overridevirtual

Returns the fulfillment's fingerprint:

The fingerprint is an octet string uniquely representing this fulfillment's condition with respect to other conditions of the same type.

Implements xrpl::cryptoconditions::Fulfillment.

Definition at line 103 of file PreimageSha256.h.

◆ cost()

std::uint32_t xrpl::cryptoconditions::PreimageSha256::cost ( ) const
overridevirtual

Calculates the cost associated with this fulfillment.

  • The cost function is deterministic and depends on the type and properties of the condition and the fulfillment that the condition is generated from.

Implements xrpl::cryptoconditions::Fulfillment.

Definition at line 112 of file PreimageSha256.h.

◆ condition()

Condition xrpl::cryptoconditions::PreimageSha256::condition ( ) const
overridevirtual

Returns the condition associated with the given fulfillment.

This process is completely deterministic. All implementations will, if compliant, produce the identical condition for the same fulfillment.

Implements xrpl::cryptoconditions::Fulfillment.

Definition at line 118 of file PreimageSha256.h.

◆ validate()

bool xrpl::cryptoconditions::PreimageSha256::validate ( Slice  data) const
overridevirtual

Validates a fulfillment.

Implements xrpl::cryptoconditions::Fulfillment.

Definition at line 124 of file PreimageSha256.h.

Member Data Documentation

◆ maxPreimageLength

constexpr std::size_t xrpl::cryptoconditions::PreimageSha256::maxPreimageLength = 128
staticconstexpr

The maximum allowed length of a preimage.

The specification does not specify a minimum supported length, nor does it require all conditions to support the same minimum length.

While future versions of this code will never lower this limit, they may opt to raise it.

Definition at line 29 of file PreimageSha256.h.

◆ payload_

Buffer xrpl::cryptoconditions::PreimageSha256::payload_
private

Definition at line 85 of file PreimageSha256.h.

◆ maxSerializedFulfillment

constexpr std::size_t xrpl::cryptoconditions::Fulfillment::maxSerializedFulfillment = 256
staticconstexprinherited

The largest binary fulfillment we support.

Note
This value will be increased in the future, but it must never decrease, as that could cause fulfillments that were previously considered valid to no longer be allowed.

Definition at line 22 of file Fulfillment.h.