xrpld
Loading...
Searching...
No Matches
xrpl::cryptoconditions Namespace Reference

Namespaces

namespace  der
namespace  detail

Classes

class  Condition
class  PreimageSha256
struct  Fulfillment
class  PreimageSha256_test

Enumerations

enum class  Type : std::uint8_t {
  PreimageSha256 = 0 , PrefixSha256 = 1 , ThresholdSha256 = 2 , RsaSha256 = 3 ,
  Ed25519Sha256 = 4
}
enum class  Error {
  Generic = 1 , UnsupportedType , UnsupportedSubtype , UnknownType ,
  UnknownSubtype , FingerprintSize , IncorrectEncoding , TrailingGarbage ,
  BufferEmpty , BufferOverfull , BufferUnderfull , MalformedEncoding ,
  ShortPreamble , UnexpectedTag , LongTag , LargeSize ,
  PreimageTooLong
}

Functions

bool operator== (Condition const &lhs, Condition const &rhs)
bool operator!= (Condition const &lhs, Condition const &rhs)
std::error_code make_error_code (Error ev)
bool operator== (Fulfillment const &lhs, Fulfillment const &rhs)
bool operator!= (Fulfillment const &lhs, Fulfillment const &rhs)
bool match (Fulfillment const &f, Condition const &c)
 Determine whether the given fulfillment and condition match.
bool validate (Fulfillment const &f, Condition const &c, Slice m)
 Verify if the given message satisfies the fulfillment.
bool validate (Fulfillment const &f, Condition const &c)
 Verify a cryptoconditional trigger.
 BEAST_DEFINE_TESTSUITE (PreimageSha256, conditions, xrpl)

Enumeration Type Documentation

◆ Type

Enumerator
PreimageSha256 
PrefixSha256 
ThresholdSha256 
RsaSha256 
Ed25519Sha256 

Definition at line 12 of file Condition.h.

◆ Error

enum class xrpl::cryptoconditions::Error
strong
Enumerator
Generic 
UnsupportedType 
UnsupportedSubtype 
UnknownType 
UnknownSubtype 
FingerprintSize 
IncorrectEncoding 
TrailingGarbage 
BufferEmpty 
BufferOverfull 
BufferUnderfull 
MalformedEncoding 
ShortPreamble 
UnexpectedTag 
LongTag 
LargeSize 
PreimageTooLong 

Definition at line 7 of file error.h.

Function Documentation

◆ operator==() [1/2]

bool xrpl::cryptoconditions::operator== ( Condition const & lhs,
Condition const & rhs )

Definition at line 78 of file Condition.h.

◆ operator!=() [1/2]

bool xrpl::cryptoconditions::operator!= ( Condition const & lhs,
Condition const & rhs )

Definition at line 85 of file Condition.h.

◆ make_error_code()

std::error_code xrpl::cryptoconditions::make_error_code ( Error ev)

Definition at line 111 of file error.cpp.

◆ operator==() [2/2]

bool xrpl::cryptoconditions::operator== ( Fulfillment const & lhs,
Fulfillment const & rhs )

Definition at line 75 of file Fulfillment.h.

◆ operator!=() [2/2]

bool xrpl::cryptoconditions::operator!= ( Fulfillment const & lhs,
Fulfillment const & rhs )

Definition at line 83 of file Fulfillment.h.

◆ match()

bool xrpl::cryptoconditions::match ( Fulfillment const & f,
Condition const & c )

Determine whether the given fulfillment and condition match.

Definition at line 16 of file Fulfillment.cpp.

◆ validate() [1/2]

bool xrpl::cryptoconditions::validate ( Fulfillment const & f,
Condition const & c,
Slice m )

Verify if the given message satisfies the fulfillment.

Parameters
fThe fulfillment
cThe condition
mThe message
Note
the message is not relevant for some conditions and a fulfillment will successfully satisfy its condition for any given message.

Definition at line 29 of file Fulfillment.cpp.

◆ validate() [2/2]

bool xrpl::cryptoconditions::validate ( Fulfillment const & f,
Condition const & c )

Verify a cryptoconditional trigger.

A cryptoconditional trigger is a cryptocondition with an empty message.

When using such triggers, it is recommended that the trigger be of type preimage, prefix or threshold. If a signature type is used (i.e. Ed25519 or RSA-SHA256) then the Ed25519 or RSA keys should be single-use keys.

Parameters
fThe fulfillment
cThe condition

Definition at line 35 of file Fulfillment.cpp.

◆ BEAST_DEFINE_TESTSUITE()

xrpl::cryptoconditions::BEAST_DEFINE_TESTSUITE ( PreimageSha256 ,
conditions ,
xrpl  )