rippled
Namespaces | Classes | Enumerations | Functions
ripple::cryptoconditions Namespace Reference

Namespaces

 der
 
 detail
 

Classes

class  Condition
 
struct  Fulfillment
 
class  PreimageSha256
 
class  PreimageSha256_test
 

Enumerations

enum  Type : std::uint8_t {
  Type::preimageSha256 = 0, Type::prefixSha256 = 1, Type::thresholdSha256 = 2, Type::rsaSha256 = 3,
  Type::ed25519Sha256 = 4
}
 
enum  error {
  error::generic = 1, error::unsupported_type, error::unsupported_subtype, error::unknown_type,
  error::unknown_subtype, error::fingerprint_size, error::incorrect_encoding, error::trailing_garbage,
  error::buffer_empty, error::buffer_overfull, error::buffer_underfull, error::malformed_encoding,
  error::short_preamble, error::unexpected_tag, error::long_tag, error::large_size,
  error::preimage_too_long
}
 

Functions

bool operator== (Condition const &lhs, Condition const &rhs)
 
bool operator!= (Condition const &lhs, Condition const &rhs)
 
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. More...
 
bool validate (Fulfillment const &f, Condition const &c, Slice m)
 Verify if the given message satisfies the fulfillment. More...
 
bool validate (Fulfillment const &f, Condition const &c)
 Verify a cryptoconditional trigger. More...
 
std::error_code make_error_code (error ev)
 
 BEAST_DEFINE_TESTSUITE (PreimageSha256, conditions, ripple)
 

Enumeration Type Documentation

◆ Type

Enumerator
preimageSha256 
prefixSha256 
thresholdSha256 
rsaSha256 
ed25519Sha256 

Definition at line 36 of file Condition.h.

◆ error

Enumerator
generic 
unsupported_type 
unsupported_subtype 
unknown_type 
unknown_subtype 
fingerprint_size 
incorrect_encoding 
trailing_garbage 
buffer_empty 
buffer_overfull 
buffer_underfull 
malformed_encoding 
short_preamble 
unexpected_tag 
long_tag 
large_size 
preimage_too_long 

Definition at line 29 of file error.h.

Function Documentation

◆ operator==() [1/2]

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

Definition at line 104 of file Condition.h.

◆ operator!=() [1/2]

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

Definition at line 111 of file Condition.h.

◆ operator==() [2/2]

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

Definition at line 97 of file Fulfillment.h.

◆ operator!=() [2/2]

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

Definition at line 105 of file Fulfillment.h.

◆ match()

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

Determine whether the given fulfillment and condition match.

Definition at line 32 of file Fulfillment.cpp.

◆ validate() [1/2]

bool ripple::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 45 of file Fulfillment.cpp.

◆ validate() [2/2]

bool ripple::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 51 of file Fulfillment.cpp.

◆ make_error_code()

std::error_code ripple::cryptoconditions::make_error_code ( error  ev)

Definition at line 130 of file error.cpp.

◆ BEAST_DEFINE_TESTSUITE()

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