diff --git a/Builds/CMake/CMakeFuncs.cmake b/Builds/CMake/CMakeFuncs.cmake index 87f2ee26756..690f54e8b01 100644 --- a/Builds/CMake/CMakeFuncs.cmake +++ b/Builds/CMake/CMakeFuncs.cmake @@ -517,20 +517,28 @@ endmacro() macro(setup_build_boilerplate) if (NOT WIN32 AND san) - add_compile_options(-fsanitize=${san} -fno-omit-frame-pointer) + STRING(REPLACE ";" "," comma_san "${san}") + add_compile_options(-fsanitize=${comma_san} -fno-omit-frame-pointer) append_flags(CMAKE_EXE_LINKER_FLAGS - -fsanitize=${san}) + -fsanitize=${comma_san}) - string(TOLOWER ${san} ci_san) - if (${ci_san} STREQUAL address) - set(SANITIZER_LIBRARIES asan) - add_definitions(-DSANITIZER=ASAN) - endif() - if (${ci_san} STREQUAL thread) - set(SANITIZER_LIBRARIES tsan) - add_definitions(-DSANITIZER=TSAN) - endif() + foreach(cur_san ${san}) + string(TOLOWER ${cur_san} ci_san) + if (${ci_san} STREQUAL address) + # set(SANITIZER_LIBRARIES asan) + add_definitions(-DSANITIZER=ASAN) + endif() + if (${ci_san} STREQUAL thread) + # set(SANITIZER_LIBRARIES tsan) + add_definitions(-DSANITIZER=TSAN) + endif() + if (${ci_san} STREQUAL fuzzer) + add_compile_options(-fsanitize-coverage=trace-pc-guard) + append_flags(CMAKE_EXE_LINKER_FLAGS + -fsanitize-coverage=trace-pc-guard) + endif() + endforeach() endif() if (perf) diff --git a/Builds/VisualStudio2015/RippleD.vcxproj b/Builds/VisualStudio2015/RippleD.vcxproj index d73f5dc2c35..1febc28a88c 100644 --- a/Builds/VisualStudio2015/RippleD.vcxproj +++ b/Builds/VisualStudio2015/RippleD.vcxproj @@ -1847,6 +1847,28 @@ True True + + + + True + True + + + + + + + True + True + + + + + True + True + + + True True @@ -1857,9 +1879,31 @@ True True + + True + True + + + + + True + True + - + + True + True + + + + + True + True + + + + True @@ -4471,6 +4515,42 @@ True True + + + + True + True + + + True + True + + + True + True + + + True + True + + + True + True + + + True + True + + + True + True + + + + + True + True + True True diff --git a/Builds/VisualStudio2015/RippleD.vcxproj.filters b/Builds/VisualStudio2015/RippleD.vcxproj.filters index 326781e37c7..41ac5a06101 100644 --- a/Builds/VisualStudio2015/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2015/RippleD.vcxproj.filters @@ -2490,6 +2490,30 @@ ripple\conditions\impl + + ripple\conditions\impl + + + ripple\conditions\impl + + + ripple\conditions\impl + + + ripple\conditions\impl + + + ripple\conditions\impl + + + ripple\conditions\impl + + + ripple\conditions\impl + + + ripple\conditions\impl + ripple\conditions\impl @@ -2499,12 +2523,33 @@ ripple\conditions\impl + + ripple\conditions\impl + + + ripple\conditions\impl + + + ripple\conditions\impl + ripple\conditions\impl - + + ripple\conditions\impl + + + ripple\conditions\impl + + + ripple\conditions\impl + + ripple\conditions\impl + + ripple\conditions + ripple\consensus @@ -5235,6 +5280,36 @@ test\beast + + test\conditions + + + test\conditions + + + test\conditions + + + test\conditions + + + test\conditions + + + test\conditions + + + test\conditions + + + test\conditions + + + test\conditions + + + test\conditions + test\conditions diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d648978bd1..7df32c7f302 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -465,16 +465,18 @@ if (WIN32 OR is_xcode) endif() if(unity) - add_executable(rippled ${rippled_src_unity} ${PROTO_HDRS}) - add_executable(rippled_classic EXCLUDE_FROM_ALL ${rippled_src_nonunity} ${PROTO_HDRS}) - set(other_target rippled_classic) + add_executable(rippled ${rippled_src_unity} ${PROTO_HDRS}) + add_executable(rippled_classic EXCLUDE_FROM_ALL ${rippled_src_nonunity} ${PROTO_HDRS}) + set(other_target rippled_classic) else() - add_executable(rippled ${rippled_src_nonunity} ${PROTO_HDRS}) - add_executable(rippled_unity EXCLUDE_FROM_ALL ${rippled_src_unity} ${PROTO_HDRS}) - set(other_target rippled_unity) + add_executable(rippled ${rippled_src_nonunity} ${PROTO_HDRS}) + add_executable(rippled_unity EXCLUDE_FROM_ALL ${rippled_src_unity} ${PROTO_HDRS}) + set(other_target rippled_unity) endif() + list(APPEND targets "rippled") list(APPEND targets ${other_target}) + # Not the same as EXCLUDE_FROM_ALL. Prevents Visual Studio from building the # other_target when the user builds the solution (default when pressing ) set_property(TARGET ${other_target} PROPERTY EXCLUDE_FROM_DEFAULT_BUILD true) @@ -530,11 +532,45 @@ set_startup_project(rippled) foreach(target IN LISTS targets) target_link_libraries(${target} - ${OPENSSL_LIBRARIES} ${PROTOBUF_LIBRARIES} ${SANITIZER_LIBRARIES}) + ${OPENSSL_LIBRARIES} ${PROTOBUF_LIBRARIES}) link_common_libraries(${target}) endforeach() +if (fuzzer_conditions) + set(FuzzerSrc + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/Condition.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/DerCommon.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/DerTraits.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/DerCoder.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/Ed25519.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/error.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/Fulfillment.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/PrefixSha256.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/PreimageSha256.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/RsaSha256.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/conditions/impl/ThresholdSha256.cpp + + ${CMAKE_SOURCE_DIR}/src/ripple/basics/impl/contract.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/basics/impl/Log.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/beast/utility/src/beast_Journal.cpp + ${CMAKE_SOURCE_DIR}/src/ripple/basics/impl/Time.cpp + ${CMAKE_SOURCE_DIR}/src/fuzzers/Conditions_fuzz_test.cpp) + + add_with_props(FuzzerSrc src/ripple/unity/ed25519_donna.c + -I"${CMAKE_SOURCE_DIR}/"src/ed25519-donna) + + add_executable(fulfillment_fuzzer ${FuzzerSrc}) + target_link_libraries(fulfillment_fuzzer ${OPENSSL_LIBRARIES}) + link_common_libraries(fulfillment_fuzzer) + target_compile_definitions(fulfillment_fuzzer PUBLIC -DFUZZ_TEST_FULFILLMENT) + + add_executable(condition_fuzzer ${FuzzerSrc}) + target_link_libraries(condition_fuzzer ${OPENSSL_LIBRARIES}) + link_common_libraries(condition_fuzzer) + target_compile_definitions(condition_fuzzer PUBLIC -DFUZZ_TEST_CONDITION) +endif() + if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8) message(WARNING "Rippled requires a 64 bit target architecture.\n" "The most likely cause of this warning is trying to build rippled with a 32-bit OS.") diff --git a/bin/crypto_conditions_test_gen/conditions.py b/bin/crypto_conditions_test_gen/conditions.py new file mode 100755 index 00000000000..f17d08ba058 --- /dev/null +++ b/bin/crypto_conditions_test_gen/conditions.py @@ -0,0 +1,1294 @@ +#!/usr/bin/env python + +# This script generates two related sets of output: +# +# 1) c++ code used to test cryptocondtions. To generate this code, run with the +# `--prefix ` switch. The results of the script will be put +# in a set of files with names for the individual cryptoconditions. For +# example: `--prefix Conditions_generated_test_` will result in cpp files for +# Conditions_generated_test_ed.cpp, Conditions_generated_test_thresh, ect. Note +# these generated files are not well formatted. It is useful to run them +# through a formatter (such as clang-format). This is done outside of this +# script. +# +# 2) A corpus used for fuzz testing. To generate the corpus, run with the +# `--fuzz ` switch. The results of the script will be put in the +# . It will create two subdirectories under , one for +# conditions and one for fulfillments. This is used as a corpus for fuzz +# testing. +# +# This script was run using python 3.6 +# When using anaconda python, the following additional packages were installed (using conda install XXX): +# pyasn1 (conda install pyasn1) +# cryptography (conda install cryptography) +# nacl (conda install -c conda-forge pynacl) + +import argparse +import base64 +import binascii +import codecs + +import collections +from collections import defaultdict + +import cryptoconditions_asn1 + +import cryptography +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives.asymmetric import rsa +from cryptography.hazmat.primitives import serialization + +import itertools + +import known_signing_keys + +import nacl +import nacl.encoding +import nacl.hash +import nacl.signing + + +import json_test_cases +import logging +from pathlib import Path + +import pyasn1 +from pyasn1.type import univ +from pyasn1.codec.der.decoder import decode +from pyasn1.codec.der.encoder import encode + +import os +import string + +from IPython.core.debugger import Tracer + +logging.basicConfig(filename='conditions.log', level=logging.DEBUG) +condition_logger = logging.getLogger('condition') + +condition_test_template_prefix = \ +''' +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +// THIS FILE WAS AUTOMATICALLY GENERATED -- DO NOT EDIT + +//============================================================================== + +#include + +namespace ripple {{ +namespace cryptoconditions {{ + +class Conditions_{RootTestName}_test : public ConditionsTestBase +{{ +''' + + +condition_test_template_suffix = \ +''' +}}; + +BEAST_DEFINE_TESTSUITE(Conditions_{RootTestName}, conditions, ripple); +}} // cryptoconditions +}} // ripple +''' + + +def to_bytes(v): + if type(v) == bytes: + return v + return v.encode() + + +def to_string(v): + if type(v) == str: + return v + return v.decode('utf8') + + +def case_and_type_insensitive_cmp(s1, s2): + return to_bytes(s1).lower() == to_bytes(s2).lower() + + +def urlsafe_base64_to_hex(data): + '''The sample cryptocondition json base 64 encoding is not correctly padded. + This function adds the correct padding before decoding + ''' + padding = len(data) % 4 + if padding != 0: + data += b'=' * (4 - padding) + return binascii.hexlify(base64.urlsafe_b64decode(data)) + + +def set_with_tags(parent, name, value): + c = parent.componentType + idx = c.getPositionByName(name) + proto = c[idx][1] + t = type(value) + if t in [ + pyasn1.type.univ.OctetString, pyasn1.type.univ.Integer, + pyasn1.type.univ.BitString + ]: + value_with_tags = value.clone( + tagSet=proto.getEffectiveTagSet(), + subtypeSpec=proto.getSubtypeSpec()) + else: + value_with_tags = value.clone( + tagSet=proto.getEffectiveTagSet(), + subtypeSpec=proto.getSubtypeSpec(), + cloneValueFlag=True) + parent[name] = value_with_tags + + +def encode_it(a): + return to_string(binascii.hexlify(encode(a))) + + +def escape_hex(v): + v = to_string(v) + if len(v) % 2: + raise ValueError('String must have an even number of characters') + r = '' + for i in range(0, len(v), 2): + r += '\\x' + v[i] + v[i + 1] + return r + + +def array_data_hex(v): + v = to_string(v) + if len(v) % 2: + raise ValueError('String must have an even number of characters') + r = [] + for i in range(0, len(v), 2): + r.append('0x' + v[i] + v[i + 1]) + return ', '.join(r) + + +def write_array(f, var_name, str_data): + if len(str_data) % 2: + raise ValueError('String must have an even number of characters') + f.write('std::array const {v_name}{{{{{data}}}}};\n'. + format( + v_name=var_name, + len=len(str_data) // 2, + data=array_data_hex(str_data))) + + +def write_cpp_string_literal(f, s, col_width=60): + if col_width % 3: + raise ValueError( + 'Col width must be a multiple of 3 to handle hex data') + cur_col = 0 + if not len(s): + f.write('""') + while cur_col < len(s): + f.write('"{}"'.format(s[cur_col:cur_col + col_width])) + cur_col += col_width + f.write('s;\n') + + +def bitset_to_tuple(seq): + if seq: + result = [0] * (1 + max(seq)) + else: + result = [0] + for b in seq: + if b >= 32 or b < 0: + raise ValueError('Can only set bits between 0 and 31') + result[b] = 1 + return tuple(result) + + +def bitset_to_int(seq): + result = 0 + for b in seq: + if b >= 32 or b < 0: + raise ValueError('Can only set bits between 0 and 31') + result |= (1 << b) + return result + + +preimageSha256TypeId = 0 +prefixSha256TypeId = 1 +thresholdSha256TypeId = 2 +rsaSha256TypeId = 3 +ed25519Sha256TypeId = 4 + + +def asn1_type(id): + d = { + preimageSha256TypeId: 'preimageSha256', + prefixSha256TypeId: 'prefixSha256', + thresholdSha256TypeId: 'thresholdSha256', + rsaSha256TypeId: 'rsaSha256', + ed25519Sha256TypeId: 'ed25519Sha256' + } + return d[id] + + +def cpp_type(id): + return 'Type::' + asn1_type(id) + + +def short_type(id): + d = { + preimageSha256TypeId: 'preim', + prefixSha256TypeId: 'prefix', + thresholdSha256TypeId: 'thresh', + rsaSha256TypeId: 'rsa', + ed25519Sha256TypeId: 'ed' + } + return d[id] + + +def json_type_string_to_type_id(id): + d = { + 'preimage-sha-256': preimageSha256TypeId, + 'prefix-sha-256': prefixSha256TypeId, + 'threshold-sha-256': thresholdSha256TypeId, + 'rsa-sha-256': rsaSha256TypeId, + 'ed25519-sha-256': ed25519Sha256TypeId + } + return d[id] + + +class Condition: + def __init__(self, fulfillment): + self.fulfillment = fulfillment + + def type_id(self): + return self.fulfillment.type_id() + + def type_name(self): + return asn1_type(self.type_id()) + + def cost(self): + return self.fulfillment.cost() + + def fingerprint(self): + if self.type_id() == preimageSha256TypeId: + encoding = self.fulfillment.preimage + else: + encoding = self.fulfillment.encoded_fingerprint() + digest = nacl.hash.sha256(encoding, encoder=nacl.encoding.HexEncoder) + return digest + + def to_asn1(self): + digest = self.fingerprint() + + c = cryptoconditions_asn1.Condition().componentType + idx = c.getPositionByName(self.type_name()) + asn1_condition = c[idx][1].clone() + set_with_tags( + asn1_condition, + 'fingerprint', + univ.OctetString(hexValue=to_string(digest))) + set_with_tags(asn1_condition, 'cost', univ.Integer(self.cost())) + + subtypes_set = self.fulfillment.subtype_ids() + if subtypes_set: + subtypes = bitset_to_tuple(subtypes_set) + set_with_tags(asn1_condition, 'subtypes', univ.BitString(subtypes)) + + result = cryptoconditions_asn1.Condition() + result[self.type_name()] = asn1_condition + return result + + def decl_var_name(self): + return '{}{}Cond'.format( + short_type(self.type_id()).capitalize(), self.fulfillment.id) + + def write_test_structure(self, f, level=0): + f.write(' // {} {}\n'.format('*' * (level + 1), self.decl_var_name())) + + def write_decl(self, f): + ''' + Condition(Type t, std::uint32_t cost, std::array const& fingerprint, std::bitset<5> const& subtypes) + ''' + var_name = self.decl_var_name() + t = cpp_type(self.type_id()) + digest = self.fingerprint() + fingerprint_var = '{}ConditionFingerprint'.format(var_name) + f.write('std::array const {var_name}={{{{ {array_data} }}}};'. + format(var_name=fingerprint_var, array_data=array_data_hex(digest))) + cost = str(self.cost()) + subtypes_as_int = 0 + for i in self.fulfillment.subtype_ids(): + subtypes_as_int += 1 << i + params = ', '.join( + [t, cost, fingerprint_var, 'std::bitset<5>{{{}}}'.format(subtypes_as_int)]) + + f.write('Condition const {var_name}{{{params}}};\n'.format( + var_name=var_name, params=params)) + + def write_test(self, f): + var_name = self.decl_var_name() + f.write('{\n') + f.write('auto const {var_name}EncodedCondition="{encoded}"s;\n'.format( + var_name=var_name, encoded=escape_hex(encode_it(self.to_asn1())))) + + f.write( + 'auto const {var_name}EncodedFingerprint="{encoded}";\n'.format( + var_name=var_name, + encoded=escape_hex( + binascii.hexlify(self.fulfillment.encoded_fingerprint())))) + self.write_decl(f, var_name) + f.write('}\n') + + +class Fulfillment: + next_id = 0 + + def __init__(self): + self.msg = b'' + self.id = Fulfillment.next_id + Fulfillment.next_id += 1 + + @classmethod + def reset_id(cls): + cls.next_id = 0 + + @classmethod + def create_from_json(cls, json_init, json_check=None): + prototypes = { + 'preimage-sha-256': Preimage, + 'prefix-sha-256': Prefix, + 'threshold-sha-256': Threshold, + 'rsa-sha-256': RsaSha256, + 'ed25519-sha-256': Ed25519 + } + return prototypes[json_init['type']](json_init=json_init, + json_check=json_check) + + def check_json(self, json): + if not case_and_type_insensitive_cmp( + encode_it(self.to_asn1()), json['fulfillment']): + raise ValueError('Expected fulfillment mismatch') + if not case_and_type_insensitive_cmp( + encode_it(self.condition().to_asn1()), + json['conditionBinary']): + raise ValueError('Expected condition mismatch') + if not case_and_type_insensitive_cmp( + binascii.hexlify(self.encoded_fingerprint()), + to_bytes(json['fingerprintContents'])): + raise ValueError('Fingerprint contents mismatch') + if self.cost() != json['cost']: + raise ValueError('Cost mismatch') + st_from_json = set( + [json_type_string_to_type_id(tid) for tid in json['subtypes']]) + if self.subtype_ids() != st_from_json: + raise ValueError('Subtypes mismatch') + self.msg = escape_hex(to_bytes(json['message'])) + + @classmethod + def create_from_pylist(cls, pylist): + prototypes = { + 'preim': Preimage, + 'prefix': Prefix, + 'thresh': Threshold, + 'rsa': RsaSha256, + 'ed': Ed25519 + } + t = type(pylist) + if t == str: + return prototypes[pylist](pylist=pylist) + if t != list: + raise ValueError('Bad pylist') + if len(pylist) == 0: + return [] + if type(pylist[0]) == str: + if pylist[0] == 'thresh': + return Threshold(pylist=pylist) + elif pylist[0] == 'prefix': + return Prefix(pylist=pylist) + return [Fulfillment.create_from_pylist(f) for f in pylist] + + def set_msg_self_and_children(self, msg): + ''' + Set the message of a fulfillment so it succeeds. + This will set the message of child fulfillments so they + will succeeds as well, in particular, this means prefix subcondition + will change their prefixes and set its message so + prefix+new_message==set_msg + ''' + self.set_msg(msg) + + def self_and_subtype_ids(self): + return set([self.type_id()]) + + def subtype_ids(self): + return set() + + def condition(self): + return Condition(self) + + def decl_var_name(self): + return '{}{}'.format(short_type(self.type_id()), self.id) + + def depth_first_fulfillments(self, result): + result.append(self) + + def write_test_structure(self, f, level=0): + if level == 0: + f.write(' // Fulfillment structure\n') + f.write(' // {} {}\n'.format('*' * (level + 1), self.decl_var_name())) + + def write_test(self, f): + self.write_test_structure(f) + f.write('\n\n') + allfulfillments = [] + self.depth_first_fulfillments(allfulfillments) + for s in allfulfillments: + s.write_init_data(f) + f.write('\n\n') + for s in allfulfillments[:-1]: + s.write_decl(f, is_unique_ptr=True) + allfulfillments[-1].write_decl(f, is_unique_ptr=True) + + var_name = self.decl_var_name() + f.write('{\n') + f.write('auto {var_name}EncodedFulfillment='.format( + var_name=var_name)) + write_cpp_string_literal(f, escape_hex(encode_it(self.to_asn1()))) + f.write('auto const {var_name}EncodedCondition='.format( + var_name=var_name)) + write_cpp_string_literal( + f, escape_hex(encode_it(self.condition().to_asn1()))) + f.write('auto const {var_name}EncodedFingerprint='.format( + var_name=var_name)) + write_cpp_string_literal( + f, escape_hex(binascii.hexlify(self.encoded_fingerprint()))) + f.write('check(') + f.write(''' + std::move({var_name}), + {var_name}Msg, + std::move({var_name}EncodedFulfillment), + {var_name}EncodedCondition, + {var_name}EncodedFingerprint); + '''.format(var_name=var_name)) + f.write('}\n') + + +def load_ed25519_key(signing_key): + return nacl.signing.SigningKey(signing_key, nacl.encoding.HexEncoder) + + +class Ed25519(Fulfillment): + + known_keys = [load_ed25519_key(k) for k in known_signing_keys.ed25519_known_keys_serialized] + + def __init__(self, + msg=b'Attack at Dawn', + signing_key=None, + json_init=None, + json_check=None, + pylist=None): + super().__init__() + self.cached_verify_key_hex = None + self.cached_signature_hex = None + self.signing_key = None + if json_init: + self.from_json(json_init) + if json_check: + self.check_json(json_check) + return + if pylist is not None and pylist != short_type(self.type_id()): + raise ValueError('Ill formed pylist spec') + if signing_key is None: + signing_key = Ed25519.known_keys[self.id % len(Ed25519.known_keys)] + + self.signing_key = signing_key + self.set_msg(msg) + + def from_json(self, json): + self.cached_verify_key_hex = to_bytes( + urlsafe_base64_to_hex(to_bytes(json['publicKey']))) + self.cached_signature_hex = to_bytes( + urlsafe_base64_to_hex(to_bytes(json['signature']))) + + def set_msg(self, msg): + msg = to_bytes(msg) + self.msg = msg + self.signature = self.signing_key.sign(msg)[0:-len(msg)] + + def signature_hex(self): + if self.cached_signature_hex: + return self.cached_signature_hex + return binascii.hexlify(self.signature) + + def signing_key_hex(self): + return self.signing_key.encode(encoder=nacl.encoding.HexEncoder) + + def verify_key_hex(self): + if self.cached_verify_key_hex: + return self.cached_verify_key_hex + return self.signing_key.verify_key.encode( + encoder=nacl.encoding.HexEncoder) + + def cost(self): + # see crypto-conditions spec: + # https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#page-27 + return 131072 + + def type_id(self): + return ed25519Sha256TypeId + + def to_asn1(self): + result = cryptoconditions_asn1.Fulfillment() + idx = result.componentType.getPositionByName('ed25519Sha256') + # tag types must match - creating a choice independent of the tags (i.e. not cloning here) + # and then setting f['ed25519Sha256'] = my_fulfillment_without_correct_tags will not work + choice_ed_f = result.componentType[idx][1].clone() + + vk_hex = to_string(self.verify_key_hex()) + sig_hex = to_string(self.signature_hex()) + set_with_tags( + choice_ed_f, 'publicKey', univ.OctetString(hexValue=vk_hex)) + set_with_tags( + choice_ed_f, 'signature', univ.OctetString(hexValue=sig_hex)) + result['ed25519Sha256'] = choice_ed_f + return result + + def encoded_fingerprint(self): + fingerprint = cryptoconditions_asn1.Ed25519FingerprintContents() + set_with_tags( + fingerprint, + 'publicKey', + univ.OctetString(hexValue=to_string(self.verify_key_hex()))) + return encode(fingerprint) + + def write_init_data(self, f): + var_name = self.decl_var_name() + f.write('auto const {}Msg="{}"s;\n'.format(var_name, + to_string(self.msg))) + write_array(f, '{}PublicKey'.format(var_name), self.verify_key_hex()) + write_array(f, '{}Sig'.format(var_name), self.signature_hex()) + if self.signing_key: + write_array(f, '{}SigningKey'.format(var_name), + self.signing_key_hex()) + f.write('(void){}SigningKey;\n'.format(var_name)) + + def write_decl(self, f, is_unique_ptr=True, inc_sub_test=False): + var_name = self.decl_var_name() + if not is_unique_ptr: + f.write( + 'Ed25519 const {var_name}({var_name}PublicKey, {var_name}Sig);\n'. + format(var_name=var_name)) + else: + f.write( + 'auto {var_name}=std::make_unique({var_name}PublicKey, {var_name}Sig);\n'. + format(var_name=var_name)) + + +def load_rsa_key(signing_key): + return serialization.load_pem_private_key( + signing_key, password=None, backend=default_backend()) + + +class RsaSha256(Fulfillment): + known_keys = [load_rsa_key(k) for k in known_signing_keys.rsa_known_keys_serialized] + + def __init__(self, + msg=b'Attack at Dawn', + signing_key=None, + json_init=None, + json_check=None, + pylist=None): + super().__init__() + self.cached_verify_key_hex = None + self.cached_signature_hex = None + self.signing_key = None + if json_init: + self.from_json(json_init) + if json_check: + self.check_json(json_check) + return + if pylist is not None and pylist != short_type(self.type_id()): + raise ValueError('Ill formed pylist spec') + if signing_key is None: + signing_key = RsaSha256.known_keys[self.id % len(RsaSha256.known_keys)] + + self.signing_key = signing_key + self.set_msg(msg) + + def from_json(self, json): + self.cached_verify_key_hex = to_bytes( + urlsafe_base64_to_hex(to_bytes(json['modulus']))) + self.cached_signature_hex = to_bytes( + urlsafe_base64_to_hex(to_bytes(json['signature']))) + + def set_msg(self, msg): + from cryptography.hazmat.primitives import hashes + from cryptography.hazmat.primitives.asymmetric import padding + msg = to_bytes(msg) + self.msg = msg + + self.signature = self.signing_key.sign( + self.msg, + padding.PSS(mgf=padding.MGF1(hashes.SHA256()), + salt_length=256 // 8), + hashes.SHA256()) + # dummy check. Will raise an exception if it does not verify + self.signing_key.public_key().verify( + self.signature, + self.msg, + padding.PSS(mgf=padding.MGF1(hashes.SHA256()), + salt_length=256 // 8), + hashes.SHA256()) + + def signature_hex(self): + if self.cached_signature_hex: + return self.cached_signature_hex + return binascii.hexlify(self.signature) + + def verify_key_hex(self): + if self.cached_verify_key_hex: + return self.cached_verify_key_hex + pk = self.signing_key.public_key() + return '{:x}'.format(pk.public_numbers().n) + + def cost(self): + if self.cached_signature_hex: + key_bytes = len(self.cached_verify_key_hex) // 2 + else: + key_bytes = self.signing_key.key_size // 8 + return key_bytes * key_bytes + + def type_id(self): + return rsaSha256TypeId + + def to_asn1(self): + result = cryptoconditions_asn1.Fulfillment() + idx = result.componentType.getPositionByName('rsaSha256') + # tag types must match - creating a choice independent of the tags (i.e. not cloning here) + # and then setting f['rsaSha256'] = my_fulfillment_without_correct_tags will not work + choice_rsa_f = result.componentType[idx][1].clone() + + vk_hex = to_string(self.verify_key_hex()) + sig_hex = to_string(self.signature_hex()) + set_with_tags( + choice_rsa_f, 'modulus', univ.OctetString(hexValue=vk_hex)) + set_with_tags( + choice_rsa_f, 'signature', univ.OctetString(hexValue=sig_hex)) + result['rsaSha256'] = choice_rsa_f + return result + + def encoded_fingerprint(self): + fingerprint = cryptoconditions_asn1.RsaFingerprintContents() + set_with_tags( + fingerprint, + 'modulus', + univ.OctetString(hexValue=to_string(self.verify_key_hex()))) + return encode(fingerprint) + + def write_init_data(self, f): + var_name = self.decl_var_name() + f.write('auto const {}Msg="{}"s;\n'.format(var_name, + to_string(self.msg))) + write_array(f, '{}PublicKey'.format(var_name), self.verify_key_hex()) + write_array(f, '{}Sig'.format(var_name), self.signature_hex()) + + def write_decl(self, f, is_unique_ptr=True, inc_sub_test=False): + var_name = self.decl_var_name() + if not is_unique_ptr: + f.write('''RsaSha256 const {var_name}( + makeSlice({var_name}PublicKey), + makeSlice({var_name}Sig));\n''' + .format(var_name=var_name)) + else: + f.write('''auto {var_name}=std::make_unique( + makeSlice({var_name}PublicKey), + makeSlice({var_name}Sig));\n''' + .format(var_name=var_name)) + + +class Prefix(Fulfillment): + def __init__(self, + subfulfillment=None, + prefix=b'Attack ', + msg=b'at Dawn', + max_msg_length=None, + json_init=None, + json_check=None, + pylist=None): + super().__init__() + if json_init: + self.from_json(json_init) + if json_check: + self.check_json(json_check) + return + if max_msg_length is None: + max_msg_length = len(msg) + if pylist != None: + if len(pylist) < 2 or pylist[0] != short_type(self.type_id()): + raise ValueError('Ill formed pylist spec') + sub_init = pylist[1] if len(pylist) == 2 else pylist[1:] + subfulfillment = Fulfillment.create_from_pylist(sub_init) + if subfulfillment is None: + raise ValueError('Must specify either json or subfulfillment') + self.subfulfillment = subfulfillment + self.prefix = to_bytes(prefix) + self.msg = to_bytes(msg) + self.max_msg_length = max_msg_length + self.set_msg(msg) + + def from_json(self, json): + self.max_msg_length = json['maxMessageLength'] + self.prefix = binascii.unhexlify( + to_bytes(urlsafe_base64_to_hex(to_bytes(json['prefix'])))) + self.subfulfillment = Fulfillment.create_from_json(json[ + 'subfulfillment']) + + def set_msg_self_and_children(self, msg): + self.msg = to_bytes(msg) + self.max_msg_length = len(msg) + self.prefix = to_bytes('P{}'.format(self.id)) + self.subfulfillment.set_msg_self_and_children(self.prefix + self.msg) + + def set_msg(self, msg): + self.msg = to_bytes(msg) + self.max_msg_length = len(msg) + self.subfulfillment.set_msg(self.prefix + self.msg) + + def cost(self): + return len(self.prefix + ) + self.max_msg_length + self.subfulfillment.cost() + 1024 + + def type_id(self): + return prefixSha256TypeId + + def self_and_subtype_ids(self): + r = self.subfulfillment.self_and_subtype_ids() + r.add(self.type_id()) + return r + + def subtype_ids(self): + r = self.subfulfillment.self_and_subtype_ids() + r.discard(self.type_id()) + return r + + def depth_first_fulfillments(self, result): + self.subfulfillment.depth_first_fulfillments(result) + result.append(self) + + def write_test_structure(self, f, level=0): + super().write_test_structure(f, level) + self.subfulfillment.write_test_structure(f, level + 1) + + def to_asn1(self): + result = cryptoconditions_asn1.Fulfillment() + idx = result.componentType.getPositionByName('prefixSha256') + # tag types must match - creating a choice independent of the tags (i.e. not cloning here) + # and then setting f['ed25519Sha256'] = my_fulfillment_without_correct_tags will not work + choice_f = result.componentType[idx][1].clone() + + set_with_tags(choice_f, 'prefix', univ.OctetString(self.prefix)) + set_with_tags(choice_f, 'maxMessageLength', + univ.Integer(self.max_msg_length)) + + set_with_tags(choice_f, 'subfulfillment', + self.subfulfillment.to_asn1()) + + result['prefixSha256'] = choice_f + return result + + def encoded_fingerprint(self): + fingerprint = cryptoconditions_asn1.PrefixFingerprintContents() + set_with_tags(fingerprint, 'prefix', univ.OctetString(self.prefix)) + set_with_tags(fingerprint, 'maxMessageLength', + univ.Integer(self.max_msg_length)) + set_with_tags(fingerprint, 'subcondition', + self.subfulfillment.condition().to_asn1()) + return encode(fingerprint) + + def write_init_data(self, f): + var_name = self.decl_var_name() + f.write('auto const {}Prefix="{}"s;\n'.format(var_name, + to_string(self.prefix))) + f.write('auto const {}Msg="{}"s;\n'.format(var_name, + to_string(self.msg))) + f.write('auto const {}MaxMsgLength={};\n'.format(var_name, + self.max_msg_length)) + + def write_decl(self, f, is_unique_ptr=True, inc_sub_test=False): + var_name = self.decl_var_name() + if not is_unique_ptr: + decl = '''PrefixSha256 const {var_name}(makeSlice({var_name}Prefix), + {var_name}MaxMsgLength, + std::move({sub_var}));\n''' + else: + decl = '''auto {var_name} = std::make_unique(makeSlice({var_name}Prefix), + {var_name}MaxMsgLength, + std::move({sub_var}));\n''' + f.write( + decl.format( + var_name=var_name, sub_var=self.subfulfillment.decl_var_name( + ))) + + +class Preimage(Fulfillment): + def __init__(self, + preimage=b'I am root', + msg=b'Attack at Dawn', + json_init=None, + json_check=None, + pylist=None): + super().__init__() + if json_init: + self.from_json(json_init) + if json_check: + self.check_json(json_check) + return + if pylist is not None and pylist != short_type(self.type_id()): + raise ValueError('Ill formed pylist spec') + self.preimage = to_bytes(preimage) + self.msg = to_bytes(msg) + self.set_msg(msg) + + def from_json(self, json): + self.preimage = binascii.unhexlify( + to_bytes(urlsafe_base64_to_hex(to_bytes(json['preimage'])))) + + def set_msg(self, msg): + self.msg = to_bytes(msg) + + def cost(self): + return len(self.preimage) + + def type_id(self): + return preimageSha256TypeId + + def to_asn1(self): + result = cryptoconditions_asn1.Fulfillment() + idx = result.componentType.getPositionByName('preimageSha256') + # tag types must match - creating a choice independent of the tags (i.e. not cloning here) + # and then setting f['ed25519Sha256'] = my_fulfillment_without_correct_tags will not work + choice_f = result.componentType[idx][1].clone() + set_with_tags(choice_f, 'preimage', univ.OctetString(self.preimage)) + result['preimageSha256'] = choice_f + return result + + def encoded_fingerprint(self): + # Unlike other cc (that use der encoding), the fingerprint is a hash of the preimage + return self.preimage + + def write_init_data(self, f): + var_name = self.decl_var_name() + f.write('auto const {}Preimage="{}"s;\n'.format( + var_name, to_string(self.preimage))) + f.write('auto const {}Msg="{}"s;\n'.format(var_name, + to_string(self.msg))) + + def write_decl(self, f, is_unique_ptr=True, inc_sub_test=False): + var_name = self.decl_var_name() + if not is_unique_ptr: + decl = '''PreimageSha256 const {var_name}(makeSlice({var_name}Preimage));\n''' + else: + decl = '''auto {var_name} = std::make_unique(makeSlice({var_name}Preimage));\n''' + f.write(decl.format(var_name=var_name)) + + +class Threshold(Fulfillment): + def __init__(self, + subfulfillments=None, + subconditions=None, + msg=b'Attack at Dawn', + json_init=None, + json_check=None, + pylist=None): + super().__init__() + if json_init: + self.from_json(json_init) + if json_check: + self.check_json(json_check) + return + self.subfulfillments = subfulfillments + self.subconditions = subconditions + if pylist != None: + if len(pylist) != 3 or pylist[0] != short_type(self.type_id()): + raise ValueError('Ill formed pylist spec') + self.subfulfillments = Fulfillment.create_from_pylist(pylist[1]) + self.subconditions = [f.condition() for f in Fulfillment.create_from_pylist(pylist[2])] + self.msg = to_bytes(msg) + self.set_msg(msg) + + def from_json(self, json): + t = json['threshold'] + if t != len(json['subfulfillments']): + if 'conditionIndexes' not in json: + raise ValueError( + 'Must specify conditionIndexes to show which fulfillments are actually used.' + ) + else: + condIndexes = json['conditionIndexes'] + else: + condIndexes = [] + self.subfulfillments = [ + Fulfillment.create_from_json(sf) + for i, sf in enumerate(json['subfulfillments']) + if i not in condIndexes + ] + self.subconditions = [ + Fulfillment.create_from_json(sf).condition() + for i, sf in enumerate(json['subfulfillments']) if i in condIndexes + ] + + def set_msg(self, msg): + self.msg = to_bytes(msg) + for f in self.subfulfillments: + f.set_msg(msg) + + def set_msg_self_and_children(self, msg): + self.msg = to_bytes(msg) + for f in self.subfulfillments: + f.set_msg_self_and_children(msg) + + def cost(self): + costs = [c.cost() for c in self.subconditions + ] + [f.cost() for f in self.subfulfillments] + costs.sort() + n_highests = costs[-len(self.subfulfillments):] + return 1024 * (len(self.subfulfillments) + len(self.subconditions) + ) + sum(n_highests) + + def type_id(self): + return thresholdSha256TypeId + + def self_and_subtype_ids(self): + r = set() + for s in self.subfulfillments: + r |= s.self_and_subtype_ids() + for s in self.subconditions: + r |= s.fulfillment.self_and_subtype_ids() + r.add(self.type_id()) + return r + + def subtype_ids(self): + r = self.self_and_subtype_ids() + r.discard(self.type_id()) + return r + + def depth_first_fulfillments(self, result): + for f in self.subfulfillments: + f.depth_first_fulfillments(result) + result.append(self) + + def write_test_structure(self, f, level=0): + super().write_test_structure(f, level) + for c in self.subconditions: + c.write_test_structure(f, level + 1) + for ful in self.subfulfillments: + ful.write_test_structure(f, level + 1) + + def to_asn1(self): + result = cryptoconditions_asn1.Fulfillment() + idx = result.componentType.getPositionByName('thresholdSha256') + # tag types must match - creating a choice independent of the tags (i.e. not cloning here) + # and then setting f['ed25519Sha256'] = my_fulfillment_without_correct_tags will not work + choice_f = result.componentType[idx][1].clone() + + a_f = univ.SetOf(componentType=cryptoconditions_asn1.Fulfillment()) + for s in self.subfulfillments: + a_f.append(s.to_asn1()) + set_with_tags(choice_f, 'subfulfillments', a_f) + a_c = univ.SetOf(componentType=cryptoconditions_asn1.Condition()) + for s in self.subconditions: + a_c.append(s.to_asn1()) + set_with_tags(choice_f, 'subconditions', a_c) + + result['thresholdSha256'] = choice_f + return result + + def encoded_fingerprint(self): + fingerprint = cryptoconditions_asn1.ThresholdFingerprintContents() + set_with_tags(fingerprint, 'threshold', + univ.Integer(len(self.subfulfillments))) + a_c = univ.SetOf(componentType=cryptoconditions_asn1.Condition()) + for s in self.subfulfillments: + a_c.append(s.condition().to_asn1()) + for s in self.subconditions: + a_c.append(s.to_asn1()) + set_with_tags(fingerprint, 'subconditions', a_c) + return encode(fingerprint) + + def subfulfill_var(self): + return '{}Subfulfillments'.format(self.decl_var_name()) + + def subcond_var(self): + return '{}Subconditions'.format(self.decl_var_name()) + + def write_init_data(self, f): + var_name = self.decl_var_name() + f.write('auto const {}Msg="{}"s;\n'.format(var_name, + to_string(self.msg))) + for sc in self.subconditions: + sc.write_decl(f) + + def write_decl(self, f, is_unique_ptr=True, inc_sub_test=False): + var_name = self.decl_var_name() + f.write('std::vector> {var_name};'.format( + var_name=self.subfulfill_var())) + for sf in self.subfulfillments: + f.write('{var_name}.emplace_back(std::move({sf_var}));'.format( + var_name=self.subfulfill_var(), sf_var=sf.decl_var_name())) + + subconditions_init = ', '.join( + ['{}'.format(sc.decl_var_name()) for sc in self.subconditions]) + if subconditions_init: + subconditions_init = '{' + subconditions_init + '}' + subcond_var = '{}Subconditions'.format(var_name) + f.write('std::vector {var_name}{{{subconditions_init}}};'. + format( + var_name=self.subcond_var(), + subconditions_init=subconditions_init)) + if not is_unique_ptr: + decl = '''ThresholdSha256 const {var_name}(std::move({subfulfil_var}), + std::move({subcond_var}));\n''' + else: + decl = '''auto {var_name} = std::make_unique(std::move({subfulfil_var}), + std::move({subcond_var}));\n''' + f.write( + decl.format( + var_name=var_name, + subfulfil_var=self.subfulfill_var(), + subcond_var=self.subcond_var())) + + +class TestWriter: + def __init__(self, result_file): + self.result_file = result_file + # function names to tests to run + self.test_names = [] + self.test_ids = defaultdict(lambda: 0) + + def checkout_test_name(self, fulfillment): + n = short_type(fulfillment.type_id()) + id = self.test_ids[n] + self.test_ids[n] += 1 + return '{}{}'.format(n.capitalize(), id) + + def write_test(self, fulfillment): + test_name = self.checkout_test_name(fulfillment) + full_test_name = 'test' + test_name + self.result_file.write(''' + void + {full_test_name}(){{ + testcase("{test_name}"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + '''.format( + full_test_name=full_test_name, test_name=test_name)) + self.test_names.append(full_test_name) + fulfillment.write_test(self.result_file) + Fulfillment.reset_id() + self.result_file.write('}\n') + + def write_test_case_ed(self): + ed = Ed25519() + self.write_test(ed) + + def write_test_case_rsa(self): + rsa = RsaSha256() + self.write_test(rsa) + + def write_test_case_preimage(self): + p = Preimage() + self.write_test(p) + + def write_test_case_prefix(self): + ed = Ed25519() + p = Prefix(ed) + self.write_test(p) + + def write_test_case_threshold(self): + prefix = b'Attack ' + msg = b'at Dawn' + p = Prefix(Ed25519(msg=prefix + msg), msg=msg) + ed = Ed25519(msg=msg) + rsa = RsaSha256(msg=msg) + subfulfillments = [p, ed, rsa] + subconditions = [] + t = Threshold(subfulfillments, subconditions) + self.write_test(t) + + def write_test_case(self, test_type): + if test_type == ed25519Sha256TypeId: + self.write_test_case_ed() + elif test_type == prefixSha256TypeId: + self.write_test_case_prefix() + elif test_type == rsaSha256TypeId: + self.write_test_case_rsa() + elif test_type == thresholdSha256TypeId: + self.write_test_case_threshold() + elif test_type == preimageSha256TypeId: + self.write_test_case_preimage() + + def save_pylist_test_case(self, pylist): + f = Fulfillment.create_from_pylist(pylist) + f.set_msg_self_and_children(string.ascii_lowercase) + self.write_test(f) + + def save_json_test_case(self, tc): + test_type = tc['json']['type'] + f = Fulfillment.create_from_json(json_init=tc['json'], json_check=tc) + self.write_test(f) + + def write_run(self): + self.result_file.write(''' + void + run(){''') + for t in self.test_names: + self.result_file.write('{}();\n'.format(t)) + self.result_file.write('}\n') + + +def test_case_str(test_type=prefixSha256TypeId): + import io + f = io.StringIO() + tw = TestWriter(f) + tw.write_test_case(test_type) + return f.getvalue() + + +def save_test_case(file_name, test_type=prefixSha256TypeId): + with open(file_name, 'w') as f: + tw = TestWriter(f) + tw.write_test_case(test_type) + + +def save_json_test_cases(test_writer): + for tc in json_test_cases.test_cases: + test_writer.save_json_test_case(tc) + test_type = tc['json']['type'] + + +def partitioned_test_cases(): + '''return a dictionary of list of test cases. The key will be the top level + cryptocondition type. The modivation for partitioning the tests is otherwise + the single file is very large and hard for editors to deal with. + ''' + result = defaultdict(list) + keys = ['thresh', 'prefix', 'preim', 'rsa', 'ed'] + def add_to_result(l): + k = l[0] if isinstance(l, list) else l + if k not in keys: + raise ValueError('Unknown test type: {}'.format(k)) + result[k].append(l) + for tc in ['preim', 'rsa', 'ed']: + add_to_result(tc) + pre0 = ['prefix', tc] + add_to_result(pre0) + thresh0 = ['thresh', [tc], []] + thresh1 = ['thresh', [tc], ['preim', 'rsa', 'ed']] + thresh2 = ['thresh', [tc, thresh1], ['preim', 'rsa', 'ed']] + thresh3 = ['thresh', [tc, thresh1], ['preim', 'rsa', 'ed', thresh1]] + all_thresh = [thresh0, thresh1, thresh2, thresh3] + for i in all_thresh: + add_to_result(i) + prepre0 = ['prefix', 'prefix', tc] + prepre1 = ['prefix', 'prefix', pre0] + prepre2 = ['prefix', 'prefix', thresh0] + prepre3 = ['prefix', 'prefix', thresh1] + prepre4 = ['prefix', 'prefix', thresh2] + prepre5 = ['prefix', 'prefix', thresh3] + all_prepre = [prepre0, prepre1, prepre2, prepre3, prepre4, prepre5] + for i in all_prepre: + add_to_result(i) + for a,b,c in zip(all_prepre + all_thresh, itertools.cycle(all_prepre), itertools.cycle(all_thresh)): + add_to_result(['thresh', [a, b, c], ['preim', 'rsa', 'ed']]) + add_to_result(['thresh', [a, 'preim', 'rsa', 'ed'], ['preim', 'rsa', 'ed', b, c]]) + return result + + +def save_all_test_cases(file_name_prefix, inc_json=True): + test_cases = partitioned_test_cases() + for root_condition_name, test_list in test_cases.items(): + file_name = file_name_prefix+root_condition_name+'.cpp' + with open(file_name, 'w') as f: + f.write(condition_test_template_prefix.format(RootTestName=root_condition_name)) + tw = TestWriter(f) + for tc in test_list: + tw.save_pylist_test_case(tc) + tw.write_run() + f.write(condition_test_template_suffix.format(RootTestName=root_condition_name)) + + if inc_json: + root_condition_name = 'json' + file_name = file_name_prefix+root_condition_name+'.cpp' + with open(file_name, 'w') as f: + f.write(condition_test_template_prefix.format(RootTestName=root_condition_name)) + tw = TestWriter(f) + save_json_test_cases(tw) + tw.write_run() + f.write(condition_test_template_suffix.format(RootTestName=root_condition_name)) + + +def save_fuzz_corpus(corpus_dir_path): + cdp = Path(corpus_dir_path) + fulfillments_dir = cdp / 'fulfillments' + conditions_dir = cdp / 'conditions' + if not fulfillments_dir.is_dir(): + os.makedirs(fulfillments_dir) + if not conditions_dir.is_dir(): + os.makedirs(conditions_dir) + + test_cases = partitioned_test_cases() + + fulfillments = [] + for root_condition_name, test_list in test_cases.items(): + for tc in test_list: + fulfillments.append(Fulfillment.create_from_pylist(tc)) + + for tc in json_test_cases.test_cases: + fulfillments.append(Fulfillment.create_from_json(json_init=tc['json'], json_check=tc)) + + for i,f in enumerate(fulfillments): + file_name = '{}_{}.bin'.format(short_type(f.type_id()), i) + with open(fulfillments_dir / file_name, 'wb') as out: + out.write(encode(f.to_asn1())) + with open(conditions_dir / file_name, 'wb') as out: + out.write(encode(f.condition().to_asn1())) + +def parse_args(): + parser = argparse.ArgumentParser( + description=('Generate test files for cryptocondtions')) + parser.add_argument( + '--fuzz', + '-f', + help=('fuzz corpus directory'), ) + parser.add_argument( + '--prefix', + '-p', + help=('c++ test cases file name prefix'), ) + return parser.parse_args() + +def run_main(): + args = parse_args() + if not args.fuzz and not args.prefix: + print('Must specify at least one of --fuzz or --prefix') + return + + if args.fuzz: + save_fuzz_corpus(args.fuzz) + if args.prefix: + save_all_test_cases(args.prefix) + +if __name__ == '__main__': + run_main() diff --git a/bin/crypto_conditions_test_gen/cryptoconditions_asn1.py b/bin/crypto_conditions_test_gen/cryptoconditions_asn1.py new file mode 100644 index 00000000000..714e2020bdd --- /dev/null +++ b/bin/crypto_conditions_test_gen/cryptoconditions_asn1.py @@ -0,0 +1,240 @@ +# Auto-generated by asn1ate v.0.5.1.dev from appendix_c.asn1 +# (last modified on 2017-04-24 16:44:58.756111) + +from pyasn1.type import univ, char, namedtype, namedval, tag, constraint, useful + + +class ConditionTypes(univ.BitString): + pass + + +ConditionTypes.namedValues = namedval.NamedValues( + ('preImageSha256', 0), ('prefixSha256', 1), ('thresholdSha256', 2), + ('rsaSha256', 3), ('ed25519Sha256', 4)) + + +class CompoundSha256Condition(univ.Sequence): + pass + + +CompoundSha256Condition.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'fingerprint', + univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint( + 32, 32)).subtype(implicitTag=tag.Tag(tag.tagClassContext, + tag.tagFormatSimple, 0))), + namedtype.NamedType( + 'cost', + univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint( + 0, 4294967295)).subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 1))), + namedtype.NamedType( + 'subtypes', + ConditionTypes().subtype(implicitTag=tag.Tag(tag.tagClassContext, + tag.tagFormatSimple, 2)))) + + +class SimpleSha256Condition(univ.Sequence): + pass + + +SimpleSha256Condition.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'fingerprint', + univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint( + 32, 32)).subtype(implicitTag=tag.Tag(tag.tagClassContext, + tag.tagFormatSimple, 0))), + namedtype.NamedType( + 'cost', + univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint( + 0, 4294967295)).subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 1)))) + + +class Condition(univ.Choice): + pass + + +Condition.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'preimageSha256', + SimpleSha256Condition().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 0))), + namedtype.NamedType( + 'prefixSha256', + CompoundSha256Condition().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 1))), + namedtype.NamedType( + 'thresholdSha256', + CompoundSha256Condition().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 2))), + namedtype.NamedType( + 'rsaSha256', + SimpleSha256Condition().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 3))), + namedtype.NamedType( + 'ed25519Sha256', + SimpleSha256Condition().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 4)))) + + +class Ed25519FingerprintContents(univ.Sequence): + pass + + +Ed25519FingerprintContents.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'publicKey', + univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint( + 32, 32)).subtype(implicitTag=tag.Tag(tag.tagClassContext, + tag.tagFormatSimple, 0)))) + + +class Ed25519Sha512Fulfillment(univ.Sequence): + pass + + +Ed25519Sha512Fulfillment.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'publicKey', + univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint( + 32, 32)).subtype(implicitTag=tag.Tag(tag.tagClassContext, + tag.tagFormatSimple, 0))), + namedtype.NamedType( + 'signature', + univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint( + 64, 64)).subtype(implicitTag=tag.Tag(tag.tagClassContext, + tag.tagFormatSimple, 1)))) + + +class RsaSha256Fulfillment(univ.Sequence): + pass + + +RsaSha256Fulfillment.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'modulus', + univ.OctetString().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 0))), + namedtype.NamedType( + 'signature', + univ.OctetString().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 1)))) + + +class PreimageFulfillment(univ.Sequence): + pass + + +PreimageFulfillment.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'preimage', + univ.OctetString().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 0)))) + + +class PrefixFulfillment(univ.Sequence): + pass + + +class ThresholdFulfillment(univ.Sequence): + pass + + +class Fulfillment(univ.Choice): + pass + + +PrefixFulfillment.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'prefix', + univ.OctetString().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 0))), + namedtype.NamedType( + 'maxMessageLength', + univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint( + 0, 4294967295)).subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 1))), + namedtype.NamedType( + 'subfulfillment', + Fulfillment().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 2)))) + +ThresholdFulfillment.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'subfulfillments', + univ.SetOf(componentType=Fulfillment()).subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 0))), + namedtype.NamedType( + 'subconditions', + univ.SetOf(componentType=Condition()).subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 1)))) + +Fulfillment.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'preimageSha256', + PreimageFulfillment().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 0))), + namedtype.NamedType( + 'prefixSha256', + PrefixFulfillment().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 1))), + namedtype.NamedType( + 'thresholdSha256', + ThresholdFulfillment().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 2))), + namedtype.NamedType( + 'rsaSha256', + RsaSha256Fulfillment().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 3))), + namedtype.NamedType( + 'ed25519Sha256', + Ed25519Sha512Fulfillment().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatConstructed, 4)))) + + +class PrefixFingerprintContents(univ.Sequence): + pass + + +PrefixFingerprintContents.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'prefix', + univ.OctetString().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 0))), + namedtype.NamedType( + 'maxMessageLength', + univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint( + 0, 4294967295)).subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 1))), + namedtype.NamedType( + 'subcondition', + Condition().subtype(implicitTag=tag.Tag(tag.tagClassContext, + tag.tagFormatConstructed, 2)))) + + +class RsaFingerprintContents(univ.Sequence): + pass + + +RsaFingerprintContents.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'modulus', + univ.OctetString().subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 0)))) + + +class ThresholdFingerprintContents(univ.Sequence): + pass + + +ThresholdFingerprintContents.componentType = namedtype.NamedTypes( + namedtype.NamedType( + 'threshold', + univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint( + 1, 65535)).subtype(implicitTag=tag.Tag(tag.tagClassContext, + tag.tagFormatSimple, 0))), + namedtype.NamedType( + 'subconditions', + univ.SetOf(componentType=Condition()).subtype(implicitTag=tag.Tag( + tag.tagClassContext, tag.tagFormatSimple, 1)))) diff --git a/bin/crypto_conditions_test_gen/decode_der.py b/bin/crypto_conditions_test_gen/decode_der.py new file mode 100644 index 00000000000..49f7977e440 --- /dev/null +++ b/bin/crypto_conditions_test_gen/decode_der.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python + +import binascii +import codecs +import pyasn1 +import numpy as np +from pyasn1.type import univ +from pyasn1.codec.der import encoder + + +def to_array(hex_string): + b = codecs.decode(hex_string.replace(' ',''), 'hex') + return np.frombuffer(b,dtype=np.int8) + + +def to_bitstring(x): + b = f'{x:b}' + t = tuple(reversed([int(i) for i in b])) + return univ.BitString(t) + + +def to_string(v): + if type(v) == str: + return v + return v.decode('utf8') + + +def escape_hex(v): + v = to_string(v) + if len(v) % 2: + raise ValueError('String must have an even number of characters') + r = '' + for i in range(0, len(v), 2): + r += '\\x' + v[i] + v[i + 1] + return r + + +def encode_bitstring(x): + return escape_hex(binascii.hexlify(encoder.encode(to_bitstring(x)))) + + +def bitstring_testcases(start, end, lshift=0, offset=0): + mul = 2**lshift + cases = [((i*mul+offset), encode_bitstring(i*mul+offset)) for i in range(start,end)] + return cases + + +def write_bitstring_testcases(f, start, end, lshift=0, offset=0): + ts = bitstring_testcases(start, end, lshift, offset) + + f.write(''' + { + std::array, 32> + testCases = {{ + ''') + to_write = [f'std::make_pair({bits}ull, "{encoding}"s)' for bits, encoding in ts] + f.write(', '.join(to_write)) + f.write('}};') + f.write(''' + doTest(testCases, std::integral_constant{}); + doTest(testCases, std::integral_constant{}); + } + ''') + + +def save_all_test_cases(file_name): + with open(file_name, 'w') as f: + write_bitstring_testcases(f, 0, 32) + write_bitstring_testcases(f, 0, 32, lshift = 14) diff --git a/bin/crypto_conditions_test_gen/generate_known_keys.py b/bin/crypto_conditions_test_gen/generate_known_keys.py new file mode 100644 index 00000000000..8a6121d739d --- /dev/null +++ b/bin/crypto_conditions_test_gen/generate_known_keys.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python + +import base64 +import binascii +import codecs + +import collections +from collections import defaultdict + +import cryptoconditions_asn1 + +import cryptography +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives.asymmetric import rsa +from cryptography.hazmat.primitives import serialization + +import nacl +import nacl.encoding +import nacl.hash +import nacl.signing + + +def generate_rsa_keys(n): + ''' + return a list of serializations of n rsa private keys + This list will be used for known keys + ''' + result = [] + for i in range(n): + signing_key = rsa.generate_private_key( + public_exponent=65537, key_size=2048, backend=default_backend()) + pem = signing_key.private_bytes( + encoding=serialization.Encoding.PEM, + format=serialization.PrivateFormat.TraditionalOpenSSL, + encryption_algorithm=serialization.NoEncryption()) + result.append(pem) + return result + + +def generate_ed25519_keys(n): + ''' + return a list of serializations of n ed25519 private keys + This list will be used for known keys + ''' + result = [] + for i in range(n): + signing_key = nacl.signing.SigningKey.generate() + result.append(signing_key.encode(encoder=nacl.encoding.HexEncoder)) + return result + + +def write_known_keys(file_name, n=64): + with open(file_name, 'w') as f: + f.write('rsa_known_keys_serialized = {}\n\n'.format( + generate_rsa_keys(n))) + + f.write('ed25519_known_keys_serialized = {}'.format( + generate_ed25519_keys(n))) + + +def load_rsa_key(signing_key): + return serialization.load_pem_private_key( + signing_key, password=None, backend=default_backend()) + + +def load_ed25519_key(signing_key): + return nacl.signing.SigningKey(signing_key, nacl.encoding.HexEncoder) diff --git a/bin/crypto_conditions_test_gen/json_test_cases.py b/bin/crypto_conditions_test_gen/json_test_cases.py new file mode 100644 index 00000000000..c7b6d0ae009 --- /dev/null +++ b/bin/crypto_conditions_test_gen/json_test_cases.py @@ -0,0 +1,515 @@ +test_cases = [ + { + "json": { + "type": "preimage-sha-256", + "preimage": "" + }, + "cost": 0, + "subtypes": [], + "fingerprintContents": "", + "fulfillment": "A0028000", + "conditionBinary": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100", + "conditionUri": "ni:///sha-256;47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU?fpt=preimage-sha-256&cost=0", + "message": "" + }, + { + "json": { + "type": "prefix-sha-256", + "maxMessageLength": 0, + "prefix": "", + "subfulfillment": { + "type": "preimage-sha-256", + "preimage": "" + } + }, + "cost": 1024, + "subtypes": [ + "preimage-sha-256" + ], + "fingerprintContents": "302E8000810100A227A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100", + "fulfillment": "A10B8000810100A204A0028000", + "conditionBinary": "A12A8020BB1AC5260C0141B7E54B26EC2330637C5597BF811951AC09E744AD20FF77E2878102040082020780", + "conditionUri": "ni:///sha-256;uxrFJgwBQbflSybsIzBjfFWXv4EZUawJ50StIP934oc?fpt=prefix-sha-256&cost=1024&subtypes=preimage-sha-256", + "message": "" + }, + { + "json": { + "type": "threshold-sha-256", + "threshold": 1, + "conditionIndexes": [1], + "subfulfillments": [ + { + "type": "preimage-sha-256", + "preimage": "" + } + ] + }, + "cost": 1024, + "subtypes": [ + "preimage-sha-256" + ], + "fingerprintContents": "302C800101A127A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100", + "fulfillment": "A208A004A0028000A100", + "conditionBinary": "A22A8020B4B84136DF48A71D73F4985C04C6767A778ECB65BA7023B4506823BEEE7631B98102040082020780", + "conditionUri": "ni:///sha-256;tLhBNt9Ipx1z9JhcBMZ2eneOy2W6cCO0UGgjvu52Mbk?fpt=threshold-sha-256&cost=1024&subtypes=preimage-sha-256", + "message": "" + }, + { + "json": { + "type": "rsa-sha-256", + "modulus": "4e-LJNb3awnIHtd1KqJi8ETwSodNQ4CdMc6mEvmbDJeotDdBU-Pu89ZmFoQ-DkHCkyZLcbYXPbHPDWzVWMWGV3Bvzwl_cExIPlnL_f1bPue8gNdAxeDwR_PoX8DXWBV3am8_I8XcXnlxOaaILjgzakpfs2E3Yg_zZj264yhHKAGGL3Ly-HsgK5yJrdfNWwoHb3xT41A59n7RfsgV5bQwXMYxlwaNXm5Xm6beX04-V99eTgcv8s5MZutFIzlzh1J1ljnwJXv1fb1cRD-1FYzOCj02rce6AfM6C7bbsr-YnWBxEvI0TZk-d-VjwdNh3t9X2pbvLPxoXwArY4JGpbMJuQ", + "signature": "vULWVp9lma7UVflrwO0I7RSAvzbNnhRn-cb3RGHJ46dJM0svZASqX59rr-dsNH0GklCzXRyXDHkwWe5zOoGT8w-nj-x8rkWePd_XYzgF1HaUDQy1PX-zidza6vboz0jEtWNUMOTyvN_lBcLA_Be0DZPH7bfCYev0OJWnBeAkqgVJpmD3CjIVBkdSLb5rY1IEl8_4-NXXR2iifFuG5YC-P83Jbxl2KTy6DVjfxgtRi2MqbcHpUMQ-Ix_ho3mqbdzFLHDt-FHGwBI6lkJhz9s4V81s1a3DfY2izJJO2uHYTPYSRYfydMH6NpfaKQHwJp8DskPAO2FOA4Xhlh-sUAD5uw" + }, + "cost": 65536, + "subtypes": [], + "fingerprintContents": "3082010480820100E1EF8B24D6F76B09C81ED7752AA262F044F04A874D43809D31CEA612F99B0C97A8B4374153E3EEF3D66616843E0E41C293264B71B6173DB1CF0D6CD558C58657706FCF097F704C483E59CBFDFD5B3EE7BC80D740C5E0F047F3E85FC0D75815776A6F3F23C5DC5E797139A6882E38336A4A5FB36137620FF3663DBAE328472801862F72F2F87B202B9C89ADD7CD5B0A076F7C53E35039F67ED17EC815E5B4305CC63197068D5E6E579BA6DE5F4E3E57DF5E4E072FF2CE4C66EB452339738752759639F0257BF57DBD5C443FB5158CCE0A3D36ADC7BA01F33A0BB6DBB2BF989D607112F2344D993E77E563C1D361DEDF57DA96EF2CFC685F002B638246A5B309B9", + "fulfillment": "A382020880820100E1EF8B24D6F76B09C81ED7752AA262F044F04A874D43809D31CEA612F99B0C97A8B4374153E3EEF3D66616843E0E41C293264B71B6173DB1CF0D6CD558C58657706FCF097F704C483E59CBFDFD5B3EE7BC80D740C5E0F047F3E85FC0D75815776A6F3F23C5DC5E797139A6882E38336A4A5FB36137620FF3663DBAE328472801862F72F2F87B202B9C89ADD7CD5B0A076F7C53E35039F67ED17EC815E5B4305CC63197068D5E6E579BA6DE5F4E3E57DF5E4E072FF2CE4C66EB452339738752759639F0257BF57DBD5C443FB5158CCE0A3D36ADC7BA01F33A0BB6DBB2BF989D607112F2344D993E77E563C1D361DEDF57DA96EF2CFC685F002B638246A5B309B981820100BD42D6569F6599AED455F96BC0ED08ED1480BF36CD9E1467F9C6F74461C9E3A749334B2F6404AA5F9F6BAFE76C347D069250B35D1C970C793059EE733A8193F30FA78FEC7CAE459E3DDFD7633805D476940D0CB53D7FB389DCDAEAF6E8CF48C4B5635430E4F2BCDFE505C2C0FC17B40D93C7EDB7C261EBF43895A705E024AA0549A660F70A32150647522DBE6B63520497CFF8F8D5D74768A27C5B86E580BE3FCDC96F1976293CBA0D58DFC60B518B632A6DC1E950C43E231FE1A379AA6DDCC52C70EDF851C6C0123A964261CFDB3857CD6CD5ADC37D8DA2CC924EDAE1D84CF6124587F274C1FA3697DA2901F0269F03B243C03B614E0385E1961FAC5000F9BB", + "conditionBinary": "A3278020B31FA8206E4EA7E515337B3B33082B877651801085ED84FB4DAEB247BF698D7F8103010000", + "conditionUri": "ni:///sha-256;sx-oIG5Op-UVM3s7Mwgrh3ZRgBCF7YT7Ta6yR79pjX8?fpt=rsa-sha-256&cost=65536", + "message": "" + }, + { + "json": { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "5VZDAMNgrHKQhuLMgG6CioSHfx645dl02HPgZSJJAVVfuIIVkKM7rMYeOXAc-bRr0lv18FlbviRlUUFDjnoQCw" + }, + "cost": 131072, + "subtypes": [], + "fingerprintContents": "30228020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A", + "fulfillment": "A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140E5564300C360AC729086E2CC806E828A84877F1EB8E5D974D873E065224901555FB8821590A33BACC61E39701CF9B46BD25BF5F0595BBE24655141438E7A100B", + "conditionBinary": "A4278020799239ABA8FC4FF7EABFBC4C44E69E8BDFED993324E12ED64792ABE289CF1D5F8103020000", + "conditionUri": "ni:///sha-256;eZI5q6j8T_fqv7xMROaei9_tmTMk4S7WR5Kr4onPHV8?fpt=ed25519-sha-256&cost=131072", + "message": "" + }, + { + "json": { + "type": "preimage-sha-256", + "preimage": "YWFh" + }, + "cost": 3, + "subtypes": [], + "fingerprintContents": "616161", + "fulfillment": "A0058003616161", + "conditionBinary": "A02580209834876DCFB05CB167A5C24953EBA58C4AC89B1ADF57F28F2F9D09AF107EE8F0810103", + "conditionUri": "ni:///sha-256;mDSHbc-wXLFnpcJJU-uljErImxrfV_KPL50JrxB-6PA?fpt=preimage-sha-256&cost=3", + "message": "" + }, + { + "json": { + "type": "prefix-sha-256", + "maxMessageLength": 0, + "prefix": "YWFh", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "UGoepoMY5i1AY12tBD4Zh-vCbltcRAb3vfhacziPv-XCRaxJ9HcOvHh3CCcKpqh2n-_okw_Q6h7mSzFAfXaVCQ" + } + }, + "cost": 132099, + "subtypes": [ + "ed25519-sha-256" + ], + "fingerprintContents": "30338003616161810100A229A4278020799239ABA8FC4FF7EABFBC4C44E69E8BDFED993324E12ED64792ABE289CF1D5F8103020000", + "fulfillment": "A1708003616161810100A266A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140506A1EA68318E62D40635DAD043E1987EBC26E5B5C4406F7BDF85A73388FBFE5C245AC49F4770EBC787708270AA6A8769FEFE8930FD0EA1EE64B31407D769509", + "conditionBinary": "A12B8020451FE15F16299D495993FE692DB989E56A5230A90476F77392A3CD3213C0733F810302040382020308", + "conditionUri": "ni:///sha-256;RR_hXxYpnUlZk_5pLbmJ5WpSMKkEdvdzkqPNMhPAcz8?fpt=prefix-sha-256&cost=132099&subtypes=ed25519-sha-256", + "message": "" + }, + { + "json": { + "type": "prefix-sha-256", + "maxMessageLength": 3, + "prefix": "YmJi", + "subfulfillment": { + "type": "prefix-sha-256", + "maxMessageLength": 6, + "prefix": "YWFh", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "pCNg9H99uG218DfIECQiNyB9et1uPlMX4hKyB-Jb7SrLSFrQvLtXdVcmDsu71ncY1sq630W61lXRuM6EYJ6XAQ" + } + } + }, + "cost": 133135, + "subtypes": [ + "ed25519-sha-256" + ], + "fingerprintContents": "30378003626262810103A22DA12B80207F19C9BB3BC767DE39657E11D16068F8CAB00E3E3C23916DF967B584A28B26DC810302040982020308", + "fulfillment": "A17C8003626262810103A272A1708003616161810106A266A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140A42360F47F7DB86DB5F037C810242237207D7ADD6E3E5317E212B207E25BED2ACB485AD0BCBB577557260ECBBBD67718D6CABADF45BAD655D1B8CE84609E9701", + "conditionBinary": "A12B8020177350AD8566C528B92D9B5382DF2C68D9BA9F9FA41D43DBDD8E40B118DD9641810302080F82020308", + "conditionUri": "ni:///sha-256;F3NQrYVmxSi5LZtTgt8saNm6n5-kHUPb3Y5AsRjdlkE?fpt=prefix-sha-256&cost=133135&subtypes=ed25519-sha-256", + "message": "7A7A7A" + }, + { + "json": { + "type": "threshold-sha-256", + "threshold": 2, + "conditionIndexes": [0], + "subfulfillments": [ + { + "type": "rsa-sha-256", + "modulus": "u7ChoxT_ai_HmuBvYQ3I1EIck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dZQ785YGzDGhDCH5wFBkPRGAmfYlNUlgU3aNDuaBIncCMajQzR0LOowtJJRLSlXRSF91l7P7LnKGNIS-EpQbXACbtMyiWvSSmMFoMve6d_Yq7hQf4QOuUz6jpKOaRDCdfe2jRH5ZGPBAqWWYTR4aVvHZx-ycwkTnGzS8Vyn4kBS5H9ONO-LhE7DZKhb3JvoQlz_cqd76Y2QFphqZnEJgl8e8Y4IFwqHtDaOfBQsGdrRBgXE80HVIJmHrzGrqOLklj8-B5TdEfC3I" + }, + { + "type": "prefix-sha-256", + "maxMessageLength": 0, + "prefix": "YWFh", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "NEydEqAqV7Nf2WYZPO6V1du7xndVP86_QUwY2nUAKd05xuU63Yks7-RCNYMf-OXzaGiO93zPb5l_1BGmp-v5Ag" + } + }, + { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "UGoepoMY5i1AY12tBD4Zh-vCbltcRAb3vfhacziPv-XCRaxJ9HcOvHh3CCcKpqh2n-_okw_Q6h7mSzFAfXaVCQ" + } + ] + }, + "cost": 397315, + "subtypes": [ + "ed25519-sha-256", + "prefix-sha-256", + "rsa-sha-256" + ], + "fingerprintContents": "308184800102A17FA12B8020451FE15F16299D495993FE692DB989E56A5230A90476F77392A3CD3213C0733F810302040382020308A32780204DD2EA7F85B3EACB8F19058E8360955C32E74C124392A1F44660739709C539C38103040000A4278020799239ABA8FC4FF7EABFBC4C44E69E8BDFED993324E12ED64792ABE289CF1D5F8103020000", + "fulfillment": "A2820106A081D8A1708003616161810100A266A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140344C9D12A02A57B35FD966193CEE95D5DBBBC677553FCEBF414C18DA750029DD39C6E53ADD892CEFE44235831FF8E5F368688EF77CCF6F997FD411A6A7EBF902A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140506A1EA68318E62D40635DAD043E1987EBC26E5B5C4406F7BDF85A73388FBFE5C245AC49F4770EBC787708270AA6A8769FEFE8930FD0EA1EE64B31407D769509A129A32780204DD2EA7F85B3EACB8F19058E8360955C32E74C124392A1F44660739709C539C38103040000", + "conditionBinary": "A22B8020B6ACF4083E438BE4356F25FF92C295E9C8E1BAB141B4607BA48511EBA35AEFCC810306100382020358", + "conditionUri": "ni:///sha-256;tqz0CD5Di-Q1byX_ksKV6cjhurFBtGB7pIUR66Na78w?fpt=threshold-sha-256&cost=397315&subtypes=ed25519-sha-256,prefix-sha-256,rsa-sha-256", + "message": "616161" + }, + { + "json": { + "type": "threshold-sha-256", + "threshold": 1, + "conditionIndexes": [0, 1, 2, 3], + "subfulfillments": [ + { + "type": "prefix-sha-256", + "maxMessageLength": 0, + "prefix": "YWFh", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "UGoepoMY5i1AY12tBD4Zh-vCbltcRAb3vfhacziPv-XCRaxJ9HcOvHh3CCcKpqh2n-_okw_Q6h7mSzFAfXaVCQ" + } + }, + { + "type": "rsa-sha-256", + "modulus": "u7ChoxT_ai_HmuBvYQ3I1EIckz7QxDVOaurZHvlH6k-PYysuL3i4oHp4wzJIlcfLCRbrM0wQCQ5e254Cle0v8d6v0fSfVEEuQ-3iywbP_DlTAzCaTOPqwjQdmvMYgzfuur09Skr49D4VfW8C-dHySkJ3cEnJMKojP-1cY7B_clzea7JEBPy_wLhyR-rLfbBEeFumbt6OeSESRwFQQB4KhHG9428tXsuWD1cboX2vOB2DeN7CHhAS5LN2yebEa7Z9aO7xK6mhWWf0hti8kbPisG-l_KabdSQmrwKcsUnqWG3thR66Fgh2rNhfBiJx-tc9FfXw8CLiYTCSJr7jVnrQUvl0bKi_rPDU9BcwCFwJegICgwHZKgxUXAOXRywu7lthIiAl1jRw7mgc4yUnR86coj8Z5m8vY4bmrRORHXrazTjOXKj_LC2Zq7D1w7qEdQlhPmYyoSzm73jaTIIOkINAUwA9EZf2pXsBAP7hUshMixszu5ZXGYh4D6-9aXz4NwqZ2o-q91aH2VHMZTPHi44c4uHVzrmhFikgGvQ3R1yUAn-lJhS0MAt33PGArEnKo0AWjzJi_R7osTgCzqNXVLQjuDP6FMXdDEdt3l1ee_c3TWHySMO6uRywVQvRy-9wUH7o2xzzmTB-Io1PRZKmbFhXPP7MY5ZoBvr4gQnMsJkj6ls", + "signature": "fss4we3Ml_SM2IUwwkbFSRKGf1EbxN3QjFc8ogg6yf2qNFwXdo2t6YNCSBjbUqNy4oD7pWgvZSFalz-3KGdJO2T4-zQVM5felzo2xzxSuR4DQBtvpWP3d4T6r4ggQFvukx6jX3qNlCUUrlhsH8yo7e-biQTRuOEcnNjdu38VG3cX4STnLVejyjP0TkrXvDvYf9wge6rqrbax8XVPx48bQmbd84bl1STBo4cGUjqoIPEYsFN3Law-SoZ700WkvDWSCe9sHIPPVDKcJUjRrwUd_tr1PoBA9_OwYThrJ7UMj98w-k_X1fPfTbB0RMW4Z9V_P9L5r0AXRyHlYEJILwy4oEx4b74N47mHskntvTC32yuSic9E0OfLLmvewIpukErdNo5AwKf5LoSGWAaLDdbF7989xvK3YBB8AfWqr6jjf3ZmKIb8XS2yXduOP9T6ixFPj-pjn0VfAugCY_a85IO6LiChBeliMO84t5OO-qUKmdnj1qMd5Piy_H28FnXN_57X6tSUmOfo1oNTvMKBCWBg5azgw5dZNCYu18OxfmpxsXPgWF8Th7omsxSFqCCOOBoFPoFdVu3Lj_2pa9pLgJF5FzWZKKNEBnwBjPf6MD_PkybcjX9atigIbUvTgEbwKVNZrgENagDTgT984cfm7baOB4eYWTuaV6ycCgpMLSgk-gA" + }, + { + "type": "prefix-sha-256", + "maxMessageLength": 0, + "prefix": "YWFh", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS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PEYsFN3Law-SoZ700WkvDWSCe9sHIPPVDKcJUjRrwUd_tr1PoBA9_OwYThrJ7UMj98w-k_X1fPfTbB0RMW4Z9V_P9L5r0AXRyHlYEJILwy4oEx4b74N47mHskntvTC32yuSic9E0OfLLmvewIpukErdNo5AwKf5LoSGWAaLDdbF7989xvK3YBB8AfWqr6jjf3ZmKIb8XS2yXduOP9T6ixFPj-pjn0VfAugCY_a85IO6LiChBeliMO84t5OO-qUKmdnj1qMd5Piy_H28FnXN_57X6tSUmOfo1oNTvMKBCWBg5azgw5dZNCYu18OxfmpxsXPgWF8Th7omsxSFqCCOOBoFPoFdVu3Lj_2pa9pLgJF5FzWZKKNEBnwBjPf6MD_PkybcjX9atigIbUvTgEbwKVNZrgENagDTgT984cfm7baOB4eYWTuaV6ycCgpMLSgk-gA" + }, + { + "type": "preimage-sha-256", + "preimage": "YWFh" + } + ] + }, + "cost": 267264, + "subtypes": [ + "ed25519-sha-256", + "prefix-sha-256", + "preimage-sha-256", + "rsa-sha-256" + ], + "fingerprintContents": "3081D9800101A181D3A02580209834876DCFB05CB167A5C24953EBA58C4AC89B1ADF57F28F2F9D09AF107EE8F0810103A12B8020451FE15F16299D495993FE692DB989E56A5230A90476F77392A3CD3213C0733F810302040382020308A12B8020451FE15F16299D495993FE692DB989E56A5230A90476F77392A3CD3213C0733F810302040382020308A32780204DD2EA7F85B3EACB8F19058E8360955C32E74C124392A1F44660739709C539C38103040000A32780204DD2EA7F85B3EACB8F19058E8360955C32E74C124392A1F44660739709C539C38103040000", + "fulfillment": "A281B8A007A0058003616161A181ACA12B8020451FE15F16299D495993FE692DB989E56A5230A90476F77392A3CD3213C0733F810302040382020308A12B8020451FE15F16299D495993FE692DB989E56A5230A90476F77392A3CD3213C0733F810302040382020308A32780204DD2EA7F85B3EACB8F19058E8360955C32E74C124392A1F44660739709C539C38103040000A32780204DD2EA7F85B3EACB8F19058E8360955C32E74C124392A1F44660739709C539C38103040000", + "conditionBinary": "A22B80209A0B2C63DF80686E6020D0CA21CBFE668CCEC3D1AF82713FEAE9B8DD4A0F9BB78103041400820203D8", + "conditionUri": "ni:///sha-256;mgssY9-AaG5gINDKIcv-ZozOw9GvgnE_6um43UoPm7c?fpt=threshold-sha-256&cost=267264&subtypes=ed25519-sha-256,prefix-sha-256,preimage-sha-256,rsa-sha-256", + "message": "" + }, + { + "json": { + "type": "threshold-sha-256", + "threshold": 4, + "subfulfillments": [ + { + "type": "prefix-sha-256", + "maxMessageLength": 0, + "prefix": "YWFh", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "UGoepoMY5i1AY12tBD4Zh-vCbltcRAb3vfhacziPv-XCRaxJ9HcOvHh3CCcKpqh2n-_okw_Q6h7mSzFAfXaVCQ" + } + }, + { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "5VZDAMNgrHKQhuLMgG6CioSHfx645dl02HPgZSJJAVVfuIIVkKM7rMYeOXAc-bRr0lv18FlbviRlUUFDjnoQCw" + }, + { + "type": "prefix-sha-256", + "maxMessageLength": 0, + "prefix": "YWFh", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "UGoepoMY5i1AY12tBD4Zh-vCbltcRAb3vfhacziPv-XCRaxJ9HcOvHh3CCcKpqh2n-_okw_Q6h7mSzFAfXaVCQ" + } + }, + { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "5VZDAMNgrHKQhuLMgG6CioSHfx645dl02HPgZSJJAVVfuIIVkKM7rMYeOXAc-bRr0lv18FlbviRlUUFDjnoQCw" + } + ] + }, + "cost": 530438, + "subtypes": [ + "ed25519-sha-256", + "prefix-sha-256" + ], + "fingerprintContents": "3081B2800104A181ACA12B8020451FE15F16299D495993FE692DB989E56A5230A90476F77392A3CD3213C0733F810302040382020308A12B8020451FE15F16299D495993FE692DB989E56A5230A90476F77392A3CD3213C0733F810302040382020308A4278020799239ABA8FC4FF7EABFBC4C44E69E8BDFED993324E12ED64792ABE289CF1D5F8103020000A4278020799239ABA8FC4FF7EABFBC4C44E69E8BDFED993324E12ED64792ABE289CF1D5F8103020000", + "fulfillment": "A28201B6A08201B0A1708003616161810100A266A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140506A1EA68318E62D40635DAD043E1987EBC26E5B5C4406F7BDF85A73388FBFE5C245AC49F4770EBC787708270AA6A8769FEFE8930FD0EA1EE64B31407D769509A1708003616161810100A266A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140506A1EA68318E62D40635DAD043E1987EBC26E5B5C4406F7BDF85A73388FBFE5C245AC49F4770EBC787708270AA6A8769FEFE8930FD0EA1EE64B31407D769509A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140E5564300C360AC729086E2CC806E828A84877F1EB8E5D974D873E065224901555FB8821590A33BACC61E39701CF9B46BD25BF5F0595BBE24655141438E7A100BA4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140E5564300C360AC729086E2CC806E828A84877F1EB8E5D974D873E065224901555FB8821590A33BACC61E39701CF9B46BD25BF5F0595BBE24655141438E7A100BA100", + "conditionBinary": "A22B80208E433EF5D3EAA00A2B34A05CA7C22DD392973A19F1A243268CB53111BDF1C844810308180682020348", + "conditionUri": "ni:///sha-256;jkM-9dPqoAorNKBcp8It05KXOhnxokMmjLUxEb3xyEQ?fpt=threshold-sha-256&cost=530438&subtypes=ed25519-sha-256,prefix-sha-256", + "message": "" + }, + { + "json": { + "type": "threshold-sha-256", + "threshold": 2, + "subfulfillments": [ + { + "type": "threshold-sha-256", + "threshold": 2, + "conditionIndexes": [0], + "subfulfillments": [ + { + "type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LmvewIpukErdNo5AwKf5LoSGWAaLDdbF7989xvK3YBB8AfWqr6jjf3ZmKIb8XS2yXduOP9T6ixFPj-pjn0VfAugCY_a85IO6LiChBeliMO84t5OO-qUKmdnj1qMd5Piy_H28FnXN_57X6tSUmOfo1oNTvMKBCWBg5azgw5dZNCYu18OxfmpxsXPgWF8Th7omsxSFqCCOOBoFPoFdVu3Lj_2pa9pLgJF5FzWZKKNEBnwBjPf6MD_PkybcjX9atigIbUvTgEbwKVNZrgENagDTgT984cfm7baOB4eYWTuaV6ycCgpMLSgk-gA" + }, + { + "type": "prefix-sha-256", + "maxMessageLength": 0, + "prefix": "YWFh", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "UGoepoMY5i1AY12tBD4Zh-vCbltcRAb3vfhacziPv-XCRaxJ9HcOvHh3CCcKpqh2n-_okw_Q6h7mSzFAfXaVCQ" + } + }, + { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "5VZDAMNgrHKQhuLMgG6CioSHfx645dl02HPgZSJJAVVfuIIVkKM7rMYeOXAc-bRr0lv18FlbviRlUUFDjnoQCw" + } + ] + }, + { + "type": "preimage-sha-256", + "preimage": "YWFh" + } + ] + }, + "cost": 399366, + "subtypes": [ + "ed25519-sha-256", + "prefix-sha-256", + "preimage-sha-256", + "rsa-sha-256" + ], + "fingerprintContents": "3059800102A154A02580209834876DCFB05CB167A5C24953EBA58C4AC89B1ADF57F28F2F9D09AF107EE8F0810103A22B8020B6ACF4083E438BE4356F25FF92C295E9C8E1BAB141B4607BA48511EBA35AEFCC810306100382020358", + "fulfillment": "A2820117A0820111A0058003616161A2820106A081D8A1708003616161810100A266A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140506A1EA68318E62D40635DAD043E1987EBC26E5B5C4406F7BDF85A73388FBFE5C245AC49F4770EBC787708270AA6A8769FEFE8930FD0EA1EE64B31407D769509A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140E5564300C360AC729086E2CC806E828A84877F1EB8E5D974D873E065224901555FB8821590A33BACC61E39701CF9B46BD25BF5F0595BBE24655141438E7A100BA129A32780204DD2EA7F85B3EACB8F19058E8360955C32E74C124392A1F44660739709C539C38103040000A100", + "conditionBinary": "A22B80200C99630A201A99B0748D2BADB205E5CA939692C687D1C4A697E39BA8BA1EBE718103061806820203D8", + "conditionUri": "ni:///sha-256;DJljCiAambB0jSutsgXlypOWksaH0cSml-ObqLoevnE?fpt=threshold-sha-256&cost=399366&subtypes=ed25519-sha-256,prefix-sha-256,preimage-sha-256,rsa-sha-256", + "message": "" + }, + { + "json": { + "type": "threshold-sha-256", + "threshold": 1, + "conditionIndexes": [0], + "subfulfillments": [ + { + "type": "preimage-sha-256", + "preimage": "YWFh" + }, + { + "type": "preimage-sha-256", + "preimage": "YWFh" + } + ] + }, + "cost": 2051, + "subtypes": [ + "preimage-sha-256" + ], + "fingerprintContents": "3053800101A14EA02580209834876DCFB05CB167A5C24953EBA58C4AC89B1ADF57F28F2F9D09AF107EE8F0810103A02580209834876DCFB05CB167A5C24953EBA58C4AC89B1ADF57F28F2F9D09AF107EE8F0810103", + "fulfillment": "A232A007A0058003616161A127A02580209834876DCFB05CB167A5C24953EBA58C4AC89B1ADF57F28F2F9D09AF107EE8F0810103", + "conditionBinary": "A22A8020E4FDB4652C6F17A38B2ABE9AA00640B1E184FE7A8D0C971B5D24F7EDA6FC68BF8102080382020780", + "conditionUri": "ni:///sha-256;5P20ZSxvF6OLKr6aoAZAseGE_nqNDJcbXST37ab8aL8?fpt=threshold-sha-256&cost=2051&subtypes=preimage-sha-256", + "message": "" + }, + { + "json": { + "type": "rsa-sha-256", + "modulus": "4e-LJNb3awnIHtd1KqJi8ETwSodNQ4CdMc6mEvmbDJeotDdBU-Pu89ZmFoQ-DkHCkyZLcbYXPbHPDWzVWMWGV3Bvzwl_cExIPlnL_f1bPue8gNdAxeDwR_PoX8DXWBV3am8_I8XcXnlxOaaILjgzakpfs2E3Yg_zZj264yhHKAGGL3Ly-HsgK5yJrdfNWwoHb3xT41A59n7RfsgV5bQwXMYxlwaNXm5Xm6beX04-V99eTgcv8s5MZutFIzlzh1J1ljnwJXv1fb1cRD-1FYzOCj02rce6AfM6C7bbsr-YnWBxEvI0TZk-d-VjwdNh3t9X2pbvLPxoXwArY4JGpbMJuQ", + "signature": "SOiUXv4AdVbVv01fJJ5ICPcwfilRHTJi2u9h2ICY-apKi8BiOoyXVzj2XWv0WdVD8onXPLx69Oo6M_vz7ERARHkR1yKUCR5WGDNijkmncu1gjebERZWpHj4X1s9ew7JSjWPSrdZGOYmxLuxXffZHCWDfaDKp2Ew2DRwhetZMhiW9tZT7CtoIbN7LveWA1CS_l0bS8MMSgm27sArWi1LEy31HFWujXjqYHJc4Y3ksyA0EoYAhClJBWGW2Szphd0sdOXXXipiwgh7lXKD4YwXUJSnhDrAVzv1AL7WbKruN7uUqbyRH0ihGA9IZzU6M-c_91UmIicN4C1ndalfvfXMmIA" + }, + "cost": 65536, + "subtypes": [], + "fingerprintContents": "3082010480820100E1EF8B24D6F76B09C81ED7752AA262F044F04A874D43809D31CEA612F99B0C97A8B4374153E3EEF3D66616843E0E41C293264B71B6173DB1CF0D6CD558C58657706FCF097F704C483E59CBFDFD5B3EE7BC80D740C5E0F047F3E85FC0D75815776A6F3F23C5DC5E797139A6882E38336A4A5FB36137620FF3663DBAE328472801862F72F2F87B202B9C89ADD7CD5B0A076F7C53E35039F67ED17EC815E5B4305CC63197068D5E6E579BA6DE5F4E3E57DF5E4E072FF2CE4C66EB452339738752759639F0257BF57DBD5C443FB5158CCE0A3D36ADC7BA01F33A0BB6DBB2BF989D607112F2344D993E77E563C1D361DEDF57DA96EF2CFC685F002B638246A5B309B9", + "fulfillment": "A382020880820100E1EF8B24D6F76B09C81ED7752AA262F044F04A874D43809D31CEA612F99B0C97A8B4374153E3EEF3D66616843E0E41C293264B71B6173DB1CF0D6CD558C58657706FCF097F704C483E59CBFDFD5B3EE7BC80D740C5E0F047F3E85FC0D75815776A6F3F23C5DC5E797139A6882E38336A4A5FB36137620FF3663DBAE328472801862F72F2F87B202B9C89ADD7CD5B0A076F7C53E35039F67ED17EC815E5B4305CC63197068D5E6E579BA6DE5F4E3E57DF5E4E072FF2CE4C66EB452339738752759639F0257BF57DBD5C443FB5158CCE0A3D36ADC7BA01F33A0BB6DBB2BF989D607112F2344D993E77E563C1D361DEDF57DA96EF2CFC685F002B638246A5B309B98182010048E8945EFE007556D5BF4D5F249E4808F7307E29511D3262DAEF61D88098F9AA4A8BC0623A8C975738F65D6BF459D543F289D73CBC7AF4EA3A33FBF3EC4440447911D72294091E561833628E49A772ED608DE6C44595A91E3E17D6CF5EC3B2528D63D2ADD6463989B12EEC577DF6470960DF6832A9D84C360D1C217AD64C8625BDB594FB0ADA086CDECBBDE580D424BF9746D2F0C312826DBBB00AD68B52C4CB7D47156BA35E3A981C973863792CC80D04A180210A52415865B64B3A61774B1D3975D78A98B0821EE55CA0F86305D42529E10EB015CEFD402FB59B2ABB8DEEE52A6F2447D2284603D219CD4E8CF9CFFDD5498889C3780B59DD6A57EF7D732620", + "conditionBinary": "A3278020B31FA8206E4EA7E515337B3B33082B877651801085ED84FB4DAEB247BF698D7F8103010000", + "conditionUri": "ni:///sha-256;sx-oIG5Op-UVM3s7Mwgrh3ZRgBCF7YT7Ta6yR79pjX8?fpt=rsa-sha-256&cost=65536", + "message": "616161" + }, + { + "json": { + "type": "rsa-sha-256", + "modulus": "u7ChoxT_ai_HmuBvYQ3I1EIckz7QxDVOaurZHvlH6k-PYysuL3i4oHp4wzJIlcfLCRbrM0wQCQ5e254Cle0v8d6v0fSfVEEuQ-3iywbP_DlTAzCaTOPqwjQdmvMYgzfuur09Skr49D4VfW8C-dHySkJ3cEnJMKojP-1cY7B_clzea7JEBPy_wLhyR-rLfbBE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8Vyn4kBS5H9ONO-LhE7DZKhb3JvoQlz_cqd76Y2QFphqZnEJgl8e8Y4IFwqHtDaOfBQsGdrRBgXE80HVIJmHrzGrqOLklj8-B5TdEfC3I" + }, + "cost": 262144, + "subtypes": [], + "fingerprintContents": "3082020480820200BBB0A1A314FF6A2FC79AE06F610DC8D4421C933ED0C4354E6AEAD91EF947EA4F8F632B2E2F78B8A07A78C3324895C7CB0916EB334C10090E5EDB9E0295ED2FF1DEAFD1F49F54412E43EDE2CB06CFFC395303309A4CE3EAC2341D9AF3188337EEBABD3D4A4AF8F43E157D6F02F9D1F24A42777049C930AA233FED5C63B07F725CDE6BB24404FCBFC0B87247EACB7DB044785BA66EDE8E792112470150401E0A8471BDE36F2D5ECB960F571BA17DAF381D8378DEC21E1012E4B376C9E6C46BB67D68EEF12BA9A15967F486D8BC91B3E2B06FA5FCA69B752426AF029CB149EA586DED851EBA160876ACD85F062271FAD73D15F5F0F022E261309226BEE3567AD052F9746CA8BFACF0D4F41730085C097A02028301D92A0C545C0397472C2EEE5B61222025D63470EE681CE3252747CE9CA23F19E66F2F6386E6AD13911D7ADACD38CE5CA8FF2C2D99ABB0F5C3BA847509613E6632A12CE6EF78DA4C820E90834053003D1197F6A57B0100FEE152C84C8B1B33BB96571988780FAFBD697CF8370A99DA8FAAF75687D951CC6533C78B8E1CE2E1D5CEB9A11629201AF437475C94027FA52614B4300B77DCF180AC49CAA340168F3262FD1EE8B13802CEA35754B423B833FA14C5DD0C476DDE5D5E7BF7374D61F248C3BAB91CB0550BD1CBEF70507EE8DB1CF399307E228D4F4592A66C58573CFECC63966806FAF88109CCB09923EA5B", + "fulfillment": "A382040880820200BBB0A1A314FF6A2FC79AE06F610DC8D4421C933ED0C4354E6AEAD91EF947EA4F8F632B2E2F78B8A07A78C3324895C7CB0916EB334C10090E5EDB9E0295ED2FF1DEAFD1F49F54412E43EDE2CB06CFFC395303309A4CE3EAC2341D9AF3188337EEBABD3D4A4AF8F43E157D6F02F9D1F24A42777049C930AA233FED5C63B07F725CDE6BB24404FCBFC0B87247EACB7DB044785BA66EDE8E792112470150401E0A8471BDE36F2D5ECB960F571BA17DAF381D8378DEC21E1012E4B376C9E6C46BB67D68EEF12BA9A15967F486D8BC91B3E2B06FA5FCA69B752426AF029CB149EA586DED851EBA160876ACD85F062271FAD73D15F5F0F022E261309226BEE3567AD052F9746CA8BFACF0D4F41730085C097A02028301D92A0C545C0397472C2EEE5B61222025D63470EE681CE3252747CE9CA23F19E66F2F6386E6AD13911D7ADACD38CE5CA8FF2C2D99ABB0F5C3BA847509613E6632A12CE6EF78DA4C820E90834053003D1197F6A57B0100FEE152C84C8B1B33BB96571988780FAFBD697CF8370A99DA8FAAF75687D951CC6533C78B8E1CE2E1D5CEB9A11629201AF437475C94027FA52614B4300B77DCF180AC49CAA340168F3262FD1EE8B13802CEA35754B423B833FA14C5DD0C476DDE5D5E7BF7374D61F248C3BAB91CB0550BD1CBEF70507EE8DB1CF399307E228D4F4592A66C58573CFECC63966806FAF88109CCB09923EA5B8182020041200E42961EEA460C8276F239AB66B76F8F2869EACCC5F9E9945C0ABC63B1430656F3DA2D217A43327EE8CE1127D14A85D74AF412FE9370345BA6B44003D771AEDD2BA0FC250627FDF61631AFD64E9BEE714B1BAFB69F901BEEB6F959B16A54B328A9A674C883CAFC4FC2F7B0476DBCAA8D9BFD47F734E34736BF66E973B315C2ABF4727B062CA3C402936EB50849E1815DD1604A604DEFA668CFE823B008BF8F7BF57CEB1B41E518FF53AE911EF9880571B3D1742341D60E3CB2BEB93EB5F178F8EF7BA0C6F2290B9955D83D60F943D644571EC8D5F064D95F1DA1E759D6920D84A54CBC49783640A7B0CF3D028E627EC7AD25A915F6D8C24B2E0991528A02C5BEF0106C18B3F39C599956EB7A27B337313DCF93E75867606A4AC5A1AB6F9BB444DC1DAD1F546FAEDE6AE934884049017691371D51EE1D650EFCE581B30C6843087E7014190F4460267D894D525814DDA343B9A0489DC08C6A34334742CEA30B492512D295745217DD65ECFECB9CA18D212F84A506D70026ED332896BD24A6305A0CBDEE9DFD8ABB8507F840EB94CFA8E928E6910C275F7B68D11F96463C102A596613478695BC7671FB27309139C6CD2F15CA7E24052E47F4E34EF8B844EC364A85BDC9BE8425CFF72A77BE98D9016986A667109825F1EF18E08170A87B4368E7C142C19DAD10605C4F341D5209987AF31ABA8E2E4963F3E0794DD11F0B72", + "conditionBinary": "A32780204DD2EA7F85B3EACB8F19058E8360955C32E74C124392A1F44660739709C539C38103040000", + "conditionUri": "ni:///sha-256;TdLqf4Wz6suPGQWOg2CVXDLnTBJDkqH0RmBzlwnFOcM?fpt=rsa-sha-256&cost=262144", + "message": "616161" + }, + { + "json": { + "type": "ed25519-sha-256", + "publicKey": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo", + "signature": "UGoepoMY5i1AY12tBD4Zh-vCbltcRAb3vfhacziPv-XCRaxJ9HcOvHh3CCcKpqh2n-_okw_Q6h7mSzFAfXaVCQ" + }, + "cost": 131072, + "subtypes": [], + "fingerprintContents": "30228020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A", + "fulfillment": "A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140506A1EA68318E62D40635DAD043E1987EBC26E5B5C4406F7BDF85A73388FBFE5C245AC49F4770EBC787708270AA6A8769FEFE8930FD0EA1EE64B31407D769509", + "conditionBinary": "A4278020799239ABA8FC4FF7EABFBC4C44E69E8BDFED993324E12ED64792ABE289CF1D5F8103020000", + "conditionUri": "ni:///sha-256;eZI5q6j8T_fqv7xMROaei9_tmTMk4S7WR5Kr4onPHV8?fpt=ed25519-sha-256&cost=131072", + "message": "616161" + }, + { + "json": { + "type": "threshold-sha-256", + "threshold": 2, + "subfulfillments": [ + { + "type": "prefix-sha-256", + "maxMessageLength": 0, + "prefix": "aHR0cHM6Ly9ub3RhcnkuZXhhbXBsZS9jYXNlcy82NTdjMTJkYS04ZGNhLTQzYjAtOTdjYS04ZWU4YzM4YWI5Zjcvc3RhdGUvZXhlY3V0ZWQ", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "LlMeiL_oxBn5Ya2ckB3ivdjnoOcUhFUFnonreZhrJSQ", + "signature": "5f3bvsLo21m8tqaA5KcFb91GUAtOmaNxnyVzUDahSSg-KHzt7c2eWlDNl2q0EfhP9Wmqveb24M5qC90MSoJGCA" + } + }, + { + "type": "preimage-sha-256", + "preimage": "aHR0cHM6Ly9ub3RhcnkuZXhhbXBsZS9jYXNlcy82NTdjMTJkYS04ZGNhLTQzYjAtOTdjYS04ZWU4YzM4YWI5Zjcvc3RhdGUvZXhlY3V0ZWQ" + } + ] + }, + "cost": 134304, + "subtypes": [ + "ed25519-sha-256", + "prefix-sha-256", + "preimage-sha-256" + ], + "fingerprintContents": "3059800102A154A02580200B4AC3A1E0932CB71B74309FAD7D15DF51BD4D1359ED59FF7C917B35DF24464A810150A12B80203F94525555CF4C5234BF77CB108501D97B9D8A28D1E7A3A7FE8D3D7F031FDEBD810302045082020308", + "fulfillment": "A282011AA0820114A052805068747470733A2F2F6E6F746172792E6578616D706C652F63617365732F36353763313264612D386463612D343362302D393763612D3865653863333861623966372F73746174652F6578656375746564A181BD805068747470733A2F2F6E6F746172792E6578616D706C652F63617365732F36353763313264612D386463612D343362302D393763612D3865653863333861623966372F73746174652F6578656375746564810100A266A46480202E531E88BFE8C419F961AD9C901DE2BDD8E7A0E7148455059E89EB79986B25248140E5FDDBBEC2E8DB59BCB6A680E4A7056FDD46500B4E99A3719F25735036A149283E287CEDEDCD9E5A50CD976AB411F84FF569AABDE6F6E0CE6A0BDD0C4A824608A100", + "conditionBinary": "A22B802009E391004628725E88F8557E954FB2A0EAE2B7C151C47DF3C4AF22F8C16988F98103020CA0820203C8", + "conditionUri": "ni:///sha-256;CeORAEYocl6I-FV-lU-yoOrit8FRxH3zxK8i-MFpiPk?fpt=threshold-sha-256&cost=134304&subtypes=ed25519-sha-256,prefix-sha-256,preimage-sha-256", + "message": "" + }, + { + "json": { + "type": "threshold-sha-256", + "threshold": 2, + "subfulfillments": [ + { + "type": "prefix-sha-256", + "maxMessageLength": 0, + "prefix": "Y2FzZXMvNjU3YzEyZGEtOGRjYS00M2IwLTk3Y2EtOGVlOGMzOGFiOWY3L3N0YXRlL2V4ZWN1dGVk", + "subfulfillment": { + "type": "threshold-sha-256", + "threshold": 3, + "conditionIndexes": [0], + "subfulfillments": [ + { + "type": "prefix-sha-256", + "maxMessageLength": 1025, + "prefix": "aHR0cHM6Ly9ub3Rhcnk0LmV4YW1wbGUv", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "Rkvo5cq-MB4FMv5iIUjPy8zxG_MXop9cyHg5xpUf6pg", + "signature": "rlayC5_mc7O1szd9hCV8kIVronrH_IYj89BwVubxNmV2CacPp9ASs8UqqLrQPtxIKp7kA-aA5IPjr1mlxK05BA" + } + }, + { + "type": "prefix-sha-256", + "maxMessageLength": 1024, + "prefix": "aHR0cHM6Ly9ub3RhcnkxLmV4YW1wbGUv", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "LlMeiL_oxBn5Ya2ckB3ivdjnoOcUhFUFnonreZhrJSQ", + "signature": "hzAaGAj3PCA_DpyBBvEwcQiB2s2sgHwQ00m3mCDcs0B8d7nSPbQoJ2QL3EE4P9xOynYZwXA36HA3pcfPM4F6Dg" + } + }, + { + "type": "prefix-sha-256", + "maxMessageLength": 1024, + "prefix": "aHR0cHM6Ly9ub3RhcnkyLmV4YW1wbGUv", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "WQI-doqchYdsYeuqo07BjmSFf6dmksVamWNfm4jlr5A", + "signature": "rPnug4hbpY9ixCtImejOqRWpGS90iMFZLOlZVgtS-Ho3kOA208aVS4dVQUjRMcy682nGimajE3_o-kNooWWgCg" + } + }, + { + "type": "prefix-sha-256", + "maxMessageLength": 1024, + "prefix": "aHR0cHM6Ly9ub3RhcnkzLmV4YW1wbGUv", + "subfulfillment": { + "type": "ed25519-sha-256", + "publicKey": "mpisbb_wkOluONgfBUd9-Gs7uw7_wxG8e0LNrJnWvdk", + "signature": "l6MrDGHOFRA2ytNZacn5XrVEZepdYpupZav4pqkX8Q3RSr5V0zBUQ45oyRWmtnwd34oMFtLYAfjQuoXv7pu_Dw" + } + } + ] + } + }, + { + "type": "preimage-sha-256", + "preimage": "aHR0cHM6Ly9ub3RhcnkuZXhhbXBsZS9jYXNlcy82NTdjMTJkYS04ZGNhLTQzYjAtOTdjYS04ZWU4YzM4YWI5Zjcvc3RhdGUvZXhlY3V0ZWQ" + } + ] + }, + "cost": 406738, + "subtypes": [ + "ed25519-sha-256", + "prefix-sha-256", + "preimage-sha-256" + ], + "fingerprintContents": "3059800102A154A02580200B4AC3A1E0932CB71B74309FAD7D15DF51BD4D1359ED59FF7C917B35DF24464A810150A12B8020062F2C1BDD08661FE7FEFAC20E02DA8B0184FCD36F6C6C54C53CC28D2E54DD118103062C8282020328", + "fulfillment": "A2820272A082026CA052805068747470733A2F2F6E6F746172792E6578616D706C652F63617365732F36353763313264612D386463612D343362302D393763612D3865653863333861623966372F73746174652F6578656375746564A1820214803963617365732F36353763313264612D386463612D343362302D393763612D3865653863333861623966372F73746174652F6578656375746564810100A28201D2A28201CEA082019BA18186801868747470733A2F2F6E6F74617279312E6578616D706C652F81020400A266A46480202E531E88BFE8C419F961AD9C901DE2BDD8E7A0E7148455059E89EB79986B2524814087301A1808F73C203F0E9C8106F130710881DACDAC807C10D349B79820DCB3407C77B9D23DB42827640BDC41383FDC4ECA7619C17037E87037A5C7CF33817A0EA18186801868747470733A2F2F6E6F74617279322E6578616D706C652F81020400A266A464802059023E768A9C85876C61EBAAA34EC18E64857FA76692C55A99635F9B88E5AF908140ACF9EE83885BA58F62C42B4899E8CEA915A9192F7488C1592CE959560B52F87A3790E036D3C6954B87554148D131CCBAF369C68A66A3137FE8FA4368A165A00AA18186801868747470733A2F2F6E6F74617279332E6578616D706C652F81020400A266A46480209A98AC6DBFF090E96E38D81F05477DF86B3BBB0EFFC311BC7B42CDAC99D6BDD9814097A32B0C61CE151036CAD35969C9F95EB54465EA5D629BA965ABF8A6A917F10DD14ABE55D33054438E68C915A6B67C1DDF8A0C16D2D801F8D0BA85EFEE9BBF0FA12DA12B8020EE0BC02F977C264B6C306ED1B168FEB4FD600950AD21750CE8A86ECBD4603538810302081982020308A100", + "conditionBinary": "A22B8020424A704949529267B621B3D79119D729B2382CED8B296C3C028FA97D350F6D0781030634D2820203C8", + "conditionUri": "ni:///sha-256;QkpwSUlSkme2IbPXkRnXKbI4LO2LKWw8Ao-pfTUPbQc?fpt=threshold-sha-256&cost=406738&subtypes=ed25519-sha-256,prefix-sha-256,preimage-sha-256", + "message": "" + } +] diff --git a/bin/crypto_conditions_test_gen/known_signing_keys.py b/bin/crypto_conditions_test_gen/known_signing_keys.py new file mode 100644 index 00000000000..30a4d8c2748 --- /dev/null +++ b/bin/crypto_conditions_test_gen/known_signing_keys.py @@ -0,0 +1,3 @@ +rsa_known_keys_serialized = [b'-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAp2xvkhV8VuitA5orBGy2QQJKcxKHhsJYPNAEpIyYp3t5Ibre\nOMpn7920njeLZfVazv4W/a1ie6e6XiwQmUAw9u4mSSc7xbghMFw+RrYCFcQPGCTy\nyziLR3cxY3FI7naz/baioI5aAXMyNb+YOT4aq4fav4IMcS61ilTMf8K/tH/i5bkP\nbu5KL4sgseqq3IlZNHy6mzql4VdwZGjxu65A9viQY1V1OjqecWqTUI1i/a+Jih8n\nV90w08p9j6VZyk7k7J0lIKeBagamu7LxdflrKcd1wJ/Mh0IZn4u1K6aaw2GIdIKR\ndvVGjOeB9SwlbV1QGAPWHe2NdH8Frrs1uedv4QIDAQABAoIBAQCFPMNxk023cEW3\n9ynCxK0qASO0fguC0AkepED9nrIhnx6gHDGbKmEav+psezGhe2fAEO/FBAW6+JlV\nNmYjP7V33cB0ORfVWpp2/QHGjjQMlFGa2lSqK56TyiRwygfLVoYZJA46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qEkjhFdyWl2dCBM5hEJIpc4uZHS\n7lAY4pL/NO2xyo7GW3fxu4/Hp3ITHykM/EmPoHqHzR03ci8fHC7G7b4YGo2EXMex\neCjXTcVG1ZPkUNz+K+3/L8bwEl8u5uWSFjJL4SBlz8qlbJqmfeP6Rq7vAoGBANHY\ntvTcUIW6ikNdFjBXujVu0B/X3GKOUPxEIZr/4CqelUvtzdU3IUWv1jzdnhGBn9WX\nVmT0NLpo1mdbQA0EfVOREPLSJwm2NSb/tRoZMi2T6TZ9Yo2XBDQtZQoXiUyPYUZo\n28rP4Y5aB/r0ReoxYs4dkQ9LXVO1DQwa8P8nwOLNAoGBAI7xLnzK4b4ZLnifaFQv\n26sc43Uljfs2D78cA96eaF+/wzcIcDjrJnd0mtFZrSGmZ7aeCA4G6mQiHxlCglPQ\ng42zhMo9JNcqXVhpcgV4suRhsT5fD+jed/hK9IPniCRT1gV70IHxfGE2aX11q9zO\nc8/JWTRdWUk/n9VAC2dT2i1/AoGAWyF/StVGztyU4O5TDYl7n2rRTZLj7ZUajINW\nCMcoZbna4k+SvQ6lD2tuYZ5o3/doH00Kwure3zlaKyaQqVaSyrDMKHelZm1PpfEU\niBH7HZoHhJdtLkowFCzGnVxdTvdRak9tbCVdMgHdR1m/5xWtcA+dCIRVMl4FHYWx\ntU1hUd0CgYAOjRXi3UBOiiWC7pTyfGSJ8gQ8W85C4j+b9xKi2iSJ+NNjYrGDKMBs\n2RZhTO1saQc70Va5AXu6i7FP3Wp7elePseY+Mn97jUeVH49JrTUdl19PbNc2LAWf\njupjye9PepN7Q8ORNXTap5uXpGw7n128aHO+gJ6IvpUY1sQtHWYHNg==\n-----END RSA PRIVATE KEY-----\n'] + +ed25519_known_keys_serialized = [b'1aeed372554183f2a7e25e240e22289e81615f9dd211ddcdc3942d0226cf9e1c', b'e920aa4173352faea24b4b1964dac0d57bfd9906908048e46ac486307d5337b9', b'a7eb15c52a4159f9f7b4785fdb79e55b1644f7c7cfe246c5b35464b52f6c8e8e', b'1b90f22cd55dcde52d71846610f0f191feb5be9485c1c8f36191c3a44158cdfc', b'2a7a9a1ff1088f8eef3a39ce13ea08088af60678d53e0b9c84fb3993d6fea03d', b'426767c0badfb4d3f5c51f71978ab48e9aea3eecafdcc72b011b068f055663bc', b'8fac1502ceb4102756912bd057e76ce0c5466538f0c809e0b457fb11fc00e9df', b'9c024b5e6a83358a2a71704eab747222335a82d98e9c8c41626b0262bd5931cb', b'c200c62e45def239810af86d5329e31b8e57adfa291b071aee34e6575aebf21c', b'3e5f71f540bfa2e5bbaed49eb8fdcf8bb57a305380f91f0f4edd7b2e49cf7c12', b'8404dd346a4d40ef70f7ef7f25f4d0a0a8adc1511c16579d5ed9a645daff5e1e', b'563dfd5f56ef52a4bcc520998bc7f1c841cd936e4e7f95812aa16b4633d9115f', b'f8587264b9fdec47172fcebaba4accb9b49bfe0be2c7fce13fc7390f96df3ffa', b'0c453e20e212636a7c3675ad2ed7c039277e389aa2d33b2418f8684e7ffa5df3', b'559183d062bb44996efdc1aaeff48b055f39da5acda0c5d43b12e9c22b7d0cc7', b'0e2d4072237c1166dbe2a26e4a4e953a037862842b403ec5a8934db5e0e4c5dd', b'b7bd934b0339f86f47667fd44f9432e6b2709c2c6492c4b1dd046d009241e941', b'df538176ba4ed2e9b598fd534389a8977452485c423a2c94b6817cb600bdd29c', b'5973bb41b0e0cec2a985aa05a47e3b51098d3e47b775da8139a0e1d59fb09c5a', b'59de6042594ebcfb369214f554853a94c4942a151c81bded818fcc5106a4ae45', b'15e5d2b8151fe1897e3f333b27ed94b6e44782a0a840b94da865b8792b0f1b4c', b'6f78dc8f33c2310b537d72aee13a9b8d6f7788dc3fba1dc1785230f94f2076b8', b'974bf395dc9b3ebf54e15daf49f7ff3a0174d03c9a907abe9c869cd3ee05ed1d', b'c7ab870bb3ca9f0c87ed7b4ce289c23ce4aba623183faba5ae7d205f656d40a9', b'1dfa6928beae45fb237e3e40382dfa28d7ffb874f5524b3df499062930a6fa01', b'c19f3a86f00eecc41328d98ccde5cb17a6cd94366559823827017c580eebd763', b'15752c00d7c643eea1220bf05af5cdf6a2c0165d4c2a5c571ebf195ac7c9f95a', b'8c8eba92ae3f7de2f956d14c2639a67af9e78fac8c5432dcd188cb990704646f', b'82af783b9cdf92f013b626dff07537cda6a4d583722457bffd652c52faa4785d', b'5dc5400756fc83835164f9016c900e26b9c3d833af8b3ee3e86883a22006da98', b'4d3963403c356bdb18814e567106abf135c998da3ef799c9dcf908483ca5dce0', b'325e2f60747041201cf09320474955839967d5b67a95c9b4525b812ac970e7a0', b'69c9103a629930d9b47dbcc9a2a880ee123b4db4fd3f016763b38e7722553528', b'5f7051e7f9667ce4f96b4d2d86583ffa7fe7d91562f1e6756135496435c5faa1', b'b33f79a6672ca3bde7df7d7f998973fe703069b84cd94c30510c637576023882', b'd22b1dbc3ab13eaffabe5a9faa5e09a56f89531e27c3e0c535501daadc524a6a', b'21c726da4161983b2cf3e4802334ad5ea3a7b2d53329c98b4dd51add8e54234f', b'98f098b26e35bb2af0453715bbe1df7ad05bdb276adc68adb9178e145aa3524b', b'5caa2fd97856f18b642017b3f6f757e18e7675f6042d288b6135a22b9c8aeb1d', b'6e1b197476878c7d68e0e61b3670f9ae4e8166500e6e6b2c040edec58117ab39', b'c378998d2c87dd9591a54421b51314dc1fd3f0ddfc074be5d33c2b3d919bd757', b'03ada8dd8cc51885d6435bc0a4416f1594f2d35b193b16c052812e49e40704ee', b'8cb1349d69d48d0c639c2872c3fc0423ae992ef25457a0a222fb23d6d7308e73', b'78fa2ae2f5071d43939a414107af221e32571799529736e61f8baf7f78e630f7', b'2178249788af19a381410e4ccd56c89a75ea49a0bf164b70cef8809f839b5d0e', b'783c2d08e57a76968d52cba7370344527f100ef9255df06a95fc64ceff13e288', b'3acba399697e9b212919c372d852bff4db5ed3c77f8fd4be7debbfd4d88d025a', b'a78e9c3af9623707a2d3ea98d7c4ff21e810bd393f133d532f212adcbb48947e', b'5f3b59af31330365e46fd4117cc009a115c15543c749785430954e760a774b89', b'e0c8abbc27d16f78fe4399ff77fead4ce66db946cdf6f4a5fa9b03b2b8caf39b', b'b70416b241c30bbc1e20b1519978600cc710d723937f4ba46a6cde808a1165cc', b'd79d5b510b89099049b671193531617dfa87ed8f4d261c20e862c07c6d4f34c5', b'f88205a87c6e3fe18b5439b757466692e67eb901feb7f89087b39c03e7b2cbfa', b'efe41b082f1f11cac72b74ae4cd5cfaff4aa21c9efc2b1e45c71108f07647083', b'6baaaef2ad721cd28fd3b5711b66058e87e564d38a86cd42b09dfa88e927e04a', b'2c1162689b1aeddaef68198400a5e0f3f23b871506c715924b9852dc8554b782', b'85bf0fba2f748b78bebb0e69f2c1a719e26700759e2f6d5095d685710d6c0e68', b'88fb2e6b887ab9f0cb452948632cba6caca595bcebe263f7acf8ae56551ee5ef', b'df71b8904f33fb061c4fde5228e2fd922c503b5b76ab46de401de4cd046ea30f', b'bd44dc415121c9498fe1f4e5942904fdd9ecb879ad5f772d6a1e84b55450ab77', b'bab6ab52f6a5614641e4e338a8278e55f0d7e7ba1689b30a6492e0ff03c5dd85', b'8422190a931d3ec275e8b49bf062f8bbef52e814d1fd3b0a6c0d8f901e9d4ded', b'e6403bb2a179d6dc3483aca326ae911153acd439af74e99afb4638a355ebcd4d', b'581e4c3008f42cffc658d6c6b13f3f430d50f56cd30e91fa23ff08f0bf5e5472'] \ No newline at end of file diff --git a/docs/source.dox b/docs/source.dox index d0d82d7a86d..e8afed2b6ab 100644 --- a/docs/source.dox +++ b/docs/source.dox @@ -124,6 +124,7 @@ INPUT = \ ../src/ripple/app/tx/applySteps.h \ ../src/ripple/app/tx/impl/InvariantCheck.h \ ../src/ripple/app/consensus/RCLValidations.h \ + ../src/ripple/conditions/impl/Der.h \ INPUT_ENCODING = UTF-8 FILE_PATTERNS = diff --git a/src/fuzzers/Conditions_fuzz_test.cpp b/src/fuzzers/Conditions_fuzz_test.cpp new file mode 100644 index 00000000000..5546a494df5 --- /dev/null +++ b/src/fuzzers/Conditions_fuzz_test.cpp @@ -0,0 +1,66 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +/* + Note: This file requires clang 5.0 or greater. + Typical build setup: + cmake -Dfuzzer_conditions=ON -Dsan='fuzzer;address' -Dtarget=clang.debug + Typical run: + ./fulfillment_fuzzer -max_len=5000 -jobs=4 + An initial fuzz corpus may be generated with the `conditions.py` script. + */ + + +#include +#include + +#include + +#include + +extern "C" int +LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) +{ + using namespace ripple; + using namespace ripple::cryptoconditions; + using namespace ripple::cryptoconditions::der; + Decoder decoder(Slice{data, size}, TagMode::automatic); + +#if FUZZ_TEST_FULFILLMENT + std::unique_ptr f; + decoder >> f >> eos; +#elif FUZZ_TEST_CONDITION + Condition c; + decoder >> c >> eos; +#else +#error("Must define either FUZZ_TEST_CONDITION or FUZZ_TEST_FULFILLMENT") +#endif + + if (decoder.ec() == Error::logicError) + { + static boost::filesystem::path model{"logic_error%%%%.dat"}; + auto const fileName = boost::filesystem::unique_path(model); + std::ofstream ofs; + ofs.open(fileName.native(), std::ofstream::out | std::ofstream::binary); + ofs.write((char const*) data, size); + ofs.close(); + } + + return 0; +} diff --git a/src/ripple/app/tx/impl/Escrow.cpp b/src/ripple/app/tx/impl/Escrow.cpp index 3b9abf0149b..a14cf926930 100644 --- a/src/ripple/app/tx/impl/Escrow.cpp +++ b/src/ripple/app/tx/impl/Escrow.cpp @@ -171,7 +171,7 @@ EscrowCreate::preflight (PreflightContext const& ctx) std::error_code ec; auto condition = Condition::deserialize(*cb, ec); - if (!condition) + if (ec) { JLOG(ctx.j.debug()) << "Malformed condition during escrow creation: " << ec.message(); @@ -180,7 +180,7 @@ EscrowCreate::preflight (PreflightContext const& ctx) // Conditions other than PrefixSha256 require the // "CryptoConditionsSuite" amendment: - if (condition->type != Type::preimageSha256 && + if (condition.type != Type::preimageSha256 && !ctx.rules.enabled(featureCryptoConditionsSuite)) return temDISABLED; } @@ -281,14 +281,14 @@ checkCondition (Slice f, Slice c) std::error_code ec; auto condition = Condition::deserialize(c, ec); - if (!condition) + if (ec) return false; auto fulfillment = Fulfillment::deserialize(f, ec); if (!fulfillment) return false; - return validate (*fulfillment, *condition); + return validate (*fulfillment, condition); } TER diff --git a/src/ripple/basics/Slice.h b/src/ripple/basics/Slice.h index 076dbb0acc5..5e168994cef 100644 --- a/src/ripple/basics/Slice.h +++ b/src/ripple/basics/Slice.h @@ -22,6 +22,9 @@ #include #include + +#include + #include #include #include @@ -34,32 +37,53 @@ namespace ripple { -/** An immutable linear range of bytes. +/** A linear range of bytes. A fully constructed Slice is guaranteed to be in a valid state. A Slice is lightweight and copyable, it retains no ownership of the underlying memory. */ -class Slice +template +class SliceImpl { private: - std::uint8_t const* data_ = nullptr; + using TData = typename std::conditional::type; + using TVoidData = typename std::conditional::type; + TData data_ = nullptr; std::size_t size_ = 0; public: /** Default constructed Slice has length 0. */ - Slice() noexcept = default; + SliceImpl() noexcept = default; - Slice (Slice const&) noexcept = default; - Slice& operator= (Slice const&) noexcept = default; + SliceImpl (SliceImpl const&) noexcept = default; + SliceImpl& operator= (SliceImpl const&) noexcept = default; /** Create a slice pointing to existing memory. */ - Slice (void const* data, std::size_t size) noexcept - : data_ (reinterpret_cast(data)) + SliceImpl (TVoidData data, std::size_t size) noexcept + : data_ (reinterpret_cast(data)) , size_ (size) { } + /** Can convert from a mutable slice to a non-mutable slice */ + template>::value>> + SliceImpl (/*SliceImpl*/T const& rhs) noexcept + :SliceImpl{rhs.data(), rhs.size()} + { + } + + /** Can assign from a mutable slice to a non-mutable slice */ + template>::value>> + SliceImpl& operator= (/*SliceImpl*/T const& rhs) noexcept + { + data_ = rhs.data(); + size_ = rhs.size(); + return *this; + } + /** Return `true` if the byte range is empty. */ bool empty() const noexcept @@ -81,7 +105,7 @@ class Slice @note The return type is guaranteed to be a pointer to a single byte, to facilitate pointer arithmetic. */ - std::uint8_t const* + TData data() const noexcept { return data_; @@ -97,7 +121,7 @@ class Slice /** Advance the buffer. */ /** @{ */ - Slice& + SliceImpl& operator+= (std::size_t n) { if (n > size_) @@ -107,15 +131,30 @@ class Slice return *this; } - Slice + SliceImpl operator+ (std::size_t n) const { - Slice temp = *this; + SliceImpl temp = *this; return temp += n; } /** @} */ + + template::value>> + void + push_back(/*std::uint8_t*/T v) + { + assert(size_ != 0); + *data_ = v; + *this += 1; + } }; +/** An immutable linear range of bytes. */ +using Slice = SliceImpl; +/** A mutable linear range of bytes. */ +using MutableSlice = SliceImpl; + //------------------------------------------------------------------------------ template @@ -185,6 +224,17 @@ makeSlice (std::vector const& v) return Slice(v.data(), v.size()); } +template +std::enable_if_t< + std::is_same::value || + std::is_same::value, + Slice +> +makeSlice (boost::container::small_vector const& v) +{ + return Slice(v.data(), v.size()); +} + template Slice makeSlice (std::basic_string const& s) diff --git a/src/ripple/conditions/Condition.h b/src/ripple/conditions/Condition.h index 0c92a5ea95f..ecb493ef6c7 100644 --- a/src/ripple/conditions/Condition.h +++ b/src/ripple/conditions/Condition.h @@ -22,27 +22,19 @@ #include #include -#include +#include +#include + +#include + #include -#include -#include -#include +#include #include -#include +#include namespace ripple { namespace cryptoconditions { -enum class Type - : std::uint8_t -{ - preimageSha256 = 0, - prefixSha256 = 1, - thresholdSha256 = 2, - rsaSha256 = 3, - ed25519Sha256 = 4 -}; - class Condition { public: @@ -57,7 +49,7 @@ class Condition /** Load a condition from its binary form - @param s The buffer containing the fulfillment to load. + @param s The slice containing the condition to load. @param ec Set to the error, if any occurred. The binary format for a condition is specified in the @@ -66,9 +58,12 @@ class Condition https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-7.2 */ static - std::unique_ptr + Condition deserialize(Slice s, std::error_code& ec); + static + bool + isCompoundCondition(Type t); public: Type type; @@ -77,36 +72,64 @@ class Condition This fingerprint is meant to be unique only with respect to other conditions of the same type. */ - Buffer fingerprint; + std::array fingerprint; /** The cost associated with this condition. */ std::uint32_t cost; /** For compound conditions, set of conditions includes */ - std::set subtypes; - - Condition(Type t, std::uint32_t c, Slice fp) - : type(t) - , fingerprint(fp) - , cost(c) + std::bitset<5> subtypes; + + Condition( + Type t, + std::uint32_t c, + std::array const& fp, + std::bitset<5> const& s = {}) + : type(t), fingerprint(fp), cost(c), subtypes(s) { } - Condition(Type t, std::uint32_t c, Buffer&& fp) - : type(t) - , fingerprint(std::move(fp)) - , cost(c) + Condition(Condition const&) = default; + Condition(Condition&&) = default; + + ~Condition() = default; + + + // A default constructor is needed to serialize a vector on conditions - as + // needed for the threshold condition. + Condition() = default; + + /// Construct for DER serialization + explicit + Condition(der::Constructor const&); + + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) { + if (isCompoundCondition(type)) + f(std::tie(fingerprint, cost, subtypes)); + else + f(std::tie(fingerprint, cost)); } - ~Condition() = default; + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) const + { + const_cast(this)->withTuple( + std::forward(f), traitsCache); + } - Condition(Condition const&) = default; - Condition(Condition&&) = default; + /** Return the subtypes that this type depends on, including this type. - Condition() = delete; + @see {@link #subtypes} + */ + std::bitset<5> + selfAndSubtypes() const; }; +/// compare two conditions for equality inline bool operator== (Condition const& lhs, Condition const& rhs) @@ -118,6 +141,7 @@ operator== (Condition const& lhs, Condition const& rhs) lhs.fingerprint == rhs.fingerprint; } +/// compare two conditions for inequality inline bool operator!= (Condition const& lhs, Condition const& rhs) @@ -125,8 +149,61 @@ operator!= (Condition const& lhs, Condition const& rhs) return !(lhs == rhs); } -} +/** DerCoderTraits for Condition -} + Condition will be coded in ASN.1 as a choice. The actual + choice will depend on if the condition is a compound condition + or not. + + @see {@link #DerCoderTraits} +*/ +namespace der { +template <> +struct DerCoderTraits +{ + constexpr static GroupType + groupType() + { + return GroupType::choice; + } + constexpr static ClassId classId(){return ClassId::contextSpecific;} + static boost::optional const& + tagNum() + { + static boost::optional tn; + return tn; + } + static std::uint8_t + tagNum(Condition const& f) + { + return static_cast(f.type); + } + constexpr static bool primitive(){return false;} + + static void + encode(Encoder& encoder, Condition const& c); + + static + void + decode(Decoder& decoder, Condition& v); + + static + std::uint64_t + length( + Condition const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache); + + static + int + compare( + Condition const& lhs, + Condition const& rhs, + TraitsCache& traitsCache); +}; +} // der +} // cryptoconditions +} // ripple #endif diff --git a/src/ripple/conditions/Fulfillment.h b/src/ripple/conditions/Fulfillment.h index c0296419313..68b950d6159 100644 --- a/src/ripple/conditions/Fulfillment.h +++ b/src/ripple/conditions/Fulfillment.h @@ -23,14 +23,22 @@ #include #include #include -#include +#include + #include +#include +#include +#include + namespace ripple { namespace cryptoconditions { struct Fulfillment { + friend class ConditionsTestBase; + friend class ThresholdSha256; + friend class PrefixSha256; public: /** The largest binary fulfillment we support. @@ -39,11 +47,11 @@ struct Fulfillment that were previously considered valid to no longer be allowed. */ - static constexpr std::size_t maxSerializedFulfillment = 256; + static constexpr std::size_t maxSerializedFulfillment = 4096; /** Load a fulfillment from its binary form - @param s The buffer containing the fulfillment to load. + @param s The slice containing the fulfillment to load. @param ec Set to the error, if any occurred. The binary format for a fulfillment is specified in the @@ -57,6 +65,37 @@ struct Fulfillment Slice s, std::error_code& ec); +protected: + /** encode the contents used to calculate a fingerprint + + @note Most cryptoconditions (excepting preimage) calculate their + fingerprints by encoding into a ans.1 DER format and hashing the + contents of that encoding. This function encodes the contents that will be + hashed. It does not encode the hash itself. + */ + virtual + void + encodeFingerprint(der::Encoder&) const = 0; + + /** FOR TEST CODE ONLY return true if the fulfillment is equal to the given + fulfillment. Non-test code should use operator== + + @note This uses an inefficient algorithm for comparison. Threshold is + particular problematic. This should be used for TESTING ONLY!!! + */ + virtual + bool + checkEqualForTesting(Fulfillment const& rhs) const = 0; + + /** FOR TEST CODE ONLY return true if the fulfillment depends on the message. + + @note Preimage does not depend on the message. So any fulfillment where + all the "leaf" fulfillments are preimage would not depend on the + message, all others would. + */ + virtual + bool + validationDependsOnMessage() const = 0; public: virtual ~Fulfillment() = default; @@ -68,8 +107,8 @@ struct Fulfillment same type. */ virtual - Buffer - fingerprint() const = 0; + std::array + fingerprint(std::error_code& ec) const = 0; /** Returns the type of this condition. */ virtual @@ -91,28 +130,79 @@ struct Fulfillment std::uint32_t cost() const = 0; + /** Returns the subtypes that this fulfillment depends on. + + @note This never including the current type, even if the current type + recursively depends on itself (i.e. a prefix that has a prefix as a + subcondition will not include the prefix type as a subtype. @see {@link + #selfAndSubtypes} + */ + virtual + std::bitset<5> + subtypes() const = 0; + + /** Return the subtypes that this type depends on, including this type. + + @see {@link #subtypes} + */ + std::bitset<5> + selfAndSubtypes() const; + /** 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. */ - virtual Condition - condition() const = 0; + condition(std::error_code& ec) const; + + /// serialize the fulfillment into the ASN.1 DER encoder + virtual + void + encode(der::Encoder&) const = 0; + + /// deserialize from the ASN.1 decoder into this object + virtual + void + decode(der::Decoder&) = 0; + + /// return the size in bytes of the content when encoded (does not include the size of the preamble) + virtual + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, + der::TraitsCache& traitsCache) const = 0; + + /** compare two fulfillments for sorting in a DER set + + @return <0 if less, 0 if equal, >0 if greater + */ + virtual + int + compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const = 0; }; +/// compare two fulfillments for equality inline bool operator== (Fulfillment const& lhs, Fulfillment const& rhs) { - // FIXME: for compound conditions, need to also check subtypes - return - lhs.type() == rhs.type() && + std::error_code ec1, ec2; + auto const result = + lhs.selfAndSubtypes() == rhs.selfAndSubtypes() && lhs.cost() == rhs.cost() && - lhs.fingerprint() == rhs.fingerprint(); + lhs.fingerprint(ec1) == rhs.fingerprint(ec2); + if (ec1 || ec2) + { + // can not compare if there is an error encoding the fingerprint + return false; + } + return result; } +/// compare two fulfillments for inequality inline bool operator!= (Fulfillment const& lhs, Fulfillment const& rhs) @@ -160,7 +250,66 @@ validate ( Fulfillment const& f, Condition const& c); -} -} + +/** DerCoderTraits for std::unique_ptr + + std::unique_ptr will be coded in ASN.1 as a choice. The actual + choice will depend on the concrete type of the Fulfillment (preimage, + prefix, ect...) + + @see {@link #DerCoderTraits} +*/ +namespace der { +template <> +struct DerCoderTraits> +{ + constexpr static GroupType + groupType() + { + return GroupType::choice; + } + constexpr static ClassId classId(){return ClassId::contextSpecific;} + static boost::optional const& + tagNum() + { + static boost::optional tn; + return tn; + } + static std::uint8_t + tagNum(std::unique_ptr const& f) + { + assert(f); + return static_cast(f->type()); + } + constexpr static bool primitive(){return false;} + + static void + encode(Encoder& encoder, std::unique_ptr const& f); + + static + void + decode(Decoder& decoder, std::unique_ptr& v); + + static + std::uint64_t + length( + std::unique_ptr const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, TraitsCache& traitsCache); + + static + int + compare( + std::unique_ptr const& lhs, + std::unique_ptr const& rhs, + TraitsCache& traitsCache) + { + return lhs->compare(*rhs, traitsCache); + } +}; + +} // der +} // cryptconditions +} // ripple #endif diff --git a/src/ripple/conditions/Types.h b/src/ripple/conditions/Types.h new file mode 100644 index 00000000000..e8ee1541d1d --- /dev/null +++ b/src/ripple/conditions/Types.h @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_CONDITIONS_TYPES_H +#define RIPPLE_CONDITIONS_TYPES_H + +#include + +namespace ripple { +namespace cryptoconditions { + +enum class Type + : std::uint8_t +{ + preimageSha256 = 0, + prefixSha256 = 1, + thresholdSha256 = 2, + rsaSha256 = 3, + ed25519Sha256 = 4, + last = 4 +}; + +} // cryptoconditions +} // ripple + +#endif diff --git a/src/ripple/conditions/impl/Condition.cpp b/src/ripple/conditions/impl/Condition.cpp index 9611507948e..3f3688bae76 100644 --- a/src/ripple/conditions/impl/Condition.cpp +++ b/src/ripple/conditions/impl/Condition.cpp @@ -17,225 +17,230 @@ */ //============================================================================== -#include #include -#include +#include #include -#include -#include -#include -#include -#include namespace ripple { namespace cryptoconditions { -namespace detail { -// The binary encoding of conditions differs based on their -// type. All types define at least a fingerprint and cost -// sub-field. Some types, such as the compound condition -// types, define additional sub-fields that are required to -// convey essential properties of the cryptocondition (such -// as the sub-types used by sub-conditions in the case of -// the compound types). -// -// Conditions are encoded as follows: -// -// Condition ::= CHOICE { -// preimageSha256 [0] SimpleSha256Condition, -// prefixSha256 [1] CompoundSha256Condition, -// thresholdSha256 [2] CompoundSha256Condition, -// rsaSha256 [3] SimpleSha256Condition, -// ed25519Sha256 [4] SimpleSha256Condition -// } -// -// SimpleSha256Condition ::= SEQUENCE { -// fingerprint OCTET STRING (SIZE(32)), -// cost INTEGER (0..4294967295) -// } -// -// CompoundSha256Condition ::= SEQUENCE { -// fingerprint OCTET STRING (SIZE(32)), -// cost INTEGER (0..4294967295), -// subtypes ConditionTypes -// } -// -// ConditionTypes ::= BIT STRING { -// preImageSha256 (0), -// prefixSha256 (1), -// thresholdSha256 (2), -// rsaSha256 (3), -// ed25519Sha256 (4) -// } - -constexpr std::size_t fingerprintSize = 32; - -std::unique_ptr -loadSimpleSha256(Type type, Slice s, std::error_code& ec) +bool +Condition:: +isCompoundCondition(Type t) { - using namespace der; - - auto p = parsePreamble(s, ec); - - if (ec) - return {}; - - if (!isPrimitive(p) || !isContextSpecific(p)) + static_assert(Type::last == Type::ed25519Sha256, "Add new case"); + switch (t) { - ec = error::incorrect_encoding; - return {}; + case Type::preimageSha256: + case Type::rsaSha256: + case Type::ed25519Sha256: + return false; + case Type::prefixSha256: + case Type::thresholdSha256: + return true; } + assert(0); + return false; // silence compiler warning +} - if (p.tag != 0) +namespace der { +void +DerCoderTraits:: +encode( + Encoder& encoder, + Condition const& c) +{ + cryptoconditions::der::withTupleEncodeHelper(c, encoder); +} + +void +DerCoderTraits:: +decode( + Decoder& decoder, + Condition& v) +{ + if (decoder.parentSlice().size() > Condition::maxSerializedCondition) { - ec = error::unexpected_tag; - return {}; + decoder.ec_ = der::Error::largeSize; + return; } - if (p.length != fingerprintSize) + auto const parentTag = decoder.parentTag(); + if (!parentTag) { - ec = error::fingerprint_size; - return {}; + decoder.ec_ = make_error_code(Error::logicError); + return; } - Buffer b = parseOctetString(s, p.length, ec); - - if (ec) - return {}; - - p = parsePreamble(s, ec); - - if (ec) - return {}; - - if (!isPrimitive(p) || !isContextSpecific(p)) + if (parentTag->classId != classId()) { - ec = error::malformed_encoding; - return{}; + decoder.ec_ = make_error_code(Error::preambleMismatch); + return; } - if (p.tag != 1) + if (parentTag->tagNum > static_cast(Type::last)) { - ec = error::unexpected_tag; - return {}; + decoder.ec_ = make_error_code(Error::preambleMismatch); + return; } - auto cost = parseInteger(s, p.length, ec); + v.type = static_cast(parentTag->tagNum); + cryptoconditions::der::withTupleDecodeHelper(v, decoder); - if (ec) - return {}; + if (decoder.ec_) + return; - if (!s.empty()) + if (v.type == Type::preimageSha256 && + v.cost > PreimageSha256::maxPreimageLength) { - ec = error::trailing_garbage; - return {}; + decoder.ec_ = der::Error::preimageTooLong; } +} - switch (type) - { - case Type::preimageSha256: - if (cost > PreimageSha256::maxPreimageLength) - { - ec = error::preimage_too_long; - return {}; - } - break; +std::uint64_t +DerCoderTraits:: +length( + Condition const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) +{ + if (auto cached = traitsCache.length(&v)) + return *cached; - default: - break; + auto const l = cryptoconditions::der::withTupleEncodedLengthHelper( + v, parentGroupType, encoderTagMode, traitsCache); + if (encoderTagMode == TagMode::automatic) + { + traitsCache.length(&v, l); + return l; } - - return std::make_unique(type, cost, std::move(b)); -} - + auto const result = 1 + l + contentLengthLength(l); + traitsCache.length(&v, result); + return result; } -std::unique_ptr -Condition::deserialize(Slice s, std::error_code& ec) +int +DerCoderTraits:: +compare( + Condition const& lhs, + Condition const& rhs, + TraitsCache& traitsCache) { - // Per the RFC, in a condition we choose a type based - // on the tag of the item we contain: - // - // Condition ::= CHOICE { - // preimageSha256 [0] SimpleSha256Condition, - // prefixSha256 [1] CompoundSha256Condition, - // thresholdSha256 [2] CompoundSha256Condition, - // rsaSha256 [3] SimpleSha256Condition, - // ed25519Sha256 [4] SimpleSha256Condition - // } - if (s.empty()) + // compare types + if (lhs.type != rhs.type) { - ec = error::buffer_empty; - return {}; + if (lhs.type < rhs.type) + return -1; + return 1; } - using namespace der; - - auto const p = parsePreamble(s, ec); - if (ec) - return {}; - - // All fulfillments are context-specific, constructed - // types - if (!isConstructed(p) || !isContextSpecific(p)) { - ec = error::malformed_encoding; - return {}; + // compare lengths + auto const lhsL = cryptoconditions::der::withTupleEncodedLengthHelper( + lhs, boost::none, TagMode::automatic, traitsCache); + auto const rhsL = cryptoconditions::der::withTupleEncodedLengthHelper( + rhs, boost::none, TagMode::automatic, traitsCache); + if (lhsL != rhsL) + { + if (lhsL < rhsL) + return -1; + return 1; + } } - if (p.length > s.size()) { - ec = error::buffer_underfull; - return {}; + // compare finger prints + using traits = DerCoderTraits>; + if (auto const r = traits::compare(lhs.fingerprint, rhs.fingerprint, traitsCache)) + return r; } - - if (s.size() > maxSerializedCondition) + // fingerprints were equal { - ec = error::large_size; - return {}; + // compare costs + using traits = DerCoderTraits>; + if (auto const r = traits::compare(lhs.cost, rhs.cost, traitsCache)) + return r; } - - std::unique_ptr c; - - switch (p.tag) + // costs were equal + auto const lhsIsCompound = Condition::isCompoundCondition(lhs.type); + auto const rhsIsCompound = Condition::isCompoundCondition(rhs.type); + if (!lhsIsCompound && !rhsIsCompound) + return 0; + if (lhsIsCompound && !rhsIsCompound) + return 1; + if (!lhsIsCompound && rhsIsCompound) + return -1; + // both are compound + assert(lhsIsCompound && rhsIsCompound); { - case 0: // PreimageSha256 - c = detail::loadSimpleSha256( - Type::preimageSha256, - Slice(s.data(), p.length), ec); - if (!ec) - s += p.length; - break; - - case 1: // PrefixSha256 - ec = error::unsupported_type; - return {}; - - case 2: // ThresholdSha256 - ec = error::unsupported_type; - return {}; - - case 3: // RsaSha256 - ec = error::unsupported_type; - return {}; - - case 4: // Ed25519Sha256 - ec = error::unsupported_type; - return {}; - - default: - ec = error::unknown_type; - return {}; + // compare subtypes + using traits = DerCoderTraits>; + return traits::compare(lhs.subtypes, rhs.subtypes, traitsCache); } +} - if (!s.empty()) - { - ec = error::trailing_garbage; - return {}; - } +} // der - return c; +Condition::Condition(der::Constructor const&){} + +std::bitset<5> +Condition::selfAndSubtypes() const +{ + std::bitset<5> result{subtypes}; + result.set(static_cast(type)); + return result; } +Condition +Condition::deserialize(Slice s, std::error_code& ec) +{ + // The binary encoding of conditions differs based on their + // type. All types define at least a fingerprint and cost + // sub-field. Some types, such as the compound condition + // types, define additional sub-fields that are required to + // convey essential properties of the cryptocondition (such + // as the sub-types used by sub-conditions in the case of + // the compound types). + // + // Conditions are encoded as follows: + // + // Condition ::= CHOICE { + // preimageSha256 [0] SimpleSha256Condition, + // prefixSha256 [1] CompoundSha256Condition, + // thresholdSha256 [2] CompoundSha256Condition, + // rsaSha256 [3] SimpleSha256Condition, + // ed25519Sha256 [4] SimpleSha256Condition + // } + // + // SimpleSha256Condition ::= SEQUENCE { + // fingerprint OCTET STRING (SIZE(32)), + // cost INTEGER (0..4294967295) + // } + // + // CompoundSha256Condition ::= SEQUENCE { + // fingerprint OCTET STRING (SIZE(32)), + // cost INTEGER (0..4294967295), + // subtypes ConditionTypes + // } + // + // ConditionTypes ::= BIT STRING { + // preImageSha256 (0), + // prefixSha256 (1), + // thresholdSha256 (2), + // rsaSha256 (3), + // ed25519Sha256 (4) + // } + + using namespace der; + + Condition v{der::constructor}; + + der::Decoder decoder(s, der::TagMode::automatic); + decoder >> v >> der::eos; + + ec = decoder.ec_; + return v; +} } } diff --git a/src/ripple/conditions/impl/Der.h b/src/ripple/conditions/impl/Der.h new file mode 100644 index 00000000000..a98848a8c91 --- /dev/null +++ b/src/ripple/conditions/impl/Der.h @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_CONDITIONS_DER_H +#define RIPPLE_CONDITIONS_DER_H + +#include +#include +#include + +#endif diff --git a/src/ripple/conditions/impl/DerCoder.cpp b/src/ripple/conditions/impl/DerCoder.cpp new file mode 100644 index 00000000000..31b2e859077 --- /dev/null +++ b/src/ripple/conditions/impl/DerCoder.cpp @@ -0,0 +1,715 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include +#include + +namespace ripple { +namespace cryptoconditions { +namespace der { + +Tag::Tag(SequenceTag) + : classId(ClassId::universal), tagNum(16), primitive(false) +{ +} + +Tag::Tag(SetTag) + : classId(ClassId::universal), tagNum(17), primitive(false) +{ +} + +bool +Tag::isSet() const +{ + return classId == ClassId::universal && tagNum == 17; +} + +//------------------------------------------------------------------------------ + +std::uint64_t +tagNumLength(std::uint64_t v) +{ + if (v <= 30) + return 1; + + constexpr std::uint64_t chunkSize = 7; + std::uint64_t const nChunks = 1 + 8 * sizeof(v) / chunkSize; + auto const lz = numLeadingZeroChunks(v, nChunks); + assert(lz != nChunks); + return nChunks - lz + 1; +} + +void +encodeTagNum(MutableSlice& dst, std::uint64_t v, std::error_code& ec) +{ + assert(v > 30); + + auto n = tagNumLength(v) - 1; + + if (dst.size() != n) + { + ec = make_error_code(Error::logicError); + return; + } + while (n--) + { + auto b = static_cast((v >> (n * 7)) & 0xFF); + // all but the last byte has the high order bit set + if (n) + b |= 1 << 7; + else + b &= ~(1 << 7); + dst.push_back(static_cast(b)); + } +} + +void +decodeTag(Slice& slice, Tag& tag, std::error_code& ec) +{ + auto popFront = [&]() -> std::uint8_t { + if (slice.empty()) + { + ec = make_error_code(Error::shortGroup); + return 0; + } + auto const r = slice[0]; + slice += 1; + return r; + }; + + std::uint8_t curByte = popFront(); + if (ec) + return; + + tag.classId = static_cast(curByte >> 6); + tag.primitive = !(curByte & (1 << 5)); + + // decode the tag + if ((curByte & 0x1f) != 0x1f) + { + tag.tagNum = curByte & 0x1f; + } + else + { + std::uint64_t tagNum = 0; + do + { + curByte = popFront(); + if (ec) + return; + auto const asBase128 = curByte & ~(1 << 7); + + if (tagNum & (static_cast(0xfe) + << 8 * (sizeof(tagNum) - 1))) + { + // Shifting by 7 bits would overflow tagNum + ec = make_error_code(Error::tagOverflow); + return; + } + + tagNum = (tagNum << 7) | asBase128; + + if (!tagNum) + { + // leading zeros + ec = make_error_code(Error::badDerEncoding); + return; + } + + } while (curByte & (1 << 7)); + + tag.tagNum = tagNum; + if (tagNum <= 30) + { + // tag was encoded with the long form, but should have been short + // form + ec = make_error_code(Error::badDerEncoding); + return; + } + } +} + +std::uint64_t +contentLengthLength(std::uint64_t v) +{ + if (v <= 127) + return 1; + + constexpr std::uint64_t chunkSize = 8; + constexpr std::uint64_t nChunks = sizeof(v); + auto const lz = numLeadingZeroChunks(v, nChunks); + return nChunks - lz + 1; +} + +void +encodeContentLength(MutableSlice& dst, std::uint64_t v, std::error_code& ec) +{ + if (v <= 127) + { + if (dst.size() != 1) + { + ec = make_error_code(Error::logicError); + return; + } + dst.push_back(static_cast(v)); + return; + } + + auto n = contentLengthLength(v); + + if (dst.size() != n) + { + ec = make_error_code(Error::logicError); + return; + } + + --n; + dst.push_back(static_cast(n) | (1 << 7)); + + while (n--) + dst.push_back(static_cast((v >> (n * 8)) & 0xFF)); +} + +void +decodeContentLength(Slice& slice, std::uint64_t& contentLength, std::error_code& ec) +{ + auto popFront = [&]() -> std::uint8_t { + if (slice.empty()) + { + ec = make_error_code(Error::shortGroup); + return 0; + } + auto const r = slice[0]; + slice += 1; + return r; + }; + + contentLength = 0; + + std::uint8_t curByte = popFront(); + if (ec) + return; + if (curByte <= 127) + { + contentLength = curByte; + } + else if ((curByte & ~(1 << 7)) > 8) + { + ec = make_error_code(Error::unsupported); + return; + } + else + { + int const n = (curByte & ~(1 << 7)); + for (int i = 0; i < n; ++i) + { + curByte = popFront(); + if (ec) + return; + contentLength = (contentLength << 8) | curByte; + } + } +} + +std::uint64_t +tagLength(Tag t) +{ + return tagNumLength(t.tagNum); +} + +void +encodePreamble(MutableSlice& dst, Preamble const& p, std::error_code& ec) +{ + if (dst.size() <= 1) + { + ec = make_error_code(Error::logicError); + return; + } + + char d = (static_cast(p.tag_.classId) << 6); + if (!p.tag_.primitive) + d |= 1 << 5; + + if (p.tag_.tagNum <= 30) + { + d |= p.tag_.tagNum; + dst.push_back(d); + } + else + { + d |= 0x1f; + dst.push_back(d); + encodeTagNum(dst, p.tag_.tagNum, ec); + if (ec) + return; + } + encodeContentLength(dst, p.contentLength_, ec); +} + +void +decodePreamble(Slice& slice, Preamble& p, std::error_code& ec) +{ + decodeTag(slice, p.tag_, ec); + if (ec) + return; + decodeContentLength(slice, p.contentLength_, ec); +} + +//------------------------------------------------------------------------------ + +Group::Group( + Tag t, + TagMode tagMode, + GroupType groupType, + MutableSlice slice) + : id_(t) + , tagMode_(tagMode) + , groupType_(groupType) + , slice_(slice) +{ +} + +MutableSlice& +Group::slice() +{ + return slice_; +} + +Slice +Group::slice() const +{ + return slice_; +} + +bool +Group::isSet() const +{ + return id_.isSet(); +} + +bool +Group::isAutoSequence() const +{ + return tagMode_ == TagMode::automatic && + groupType_ == GroupType::autoSequence; +} + +bool +Group::isChoice() const +{ + return groupType_ == GroupType::choice; +} + +void +Group::set(bool primitive, GroupType bt) +{ + id_.primitive = primitive; + groupType_ = bt; +} + +size_t +Group::numChildren() const +{ + return numChildren_; +} + +GroupType Group::groupType() const +{ + return groupType_; +} + +Eos eos; +Automatic automatic; +Constructor constructor; + +//------------------------------------------------------------------------------ + +Encoder::Encoder(TagMode tagMode) : tagMode_(tagMode) +{ +} + +Encoder::~Encoder() +{ + if (ec_) + return; + + // hitting this assert means the encoding stream was not terminated with a + // call to eos(); The usual way to do this is with the `eos` object: + // encoder << someObject << eos; + // Certain error checks can only happen after the stream knows there are not + // other objects to be encoded. + assert(atEos_); +} + +void +Encoder::startGroup(Tag t, GroupType groupType, std::uint64_t contentSize) +{ + if (ec_) + return; + + assert(!root_); + + if (groupType == GroupType::choice && parentIsChoice()) + { + // Choice/choice groups are not supported + ec_ = make_error_code(Error::unsupported); + return; + } + + if (parentIsChoice() && tagMode_ == TagMode::automatic) + { + auto g = subgroups_.top(); + g.set(t.primitive, groupType); + subgroups_.emplace(std::move(g)); + return; + } + + auto const contentLL = contentLengthLength(contentSize); + auto const tagL = tagLength(t); + auto const sliceSize = contentSize + contentLL + tagL; + + auto const parentSlice = [&] + { + if (!subgroups_.empty()) + return subgroups_.top().slice(); + assert(rootBuf_.empty()); + rootBuf_.resize(sliceSize); + rootSlice_ = Slice{rootBuf_.data(), rootBuf_.size()}; + return MutableSlice(rootBuf_.data(), rootBuf_.size()); + }(); + + if (sliceSize > parentSlice.size()) + { + // incorrect length calculation + ec_ = make_error_code(Error::logicError); + return; + } + + MutableSlice thisSlice{parentSlice.data(), sliceSize}; + + auto const preambleLength = sliceSize - contentSize; + if (preambleLength > thisSlice.size()) + { + // incorrect length calculation + ec_ = make_error_code(Error::logicError); + return; + } + MutableSlice preambleSlice{thisSlice.data(), preambleLength}; + encodePreamble(preambleSlice, Preamble{t, contentSize}, ec_); + if (ec_) + return; + if (!preambleSlice.empty()) + { + // incorrect length calculation + ec_ = make_error_code(Error::logicError); + return; + } + thisSlice += preambleLength; + + subgroups_.emplace(t, tagMode_, groupType, thisSlice); +}; + +void +Encoder::endGroup() +{ + if (ec_) + return; + + if (subgroups_.empty()) + { + ec_ = make_error_code(Error::logicError); + return; + } + + Group top(std::move(subgroups_.top())); + subgroups_.pop(); + + if (!top.slice().empty()) + { + // incorrect length calculation + ec_ = make_error_code(Error::logicError); + return; + } + + if (parentIsChoice() && tagMode_ == TagMode::automatic) + { + // copy the child group, but don't add it to the parent + subgroups_.top() = std::move(top); + return; + } + + if (subgroups_.empty()) + { + assert(!root_); + root_.emplace(std::move(top)); + return; + } + + auto& parentSlice = subgroups_.top().slice(); + auto const inc = std::distance(parentSlice.data(), top.slice().data()); + if (inc < 0 || inc > parentSlice.size()) + { + // incorrect length calculation + ec_ = make_error_code(Error::logicError); + return; + } + parentSlice += inc; + subgroups_.top().incrementNumChildren(); +}; + +void +Encoder::eos() +{ + atEos_ = true; + + if (ec_) + return; + + if (!subgroups_.empty()) + { + ec_ = make_error_code(Error::logicError); + return; + } +} + +size_t +Encoder::size() const +{ + return rootSlice_.size(); +} + +MutableSlice& +Encoder::parentSlice() +{ + static MutableSlice empty{nullptr, 0}; + if (!subgroups_.empty()) + return subgroups_.top().slice(); + return empty; +} + +std::error_code const& +Encoder::ec() const +{ + return ec_; +} + +std::vector const& +Encoder:: +serializationBuffer(std::error_code& ec) const +{ + if (ec_) + { + ec = ec_; + return rootBuf_; + } + + if (!root_ || rootSlice_.size() != rootBuf_.size()) + ec = make_error_code(Error::logicError); + + return rootBuf_; +} + +bool +Encoder::parentIsAutoSequence() const +{ + return tagMode_ == TagMode::automatic && !subgroups_.empty() && + subgroups_.top().isAutoSequence(); +} + +bool +Encoder::parentIsChoice() const +{ + return !subgroups_.empty() && subgroups_.top().isChoice(); +} + +//------------------------------------------------------------------------------ + +Decoder::Decoder(Slice slice, TagMode tagMode) + : tagMode_(tagMode), rootSlice_(slice) +{ +} + +Decoder::~Decoder() +{ + if (ec_) + return; + + // hitting this assert means the decoding stream was not terminated with a + // call to eos(); The usual way to do this is with the `eos` object: + // decoder >> someObject >> eos; + // Certain error checks can only happen after the stream knows there are not + // other objects to be encoded. + assert(atEos_); +} + +void +Decoder::startGroup(boost::optional const& t, GroupType groupType) +{ + if (ec_) + return; + + if (groupType == GroupType::choice && parentIsChoice()) + { + // Choice/choice groups are not supported + ec_ = make_error_code(Error::unsupported); + return; + } + + if (parentIsChoice() && tagMode_ == TagMode::automatic) + { + if (std::get(ancestors_.top()) > 0) + { + // choice groups must have exactly one child, and adding this child + // would violate that constraint + ec_ = make_error_code(Error::badDerEncoding); + return; + } + auto a = ancestors_.top(); + std::get(a) = groupType; + ancestors_.emplace(a); + return; + } + + Preamble p; + (*this) >> p; + + if (!(groupType == GroupType::choice && tagMode_ == TagMode::automatic)) + { + if (t && (p.tag_ != t)) + { + ec_ = make_error_code(Error::preambleMismatch); + return; + } + } + + auto const& s = parentSlice(); + if (p.contentLength_ > s.size()) + { + ec_ = make_error_code(Error::shortGroup); + return; + } + ancestors_.emplace(Slice{s.data(), p.contentLength_}, p.tag_, groupType, 0); +} + +void +Decoder::endGroup() +{ + if (ec_) + return; + + if (ancestors_.empty()) + { + ec_ = make_error_code(Error::logicError); + return; + } + + if (std::get(ancestors_.top()) == GroupType::choice && + tagMode_ == TagMode::automatic && + std::get(ancestors_.top()) != 1) + { + // choice groups must have exactly one child + ec_ = make_error_code(Error::badDerEncoding); + return; + } + + auto const poped = std::get(ancestors_.top()); + ancestors_.pop(); + if (!poped.empty()) + { + ec_ = make_error_code(Error::longGroup); + return; + } + + if (!ancestors_.empty() && + std::get(ancestors_.top()) == GroupType::choice && + tagMode_ == TagMode::automatic) + { + // track children to make sure choices always have exactly one child + ++std::get(ancestors_.top()); + } + + auto& parent = parentSlice(); + auto const toConsume = std::distance(parent.data(), poped.data()); + if (toConsume < 0 || toConsume > parent.size()) + { + // incorrect length calculation + ec_ = make_error_code(Error::logicError); + return; + } + parent += toConsume; +} + +void +Decoder::eos() +{ + atEos_ = true; + if (ec_) + return; + + if (!ancestors_.empty()) + { + ec_ = make_error_code(Error::logicError); + return; + } + if (!rootSlice_.empty()) + { + ec_ = make_error_code(Error::longGroup); + return; + } +} + +boost::optional +Decoder::parentTag() const +{ + if (ancestors_.empty()) + return boost::none; + return std::get(ancestors_.top()); +} + +Slice& +Decoder::parentSlice() +{ + if (!ancestors_.empty()) + return std::get(ancestors_.top()); + return rootSlice_; +}; + +bool +Decoder::parentIsAutoSequence() const +{ + return tagMode_ == TagMode::automatic && !ancestors_.empty() && + std::get(ancestors_.top()) == GroupType::autoSequence; +} + +bool +Decoder::parentIsChoice() const +{ + return !ancestors_.empty() && + std::get(ancestors_.top()) == GroupType::choice; +} + +std::error_code const& +Decoder::ec() const +{ + return ec_; +} + +} // der +} // ripple +} // cryptoconditions diff --git a/src/ripple/conditions/impl/DerCoder.h b/src/ripple/conditions/impl/DerCoder.h new file mode 100644 index 00000000000..a5eb3a47f33 --- /dev/null +++ b/src/ripple/conditions/impl/DerCoder.h @@ -0,0 +1,1000 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_CONDITIONS_DERCODER_H +#define RIPPLE_CONDITIONS_DERCODER_H + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +namespace ripple { +namespace cryptoconditions { + +/** + The `der` namespace contains a set of classes the implement ASN.1 DER encoding + and decoding for cryptoconditions. + + There are two keys to understanding how to use these coders: 1) + DerCoderTraits, and 2) `withTuple`. + + To encode or decode a type `T`, a specialization of DerCoderTraits must + exist. This specialization contains all the functions specific to streaming + type `T`. The most important are: `encode`, `decode`, `length`, and `compare`. + @see {@link #DerCoderTraits}. + + If a class defines the function `withTuple`, that class can use the helper + functions `withTupleEncodeHelper`, `withTupleDecodeHelper`, + `withTupleEncodedLengthHelper`, and `withTupleCompareHelper`. The `withTuple` + function takes a callable, and the class will wrap its member variables in a + tuple of references (usually using `tie`), and call the callable with the + tuple as an argument. See one of the existing cryptocondtion implementations + for an example of how `withTuple` is used. + + @note Efficiently encoding cryptocondition classes into ASN.1 has some challenges: + + 1) The size of the preamble depends on the size of content being encoded. This + makes it difficult to encode in a single pass. The most natural implementation + would a) encode the content, b) encode the preamble, c) copy the result into + some final buffer. The function `DerCoderTraits::length` solves this + problem. When encoding a value of type T, the length will return the number of + bytes used to encode contents of the value (but does not include the + preamble). + + 2) Encoding DER sets requires the elements of the set be encoded in sorted + order (sorted by the encoding of the individual elements). The function + `DerCoderTraits::compare` solves this problem. This function returns a + values less than 0 if the lhs < rhs, 0 if lhs == rhs, and a value greater than + 0 if lhs > rhs. + + 3) When encoding cryptoconditions that contain other cryptoconditions in + hierarchies (such as threshold and prefix), some values - like length and sort + order - will be computed multiple times, and the number of times a value is + computed grows as a function of the cryptocondition's depth in the hierarchy. + This is solved with a TraitCache. This caches previously computed values of + length and sort order so they do not need to be recomputed. Note that storing + values in the cache is type dependent, and the address of the variable must be + stable while encoding. It makes sense to cache higher level values, but not + primitives. + */ + +namespace der { + +struct Encoder; +struct Decoder; + +/// constructor tag to specify an ASN.1 sequence +struct SequenceTag {}; +/// constructor tag to specify an ASN.1 set +struct SetTag {}; + +/// the type information part of an ASN.1 preamble +struct Tag +{ + ClassId classId = ClassId::universal; + std::uint64_t tagNum = 0; + bool primitive = true; + + Tag() = default; + + Tag(ClassId classId_, std::uint64_t tagNum_, bool primitive_) + : classId(classId_), tagNum(tagNum_), primitive(primitive_) + { + } + + template + Tag(DerCoderTraits t, std::uint64_t tn) + : Tag(DerCoderTraits::classId(), tn, DerCoderTraits::primitive()) + { + } + + explicit + Tag(SequenceTag); + + explicit + Tag(SetTag); + + /// return true if the tag represents an ASN.1 set + bool + isSet() const; + + friend bool + operator<(Tag const& lhs, Tag const& rhs) + { + return std::tie(lhs.classId, lhs.tagNum, lhs.primitive) < + std::tie(rhs.classId, rhs.tagNum, rhs.primitive); + } + friend bool + operator==(Tag const& lhs, Tag const& rhs) + { + return lhs.classId == rhs.classId && lhs.tagNum == rhs.tagNum && + lhs.primitive == rhs.primitive; + } + friend bool + operator!=(Tag const& lhs, Tag const& rhs) + { + return !operator==(lhs, rhs); + } +}; + +/** an ans.1 preamble + + values are encoded in ans.1 with a preamble that specifies how to interpret + the content, followed by the content. This struct represents the preamble. +*/ +struct Preamble +{ + /// type information + Tag tag_; + /// content length in bytes + std::uint64_t contentLength_; +}; + +/** RAII class for coder groups + + ASN.1 values are coded as a hierarchy. There are root values, which have + sub-values as children. A `GroupGuard` organizes the serialization code so + C++ scopes represent levels in the ASN.1 hierarchy. The constructor pushes a + new group onto the coders group stack, and the destructor pops the group. + Entering a scope represents a new value that will be coded. New values will + be descendants of this value coded in this scope until the scope is exited. + */ +template +class GroupGuard +{ + /// The encoder or decoder + Coder& s_; + +public: + GroupGuard(Coder& s, Tag t, GroupType bt) + : s_(s) + { + s_.startGroup(t, bt); + } + + GroupGuard(Coder& s, Tag t, GroupType bt, std::uint64_t contentSize) + : s_(s) + { + s_.startGroup(t, bt, contentSize); + } + + GroupGuard(Coder& s, boost::optional const& t, GroupType bt) + : s_(s) + { + s_.startGroup(t, bt); + } + + GroupGuard(Coder& s, SequenceTag t) + : GroupGuard(s, Tag{t}, GroupType::sequence) + { + } + + GroupGuard(Coder& s, SetTag t) + : GroupGuard(s, Tag{t}, GroupType::set) + { + } + + template + GroupGuard(Coder& s, DerCoderTraits t) + : s_(s) + { + boost::optional tag; + if (auto const tagNum = t.tagNum()) + tag.emplace(t, *tagNum); + s_.startGroup(tag, t.groupType()); + } + + template + GroupGuard(Coder& s, T const& v, DerCoderTraits t) + : s_(s) + { + auto const tagNum = t.tagNum(v); + Tag tag(t, tagNum); + s_.startGroup(tag, t.groupType()); + } + + // Needed for fuzz testing + GroupGuard(Coder& s, GroupType bt) + : s_(s) + { + s_.startGroup(boost::none, bt); + } + + ~GroupGuard() + { + s_.endGroup(); + } +}; + +/** End of stream guard + + Coders need to know when when a serialization is complete. Clients signal + this by calling `eos`. This guard calls `eos` in the destructor so leaving + a scope may be used to signal `eos`. + + @note: This class is mostly used for testing. The usual way to signal `eos` + is by adding `der::eos` at the end of a stream. For example: `coder << value + << der::eos;` + */ +template +class EosGuard +{ + // Encoder or decoder + Coder& s_; + +public: + explicit + EosGuard(Coder& s) + : s_(s) + { + } + + ~EosGuard() + { + s_.eos(); + } +}; + +template +std::uint64_t +numLeadingZeroChunks(std::uint64_t v, std::uint64_t n) +{ + static_assert(ChunkBitSize <= 8, "Unsupported chunk bit size"); + + std::uint64_t result = 0; + while (n--) + { + auto b = static_cast((v >> (n * ChunkBitSize)) & 0xFF); + if (b) + break; + ++result; + } + return result; +} + +/** decode the tag from ASN.1 format + */ +void +decodeTag(Slice& slice, Tag& tag, std::error_code& ec); + +/** Encode the integer in a format appropriate for an ans.1 tag number. + + Encode the integer in big endian form, in as few of bytes as possible. All + but the last byte has the high order bit set. The number is encoded in base + 128 (7-bits each). +*/ +void +encodeTagNum(MutableSlice& dst, std::uint64_t v, std::error_code& ec); + +/** Return the number of bytes required to encode a tag with the given tag num */ +std::uint64_t +tagNumLength(std::uint64_t v); + +/** Decode the content length from ASN.1 format +*/ +void +decodeContentLength(Slice& slice, std::uint64_t& contentLength, std::error_code& ec); + +/** Encode the integer in a format appropriate for an ans.1 content length + + Encode the integer in big endian form, in as few of bytes as possible. +*/ +void +encodeContentLength(MutableSlice& dst, std::uint64_t v, std::error_code& ec); + +/** return the number of bytes required to encode the given content length + */ +std::uint64_t +contentLengthLength(std::uint64_t); + +/** return the number of bytes required to encode the given tag + */ +std::uint64_t +tagLength(Tag t); + +/** return the number of bytes required to encode the value, including the preamble + */ +template +std::uint64_t +totalLength( + T const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache, + boost::optional const& childNumber) +{ + auto const contentLength = + Trait::length(v, parentGroupType, encoderTagMode, traitsCache); + if (encoderTagMode == TagMode::automatic && + parentGroupType && *parentGroupType == GroupType::choice) + return contentLength; + + auto const oneTagResult = tagNumLength(childNumber.value_or(0)) + + contentLength + contentLengthLength(contentLength); + + if (parentGroupType && *parentGroupType == GroupType::autoSequence && + DerCoderTraits::groupType() == GroupType::choice) + { + // auto sequences with a choice write a two tags: one for the sequence + // number and one for the choice + // note: This breaks down if the choice number is large enough to + // require more than one byte for the tag (more than 30 choices) + return tagNumLength(0) + oneTagResult + contentLengthLength(oneTagResult); + } + + // all cryptocondition preambles are one byte + return oneTagResult; +} + +/** A value in a hierarchy of values when encoding + + ASN.1 values are coded as a hierarchy. There is one root value, which has + sub-values as children. When encoding, this class keeps track the type that + is being encoded, what bytes in the stream represent content for this value, + and child values. + + @note: decoders use a different class to represent the hierarchy of values. + */ +class Group +{ + /// ASN.1 type information for the value being encoded + Tag id_; + /// current number of children + size_t numChildren_ = 0; + /// ASN.1 explicit (direct) or automatic tagging + TagMode tagMode_; + /// additional type information for the group + GroupType groupType_; + + /** data slice reserved for both the preamble and contents of the group + + @note: it _must_ be the correct size. It will not be resized. + */ + MutableSlice slice_; + +public: + Group(Group const&) = default; + Group(Group&&) = default; + Group& + operator=(Group&&) = default; + Group& + operator=(Group const&) = default; + + Group( + Tag t, + TagMode tagMode, + GroupType groupType, + MutableSlice slice); + + /// the data slice reserved for both the preamble and contents of the group + MutableSlice& + slice(); + + Slice + slice() const; + + /** Increment the number of children this group has + */ + void + incrementNumChildren() + { + ++numChildren_; + } + + /// return true if the group represents an ASN.1 set + bool + isSet() const; + + /** return true if the group represents an auto sequence + + @note an auto sequence is an ASN.1 sequence that has autogenerated + tag numbers + */ + bool + isAutoSequence() const; + + /// return true if the group represents an ASN.1 choice + bool + isChoice() const; + + /** set the groups type information + + @param primitive true is primitive, false if constructed + @param bt the groups type information + */ + void + set(bool primitive, GroupType bt); + + /// return the number of sub-values + size_t + numChildren() const; + + GroupType groupType() const; +}; + +/** encode the preamble into the dst slice + */ +void +encodePreamble(MutableSlice& dst, Preamble const& p, std::error_code& ec); + +/** decode the preamble from slice into p + */ +void +decodePreamble(Slice& slice, Preamble& p, std::error_code& ec); + +/** type representing and end of stream + + Coders need to know when when a serialization is complete. Clients signal + this by calling `eos`. The typical way of calling `eos` is by serializing a + value of type Eos. There is a convenience global variable for this purpose. + It will typically be used as follows: `coder << value << der::eos;` +*/ +struct Eos {}; +extern Eos eos; +/// constructor tag to specify a decoder in automatic mode +struct Automatic {}; +extern Automatic automatic; +/** constructor tag to specify a type is being constructed for decoding into + + Often, it is convenient to create a type and then decode into that type. + However, this would usually require that type to be default constructable + (as the contents used to create are deserialized after the variable is + constructed). This `Constructor` type is used to create constructors and + specify that they should only be used for DER decoding. + */ +struct Constructor {}; +extern Constructor constructor; + + +/** Stream interface to encode values into ASN.1 DER format + + The encoder class has an interface similar to a c++ output stream. Values + are added to the stream using the `<<` operator. After all the values are + added to the encoder, it must be terminated with a call to `eos()`. As a + convenience, there is a special variable called `eos` that when streamed will + call the stream's `eos()` function. Typically, the code to encode values to a + stream is: `encoder << value_1 << ... << value_n << eos;`. + + Every type to be streamed must specialize the DerCoderTraits class @see + {@link #DerCoderTraits}. There exist specializations for some C++ types and + primitive rippled types - including integers, strings, bitstrings, tuples, + buffers, arrays, and wrappers for wrapping collections like vector into + either ASN.1 sets or sequences. + + After the values are written, the stream should be checked for errors. The + function `ec` will return the error code of the first error encountered + while streaming. Streaming will stop after the first error. + + Once the values are streamed, the actual encoding is retrieved by calling + the `write` function. + + Encoding and decoding values often have the same code structure. The only + difference is encoding will use `operator<<` and decoding will use + `operator>>`. To allow writing generic code, both encoders and decoders + support `operator&`. Typically, the generic code both encode and decode is: + `coder & value_1 & ... & value_n & eos;` + */ +struct Encoder +{ + /// explicit or automatic tagging + TagMode tagMode_ = TagMode::direct; + + /** values are coded as a hierarchy. `subgroups_` tracks the current + position in the hierarchy. + + The bottom of the stack is the root value, the top of the stack is the + current parent. + */ + std::stack subgroups_; + + /** root of the tree of groups that were encoded + + @note: This is not populated until after encoding is complete + */ + boost::optional root_; + + /** Buffer to encode into */ + std::vector rootBuf_; + + /** Slice to encode into + + @note: rootBuf_ should contain the same information as rootSlice_, and + `rootSlice_` may be removed in the future. It is kept as a debugging + tool to make sure rootBuf_ is not resized after it is resized for the + root group. + */ + Slice rootSlice_; + + /** the error code of the first error encountered + + @note after the error code is set encoding stops + */ + std::error_code ec_; + + /** true if the `eos` function has been called + + some error handling cannot happen until all the values have been coded. + `atEos_` ensures every stream is terminated with an `eos` call so those + error checks can be run. + */ + bool atEos_ = false; + + /** traitsCache cache some values that need to be repeatedly computed and may be expensive to compute. + + Some value types will cache lengths and sort orders, other values types will not cache any values. + */ + TraitsCache traitsCache_; + + explicit + Encoder(TagMode tagMode); + ~Encoder(); + + /// prepare to add a new value as a child of the current value + void + startGroup(Tag t, GroupType groupType, std::uint64_t contentSize); + + /// finish adding the new value + void + endGroup(); + + /** terminate the stream + + Streams must be terminated before the destructor is called. Certain error checks + cannot occur until the encoder knows streaming is complete. Calling `eos()` runs these + error checks. Failing to call `eos` before the destructor is an error. + */ + void + eos(); + + /// total size in bytes of the content and all the preambles + size_t + size() const; + + /// return the portion of the buffer that represents the parent value + MutableSlice& + parentSlice(); + + /** return the first error code encountered + + ec should be checked after streaming to ensure no errors occurred + */ + std::error_code const& + ec() const; + + /** get the serialization buffer that contains the values encoded as ASN.1 der + */ + std::vector const& + serializationBuffer(std::error_code& ec) const; + + /** return true if the group at the top of the stack represents an auto + sequence + + @note an auto sequence is an ASN.1 sequence that has autogenerated + tag numbers + */ + bool + parentIsAutoSequence() const; + + /** return true if the group at the top of the stack represents an ASN.1 + choice + */ + bool + parentIsChoice() const; + + /** Add values to the encoder + @{ + */ + friend + Encoder& + operator&(Encoder& s, Eos e) + { + s.eos(); + return s; + } + + template + friend + Encoder& + operator&(Encoder& s, T const& v) + { + if (s.ec_) + return s; + + using traits = DerCoderTraits>; + auto const groupType = traits::groupType(); + + auto contentSize = [&] { + boost::optional parentGroupType; + if (!s.subgroups_.empty()) + parentGroupType.emplace(s.subgroups_.top().groupType()); + return traits::length(v, parentGroupType, s.tagMode_, s.traitsCache_); + }; + + if (s.parentIsAutoSequence()) + { + if (groupType == GroupType::choice) + { + Tag const tag1{ClassId::contextSpecific, + s.subgroups_.top().numChildren(), + traits::primitive()}; + Tag const tag2{traits{}, traits::tagNum(v)}; + auto const contentSize = traits::length( + v, GroupType::sequenceChild, s.tagMode_, s.traitsCache_); + GroupGuard g1(s, tag1, GroupType::sequenceChild, + tagLength(tag2) + contentLengthLength(contentSize) + contentSize); + if (s.ec_) + return s; + GroupGuard g2(s, tag2, groupType, contentSize); + if (s.ec_) + return s; + traits::encode(s, v); + } + else + { + Tag const tag{ClassId::contextSpecific, + s.subgroups_.top().numChildren(), + traits::primitive()}; + GroupGuard g(s, tag, groupType, contentSize()); + if (s.ec_) + return s; + traits::encode(s, v); + } + } + else + { + Tag const tag{traits{}, traits::tagNum(v)}; + GroupGuard g(s, tag, groupType, contentSize()); + if (s.ec_) + return s; + traits::encode(s, v); + } + + return s; + } + + template + friend Encoder& + operator<<(Encoder& s, T const& t) + { + return s & t; + } + /** @} */ +}; + +//------------------------------------------------------------------------------ + +/** Stream interface to decode values from ASN.1 DER format + + The decode class has an interface similar to a c++ output stream. Values are + decoded from the stream using the `>>` operator. After all the values are + decoded, it must be terminated with a call to `eos()`. As a convenience, there + is a special variable called `eos` that when streamed will call the stream's + `eos()` function. Typically, the code to encode values to a stream is: + `decoder >> value_1 >> ... >> value_n >> eos;`. + + Every type to be streamed must specialize the DerCoderTraits class @see + {@link #DerCoderTraits}. There exist specializations for some C++ types and + primitive rippled types - including integers, strings, bitstrings, tuples, + buffers, arrays, and wrappers for wrapping collections like vector into + either ASN.1 sets or sequences. + + After the values are decoded, the stream should be checked for errors. The + function `ec` will return the error code of the first error encountered + while decoding. Decoding will stop after the first error. + + Encoding and decoding values often have the same code structure. The only + difference is encoding will use `operator<<` and decoding will use + `operator>>`. To allow writing generic code, both encoders and decoders + support `operator&`. Typically, the generic code both encode and decode is: + `coder & value_1 & ... & value_n & eos;` + */ +struct Decoder +{ + /** explicit or automatic tagging + + @note this must match the mode the values were encoded with + */ + TagMode tagMode_; + + /** true if the `eos` function has been called + + some error handling cannot happen until all the values have been coded. + `atEos_` ensures every stream is terminated with an `eos` call so those + error checks can be run. + */ + bool atEos_ = false; + + /** slice for the entire buffer to be decoded */ + Slice rootSlice_; + + /** values are coded as a hierarchy. `ancestors_` tracks the current + position in the hierarchy. + + The bottom of the stack is the root value, the top of the stack is the + current parent. + + The tuple contains the slice, ancestor tag, groupType, and number of children + */ + std::stack> ancestors_; + + /** the error code of the first error encountered + + @note after the error code is set decoding stops + */ + std::error_code ec_; + + Decoder() = delete; + + Decoder(Slice slice, TagMode tagMode); + + ~Decoder(); + + /// prepare to decode a value as a child of the current value + void + startGroup(boost::optional const& t, GroupType groupType); + + /** finish decoding the new value */ + void + endGroup(); + + /** terminate the stream + + Streams must be terminated before the destructor is called. Certain error checks + cannot occur until the encoder knows streaming is complete. Calling `eos()` runs these + error checks. Failing to call `eos` before the destructor is an error. + */ + void + eos(); + + /** return the first error code encountered + + ec should be checked after streaming to ensure no errors occurred + */ + std::error_code const& + ec() const; + + /** return the tag at the top of the ancestors stack + + return boost::none if the stack is empty + */ + boost::optional + parentTag() const; + + /** return true if the ancestor at the top of the stack represents an auto + sequence + + @note an auto sequence is an ASN.1 sequence that has autogenerated + tag numbers + */ + bool + parentIsAutoSequence() const; + + /** return true if the ancestor at the top of the stack represents an ASN.1 + choice + */ + bool + parentIsChoice() const; + + /** return the portion of the buffer that represents the parent value */ + Slice& + parentSlice(); + + /** Decode values from the encoder into variables + + @note The forwarding ref is used for some value types to support + std::tie, SetWrapper, and SequenceWrapper (i.e. `s >> make_set(some_vec)`) + + @{ + */ + friend + Decoder& + operator&(Decoder& s, Eos e) + { + s.eos(); + return s; + } + + friend + Decoder& + operator&(Decoder& s, Preamble& p) + { + if (s.ec_) + return s; + + decodePreamble(s.parentSlice(), p, s.ec_); + return s; + } + + template + friend + Decoder& + operator&(Decoder& s, T&& v) + { + if (s.ec_) + return s; + + using traits = DerCoderTraits>; + auto const groupType = traits::groupType(); + if (s.parentIsAutoSequence()) + { + if (groupType == GroupType::choice) + { + auto& numChildren = std::get(s.ancestors_.top()); + Tag const tag1{ + ClassId::contextSpecific, numChildren++, traits::primitive()}; + GroupGuard g1(s, tag1, GroupType::sequenceChild); + if (s.ec_) + return s; + boost::optional tag2; + if (auto const tagNum = traits::tagNum()) + tag2.emplace(traits{}, *tagNum); + GroupGuard g2(s, tag2, groupType); + if (s.ec_) + return s; + traits::decode(s, v); + } + else + { + auto& numChildren = std::get(s.ancestors_.top()); + Tag const tag{ + ClassId::contextSpecific, numChildren++, traits::primitive()}; + GroupGuard g(s, tag, groupType); + if (s.ec_) + return s; + traits::decode(s, v); + } + } + else + { + boost::optional tag; + if (auto const tagNum = traits::tagNum()) + tag.emplace(traits{}, *tagNum); + GroupGuard g(s, tag, groupType); + if (s.ec_) + return s; + traits::decode(s, v); + } + + return s; + } + + template + friend Decoder& + operator>>(Decoder& s, T&& t) + { + return s & std::forward(t); + } + /** @} */ +}; + +//------------------------------------------------------------------------------ + +/** For types that define `withTuple`, encode the type. + + @note If the user defined type defines the function `withTuple`, then + `withTupleEncodeHelper`, `withTupleDecodeHelper`, and + `withTupleEncodeHelper` may be used to help implement the DerCoderTraits + functions `encode`, `decode`, and `length`. The `withTuple` function should + take a single parameter: a callback function. That callback function should + take a single parameter, a tuple of references that represent the object being + coded. + */ +template +void +withTupleEncodeHelper(TChoice const& c, cryptoconditions::der::Encoder& encoder) +{ + c.withTuple( + [&encoder](auto const& tup) { encoder << tup; }, + encoder.traitsCache_); +} + +/** For types that define `withTuple`, decode the type. + + @see note on {@link #withTupleEncodeHelper} + */ +template +void +withTupleDecodeHelper(TChoice& c, cryptoconditions::der::Decoder& decoder) +{ + TraitsCache dummy; // traits cache is not used in decoding + c.withTuple([&decoder](auto&& tup) { decoder >> tup; }, + dummy); +} + +/** For types that define `withTuple`, find the length, in bytes, of the encoded content. + + @see note on {@link #withTupleEncodeHelper} + */ +template +std::uint64_t +withTupleEncodedLengthHelper( + TChoice const& c, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) +{ + std::uint64_t result = 0; + boost::optional thisGroupType(GroupType::sequence); + c.withTuple( + [&](auto const& tup) { + using T = std::decay_t; + using Traits = cryptoconditions::der::DerCoderTraits; + result = + Traits::length(tup, thisGroupType, encoderTagMode, traitsCache); + }, + traitsCache); + return result; +} + +/** For types that define `withTuple`, compare the type. + + @see note on {@link #withTupleEncodeHelper} + */ +template +int +withTupleCompareHelper( + TChoiceDerived const& lhs, + TChoiceBase const& rhs, + TraitsCache& traitsCache) +{ + auto const lhsType = lhs.type(); + auto const rhsType = rhs.type(); + if (lhsType != rhsType) + { + if (lhsType < rhsType) + return -1; + return 1; + } + + auto const pRhs = dynamic_cast(&rhs); + if (!pRhs) + { + assert(0); + return -1; + } + + int result = 0; + lhs.withTuple( + [&](auto const& lhsTup) { + pRhs->withTuple( + [&](auto const& rhsTup) { + using traits = + DerCoderTraits>; + result = traits::compare(lhsTup, rhsTup, traitsCache); + }, + traitsCache); + }, + traitsCache); + return result; +} + + +} // der +} // cryptoconditions +} // ripple + +#endif diff --git a/src/ripple/conditions/impl/DerPrimitiveTraits.h b/src/ripple/conditions/impl/DerPrimitiveTraits.h new file mode 100644 index 00000000000..442c3cdc835 --- /dev/null +++ b/src/ripple/conditions/impl/DerPrimitiveTraits.h @@ -0,0 +1,1610 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_CONDITIONS_DERPRIMITIVETRAITS_H +#define RIPPLE_CONDITIONS_DERPRIMITIVETRAITS_H + +#include +#include +#include +#include // must come before encoder and decoder +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace ripple { +namespace cryptoconditions { +namespace der { + +/** base class for DerCoderTraits for integer types + + @see {@link #DerCoderTraits} +*/ +struct IntegerTraits +{ + constexpr static + ClassId + classId() + { + return ClassId::universal; + } + + constexpr static + GroupType + groupType() + { + return GroupType::integer; + } + + static + boost::optional const& + tagNum() + { + static boost::optional tn{tagInteger}; + return tn; + } + + template + static + std::uint8_t + tagNum(T) + { + return tagInteger; + } + + constexpr static + bool + primitive() + { + return true; + } + + template + static + std::uint64_t + length(T const& v) + { + const auto isSigned = std::numeric_limits::is_signed; + if (!v || (isSigned && v == -1)) + return 1; + + std::uint64_t n = sizeof(v); + signed char toSkip = (isSigned && v < 0) ? 0xff : 0; + // skip leading 0xff for negative signed, otherwise skip leading zeros + // when skipping 0xff, the next octet's high bit must be set + // when skipping 0, the first octet's high bit must not be set + while (n--) + { + auto const c = static_cast((v >> (n * 8)) & 0xff); + if (c == toSkip && + !(isSigned && v < 0 && n && + (static_cast((v >> ((n - 1) * 8)) & 0xff) >= 0))) + continue; + + if (v > 0 && c < 0) + return n + 2; + else + return n + 1; + } + assert(0); // will never happen + return 1; + } + + template + static + std::uint64_t + length( + T const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + return length(v); + } + + template + static + void + encode(Encoder& s, T v) + { + if (s.subgroups_.empty()) + { + s.ec_ = make_error_code(Error::logicError); + return; + } + + auto& parentSlice = s.parentSlice(); + + if (!v) + { + if (parentSlice.empty()) + { + s.ec_ = make_error_code(Error::logicError); + return; + } + parentSlice.push_back(0); + return; + } + + boost::optional parentGroupType; + if (!s.subgroups_.empty()) + parentGroupType.emplace(s.subgroups_.top().groupType()); + std::size_t n = length(v, parentGroupType, s.tagMode_, s.traitsCache_); + if (parentSlice.size() != n) + { + s.ec_ = make_error_code(Error::logicError); + return; + } + while (n--) + { + if (n >= sizeof(T)) + parentSlice.push_back(static_cast(0)); + else + parentSlice.push_back(static_cast((v >> (n * 8)) & 0xFF)); + } + } + + template + static + void + decode(Decoder& decoder, T& v) + { + auto& slice = decoder.parentSlice(); + std::error_code& ec = decoder.ec_; + + if (slice.empty()) + { + // can never have zero sized integers + ec = make_error_code(Error::contentLengthMismatch); + return; + } + + const bool isSigned = std::numeric_limits::is_signed; + // unsigned types may have a leading zero octet + const size_t maxLength = isSigned ? sizeof(T) : sizeof(T) + 1; + if (slice.size() > maxLength) + { + ec = make_error_code(Error::integerBounds); + return; + } + + if (!isSigned && (slice[0] & (1 << 7))) + { + // trying to decode a negative number into a positive value + ec = make_error_code(Error::integerBounds); + return; + } + + if (!isSigned && slice.size() == sizeof(T) + 1 && slice[0]) + { + // since integers are coded as two's complement, the first byte may + // be zero for unsigned reps + ec = make_error_code(Error::integerBounds); + return; + } + + v = 0; + for (size_t i = 0; i < slice.size(); ++i) + v = (v << 8) | (slice[i] & 0xff); + + if (isSigned && (slice[0] & (1 << 7))) + { + for (int i = slice.size(); i < sizeof(T); ++i) + v |= (T(0xff) << (8 * i)); + } + slice += slice.size(); + } + + template + static + int + compare(T const& lhs, T const& rhs, TraitsCache& traitsCache) + { + if (lhs >= 0 && rhs >= 0) + { + // fast common case + // since the length is encoded, comparing the values directly will be + // the same as comparing the encoded values + return (lhs > rhs) - (lhs < rhs); + } + auto const lhsL = length(lhs); + auto const rhsL = length(rhs); + if (lhsL != rhsL) + { + if (lhsL < rhsL) + return -1; + return 1; + } + + // lengths are equal + auto n = std::min(lhsL, sizeof(T) - 1); + while (n--) + { + auto const lhsV = (static_cast((lhs >> (n * 8)) & 0xFF)); + auto const rhsV = (static_cast((rhs >> (n * 8)) & 0xFF)); + if (lhsV != rhsV) + { + if (lhsV < rhsV) + return -1; + return 1; + } + } + + return 0; + } +}; + +template <> +struct DerCoderTraits : IntegerTraits +{ +}; +template <> +struct DerCoderTraits : IntegerTraits +{ +}; +template <> +struct DerCoderTraits : IntegerTraits +{ +}; +template <> +struct DerCoderTraits : IntegerTraits +{ +}; +template <> +struct DerCoderTraits : IntegerTraits +{ +}; +template <> +struct DerCoderTraits : IntegerTraits +{ +}; +template <> +struct DerCoderTraits : IntegerTraits +{ +}; +template <> +struct DerCoderTraits : IntegerTraits +{ +}; + +//------------------------------------------------------------------------------ + +/** base class for DerCoderTraits for types that will be coded as ASN.1 octet + strings + + @see {@link #DerCoderTraits} + + @note this includes std::string and std::array, Buffer, and + boost small_vector +*/ +struct OctetStringTraits +{ + constexpr static + ClassId + classId() + { + return ClassId::universal; + } + + constexpr static + GroupType + groupType() + { + return GroupType::octetString; + } + + static + boost::optional const& + tagNum() + { + static boost::optional tn{tagOctetString}; + return tn; + } + + template + static + std::uint8_t + tagNum(T const&) + { + return tagOctetString; + } + + constexpr static + bool + primitive() + { + return true; + } + +protected: + static + void + encode(Encoder& encoder, Slice s) + { + if (s.empty()) + return; + + auto& parentSlice = encoder.parentSlice(); + if (parentSlice.size() != s.size()) + { + encoder.ec_ = make_error_code(Error::logicError); + return; + } + memcpy(parentSlice.data(), s.data(), s.size()); + parentSlice += s.size(); + } + + static + void + decode(Decoder& decoder, void* dstData, std::size_t dstSize) + { + auto& slice = decoder.parentSlice(); + std::error_code& ec = decoder.ec_; + + if (dstSize != slice.size()) + { + ec = make_error_code(Error::contentLengthMismatch); + return; + } + + if (!slice.empty()) + memcpy(dstData, slice.data(), slice.size()); + + slice += slice.size(); + } +}; + +template <> +struct DerCoderTraits : OctetStringTraits +{ + static + void + encode(Encoder& encoder, std::string const& s) + { + OctetStringTraits::encode(encoder, makeSlice(s)); + } + + static + void + decode(Decoder& decoder, std::string& v) + { + auto& slice = decoder.parentSlice(); + v.resize(slice.size()); + if (!v.empty()) + OctetStringTraits::decode(decoder, &v[0], v.size()); + } + + static + std::uint64_t + length( + std::string const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + return v.size(); + } + + static + int + compare( + std::string const& lhs, + std::string const& rhs, + TraitsCache& traitsCache) + { + auto const lhsL = lhs.size(); + auto const rhsL = rhs.size(); + if (lhsL != rhsL) + { + if (lhsL < rhsL) + return -1; + return 1; + } + return lhs.compare(rhs); + } +}; + +template +struct DerCoderTraits> : OctetStringTraits +{ + static + void + encode(Encoder& encoder, std::array const& s) + { + OctetStringTraits::encode(encoder, makeSlice(s)); + } + + static + void + decode(Decoder& decoder, std::array& v) + { + OctetStringTraits::decode(decoder, v.data(), v.size()); + } + + static + std::uint64_t + length( + std::array const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + return S; + } + + static + int + compare( + std::array const& lhs, + std::array const& rhs, + TraitsCache& traitsCache) + { + for(size_t i=0; i +struct DerCoderTraits> : OctetStringTraits +{ + static void + encode( + Encoder& encoder, + boost::container::small_vector const& s) + { + OctetStringTraits::encode(encoder, makeSlice(s)); + } + + static + void + decode(Decoder& decoder, boost::container::small_vector& v) + { + auto& slice = decoder.parentSlice(); + v.resize(slice.size()); + if (!v.empty()) + OctetStringTraits::decode(decoder, v.data(), v.size()); + } + + static + std::uint64_t + length( + boost::container::small_vector const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + return v.size(); + } + + static + int + compare( + boost::container::small_vector const& lhs, + boost::container::small_vector const& rhs, + TraitsCache& traitsCache) + { + if (lhs.size() != rhs.size()) + { + if (lhs.size() < rhs.size()) + return -1; + return 1; + } + auto const s = lhs.size(); + for (size_t i = 0; i < s; ++i) + { + if (lhs[i] != rhs[i]) + { + if (lhs[i] < rhs[i]) + return -1; + return 1; + } + } + return 0; + } +}; + +template <> +struct DerCoderTraits : OctetStringTraits +{ + static + void + encode(Encoder& encoder, Buffer const& b) + { + OctetStringTraits::encode(encoder, b); + } + + static + void + decode(Decoder& decoder, Buffer& v) + { + auto& slice = decoder.parentSlice(); + v.alloc(slice.size()); + if (!v.empty()) + OctetStringTraits::decode(decoder, v.data(), v.size()); + } + + static + std::uint64_t + length( + Buffer const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + return v.size(); + } + + static + int + compare(Buffer const& lhs, Buffer const& rhs, TraitsCache& traitsCache) + { + if (lhs.size() != rhs.size()) + { + if (lhs.size() < rhs.size()) + return -1; + return 1; + } + auto const s = lhs.size(); + auto const lhsD = lhs.data(); + auto const rhsD = rhs.data(); + for (size_t i = 0; i < s; ++i) + { + if (lhsD[i] != rhsD[i]) + { + if (lhsD[i] < rhsD[i]) + return -1; + return 1; + } + } + return 0; + } +}; + +/** Wrapper for a size constrained DER OctetString + + The size of the string must be equal to the specified constraint. + */ +template +struct OctetStringCheckEqualSize +{ + T& col_; + std::size_t constraint_; + OctetStringCheckEqualSize(T& col, std::size_t s) : col_{col}, constraint_{s} + { + } +}; + +/** Wrapper for a size constrained DER OctetString + + The size of the string must be less than the specified constraint. + */ +template +struct OctetStringCheckLessSize +{ + T& col_; + std::size_t constraint_; + OctetStringCheckLessSize(T& col, std::size_t s) : col_{col}, constraint_{s} + { + } +}; + +/** convenience function to create an equal-size constrained octet string + + @note the template parameter T must be one of the types OctetStringTraits is + specialized on. @see {@link #OctetStringTraits} +*/ +template +OctetStringCheckEqualSize +make_octet_string_check_equal(T& t, std::size_t s) +{ + return OctetStringCheckEqualSize(t, s); +} + +/** convenience function to create a "less size" constrained octet string + + @note the template parameter T must be one of the types OctetStringTraits is + specialized on. @see {@link #OctetStringTraits} +*/ +template +OctetStringCheckLessSize +make_octet_string_check_less(T& t, std::size_t s) +{ + return OctetStringCheckLessSize(t, s); +} + +/** DerCoderTraits for types that will be coded as "equal size" constrained + ASN.1 octet strings + + @see {@link #DerCoderTraits} + @see {@link #make_octet_string_check_equal} +*/ +template +struct DerCoderTraits> : OctetStringTraits +{ + static + void + encode(Encoder& encoder, OctetStringCheckEqualSize const& v) + { + DerCoderTraits::encode(encoder, v.col_); + } + + static + void + decode(Decoder& decoder, OctetStringCheckEqualSize& v) + { + auto& slice = decoder.parentSlice(); + if (slice.size() != v.constraint_) + { + decoder.ec_ = make_error_code(Error::contentLengthMismatch); + return; + } + DerCoderTraits::decode(decoder, v.col_); + } + + static + std::uint64_t + length( + OctetStringCheckEqualSize const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + return DerCoderTraits::length(v.col_, parentGroupType, encoderTagMode, traitsCache); + } + + static + int + compare(T const& lhs, T const& rhs, TraitsCache& traitsCache) + { + return DerCoderTraits::compare(lhs, rhs, traitsCache); + } +}; + +/** DerCoderTraits for types that will be coded as "less size" constrained ASN.1 + octet strings + + @see {@link #DerCoderTraits} +*/ +template +struct DerCoderTraits> : OctetStringTraits +{ + static + void + encode(Encoder& encoder, OctetStringCheckLessSize const& v) + { + DerCoderTraits::encode(encoder, v.col_); + } + + static + void + decode(Decoder& decoder, OctetStringCheckLessSize& v) + { + auto& slice = decoder.parentSlice(); + if (slice.size() > v.constraint_) + { + // Return unsupported rather than contentLengthMismatch + // because this constraint is an implementation limit rather + // than a parser constraint + decoder.ec_ = make_error_code(Error::unsupported); + return; + } + DerCoderTraits::decode(decoder, v.col_); + } + + static + std::uint64_t + length( + OctetStringCheckLessSize const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + return DerCoderTraits::length( + v.col_, parentGroupType, encoderTagMode, traitsCache); + } + + static + int + compare(T const& lhs, T const& rhs, TraitsCache& traitsCache) + { + return DerCoderTraits::compare(lhs, rhs, traitsCache); + } +}; + +//------------------------------------------------------------------------------ + +/** DerCoderTraits for std::bitset + + bitsets will be coded as ans.1 bitStrings + + @see {@link #DerCoderTraits} + @see {@link #make_octet_string_check_less} +*/ +template +struct DerCoderTraits> +{ + constexpr static std::uint8_t mod8 = S % 8; + constexpr static std::uint8_t const minUnusedBits = mod8 ? 8 - mod8 : 0; + constexpr static std::uint8_t const maxBytes = mod8 ? 1 + S / 8 : S / 8; + + constexpr static + GroupType + groupType() + { + return GroupType::bitString; + } + + constexpr static + ClassId + classId() + { + return ClassId::universal; + } + + static + boost::optional const& + tagNum() + { + static boost::optional tn{tagBitString}; + return tn; + } + + static + std::uint8_t + tagNum(std::bitset const&) + { + return tagBitString; + } + + constexpr static + bool + primitive() + { + return true; + } + + static + std::uint8_t + reverseBits(std::uint8_t b) + { + static constexpr std::uint8_t lut[256] = + { + 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, + 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, + 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, + 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, + 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, + 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, + 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, + 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, + 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, + 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, + 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, + 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, + 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, + 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, + 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, + 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF + }; + return lut[b]; + } + + /** return the number of leading zero bytes before the last byte + + @note If no bits are set on a 64-bit integer, this function returns 7 + _not_ 8 because DER will always consider the last byte, even if it is + zero. + */ + static + std::uint64_t + numLeadingZeroBytes(std::bitset const& s) + { + auto const result = numLeadingZeroChunks<8>(s.to_ulong(), maxBytes); + // Always consider the last byte, even if it is zero + return std::min(result, maxBytes - 1); + } + + static + std::uint8_t + numUnusedBits( + std::bitset const& s, + std::size_t leadingZeroBytes) + { + // b is first non-zero byte + auto const bits = s.to_ulong (); + std::uint8_t const b = + (bits >> (maxBytes - leadingZeroBytes - 1) * 8) & 0xff; + if (b & 0x80) + return 0; + if (b & 0x40) + return 1; + if (b & 0x20) + return 2; + if (b & 0x10) + return 3; + if (b & 0x08) + return 4; + if (b & 0x04) + return 5; + if (b & 0x02) + return 6; + if (b & 0x01) + return 7; + // DER always considers the last bit, even if no bits are set + return 7; + } + + static + void + encode(Encoder& encoder, std::bitset const& s) + { + static_assert( + maxBytes > 0 && maxBytes <= sizeof(unsigned long), + "Unsupported bitset size"); + + auto& parentSlice = encoder.parentSlice(); + auto const bits = s.to_ulong(); + + if (bits == 0) + { + if (parentSlice.size() != 2) + { + encoder.ec_ = make_error_code(Error::logicError); + return; + } + parentSlice.push_back(7); + parentSlice.push_back(0); + return; + } + + std::size_t const leadingZeroBytes = numLeadingZeroBytes(s); + std::uint8_t const unusedBits = numUnusedBits(s, leadingZeroBytes); + + if (parentSlice.size() != 1 + maxBytes - leadingZeroBytes) + { + encoder.ec_ = make_error_code(Error::logicError); + return; + } + + parentSlice.push_back(unusedBits); + + for (size_t curByte = 0; curByte < maxBytes - leadingZeroBytes; ++curByte) + { + uint8_t const v = (bits >> curByte * 8) & 0xff; + parentSlice.push_back(reverseBits(v)); + } + } + + static + void + decode(Decoder& decoder, std::bitset& v) + { + static_assert( + maxBytes > 0 && maxBytes <= sizeof(unsigned long), + "Unsupported bitset size"); + + auto& slice = decoder.parentSlice(); + std::error_code& ec = decoder.ec_; + + if (slice.empty() || slice.size() > maxBytes + 1) + { + ec = make_error_code(Error::contentLengthMismatch); + return; + } + + auto const unused = slice[0]; + slice += 1; + + if (unused < minUnusedBits) + { + ec = make_error_code(Error::contentLengthMismatch); + return; + } + + if (unused >= 8) + { + ec = make_error_code(Error::badDerEncoding); + return; + } + + unsigned long bits = 0; + auto const numBytes = slice.size(); + size_t curByteIndex = 0; + for (; !slice.empty(); ++curByteIndex, slice += 1) + { + std::uint8_t const curByte = reverseBits(slice[0]); + bits |= curByte << (curByteIndex * 8); + + if ((curByteIndex == numBytes - 1) && unused) + { + // check last byte for correct zero padding + std::uint8_t const mask = 0xff & ~((1 << (8 - unused)) - 1); + if (curByte & mask) + { + // last byte has incorrect padding + ec = make_error_code(Error::badDerEncoding); + return; + } + } + } + + v = bits; + } + + static + std::uint64_t + length( + std::bitset const& s, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + static_assert( + maxBytes > 0 && maxBytes <= sizeof(unsigned long), + "Unsupported bitset size"); + auto const bits = s.to_ulong(); + + if (bits == 0) + { + return 2; + } + + std::size_t const leadingZeroBytes = numLeadingZeroBytes(s); + // +1 to store unusedBits + return 1 + maxBytes - leadingZeroBytes; + } + + static + int + compare( + std::bitset const& lhs, + std::bitset const& rhs, + TraitsCache& traitsCache) + { + static_assert( + maxBytes > 0 && maxBytes <= sizeof(unsigned long), + "Unsupported bitset size"); + unsigned long const bits[2] = {lhs.to_ulong(), rhs.to_ulong()}; + + std::size_t const leadingZeroBytes[2]{ + numLeadingZeroBytes (lhs), numLeadingZeroBytes (rhs)}; + + if (leadingZeroBytes[0] != leadingZeroBytes[1]) + { + if (leadingZeroBytes[0] < leadingZeroBytes[1]) + // when leadingZeroBytes is less, size will be greater + return 1; + return -1; + } + + std::uint8_t const unusedBits[2]{ + numUnusedBits (lhs, leadingZeroBytes[0]), + numUnusedBits (rhs, leadingZeroBytes[1])}; + + if (unusedBits[0] != unusedBits[1]) + { + if (unusedBits[0] < unusedBits[1]) + return -1; + return 1; + } + + // leadingZeroBytes and unusedBits are equal + for (size_t curByte = 0; curByte < maxBytes - leadingZeroBytes[0]; + ++curByte) + { + uint8_t const v[2] = { + reverseBits(static_cast((bits[0] >> curByte * 8) & 0xff)), + reverseBits(static_cast((bits[1] >> curByte * 8) & 0xff))}; + if (v[0] != v[1]) + { + if (v[0] < v[1]) + return -1; + return 1; + } + } + return 0; + } +}; + +//------------------------------------------------------------------------------ + +/** wrapper class for coding c++ collections as ans.1 sets + + @see {@link #SequenceWrapper} for the wrapper for sequences + @see {@link #make_set} for the convenience factory function + + @note There are two types of collections in ans.1 - sets and sequences. + Given a c++ collection - i.e. a std::vector - the coders need to know + if the collection should be coded as a set or a sequence. This class + is the way to tell the coder which collection to use. + */ +template +struct SetOfWrapper +{ + using value_type = typename T::value_type; + + T& col_; + boost::container::small_vector sortOrder_; + + /** wrap the collection as a DER set + + @param col Collection to wrap + @param sorted Flag that determines if the collection is already sorted + */ + SetOfWrapper(T& col, TraitsCache& traitsCache, bool sorted = false) + : col_(col), sortOrder_(col.size()) + { + if (auto const cached = traitsCache.sortOrder(&col)) + { + sortOrder_ = *cached; + return; + } + + // contains the indexes into subChoices_ so if the elements will be + // sorted if accessed in the order specified by sortIndex_ + std::iota(sortOrder_.begin(), sortOrder_.end(), 0); + if (!sorted) + { + std::sort( + sortOrder_.begin(), + sortOrder_.end(), + [&col, &traitsCache](std::size_t lhs, std::size_t rhs) { + using Traits = cryptoconditions::der::DerCoderTraits< + std::decay_t>; + return Traits::compare(col[lhs], col[rhs], traitsCache) < 0; + }); + traitsCache.sortOrder(&col, sortOrder_); + } + } +}; + +//------------------------------------------------------------------------------ + +/** wrapper class for coding c++ collections as ans.1 sets + + @see {@link #make_sequence} for the convenience factory function + @see {@link #SetOfWrapper} for the wrapper for sets + + @note There are two types of collections in ans.1 - sets and sequences. + Given a c++ collection - i.e. a std::vector - the coders need to know + if the collection should be coded as a set or a sequence. This class + is the way to tell the coder which collection to use. + */ +template +struct SequenceOfWrapper +{ + /** the collection being wrapped + + @note col_ may be a homogeneous collection like vector or a heterogeneous + collection like tuple + */ + T& col_; + SequenceOfWrapper(T& col) : col_(col) + { + } +}; + +//------------------------------------------------------------------------------ + +/** convenience function to wrap a c++ collection as it will be coded as an ASN.1 set + + @param col Collection to wrap + @param sorted Flag that determines if the collection is already sorted + + @{ + */ +template +SetOfWrapper +make_set(T& t, TraitsCache& traitsCache, bool sorted = false) +{ + return SetOfWrapper(t, traitsCache, sorted); +} + +template +SetOfWrapper +make_set(T& t, Encoder& encoder, bool sorted = false) +{ + return SetOfWrapper(t, encoder.traitsCache_, sorted); +} + +template +SetOfWrapper +make_set(T& t, Decoder& decoder, bool sorted = false) +{ + TraitsCache dummy; // cache traits are not used in decoding + return SetOfWrapper(t, dummy, sorted); +} +/** @} */ + +/// convenience function to wrap a c++ collection as it will be coded as an ASN.1 sequence +template +auto +make_sequence(T& t) +{ + return SequenceOfWrapper(t); +} + +/// convenience function to wrap a c++ tuple as it will be coded as an ASN.1 sequence +template +auto +make_sequence(std::tuple& t) +{ + return SequenceOfWrapper>(t); +} + +//------------------------------------------------------------------------------ + +/** DerCoderTraits for types that will be coded as ASN.1 sets + + @see {@link #DerCoderTraits} + @see {@link #make_set} + @see {@link #SetOfWrapper} +*/ +template +struct DerCoderTraits> +{ + constexpr static GroupType + groupType() + { + return GroupType::set; + } + + constexpr static ClassId + classId() + { + return ClassId::universal; + } + + static boost::optional const& + tagNum() + { + static boost::optional tn{tagSet}; + return tn; + } + + static + std::uint8_t + tagNum(SetOfWrapper const&) + { + return tagSet; + } + + constexpr static + bool + primitive() + { + return false; + } + + static + void + encode(Encoder& encoder, SetOfWrapper const& v) + { + for(auto const i : v.sortOrder_) + { + encoder << v.col_[i]; + if (encoder.ec()) + return; + } + } + + static + void + decode(Decoder& decoder, SetOfWrapper& v) + { + v.col_.clear(); + + auto& slice = decoder.parentSlice(); + + while (!slice.empty()) + { + typename T::value_type val{}; + decoder >> val; + if (decoder.ec()) + return; + v.col_.emplace_back(std::move(val)); + } + } + + static + std::uint64_t + length( + SetOfWrapper const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + using ValueTraits = DerCoderTraits; + std::uint64_t l = 0; + boost::optional const thisGroupType(groupType()); + std::uint64_t childNum = 0; + for (auto const& e : v.col_) + { + l += totalLength( + e, thisGroupType, encoderTagMode, traitsCache, childNum); + ++childNum; + } + return l; + } + + static + int + compare( + SetOfWrapper const& lhs, + SetOfWrapper const& rhs, + TraitsCache& traitsCache) + { + auto const lhsSize = lhs.col_.size(); + auto const rhsSize = rhs.col_.size(); + + if (lhsSize != rhsSize) + { + if (lhsSize < rhsSize) + return -1; + return 1; + } + + auto const& lhsSortOrder = lhs.sortOrder_; + auto const& rhsSortOrder = rhs.sortOrder_; + + using elementType = std::decay_t; + // sizes are equal + for (size_t i = 0; i < lhsSize; ++i) + { + auto const r = DerCoderTraits::compare( + lhs.col_[lhsSortOrder[i]], + rhs.col_[rhsSortOrder[i]], + traitsCache); + if (r != 0) + return r; + } + + return (lhsSize > rhsSize) - (lhsSize < rhsSize); + } +}; + +//------------------------------------------------------------------------------ + +/** DerCoderTraits for types that will be coded as ASN.1 sequences + + @see {@link #DerCoderTraits} + @see {@link #make_sequence} + @see {@link #SequenceOfWrapper} +*/ +template +struct DerCoderTraits> +{ + constexpr static + GroupType + groupType() + { + return GroupType::sequence; + } + + constexpr static + ClassId + classId() + { + return ClassId::universal; + } + + static + boost::optional const& + tagNum() + { + static boost::optional tn{tagSequence}; + return tn; + } + + static + std::uint8_t + tagNum(SequenceOfWrapper const&) + { + return tagSequence; + } + + constexpr static + bool + primitive() + { + return false; + } + + static + void + encode(Encoder& encoder, SequenceOfWrapper const& v) + { + for (auto const& e : v.col_) + { + encoder << e; + if (encoder.ec()) + return; + } + } + + static + void + decode(Decoder& decoder, SequenceOfWrapper& v) + { + v.col_.clear(); + + auto& slice = decoder.parentSlice(); + + while (!slice.empty()) + { + typename T::value_type val; + decoder >> val; + if (decoder.ec()) + return; + v.col_.emplace_back(std::move(val)); + } + } + + static + std::uint64_t + length( + SequenceOfWrapper const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + using ValueTraits = DerCoderTraits; + std::uint64_t l = 0; + boost::optional thisGroupType(groupType()); + std::uint64_t childNum = 0; + for (auto const& e : v.col_) + { + l += totalLength( + e, thisGroupType, encoderTagMode, traitsCache, childNum); + ++childNum; + } + return l; + } + + static + int + compare( + SequenceOfWrapper const& lhs, + SequenceOfWrapper const& rhs, + TraitsCache& traitsCache) + { + auto const lhsSize = lhs.col_.size(); + auto const rhsSize = rhs.col_.size(); + if (lhsSize != rhsSize) + { + if (lhsSize < rhsSize) + return -1; + return 1; + } + + // sizes are equal + using elementType = std::decay_t; + for (size_t i = 0; i < lhsSize; ++i) + { + auto const r = DerCoderTraits::compare( + lhs.col_[i], rhs.col_[i], traitsCache); + if (r != 0) + return r; + } + + return 0; + } +}; + +//------------------------------------------------------------------------------ + +/** DerCoderTraits for std::tuples + + @note tuples will be decoded as ans.1 sequences + + @see {@link #DerCoderTraits} +*/ +template +struct DerCoderTraits> +{ + using Tuple = std::tuple; + + constexpr static + GroupType + groupType() + { + return GroupType::autoSequence; + } + + constexpr static + ClassId + classId() + { + return ClassId::universal; + } + + static + boost::optional const& + tagNum() + { + static boost::optional tn{tagSequence}; + return tn; + } + + static + std::uint8_t + tagNum(Tuple const&) + { + return tagSequence; + } + + constexpr static bool + primitive() + { + return false; + } + + template + static + void + forEachElement( + Tuple const& elements, + std::index_sequence, + F&& f) + { + // Sean Parent for_each_argument trick + (void)std::array{ + {(f(std::get(elements)), 0)...}}; + } + + template + static + void + forEachIndex( + std::index_sequence, + F&& f) + { + // Sean Parent for_each_argument trick + (void)std::array{ + {(f(std::integral_constant{}), 0)...}}; + } + + template + static + void + decodeElementsHelper( + Decoder& decoder, + Tuple const& elements, + std::index_sequence) + { + // Sean Parent for_each_argument trick + (void)std::array{ + {((decoder >> std::get(elements)), 0)...}}; + } + + static + void + encode(Encoder& encoder, Tuple const& elements) + { + forEachElement( + elements, + std::index_sequence_for{}, + [&encoder](auto const& e) { encoder << e; }); + } + + static + void + decode(Decoder& decoder, Tuple const& elements) + { + forEachElement( + elements, std::index_sequence_for{}, + [&decoder](auto& e) {decoder >> e;}); + } + + static + std::uint64_t + length( + Tuple const& elements, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + std::uint64_t l = 0; + boost::optional thisGroupType(groupType()); + forEachIndex(std::index_sequence_for{}, [&](auto indexParam) { + // visual studio can't handle index as a constexpr + constexpr typename decltype(indexParam)::value_type index = + decltype(indexParam)::value; + auto const& e = std::get(elements); + using ElementTraits = DerCoderTraits>; + std::uint64_t childNum = index; + l += totalLength( + e, thisGroupType, encoderTagMode, traitsCache, childNum); + }); + return l; + } + + template + static + void + compareElementsHelper( + T const& lhs, + T const& rhs, + TraitsCache& traitsCache, + int* cmpResult) + { + if (*cmpResult) + return; + *cmpResult = DerCoderTraits::compare(lhs, rhs, traitsCache); + } + + template + static + int + compareElementsHelper( + Tuple const& lhs, + Tuple const& rhs, + TraitsCache& traitsCache, + std::index_sequence) + { + int result = 0; + // Sean Parent for_each_argument trick + (void)std::array{ + {((compareElementsHelper(std::get(lhs), std::get(rhs), traitsCache, &result)), 0)...}}; + return result; + } + + static int + compare(Tuple const& lhs, Tuple const& rhs, TraitsCache& traitsCache) + { + { + // compare lengths even though the parent tag or tag mode are + // unknown. Hard coding no parent tag and automatic tag mode + // will still reveal differences in length. + auto const lhsL = length(lhs, boost::none, TagMode::automatic, traitsCache); + auto const rhsL = length(rhs, boost::none, TagMode::automatic, traitsCache); + if (lhsL != rhsL) + { + if (lhsL < rhsL) + return -1; + return 1; + } + } + return compareElementsHelper( + lhs, rhs, traitsCache, std::index_sequence_for{}); + } +}; + +} // der +} // cryptoconditions +} // ripple + +#endif diff --git a/src/ripple/conditions/impl/DerTraits.cpp b/src/ripple/conditions/impl/DerTraits.cpp new file mode 100644 index 00000000000..1d1f2e58162 --- /dev/null +++ b/src/ripple/conditions/impl/DerTraits.cpp @@ -0,0 +1,64 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include + +namespace ripple { +namespace cryptoconditions { +namespace der { + +boost::optional +TraitsCache::length(void const* addr) const +{ + auto const i = lengthCache_.find(addr); + if (i != lengthCache_.end()) + return i->second; + return boost::none; +} + +void +TraitsCache::length(void const* addr, size_t l) +{ + if (lengthCache_.empty()) + lengthCache_.reserve(32); + lengthCache_[addr] = l; +} + +boost::optional> +TraitsCache::sortOrder(void const* addr) const +{ + auto const i = sortOrderCache_.find(addr); + if (i != sortOrderCache_.end()) + return i->second; + return boost::none; +} + +void +TraitsCache::sortOrder( + void const* addr, + boost::container::small_vector const& so) +{ + if (sortOrderCache_.empty()) + sortOrderCache_.reserve(32); + sortOrderCache_[addr] = so; +} + +} // der +} // ripple +} // cryptoconditions diff --git a/src/ripple/conditions/impl/DerTraits.h b/src/ripple/conditions/impl/DerTraits.h new file mode 100644 index 00000000000..b69e640080a --- /dev/null +++ b/src/ripple/conditions/impl/DerTraits.h @@ -0,0 +1,285 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_CONDITIONS_DERTRAITS_H +#define RIPPLE_CONDITIONS_DERTRAITS_H + +#include +#include +#include + +namespace ripple { +namespace cryptoconditions { +namespace der { + +struct Encoder; +struct Decoder; + +enum TagType { + tagBoolean = 1, + tagInteger = 2, + tagBitString = 3, + tagOctetString = 4, + tagNull = 5, + tagObjectIdentifier = 6, + tagReal = 9, + tagEnumerated = 10, + tagUtf8String = 12, + tagSequence = 16, + tagSet = 17 +}; + +/** Type of the group. + + @note Sometimes this matches the ASN.1 tag number, but not always. In + particular, a coder in "auto" mode may use different tags, and some of + these types (`autoSequence`, `sequenceChild`, `choice`, and `fuzzRoot`) + will never match the tag type. However, the coders need to know the + additional information, such as when a parent group is a sequence, or an + autoSequence. +*/ + +enum class GroupType { + boolean = tagBoolean, + integer = tagInteger, + bitString = tagBitString, + octetString = tagOctetString, + null = tagNull, + objectIdentifier = tagObjectIdentifier, + real = tagReal, + enumerated = tagEnumerated, + utf8String = tagUtf8String, + sequence = tagSequence, + set = tagSet, + + // The following are never tag ids. + + // a sequence that has auto generated tag numbers + autoSequence = 252, + // a child in an autogenerated sequence. This is useful as the parent when + // the child is a "choice" + sequenceChild = 253, + choice = 254, + // used in fuzz testing only + fuzzRoot = 255 +}; + +/** ASN.1 class ids + */ +enum class ClassId { universal, application, contextSpecific, priv }; + +/** The coder's tag mode. + */ +enum class TagMode { + /** direct corresponds to ASN.1's `explicit`. Tags will not be automatically assigned. + + @note `explicit` is a c++ keyword, so an alternate name must be used. + */ + direct, + /// Tags will be automatically assigned + automatic +}; + +/** cache for values that need to be repeatedly computed, and may be expensive to compute. + + @note the cache assume address of the object will not change. This is _not_ + true of some of the wrapper types (SetOfWrapper and + SequenceOfWrapper), however it should be true of the collection being + wrapped. In these cases, the address of the collection should be used + as the key. It is not necessary to cache all types. Primitive types do + not need to be cached, as their parents will be cached. + */ +class TraitsCache +{ + /** Collection of content lengths for the value at the given address */ + boost::container::flat_map lengthCache_; + + /** Collection of sort orders (for der sets) for the value at the give address */ + boost::container::flat_map> + sortOrderCache_; + +public: + /** Get the cached content length for the value at the given address + + @result If the value is stored in the cache, an optional set to the + stored value, otherwise boost::none + */ + boost::optional + length(void const* addr) const; + + /** Set the cached content length for the value at the given address + */ + void + length(void const* addr, size_t l); + + /** Get the cached content sort order for the value at the given address + + @result If the value is stored in the cache, an optional set to the + stored value, otherwise boost::none + + @note sort order is only used for der sets + */ + boost::optional> + sortOrder(void const* addr) const; + + /** Set the cached content sort order for the value at the given address + + @note sort order is only used for der sets + */ + void + sortOrder( + void const* addr, + boost::container::small_vector const& so); +}; + +/** Interface for serializing and deserializing types into a der coder. + + Types that serialized into a der coder need to specialize a `DerCoderTraits` + class and provide implementations of each of the member functions described + in this unspecialized class. + + Specialized classes are provided for common C++ types, such as integers, + strings, buffers, bitsets, etc. + + Since there are two types of collections in ans.1 - sets and sequences - some + c++ collections like `std::vector` must be wrapped in the helper functions + `make_sequence` or `make_set` so the coder knows which ASN.1 collection type + to use. `std::tuple` is always coded as an ASN.1 sequence, since 100% of the + cryptocondition use-cases serialized tuples as sequences. + + A typical user type is written as an ASN.1 choice type, where each choice + type is a ASN.1 sequence. This would be implemented in C++ as a class + hierarchy. Each concrete leaf class represents a choice. The trait is written + in terms of a `unique_ptr` to the base class. When decoding, the choice is + used to create the correct concrete leaf class, and the leaf class would + serialize itself by using a `std::tuple` of each member of the sequence. For + example `der_decoder >> std::tuple(member1, member2,...) >> der::eos;` + Encoding is similar: the correct choice is written to the der stream, then + the data members are serialized using a `std::tuple`. For example: + `der_encoder << std::tuple(member1, member2,...) << der::eos;`. Since + encoding and decoding are almost always exact copies, except decoding uses + `operator>>` while encoding uses `operator<<`, the der encoders offer + `operator&` which will decode when using a decoder, and encode with using an + encoder (boost serialization library uses the same operator). Using this + operator, both the encoder and decoder may be written as `coder & + std::tuple(member1, member2,...) & der::eos;`. + + + @note This unspecialized class should never be instantiated. If it is, a + `static_assert` will fire. A specialized `DerCoderTraits` must be provided + for each class that is to be serialized. + */ +template +struct DerCoderTraits +{ + static_assert( + sizeof(T) == -1, + "DerCoderTraits must be specialized for this type"); + + /// ans.1 class id + constexpr static + ClassId + classId(); + + /// group type + constexpr static + GroupType + groupType(); + + /** ans.1 tag type, if known. + + The tagNum for choice types can only be known from the actual value being + encoded. In these cases `boost::none` is returned. + */ + static + boost::optional const& + tagNum(); + + /// ans.1 tag type for this given value. + template + static + std::uint8_t + tagNum(TT); + + /** return true if this type is an ASN.1 primitive. return false if this + type is an ASN.1 constructed type. + */ + constexpr static + bool + primitive(); + + /** return the number of bytes required to encode the value, not including + the preamble + + @param v the value to find the length of + @param parentGroupType type of the parent group. + @param encoderTagMode tag mode of the encoder. + @param traitsCache cache some values that need to be repeatably computed, + and may be expensive to compute. Some value types will cache lengths and + sort orders, other values types will not cache any values. + @param childNumber if this value is stored in a set or a sequence, the child number of + this value. This is needed to compute the tag size. + + @note Choice parents groups in automatic tag mode are treated specially. + */ + template + static + std::uint64_t + length( + TT const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache, + boost::optional const& childNumber=boost::none); + + /// serialize the value into the encoder + template + static + void + encode(Encoder& s, TT v); + + /// deserialize the value from the decoder + template + static + void + decode(Decoder& decoder, TT& v); + + /** compare two values so they sort appropriately for an ASN.1 set. Returns a + value less than 0 if lhsrhs + + @param lhs first value to compare + @param rhs second value to compare + @param traitsCache cache some values that need to be repeatedly computed, + and may be expensive to compute. Some value types will cache lengths and + sort orders, other values types will not cache any values. + + @note ASN.1 lexagraphically compares how the values would be encoded. + ASN.1 encodes in big endian order. + */ + static + int + compare(T const& lhs, T const& rhs, TraitsCache& traitsCache); +}; + +} // der +} // cryptoconditions +} // ripple + +#endif diff --git a/src/ripple/conditions/impl/Ed25519.cpp b/src/ripple/conditions/impl/Ed25519.cpp new file mode 100644 index 00000000000..3091c2b199d --- /dev/null +++ b/src/ripple/conditions/impl/Ed25519.cpp @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include + +#include + +namespace ripple { +namespace cryptoconditions { + +void +Ed25519::encodeFingerprint(der::Encoder& encoder) const +{ + encoder << std::tie(publicKey_); +} + +bool +Ed25519::validate(Slice data) const +{ + return ed25519_sign_open( + data.data(), + data.size(), + publicKey_.data(), + signature_.data()) == 0; +} + +std::uint64_t +Ed25519::derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleEncodedLengthHelper( + *this, parentGroupType, encoderTagMode, traitsCache); +} + +void +Ed25519::encode(cryptoconditions::der::Encoder& encoder) const +{ + cryptoconditions::der::withTupleEncodeHelper(*this, encoder); +} + +void +Ed25519::decode(cryptoconditions::der::Decoder& decoder) +{ + cryptoconditions::der::withTupleDecodeHelper(*this, decoder); +} + +bool +Ed25519::checkEqualForTesting(Fulfillment const& rhs) const +{ + if (auto c = dynamic_cast(&rhs)) + return c->publicKey_ == publicKey_ && c->signature_ == signature_; + return false; +} + +int +Ed25519::compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleCompareHelper( + *this, rhs, traitsCache); +} + + +bool +Ed25519::validationDependsOnMessage() const +{ + return true; +} + +} +} diff --git a/src/ripple/conditions/impl/Ed25519.h b/src/ripple/conditions/impl/Ed25519.h new file mode 100644 index 00000000000..90305dbbefc --- /dev/null +++ b/src/ripple/conditions/impl/Ed25519.h @@ -0,0 +1,131 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_CONDITIONS_ED25519_H +#define RIPPLE_CONDITIONS_ED25519_H + +#include +#include +#include +#include +#include + +#include +#include + +namespace ripple { +namespace cryptoconditions { + +/** Fulfillment for an Ed25519 cryptocondition. + + An Ed25519 condition specifies an Ed25519 public key. The fulfillment + contains a signature of cryptocondition message. + */ +class Ed25519 final : public Fulfillment +{ + static std::size_t constexpr signature_size_ = 64; + static std::size_t constexpr pubkey_size_ = 32; + + std::array publicKey_; + std::array signature_; + + void + encodeFingerprint(der::Encoder& encoder) const override; + + bool + checkEqualForTesting(Fulfillment const& rhs) const override; + + bool + validationDependsOnMessage() const override; + +public: + Ed25519(der::Constructor const&) noexcept {}; + + Ed25519() = delete; + + explicit + Ed25519( + std::array const& publicKey, + std::array const& signature) + : publicKey_(publicKey), signature_(signature) + { + } + + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) + { + f(std::tie(publicKey_, signature_)); + } + + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) const + { + f(std::tie(publicKey_, signature_)); + } + + Type + type() const override + { + return Type::ed25519Sha256; + } + + std::array + fingerprint(std::error_code& ec) const override + { + return Fulfillment::fingerprint(ec); + } + + bool + validate(Slice data) const override; + + std::uint32_t + cost() const override + { + // see crypto-conditions spec: + // https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#page-27 + return 131072; + } + + std::bitset<5> + subtypes() const override + { + return std::bitset<5>{}; + } + + void + encode(der::Encoder& encoder) const override; + + void + decode(der::Decoder& decoder) override; + + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, + der::TraitsCache& traitsCache) const override; + + int + compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const override; +}; +} +} + +#endif diff --git a/src/ripple/conditions/impl/Fulfillment.cpp b/src/ripple/conditions/impl/Fulfillment.cpp index cbb658573b2..005595adec2 100644 --- a/src/ripple/conditions/impl/Fulfillment.cpp +++ b/src/ripple/conditions/impl/Fulfillment.cpp @@ -18,47 +18,126 @@ //============================================================================== #include +#include #include +#include +#include #include -#include +#include +#include +#include + #include #include + #include #include namespace ripple { namespace cryptoconditions { -bool -match ( - Fulfillment const& f, - Condition const& c) +namespace der { + +void +DerCoderTraits>:: +encode( + Encoder& encoder, + std::unique_ptr const& f) { - // Fast check: the fulfillment's type must match the - // conditions's type: - if (f.type() != c.type) - return false; + assert(f); + f->encode(encoder); +} - // Derive the condition from the given fulfillment - // and ensure that it matches the given condition. - return c == f.condition(); +void +DerCoderTraits>:: +decode(Decoder& decoder, std::unique_ptr& v) +{ + if (decoder.parentSlice().size() > Fulfillment::maxSerializedFulfillment) + { + decoder.ec_ = Error::largeSize; + return; + } + + auto const parentTag = decoder.parentTag(); + if (!parentTag) + { + decoder.ec_ = make_error_code(Error::logicError); + return; + } + + if (parentTag->classId != classId()) + { + decoder.ec_ = make_error_code(Error::preambleMismatch); + return; + } + + if (parentTag->tagNum > static_cast(Type::last)) + { + decoder.ec_ = make_error_code(Error::preambleMismatch); + return; + } + + switch (parentTag->tagNum) + { + case static_cast(Type::preimageSha256): + v = std::make_unique(der::constructor); + break; + case static_cast(Type::prefixSha256): + v = std::make_unique(der::constructor); + break; + case static_cast(Type::thresholdSha256): + v = std::make_unique(der::constructor); + break; + case static_cast(Type::rsaSha256): + v = std::make_unique(der::constructor); + break; + case static_cast(Type::ed25519Sha256): + v = std::make_unique(der::constructor); + break; + default: + decoder.ec_ = Error::unsupportedType; + } + + if (!v) + return; + v->decode(decoder); + + if (decoder.ec_) + v.reset(); } -bool -validate ( - Fulfillment const& f, - Condition const& c, - Slice m) +std::uint64_t +DerCoderTraits>:: +length( + std::unique_ptr const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) { - return match (f, c) && f.validate (m); + if (auto cached = traitsCache.length(v.get())) + return *cached; + + auto const l = v->derEncodedLength(parentGroupType, encoderTagMode, traitsCache); + if (encoderTagMode == TagMode::automatic) + { + traitsCache.length(v.get(), l); + return l; + } + + static_assert( + static_cast(Type::last) < 30, + "Tag will no longer fit in a byte"); + auto const result = 1 + l + contentLengthLength(l); + traitsCache.length(v.get(), result); + return result; } -bool -validate ( - Fulfillment const& f, - Condition const& c) +} // der + +Condition +Fulfillment::condition(std::error_code& ec) const { - return validate (f, c, {}); + return {type(), cost(), fingerprint(ec), subtypes()}; } std::unique_ptr @@ -66,96 +145,86 @@ Fulfillment::deserialize( Slice s, std::error_code& ec) { - // Per the RFC, in a fulfillment we choose a type based - // on the tag of the item we contain: - // - // Fulfillment ::= CHOICE { - // preimageSha256 [0] PreimageFulfillment , - // prefixSha256 [1] PrefixFulfillment, - // thresholdSha256 [2] ThresholdFulfillment, - // rsaSha256 [3] RsaSha256Fulfillment, - // ed25519Sha256 [4] Ed25519Sha512Fulfillment - // } - - if (s.empty()) - { - ec = error::buffer_empty; - return nullptr; - } - using namespace der; - auto const p = parsePreamble(s, ec); - if (ec) - return nullptr; + std::unique_ptr v; - // All fulfillments are context-specific, constructed types - if (!isConstructed(p) || !isContextSpecific(p)) - { - ec = error::malformed_encoding; - return nullptr; - } - - if (p.length > s.size()) + der::Decoder decoder(s, der::TagMode::automatic); + decoder >> v >> der::eos; + ec = decoder.ec_; + if (ec) { - ec = error::buffer_underfull; return {}; } - if (p.length < s.size()) - { - ec = error::buffer_overfull; - return {}; - } + return v; +} - if (p.length > maxSerializedFulfillment) +std::array +Fulfillment::fingerprint(std::error_code& ec) const +{ + der::Encoder encoder{der::TagMode::automatic}; + encodeFingerprint(encoder); + encoder << der::eos; + + if (encoder.ec_) { - ec = error::large_size; + ec = encoder.ec_; return {}; } - std::unique_ptr f; - - switch (static_cast(p.tag)) - { - case Type::preimageSha256: - f = PreimageSha256::deserialize(Slice(s.data(), p.length), ec); - if (ec) - return {}; - s += p.length; - break; - - case Type::prefixSha256: - ec = error::unsupported_type; + auto const& encoded = encoder.serializationBuffer(ec); + if (ec) return {}; - break; - case Type::thresholdSha256: - ec = error::unsupported_type; - return {}; - break; + sha256_hasher h; + h(encoded.data(), encoded.size()); + return static_cast(h); +} - case Type::rsaSha256: - ec = error::unsupported_type; - return {}; - break; +std::bitset<5> +Fulfillment::selfAndSubtypes() const +{ + std::bitset<5> result; + result.set(static_cast(type())); + result |= subtypes(); + return result; +} - case Type::ed25519Sha256: - ec = error::unsupported_type; - return {}; +bool +match ( + Fulfillment const& f, + Condition const& c) +{ + // Fast check: the fulfillment's type must match the + // conditions's type: + if (f.type() != c.type) + return false; - default: - ec = error::unknown_type; - return {}; - } + // Derive the condition from the given fulfillment + // and ensure that it matches the given condition. + std::error_code ec; + auto const result = c == f.condition(ec); + if (ec) + return false; + return result; +} - if (!s.empty()) - { - ec = error::trailing_garbage; - return {}; - } +bool +validate ( + Fulfillment const& f, + Condition const& c, + Slice m) +{ + return match (f, c) && f.validate (m); +} - return f; +bool +validate ( + Fulfillment const& f, + Condition const& c) +{ + return validate (f, c, {}); } } diff --git a/src/ripple/conditions/impl/PrefixSha256.cpp b/src/ripple/conditions/impl/PrefixSha256.cpp new file mode 100644 index 00000000000..492694c9c30 --- /dev/null +++ b/src/ripple/conditions/impl/PrefixSha256.cpp @@ -0,0 +1,169 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include +#include +#include +#include + +#include +#include + +namespace ripple { +namespace cryptoconditions { + +PrefixSha256::PrefixSha256( + Slice prefix, + std::uint64_t maxLength, + std::unique_ptr subfulfillment) + : maxMessageLength_(maxLength) + , subfulfillment_(std::move(subfulfillment)) +{ + prefix_.resize(prefix.size()); + std::copy(prefix.data(), prefix.data() + prefix.size(), prefix_.data()); +} + +std::array +PrefixSha256::fingerprint(std::error_code& ec) const +{ + if (!subfulfillment_) + { + assert(0); + ec = der::Error::logicError; + return {}; + }; + + return Fulfillment::fingerprint(ec); +} + +void +PrefixSha256::encodeFingerprint(der::Encoder& encoder) const +{ + if (!subfulfillment_) + { + assert(0); + encoder.ec_ = der::Error::logicError; + return; + }; + + auto const cond = subfulfillment_->condition(encoder.ec_); + if (encoder.ec_) + return; + encoder << std::tie(prefix_, maxMessageLength_, cond); +} + +bool +PrefixSha256::validate(Slice data) const +{ + if (data.size() > maxMessageLength_) + return false; + + if (!subfulfillment_) + { + assert(0); + return false; + } + boost::container::small_vector appendedData(prefix_.size() + data.size()); + std::copy( + prefix_.data(), prefix_.data() + prefix_.size(), appendedData.data()); + std::copy( + data.data(), + data.data() + data.size(), + appendedData.data() + prefix_.size()); + return subfulfillment_->validate(makeSlice(appendedData)); +} + +std::uint32_t +PrefixSha256::cost() const +{ + if (!subfulfillment_) + { + assert(0); + return std::numeric_limits::max(); + }; + + return prefix_.size() + maxMessageLength_ + subfulfillment_->cost() + 1024; +} + +std::bitset<5> +PrefixSha256::subtypes() const +{ + if (subfulfillment_) + { + auto result = subfulfillment_->selfAndSubtypes(); + result[static_cast(type())] = 0; + return result; + } + return std::bitset<5>{}; +} + +std::uint64_t +PrefixSha256::derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, + der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleEncodedLengthHelper( + *this, parentGroupType, encoderTagMode, traitsCache); +} + +void +PrefixSha256::encode(cryptoconditions::der::Encoder& encoder) const +{ + cryptoconditions::der::withTupleEncodeHelper(*this, encoder); +} + +void +PrefixSha256::decode(cryptoconditions::der::Decoder& decoder) +{ + cryptoconditions::der::withTupleDecodeHelper(*this, decoder); +} + +bool +PrefixSha256::checkEqualForTesting(Fulfillment const& rhs) const +{ + auto c = dynamic_cast(&rhs); + if (!c) + return false; + if (!(c->prefix_ == prefix_ && c->maxMessageLength_ == maxMessageLength_ && + bool(c->subfulfillment_) == bool(subfulfillment_))) + return false; + if (subfulfillment_ && !c->subfulfillment_->checkEqualForTesting(*subfulfillment_)) + return false; + return true; +} + +int +PrefixSha256::compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleCompareHelper(*this, rhs, traitsCache); +} + +bool +PrefixSha256::validationDependsOnMessage() const +{ + if (!subfulfillment_) + return false; + // Note: this isn't quite true: Since the maxMessageLength_ is enforced, + // PrefixSha256 always depends on the message + return subfulfillment_->validationDependsOnMessage(); +} + +} +} diff --git a/src/ripple/conditions/impl/PrefixSha256.h b/src/ripple/conditions/impl/PrefixSha256.h new file mode 100644 index 00000000000..fb19e7d2428 --- /dev/null +++ b/src/ripple/conditions/impl/PrefixSha256.h @@ -0,0 +1,116 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_CONDITIONS_PREFIX_SHA256_H +#define RIPPLE_CONDITIONS_PREFIX_SHA256_H + +#include +#include +#include +#include + +#include + +#include + +namespace ripple { +namespace cryptoconditions { + +/** Fulfillment for a prefix cryptocondition A prefix adds a specified prefix to + the cryptocondition's message, and sends that new message to the specified + sub-fulfillment. + */ +class PrefixSha256 final : public Fulfillment +{ + /// prefix to add to the subcondition's message + boost::container::small_vector prefix_; + std::uint64_t maxMessageLength_ = 0; + /// subfulfillment used to verify the newly created message + std::unique_ptr subfulfillment_; + + void + encodeFingerprint(der::Encoder& encoder) const override; + + bool + checkEqualForTesting(Fulfillment const& rhs) const override; + + bool + validationDependsOnMessage() const override; + +public: + PrefixSha256(der::Constructor const&) noexcept {}; + + PrefixSha256() = delete; + + PrefixSha256( + Slice prefix, + std::uint64_t maxLength, + std::unique_ptr subfulfillment); + + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) + { + f(std::tie(prefix_, maxMessageLength_, subfulfillment_)); + } + + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) const + { + f(std::tie(prefix_, maxMessageLength_, subfulfillment_)); + } + + Type + type() const override + { + return Type::prefixSha256; + } + + std::array + fingerprint(std::error_code& ec) const override; + + bool + validate(Slice data) const override; + + std::uint32_t + cost() const override; + + std::bitset<5> + subtypes() const override; + + void + encode(der::Encoder& encoder) const override; + + void + decode(der::Decoder& decoder) override; + + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, + der::TraitsCache& traitsCache) const override; + + int + compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const override; +}; +} +} + +#endif diff --git a/src/ripple/conditions/impl/PreimageSha256.cpp b/src/ripple/conditions/impl/PreimageSha256.cpp new file mode 100644 index 00000000000..bca325d12d1 --- /dev/null +++ b/src/ripple/conditions/impl/PreimageSha256.cpp @@ -0,0 +1,116 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ripple { +namespace cryptoconditions { + +std::array +PreimageSha256::fingerprint(std::error_code& ec) const +{ + sha256_hasher h; + h(preimage_.data(), preimage_.size()); + return static_cast(h); +} + +void +PreimageSha256::encodeFingerprint(der::Encoder& encoder) const +{ + // PrefixSha256's fingerprint is not DER encoded + assert(0); +} + +std::uint32_t +PreimageSha256::cost() const +{ + return static_cast(preimage_.size()); +} + +std::bitset<5> +PreimageSha256::subtypes() const +{ + return std::bitset<5>{}; +} + +bool PreimageSha256::validate(Slice) const +{ + // the message is not relevant. + return true; +} + +std::uint64_t +PreimageSha256::derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleEncodedLengthHelper( + *this, parentGroupType, encoderTagMode, traitsCache); +} + +void +PreimageSha256::encode(cryptoconditions::der::Encoder& encoder) const +{ + cryptoconditions::der::withTupleEncodeHelper(*this, encoder); +} + +void +PreimageSha256::decode(der::Decoder& decoder) +{ + if (decoder.parentSlice().size() > maxPreimageLength) + { + decoder.ec_ = der::Error::preimageTooLong; + return; + } + + cryptoconditions::der::withTupleDecodeHelper(*this, decoder); +} + + +bool +PreimageSha256::checkEqualForTesting(Fulfillment const& rhs) const +{ + if (auto c = dynamic_cast(&rhs)) + return c->preimage_ == preimage_; + return false; + +} + +int +PreimageSha256::compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleCompareHelper(*this, rhs, traitsCache); +} + + +bool +PreimageSha256::validationDependsOnMessage() const +{ + return false; +} + +} +} diff --git a/src/ripple/conditions/impl/PreimageSha256.h b/src/ripple/conditions/impl/PreimageSha256.h index 704ad5a4805..a11cf665f15 100644 --- a/src/ripple/conditions/impl/PreimageSha256.h +++ b/src/ripple/conditions/impl/PreimageSha256.h @@ -24,15 +24,19 @@ #include #include #include -#include -#include -#include +#include namespace ripple { namespace cryptoconditions { -class PreimageSha256 final - : public Fulfillment +/** Fullfillment for a preimage cryptocondition + + A preimage has a condition that is a sha256 hash and a fulfillment with a + payload that will hash to the specified hash in the condition. + + @note a preimage does not depend on the cryptocondition message. + */ +class PreimageSha256 final : public Fulfillment { public: /** The maximum allowed length of a preimage. @@ -46,110 +50,86 @@ class PreimageSha256 final */ static constexpr std::size_t maxPreimageLength = 128; - /** Parse the payload for a PreimageSha256 condition +private: + boost::container::small_vector preimage_; - @param s A slice containing the DER encoded payload - @param ec indicates success or failure of the operation - @return the preimage, if successful; empty pointer otherwise. - */ - static - std::unique_ptr - deserialize( - Slice s, - std::error_code& ec) - { - // Per the RFC, a preimage fulfulliment is defined as - // follows: - // - // PreimageFulfillment ::= SEQUENCE { - // preimage OCTET STRING - // } - - using namespace der; - - auto p = parsePreamble(s, ec); - if (ec) - return nullptr; - - if (!isPrimitive(p) || !isContextSpecific(p)) - { - ec = error::incorrect_encoding; - return {}; - } - - if (p.tag != 0) - { - ec = error::unexpected_tag; - return {}; - } - - if (s.size() != p.length) - { - ec = error::trailing_garbage; - return {}; - } - - if (s.size() > maxPreimageLength) - { - ec = error::preimage_too_long; - return {}; - } - - auto b = parseOctetString(s, p.length, ec); - if (ec) - return {}; - - return std::make_unique(std::move(b)); - } + void + encodeFingerprint(der::Encoder& encoder) const override; -private: - Buffer payload_; + bool + checkEqualForTesting(Fulfillment const& rhs) const override; + bool + validationDependsOnMessage() const override; public: - PreimageSha256(Buffer&& b) noexcept - : payload_(std::move(b)) - { - } + PreimageSha256(der::Constructor const&) noexcept {}; - PreimageSha256(Slice s) noexcept - : payload_(s) + template + explicit + PreimageSha256( + boost::container::small_vector b) noexcept + : preimage_(std::move(b)) { } - Type - type() const override + explicit + PreimageSha256(Slice s) { - return Type::preimageSha256; + preimage_.resize(s.size()); + std::copy(s.data(), s.data() + s.size(), preimage_.data()); } - Buffer - fingerprint() const override + explicit + PreimageSha256(Buffer const& b) + : PreimageSha256(Slice(b)) { - sha256_hasher h; - h(payload_.data(), payload_.size()); - auto const d = static_cast(h); - return{ d.data(), d.size() }; } - std::uint32_t - cost() const override + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) { - return static_cast(payload_.size()); + f(std::tie(preimage_)); } - Condition - condition() const override + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) const { - return { type(), cost(), fingerprint() }; + f(std::tie(preimage_)); } - bool - validate(Slice) const override + Type + type() const override { - // Perhaps counterintuitively, the message isn't - // relevant. - return true; + return Type::preimageSha256; } + + std::array + fingerprint(std::error_code& ec) const override; + + std::uint32_t + cost() const override; + + std::bitset<5> + subtypes() const override; + + bool validate(Slice) const override; + + void + encode(der::Encoder& encoder) const override; + + void + decode(der::Decoder& decoder) override; + + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, + der::TraitsCache& traitsCache) const override; + + int + compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const override; }; } diff --git a/src/ripple/conditions/impl/RsaSha256.cpp b/src/ripple/conditions/impl/RsaSha256.cpp new file mode 100644 index 00000000000..e24a1998bd6 --- /dev/null +++ b/src/ripple/conditions/impl/RsaSha256.cpp @@ -0,0 +1,212 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +namespace ripple { +namespace cryptoconditions { + +namespace detail { + +struct rsa_deleter +{ + void + operator()(RSA* rsa) const + { + RSA_free(rsa); + } +}; + +using RsaKey = std::unique_ptr; + +struct bn_deleter +{ + void + operator()(BIGNUM* bn) const + { + BN_free(bn); + } +}; + +using BigNum = std::unique_ptr; + +// Check whether the public modulus meets the length +// requirements imposed by section 4.4.1 of the RFC. +bool +checkModulusLength(int len) +{ + if (len <= 0) + return false; + + return len == boost::algorithm::clamp(len, 128, 512); +} + +bool +validateHelper(RSA* key, Slice message, Slice signature) +{ + int const keySize = RSA_size(key); + if (!checkModulusLength(keySize)) + return false; + + Buffer buf; + + auto ret = RSA_public_decrypt( + keySize, signature.data(), buf.alloc(keySize), key, RSA_NO_PADDING); + + if (ret == -1) + return false; + + sha256_hasher h; + h(message.data(), message.size()); + auto digest = static_cast(h); + + return RSA_verify_PKCS1_PSS( + key, digest.data(), EVP_sha256(), buf.data(), -1) == 1; +} +} + +RsaSha256::RsaSha256(Slice m, Slice s) +{ + modulus_.resize(m.size()); + std::copy(m.data(), m.data() + m.size(), modulus_.data()); + + signature_.resize(s.size()); + std::copy(s.data(), s.data() + s.size(), signature_.data()); +} + +std::array +RsaSha256::fingerprint(std::error_code& ec) const +{ + return Fulfillment::fingerprint(ec); +} + +void +RsaSha256::encodeFingerprint(der::Encoder& encoder) const +{ + // modulus must be greater than 128 bytes and less than or equal to 512 bytes + encoder << std::tie(modulus_); +} + +bool +RsaSha256::validate(Slice data) const +{ + if (modulus_.empty() || signature_.empty()) + return false; + + detail::RsaKey rsa(RSA_new()); + + rsa->n = BN_new(); + BN_bin2bn(modulus_.data(), modulus_.size(), rsa->n); + + rsa->e = BN_new(); + BN_set_word(rsa->e, 65537); + + return detail::validateHelper(rsa.get(), data, makeSlice(signature_)); +} + +std::uint32_t +RsaSha256::cost() const +{ + auto const mSize = modulus_.size(); + if (mSize >= 65535) + // would overflow + return std::numeric_limits::max(); + return mSize * mSize; +} + +std::bitset<5> +RsaSha256::subtypes() const +{ + return std::bitset<5>{}; +} + +std::uint64_t +RsaSha256::derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, + der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleEncodedLengthHelper( + *this, parentGroupType, encoderTagMode, traitsCache); +} + +void +RsaSha256::encode(cryptoconditions::der::Encoder& encoder) const +{ + // modulus must be greater than 128 bytes and less than or equal to 512 bytes + if (modulus_.size() <= 128 || modulus_.size() > 512) + { + encoder.ec_ = + der::make_error_code(der::Error::rsaModulusSizeRangeError); + return; + } + cryptoconditions::der::withTupleEncodeHelper(*this, encoder); +} + +void +RsaSha256::decode(cryptoconditions::der::Decoder& decoder) +{ + cryptoconditions::der::withTupleDecodeHelper(*this, decoder); + // modulus must be greater than 128 bytes and less than or equal to 512 bytes + if (modulus_.size() <= 128 || modulus_.size() > 512) + { + decoder.ec_ = + der::make_error_code(der::Error::rsaModulusSizeRangeError); + return; + } +} + +bool +RsaSha256::checkEqualForTesting(Fulfillment const& rhs) const +{ + if (auto c = dynamic_cast(&rhs)) + return c->modulus_ == modulus_ && c->signature_ == signature_; + return false; + +} + +int +RsaSha256::compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleCompareHelper(*this, rhs, traitsCache); +} + + +bool +RsaSha256::validationDependsOnMessage() const +{ + return true; +} + +} +} diff --git a/src/ripple/conditions/impl/RsaSha256.h b/src/ripple/conditions/impl/RsaSha256.h new file mode 100644 index 00000000000..661dbcab9c4 --- /dev/null +++ b/src/ripple/conditions/impl/RsaSha256.h @@ -0,0 +1,120 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_CONDITIONS_RSA_SHA256_H +#define RIPPLE_CONDITIONS_RSA_SHA256_H + +#include +#include +#include +#include + +namespace ripple { +namespace cryptoconditions { + +/** Fulfillment for a RsaSha256 cryptocondition. + + A RsaSha256 condition specifies an RsaSha256 public key (the modulus). The + fulfillment contains a signature of cryptocondition message. +*/ +class RsaSha256 final : public Fulfillment +{ + boost::container::small_vector modulus_; + boost::container::small_vector signature_; + + void + encodeFingerprint(der::Encoder& encoder) const override; + + bool + checkEqualForTesting(Fulfillment const& rhs) const override; + + bool + validationDependsOnMessage() const override; + +public: + RsaSha256(der::Constructor const&) noexcept {}; + + RsaSha256() = delete; + + template + RsaSha256( + boost::container::small_vector m, + boost::container::small_vector s) + : modulus_{std::move(m)}, signature_{std::move(s)} + { + } + + RsaSha256(Slice m, Slice s); + RsaSha256(Buffer const& m, Buffer const& s) + : RsaSha256{Slice(m), Slice(s)} + { + } + + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) + { + f(std::tie(modulus_, signature_)); + } + + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) const + { + f(std::tie(modulus_, signature_)); + } + + Type + type() const override + { + return Type::rsaSha256; + } + + std::array + fingerprint(std::error_code& ec) const override; + + bool + validate(Slice data) const override; + + std::uint32_t + cost() const override; + + std::bitset<5> + subtypes() const override; + + void + encode(der::Encoder& encoder) const override; + + void + decode(der::Decoder& decoder) override; + + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, + der::TraitsCache& traitsCache) const override; + + int + compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const override; +}; + +} +} + +#endif diff --git a/src/ripple/conditions/impl/ThresholdSha256.cpp b/src/ripple/conditions/impl/ThresholdSha256.cpp new file mode 100644 index 00000000000..26272c87ac3 --- /dev/null +++ b/src/ripple/conditions/impl/ThresholdSha256.cpp @@ -0,0 +1,207 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include +#include + +#include + +#include +#include +#include + +namespace ripple { +namespace cryptoconditions { + +ThresholdSha256::ThresholdSha256( + std::vector> subfulfillments, + std::vector subconditions) +{ + subfulfillments_.reserve(subfulfillments.size()); + subconditions_.reserve(subconditions.size()); + for(auto&& f : subfulfillments) + subfulfillments_.push_back(std::move(f)); + for(auto&& c : subconditions) + subconditions_.push_back(std::move(c)); +} + +std::array +ThresholdSha256::fingerprint(std::error_code& ec) const +{ + return Fulfillment::fingerprint(ec); +} + +void +ThresholdSha256::encodeFingerprint(der::Encoder& encoder) const +{ + std::uint16_t const threshold = + static_cast(subfulfillments_.size()); + if (!cachedAllConditions) + { + cachedAllConditions.emplace(); + cachedAllConditions->reserve( + subfulfillments_.size() + subconditions_.size()); + for (auto const& f : subfulfillments_) + { + cachedAllConditions->push_back(f->condition(encoder.ec_)); + if (encoder.ec_) + return; + } + for (auto const& c : subconditions_) + cachedAllConditions->push_back(c); + } + auto conditionsSet = + der::make_set(*cachedAllConditions, encoder.traitsCache_); + encoder << std::tie(threshold, conditionsSet); +} + +bool +ThresholdSha256::validate(Slice data) const +{ + for (auto const& f : subfulfillments_) + if (!f || !f->validate(data)) + return false; + return true; +} + +std::uint32_t +ThresholdSha256::cost() const +{ + boost::container::small_vector subcosts; + subcosts.reserve(subconditions_.size() + subfulfillments_.size()); + for (auto const& c : subconditions_) + subcosts.push_back(c.cost); + for (auto const& f : subfulfillments_) + subcosts.push_back(f->cost()); + size_t const threshold = subfulfillments_.size(); + std::nth_element( + subcosts.begin(), subcosts.end() - threshold, subcosts.end()); + std::uint64_t const result = + std::accumulate(subcosts.end() - threshold, subcosts.end(), 0ull) + + 1024 * (subfulfillments_.size() + subconditions_.size()); + if (result > std::numeric_limits::max()) + return std::numeric_limits::max(); + return static_cast(result); +} + +std::bitset<5> +ThresholdSha256::subtypes() const +{ + std::bitset<5> result; + for (auto const& s : subconditions_) + result |= s.selfAndSubtypes(); + for (auto const& s : subfulfillments_) + result |= s->selfAndSubtypes(); + result[static_cast(type())] = 0; + return result; +} + +std::uint64_t +ThresholdSha256::derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, + der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleEncodedLengthHelper( + *this, parentGroupType, encoderTagMode, traitsCache); +} + +void +ThresholdSha256::encode(cryptoconditions::der::Encoder& encoder) const +{ + cryptoconditions::der::withTupleEncodeHelper(*this, encoder); +} + +void +ThresholdSha256::decode(cryptoconditions::der::Decoder& decoder) +{ + cryptoconditions::der::withTupleDecodeHelper(*this, decoder); +} + +bool +ThresholdSha256::checkEqualForTesting(Fulfillment const& rhs) const +{ + auto c = dynamic_cast(&rhs); + if (!c) + return false; + if (c->subfulfillments_.size() != subfulfillments_.size() || + c->subconditions_.size() != subconditions_.size()) + return false; + + { + boost::dynamic_bitset<> foundEqual(subfulfillments_.size()); + for (size_t i = 0; i < subfulfillments_.size(); ++i) + { + for (size_t j = 0; j < subfulfillments_.size(); ++j) + { + if (foundEqual[j]) + continue; + + if (c->subfulfillments_[i]->checkEqualForTesting(*subfulfillments_[j])) + { + foundEqual.set(j); + break; + } + } + } + if (!foundEqual.all()) + return false; + } + + { + boost::dynamic_bitset<> foundEqual(subconditions_.size()); + for (size_t i = 0; i < subconditions_.size(); ++i) + { + for (size_t j = 0; j < subconditions_.size(); ++j) + { + if (foundEqual[j]) + continue; + + if (c->subconditions_[i] == subconditions_[j]) + { + foundEqual.set(j); + break; + } + } + } + if (!foundEqual.all()) + return false; + } + + return true; +} + +int +ThresholdSha256::compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleCompareHelper(*this, rhs, traitsCache); +} + +bool +ThresholdSha256::validationDependsOnMessage() const +{ + for(auto const& f : subfulfillments_) + if (f->validationDependsOnMessage()) + return true; + + return false; +} + +} +} diff --git a/src/ripple/conditions/impl/ThresholdSha256.h b/src/ripple/conditions/impl/ThresholdSha256.h new file mode 100644 index 00000000000..7565ecc9638 --- /dev/null +++ b/src/ripple/conditions/impl/ThresholdSha256.h @@ -0,0 +1,147 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2017 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_CONDITIONS_THRESHOLD_SHA256_H +#define RIPPLE_CONDITIONS_THRESHOLD_SHA256_H + +#include +#include +#include +#include + +#include + +#include + +namespace ripple { +namespace cryptoconditions { + +/** Fulfillment for an m-of-n collection of fulfillments + + The fulfillment contains a collection of subfulfillments. This is the + threshold (the m in the m-of-n). It also contains a collection of + subconditions. These are the additional conditions that will not be + verified (but of course, are part of the condition). + + @note The number of sub-fulfillments is the m in the m-of-n. The number of + sub-fulfillments plus the number of sub-conditions is the n in the m-of-n. + */ +class ThresholdSha256 final : public Fulfillment +{ + /** Subfulfillments to be verified. The number of subfulfillments is the + threshold (the m in the m-of-n). + */ + boost::container::small_vector, 4> + subfulfillments_; + /** Subconditions that will not be verified (but are part of this object's + condition). + */ + boost::container::small_vector subconditions_; + /** A cache of all the subconditions in this fulfillment. + + @note: This includes the conditions that will be verified (from the + subfulfillments_ collection) plus the conditions that will not be verified + (from the subconditions_ collection). + */ + mutable boost::optional> + cachedAllConditions; + + void + encodeFingerprint(der::Encoder& encoder) const override; + + bool + checkEqualForTesting(Fulfillment const& rhs) const override; + + bool + validationDependsOnMessage() const override; +public: + ThresholdSha256(der::Constructor const&) noexcept {}; + + ThresholdSha256() = delete; + explicit + ThresholdSha256( + std::vector> subfulfillments, + std::vector subconditions); + + template + explicit ThresholdSha256( + boost::container::small_vector, S1> + subfulfillments, + boost::container::small_vector subconditions) + : subfulfillments_(std::move(subfulfillments)) + , subconditions_(std::move(subconditions)) + { + } + + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) + { + auto fulfillmentsSet = der::make_set(subfulfillments_, traitsCache); + auto conditionsSet = der::make_set(subconditions_, traitsCache); + f(std::tie(fulfillmentsSet, conditionsSet)); + } + + template + void + withTuple(F&& f, der::TraitsCache& traitsCache) const + { + auto fulfillmentsSet = der::make_set(subfulfillments_, traitsCache); + auto conditionsSet = der::make_set(subconditions_, traitsCache); + f(std::tie(fulfillmentsSet, conditionsSet)); + } + + Type + type() const override + { + return Type::thresholdSha256; + } + + std::array + fingerprint(std::error_code& ec) const override; + + bool + validate(Slice data) const override; + + std::uint32_t + cost() const override; + + std::bitset<5> + subtypes() const override; + + void + encode(der::Encoder& encoder) const override; + + void + decode(der::Decoder& decoder) override; + + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + der::TagMode encoderTagMode, + der::TraitsCache& traitsCache) const override; + + int + compare(Fulfillment const& rhs, der::TraitsCache& traitsCache) const override; +}; + +} +} + +#endif diff --git a/src/ripple/conditions/impl/error.cpp b/src/ripple/conditions/impl/error.cpp index 668c52244b9..30e231ed9a7 100644 --- a/src/ripple/conditions/impl/error.cpp +++ b/src/ripple/conditions/impl/error.cpp @@ -24,120 +24,109 @@ namespace ripple { namespace cryptoconditions { -namespace detail { +namespace der { -class cryptoconditions_error_category - : public std::error_category +/** Returns an error code. + + This function is used by the implementation to convert + @ref error values into @ref error_code objects. +*/ +static inline std::error_category const& +derCategory() { -public: - const char* - name() const noexcept override - { - return "cryptoconditions"; - } + using error_category = std::error_category; + using error_code = std::error_code; + using error_condition = std::error_condition; - std::string - message(int ev) const override + struct cat_t : public error_category { - switch (static_cast(ev)) + char const* + name() const noexcept override { - case error::unsupported_type: - return "Specification: Requested type not supported."; + return "Der"; + } - case error::unsupported_subtype: - return "Specification: Requested subtype not supported."; + std::string + message(int e) const override + { + switch (static_cast(e)) + { + case Error::integerBounds: + return "integer bounds"; - case error::unknown_type: - return "Specification: Requested type not recognized."; + case Error::longGroup: + return "long group"; - case error::unknown_subtype: - return "Specification: Requested subtypes not recognized."; + case Error::shortGroup: + return "short group"; - case error::fingerprint_size: - return "Specification: Incorrect fingerprint size."; + case Error::badDerEncoding: + return "bad DER encoding"; - case error::incorrect_encoding: - return "Specification: Incorrect encoding."; + case Error::tagOverflow: + return "tag overflow"; - case error::trailing_garbage: - return "Bad buffer: contains trailing garbage."; + case Error::preambleMismatch: + return "preamble mismatch"; - case error::buffer_empty: - return "Bad buffer: no data."; + case Error::contentLengthMismatch: + return "content length mismatch"; - case error::buffer_overfull: - return "Bad buffer: overfull."; + case Error::unknownChoiceTag: + return "unknown choice tag"; - case error::buffer_underfull: - return "Bad buffer: underfull."; + case Error::unsupported: + return "unsupported DER feature"; - case error::malformed_encoding: - return "Malformed DER encoding."; + case Error::largeSize: + return "implementation limit exceeded: large payload."; - case error::unexpected_tag: - return "Malformed DER encoding: Unexpected tag."; + case Error::preimageTooLong: + return "implementation limit exceeded: preimage is too long."; - case error::short_preamble: - return "Malformed DER encoding: Short preamble."; + case Error::rsaModulusSizeRangeError: + return "rsa modulus size is out of range (129 and 512 bytes, inclusive)"; - case error::long_tag: - return "Implementation limit: Overlong tag."; + case Error::unsupportedType: + return "requested type is not supported"; - case error::large_size: - return "Implementation limit: Large payload."; + case Error::logicError: + return "a coding precondition or postcondition was " + "violated"; - case error::preimage_too_long: - return "Implementation limit: Specified preimage is too long."; + default: + return "der error"; + } + } - case error::generic: - default: - return "generic error"; + std::error_condition + default_error_condition(int ev) const noexcept override + { + return std::error_condition{ev, *this}; } - } - std::error_condition - default_error_condition(int ev) const noexcept override - { - return std::error_condition{ ev, *this }; - } + bool + equivalent(int ev, error_condition const& ec) const noexcept override + { + return ec.value() == ev && &ec.category() == this; + } - bool - equivalent( - int ev, - std::error_condition const& condition) const noexcept override - { - return &condition.category() == this && - condition.value() == ev; - } - - bool - equivalent( - std::error_code const& error, - int ev) const noexcept override - { - return &error.category() == this && - error.value() == ev; - } -}; - -inline -std::error_category const& -get_cryptoconditions_error_category() -{ - static cryptoconditions_error_category const cat{}; + bool + equivalent(error_code const& ec, int ev) const noexcept override + { + return ec.value() == ev && &ec.category() == this; + } + }; + static cat_t const cat{}; return cat; } -} // detail - std::error_code -make_error_code(error ev) +make_error_code(Error e) { - return std::error_code { - static_cast::type>(ev), - detail::get_cryptoconditions_error_category() - }; + return std::error_code{static_cast(e), derCategory()}; } } } +} diff --git a/src/ripple/conditions/impl/error.h b/src/ripple/conditions/impl/error.h index e30c14a7768..75dbc59b943 100644 --- a/src/ripple/conditions/impl/error.h +++ b/src/ripple/conditions/impl/error.h @@ -25,43 +25,66 @@ namespace ripple { namespace cryptoconditions { +namespace der { -enum class error -{ - generic = 1, - 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 +/** Error types for ASN.1 DER coders + */ +enum class Error { + /// Integer would not fit in the bounds of the specified type + integerBounds = 1, + /** There is more content data in a group than expected. For example: after + decoding a group from a slice, the slice is not empty. + */ + longGroup, + /** There is less content data in a group than expected. For example: trying to + decode a string of length 10 from a slice of length 9. + */ + shortGroup, + /// Encoding is not a valid DER encoding + badDerEncoding, + /// This implementation only supports tag numbers that will fit in a + /// std::uint64_t + tagOverflow, + /// A decoded preamble did not match an expected preamble + preambleMismatch, + /// A decoded contentLength did not match an expected contentLength + contentLengthMismatch, + /// Choice tag did not match a known type + unknownChoiceTag, + /// Serialization exceeds implementation limit + largeSize, + /// Specified preimage exceeds implementation limit + preimageTooLong, + /// Specified rsa modulus size is out of range (129 and 512 bytes, inclusive) + rsaModulusSizeRangeError, + /// Requested type not supported + unsupportedType, + /// Supported by der, but not this implementation + unsupported, + /** Programming error. For example: detecting more pops than pushes on the + group stack. + */ + logicError }; +/** Convert an error enum to an std::error_code + */ std::error_code -make_error_code(error ev); - -} // cryptoconditions -} // ripple +make_error_code(Error e); +} // der +} // cryptoconditions +} // ripple namespace std { template<> -struct is_error_code_enum +struct is_error_code_enum { static bool const value = true; }; } // std + #endif diff --git a/src/ripple/conditions/impl/utils.h b/src/ripple/conditions/impl/utils.h deleted file mode 100644 index 20b976ffad6..00000000000 --- a/src/ripple/conditions/impl/utils.h +++ /dev/null @@ -1,241 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of rippled: https://github.com/ripple/rippled - Copyright (c) 2016 Ripple Labs Inc. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#ifndef RIPPLE_CONDITIONS_UTILS_H -#define RIPPLE_CONDITIONS_UTILS_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ripple { -namespace cryptoconditions { - -// A collection of functions to decode binary blobs -// encoded with X.690 Distinguished Encoding Rules. -// -// This is a very trivial decoder and only implements -// the bare minimum needed to support PreimageSha256. -namespace der { - -// The preamble encapsulates the DER identifier and -// length octets: -struct Preamble -{ - std::uint8_t type = 0; - std::size_t tag = 0; - std::size_t length = 0; -}; - -inline -bool -isPrimitive(Preamble const& p) -{ - return (p.type & 0x20) == 0; -} - -inline -bool -isConstructed(Preamble const& p) -{ - return !isPrimitive(p); -} - -inline -bool -isUniversal(Preamble const& p) -{ - return (p.type & 0xC0) == 0; -} - -inline -bool -isApplication(Preamble const& p) -{ - return (p.type & 0xC0) == 0x40; -} - -inline -bool -isContextSpecific(Preamble const& p) -{ - return (p.type & 0xC0) == 0x80; -} - -inline -bool -isPrivate(Preamble const& p) -{ - return (p.type & 0xC0) == 0xC0; -} - -inline -Preamble -parsePreamble(Slice& s, std::error_code& ec) -{ - Preamble p; - - if (s.size() < 2) - { - ec = error::short_preamble; - return p; - } - - p.type = s[0] & 0xE0; - p.tag = s[0] & 0x1F; - - s += 1; - - if (p.tag == 0x1F) - { // Long tag form, which we do not support: - ec = error::long_tag; - return p; - } - - p.length = s[0]; - s += 1; - - if (p.length & 0x80) - { // Long form length: - std::size_t const cnt = p.length & 0x7F; - - if (cnt == 0) - { - ec = error::malformed_encoding; - return p; - } - - if (cnt > sizeof(std::size_t)) - { - ec = error::large_size; - return p; - } - - if (cnt > s.size()) - { - ec = error::short_preamble; - return p; - } - - p.length = 0; - - for (std::size_t i = 0; i != cnt; ++i) - p.length = (p.length << 8) + s[i]; - - s += cnt; - - if (p.length == 0) - { - ec = error::malformed_encoding; - return p; - } - } - - return p; -} - -inline -Buffer -parseOctetString(Slice& s, std::uint32_t count, std::error_code& ec) -{ - if (count > s.size()) - { - ec = error::buffer_underfull; - return {}; - } - - if (count > 65535) - { - ec = error::large_size; - return {}; - } - - Buffer b(s.data(), count); - s += count; - return b; -} - -template -Integer -parseInteger(Slice& s, std::size_t count, std::error_code& ec) -{ - Integer v{0}; - - if (s.empty()) - { - // can never have zero sized integers - ec = error::malformed_encoding; - return v; - } - - if (count > s.size()) - { - ec = error::buffer_underfull; - return v; - } - - const bool isSigned = std::numeric_limits::is_signed; - // unsigned types may have a leading zero octet - const size_t maxLength = isSigned ? sizeof(Integer) : sizeof(Integer) + 1; - if (count > maxLength) - { - ec = error::large_size; - return v; - } - - if (!isSigned && (s[0] & (1 << 7))) - { - // trying to decode a negative number into a positive value - ec = error::malformed_encoding; - return v; - } - - if (!isSigned && count == sizeof(Integer) + 1 && s[0]) - { - // since integers are coded as two's complement, the first byte may - // be zero for unsigned reps - ec = error::malformed_encoding; - return v; - } - - v = 0; - for (size_t i = 0; i < count; ++i) - v = (v << 8) | (s[i] & 0xff); - - if (isSigned && (s[0] & (1 << 7))) - { - for (int i = count; i < sizeof(Integer); ++i) - v |= (Integer(0xff) << (8 * i)); - } - s += count; - return v; -} - -} // der -} // cryptoconditions -} // ripple - -#endif diff --git a/src/ripple/unity/conditions.cpp b/src/ripple/unity/conditions.cpp index 54c53bfcae7..af9db4cbff8 100644 --- a/src/ripple/unity/conditions.cpp +++ b/src/ripple/unity/conditions.cpp @@ -20,5 +20,12 @@ #include #include +#include +#include #include +#include +#include +#include +#include +#include #include diff --git a/src/test/app/Escrow_test.cpp b/src/test/app/Escrow_test.cpp index adb861a7717..ed799e3489e 100644 --- a/src/test/app/Escrow_test.cpp +++ b/src/test/app/Escrow_test.cpp @@ -663,10 +663,8 @@ struct Escrow_test : public beast::unit_test::suite 0xD2, 0x82, 0x02, 0x03, 0xC8 }}; - // FIXME: this transaction should, eventually, return temDISABLED - // instead of temMALFORMED. env(condpay("alice", "carol", XRP(1000), makeSlice(cb), T(S{1})), - ter(temMALFORMED)); + ter(temDISABLED)); } } diff --git a/src/test/basics/Slice_test.cpp b/src/test/basics/Slice_test.cpp index 655b8c790d7..bc601e8692a 100644 --- a/src/test/basics/Slice_test.cpp +++ b/src/test/basics/Slice_test.cpp @@ -22,6 +22,7 @@ #include #include #include +#include namespace ripple { namespace test { @@ -109,6 +110,25 @@ struct Slice_test : beast::unit_test::suite } } } + { + testcase ("Mutable"); + boost::container::small_vector mutValues; + mutValues.resize(8); + std::iota(mutValues.begin(), mutValues.end(), 0); + MutableSlice ms{mutValues.data(), mutValues.size()}; + BEAST_EXPECT(mutValues[0] == 0); + *ms.data() = 42; + BEAST_EXPECT(mutValues[0] == 42); + Slice s = ms; // can create an immutable slice from a a mutable slice + BEAST_EXPECT(*s.data() == 42); + s = ms; // can assign an immutable slice from a mutable slice + auto const svs = makeSlice(mutValues); // can create a slice from a boost small vector + + ms.push_back(37); + BEAST_EXPECT(mutValues[0] == 37); + BEAST_EXPECT(*ms.data() == 1); + BEAST_EXPECT(*svs.data() == 37); + } } }; diff --git a/src/test/conditions/ConditionsTestBase.h b/src/test/conditions/ConditionsTestBase.h new file mode 100644 index 00000000000..e003a877bec --- /dev/null +++ b/src/test/conditions/ConditionsTestBase.h @@ -0,0 +1,124 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_TEST_CONDITIONS_CONDITIONSTESTBASE_H_INCLUDED +#define RIPPLE_TEST_CONDITIONS_CONDITIONSTESTBASE_H_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +namespace ripple { +namespace cryptoconditions { + +class ConditionsTestBase : public beast::unit_test::suite +{ +protected: + void + check( + std::unique_ptr expectedF, + std::string const& msg, + std::string encodedFulfillment, + std::string const& encodedCondition, + std::string const& encodedFingerprint) + { + using namespace cryptoconditions::der; + + std::string const badMsg = msg + " bad"; + std::error_code ec; + auto f = Fulfillment::deserialize(makeSlice(encodedFulfillment), ec); + BEAST_EXPECT(f && !ec && f->checkEqualForTesting(*expectedF)); + if (!f) + return; + BEAST_EXPECT(f->validate(makeSlice(msg))); + + if (f->validationDependsOnMessage()) + BEAST_EXPECT(!f->validate(makeSlice(badMsg))); + + auto c1 = Condition::deserialize(makeSlice(encodedCondition), ec); + BEAST_EXPECT(!ec); + BEAST_EXPECT(f->condition(ec) == c1 && !ec); + BEAST_EXPECT(expectedF->condition(ec) == c1 && !ec); + + { + // check fulfillment encodings match + Encoder s{TagMode::automatic}; + s << f << eos; + std::error_code ecSB; + auto const& encoded = s.serializationBuffer(ecSB); + BEAST_EXPECT(!ecSB && makeSlice(encoded) == makeSlice(encodedFulfillment)); + } + if (f->type() != cryptoconditions::Type::preimageSha256) + { + // check condition fingerprint encodings + Encoder s{TagMode::automatic}; + f->encodeFingerprint(s); + s << eos; + std::error_code ecSB; + auto const& encoded = s.serializationBuffer(ecSB); + BEAST_EXPECT(!ecSB && makeSlice(encoded) == makeSlice(encodedFingerprint)); + } + { + // check condition encoding match + Encoder s{TagMode::automatic}; + s << f->condition(ec) << eos; + BEAST_EXPECT(!ec); + std::error_code ecSB; + auto const& encoded = s.serializationBuffer(ecSB); + BEAST_EXPECT(!ecSB && makeSlice(encoded) == makeSlice(encodedCondition)); + } + + using Traits = cryptoconditions::der::DerCoderTraits>; + + static std::vector, std::string>> + prevTests; + + { + cryptoconditions::der::TraitsCache dummy; + BEAST_EXPECT(Traits::compare(expectedF, expectedF, dummy) == 0); + } + + for(auto const& i : prevTests) + { + cryptoconditions::der::TraitsCache dummy; + BEAST_EXPECT( + boost::math::sign( + Traits::compare(expectedF, i.first, dummy)) == + boost::math::sign(encodedFulfillment.compare(i.second))); + + } + prevTests.emplace_back(std::move(expectedF), std::move(encodedFulfillment)); + } +}; + +} +} + +#endif diff --git a/src/test/conditions/Conditions_generated_test_ed.cpp b/src/test/conditions/Conditions_generated_test_ed.cpp new file mode 100644 index 00000000000..ec8f3c44ab0 --- /dev/null +++ b/src/test/conditions/Conditions_generated_test_ed.cpp @@ -0,0 +1,93 @@ + +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include + +namespace ripple { +namespace cryptoconditions { + +class Conditions_ed_test : public ConditionsTestBase +{ + void + testEd0() + { + testcase("Ed0"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * ed0 + + auto const ed0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed0PublicKey{ + {0xa2, 0x0e, 0x9f, 0x32, 0x9a, 0x21, 0x6d, 0xac, 0x88, 0xbf, 0x51, + 0xc7, 0x60, 0xe1, 0x4c, 0xa6, 0xb6, 0x4b, 0x2d, 0x24, 0x87, 0xf6, + 0x29, 0xae, 0xd4, 0xf1, 0xe1, 0x2d, 0x15, 0x84, 0x0b, 0xb9}}; + std::array const ed0Sig{ + {0x6d, 0xea, 0x44, 0xb0, 0x26, 0x5e, 0x51, 0x57, 0x57, 0x6a, 0x49, + 0xd8, 0x03, 0x81, 0x14, 0xb8, 0x77, 0x78, 0x9f, 0xb8, 0x4f, 0xab, + 0xce, 0x19, 0x07, 0x4c, 0xf0, 0xa6, 0x3a, 0x17, 0x06, 0x10, 0x6d, + 0x80, 0xda, 0xc6, 0x8f, 0x06, 0xad, 0x53, 0xb0, 0x9c, 0x36, 0x43, + 0xd9, 0x56, 0xfd, 0x5f, 0xbd, 0x4a, 0xf0, 0xff, 0xcb, 0x20, 0x96, + 0x7f, 0x5d, 0xca, 0xcf, 0x23, 0x52, 0x62, 0x91, 0x08}}; + std::array const ed0SigningKey{ + {0x1a, 0xee, 0xd3, 0x72, 0x55, 0x41, 0x83, 0xf2, 0xa7, 0xe2, 0x5e, + 0x24, 0x0e, 0x22, 0x28, 0x9e, 0x81, 0x61, 0x5f, 0x9d, 0xd2, 0x11, + 0xdd, 0xcd, 0xc3, 0x94, 0x2d, 0x02, 0x26, 0xcf, 0x9e, 0x1c}}; + (void)ed0SigningKey; + + auto ed0 = std::make_unique(ed0PublicKey, ed0Sig); + { + auto ed0EncodedFulfillment = + "\xa4\x64\x80\x20\xa2\x0e\x9f\x32\x9a\x21\x6d\xac\x88\xbf\x51" + "\xc7\x60\xe1\x4c\xa6\xb6\x4b\x2d\x24\x87\xf6\x29\xae\xd4\xf1" + "\xe1\x2d\x15\x84\x0b\xb9\x81\x40\x6d\xea\x44\xb0\x26\x5e\x51" + "\x57\x57\x6a\x49\xd8\x03\x81\x14\xb8\x77\x78\x9f\xb8\x4f\xab" + "\xce\x19\x07\x4c\xf0\xa6\x3a\x17\x06\x10\x6d\x80\xda\xc6\x8f" + "\x06\xad\x53\xb0\x9c\x36\x43\xd9\x56\xfd\x5f\xbd\x4a\xf0\xff" + "\xcb\x20\x96\x7f\x5d\xca\xcf\x23\x52\x62\x91\x08"s; + auto const ed0EncodedCondition = + "\xa4\x27\x80\x20\xa3\xbe\x3a\xd0\x8e\x60\x1c\xd7\x95\xb0\xd9" + "\x00\x49\x56\xdb\xdb\xb5\xd2\x6e\x41\x03\x6a\x6e\x01\x3f\x58" + "\x43\x14\x5a\xd2\x58\xc5\x81\x03\x02\x00\x00"s; + auto const ed0EncodedFingerprint = + "\x30\x22\x80\x20\xa2\x0e\x9f\x32\x9a\x21\x6d\xac\x88\xbf\x51" + "\xc7\x60\xe1\x4c\xa6\xb6\x4b\x2d\x24\x87\xf6\x29\xae\xd4\xf1" + "\xe1\x2d\x15\x84\x0b\xb9"s; + check( + std::move(ed0), + ed0Msg, + std::move(ed0EncodedFulfillment), + ed0EncodedCondition, + ed0EncodedFingerprint); + } + } + + void + run() + { + testEd0(); + } +}; + +BEAST_DEFINE_TESTSUITE(Conditions_ed, conditions, ripple); +} // cryptoconditions +} // ripple diff --git a/src/test/conditions/Conditions_generated_test_json.cpp b/src/test/conditions/Conditions_generated_test_json.cpp new file mode 100644 index 00000000000..71be25993b9 --- /dev/null +++ b/src/test/conditions/Conditions_generated_test_json.cpp @@ -0,0 +1,1732 @@ + +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include + +namespace ripple { +namespace cryptoconditions { + +class Conditions_json_test : public ConditionsTestBase +{ + void + testPreim0() + { + testcase("Preim0"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * preim0 + + auto const preim0Preimage = ""s; + auto const preim0Msg = ""s; + + auto preim0 = + std::make_unique(makeSlice(preim0Preimage)); + { + auto preim0EncodedFulfillment = "\xa0\x02\x80\x00"s; + auto const preim0EncodedCondition = + "\xa0\x25\x80\x20\xe3\xb0\xc4\x42\x98\xfc\x1c\x14\x9a\xfb\xf4" + "\xc8\x99\x6f\xb9\x24\x27\xae\x41\xe4\x64\x9b\x93\x4c\xa4\x95" + "\x99\x1b\x78\x52\xb8\x55\x81\x01\x00"s; + auto const preim0EncodedFingerprint = ""s; + check( + std::move(preim0), + preim0Msg, + std::move(preim0EncodedFulfillment), + preim0EncodedCondition, + preim0EncodedFingerprint); + } + } + + void + testPrefix0() + { + testcase("Prefix0"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** preim1 + + auto const preim1Preimage = ""s; + auto const preim1Msg = ""s; + auto const prefix0Prefix = ""s; + auto const prefix0Msg = ""s; + auto const prefix0MaxMsgLength = 0; + + auto preim1 = + std::make_unique(makeSlice(preim1Preimage)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(preim1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x0b\x80\x00\x81\x01\x00\xa2\x04\xa0\x02\x80\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2a\x80\x20\xbb\x1a\xc5\x26\x0c\x01\x41\xb7\xe5\x4b\x26" + "\xec\x23\x30\x63\x7c\x55\x97\xbf\x81\x19\x51\xac\x09\xe7\x44" + "\xad\x20\xff\x77\xe2\x87\x81\x02\x04\x00\x82\x02\x07\x80"s; + auto const prefix0EncodedFingerprint = + "\x30\x2e\x80\x00\x81\x01\x00\xa2\x27\xa0\x25\x80\x20\xe3\xb0" + "\xc4\x42\x98\xfc\x1c\x14\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24\x27" + "\xae\x41\xe4\x64\x9b\x93\x4c\xa4\x95\x99\x1b\x78\x52\xb8\x55" + "\x81\x01\x00"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testThresh0() + { + testcase("Thresh0"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** preim1 + + auto const preim1Preimage = ""s; + auto const preim1Msg = ""s; + auto const thresh0Msg = ""s; + + auto preim1 = + std::make_unique(makeSlice(preim1Preimage)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(preim1)); + std::vector thresh0Subconditions{}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x08\xa0\x04\xa0\x02\x80\x00\xa1\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2a\x80\x20\xb4\xb8\x41\x36\xdf\x48\xa7\x1d\x73\xf4\x98" + "\x5c\x04\xc6\x76\x7a\x77\x8e\xcb\x65\xba\x70\x23\xb4\x50\x68" + "\x23\xbe\xee\x76\x31\xb9\x81\x02\x04\x00\x82\x02\x07\x80"s; + auto const thresh0EncodedFingerprint = + "\x30\x2c\x80\x01\x01\xa1\x27\xa0\x25\x80\x20\xe3\xb0\xc4\x42" + "\x98\xfc\x1c\x14\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24\x27\xae\x41" + "\xe4\x64\x9b\x93\x4c\xa4\x95\x99\x1b\x78\x52\xb8\x55\x81\x01" + "\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testRsa0() + { + testcase("Rsa0"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * rsa0 + + auto const rsa0Msg = ""s; + std::array const rsa0PublicKey{ + {0xe1, 0xef, 0x8b, 0x24, 0xd6, 0xf7, 0x6b, 0x09, 0xc8, 0x1e, 0xd7, + 0x75, 0x2a, 0xa2, 0x62, 0xf0, 0x44, 0xf0, 0x4a, 0x87, 0x4d, 0x43, + 0x80, 0x9d, 0x31, 0xce, 0xa6, 0x12, 0xf9, 0x9b, 0x0c, 0x97, 0xa8, + 0xb4, 0x37, 0x41, 0x53, 0xe3, 0xee, 0xf3, 0xd6, 0x66, 0x16, 0x84, + 0x3e, 0x0e, 0x41, 0xc2, 0x93, 0x26, 0x4b, 0x71, 0xb6, 0x17, 0x3d, + 0xb1, 0xcf, 0x0d, 0x6c, 0xd5, 0x58, 0xc5, 0x86, 0x57, 0x70, 0x6f, + 0xcf, 0x09, 0x7f, 0x70, 0x4c, 0x48, 0x3e, 0x59, 0xcb, 0xfd, 0xfd, + 0x5b, 0x3e, 0xe7, 0xbc, 0x80, 0xd7, 0x40, 0xc5, 0xe0, 0xf0, 0x47, + 0xf3, 0xe8, 0x5f, 0xc0, 0xd7, 0x58, 0x15, 0x77, 0x6a, 0x6f, 0x3f, + 0x23, 0xc5, 0xdc, 0x5e, 0x79, 0x71, 0x39, 0xa6, 0x88, 0x2e, 0x38, + 0x33, 0x6a, 0x4a, 0x5f, 0xb3, 0x61, 0x37, 0x62, 0x0f, 0xf3, 0x66, + 0x3d, 0xba, 0xe3, 0x28, 0x47, 0x28, 0x01, 0x86, 0x2f, 0x72, 0xf2, + 0xf8, 0x7b, 0x20, 0x2b, 0x9c, 0x89, 0xad, 0xd7, 0xcd, 0x5b, 0x0a, + 0x07, 0x6f, 0x7c, 0x53, 0xe3, 0x50, 0x39, 0xf6, 0x7e, 0xd1, 0x7e, + 0xc8, 0x15, 0xe5, 0xb4, 0x30, 0x5c, 0xc6, 0x31, 0x97, 0x06, 0x8d, + 0x5e, 0x6e, 0x57, 0x9b, 0xa6, 0xde, 0x5f, 0x4e, 0x3e, 0x57, 0xdf, + 0x5e, 0x4e, 0x07, 0x2f, 0xf2, 0xce, 0x4c, 0x66, 0xeb, 0x45, 0x23, + 0x39, 0x73, 0x87, 0x52, 0x75, 0x96, 0x39, 0xf0, 0x25, 0x7b, 0xf5, + 0x7d, 0xbd, 0x5c, 0x44, 0x3f, 0xb5, 0x15, 0x8c, 0xce, 0x0a, 0x3d, + 0x36, 0xad, 0xc7, 0xba, 0x01, 0xf3, 0x3a, 0x0b, 0xb6, 0xdb, 0xb2, + 0xbf, 0x98, 0x9d, 0x60, 0x71, 0x12, 0xf2, 0x34, 0x4d, 0x99, 0x3e, + 0x77, 0xe5, 0x63, 0xc1, 0xd3, 0x61, 0xde, 0xdf, 0x57, 0xda, 0x96, + 0xef, 0x2c, 0xfc, 0x68, 0x5f, 0x00, 0x2b, 0x63, 0x82, 0x46, 0xa5, + 0xb3, 0x09, 0xb9}}; + std::array const rsa0Sig{ + {0xbd, 0x42, 0xd6, 0x56, 0x9f, 0x65, 0x99, 0xae, 0xd4, 0x55, 0xf9, + 0x6b, 0xc0, 0xed, 0x08, 0xed, 0x14, 0x80, 0xbf, 0x36, 0xcd, 0x9e, + 0x14, 0x67, 0xf9, 0xc6, 0xf7, 0x44, 0x61, 0xc9, 0xe3, 0xa7, 0x49, + 0x33, 0x4b, 0x2f, 0x64, 0x04, 0xaa, 0x5f, 0x9f, 0x6b, 0xaf, 0xe7, + 0x6c, 0x34, 0x7d, 0x06, 0x92, 0x50, 0xb3, 0x5d, 0x1c, 0x97, 0x0c, + 0x79, 0x30, 0x59, 0xee, 0x73, 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2, 0x43, + 0xc0, 0x3b, 0x61, 0x4e, 0x03, 0x85, 0xe1, 0x96, 0x1f, 0xac, 0x50, + 0x00, 0xf9, 0xbb}}; + + auto rsa0 = std::make_unique( + makeSlice(rsa0PublicKey), makeSlice(rsa0Sig)); + { + auto rsa0EncodedFulfillment = + "\xa3\x82\x02\x08\x80\x82\x01\x00\xe1\xef\x8b\x24\xd6\xf7\x6b" + "\x09\xc8\x1e\xd7\x75\x2a\xa2\x62\xf0\x44\xf0\x4a\x87\x4d\x43" + "\x80\x9d\x31\xce\xa6\x12\xf9\x9b\x0c\x97\xa8\xb4\x37\x41\x53" + "\xe3\xee\xf3\xd6\x66\x16\x84\x3e\x0e\x41\xc2\x93\x26\x4b\x71" + "\xb6\x17\x3d\xb1\xcf\x0d\x6c\xd5\x58\xc5\x86\x57\x70\x6f\xcf" + "\x09\x7f\x70\x4c\x48\x3e\x59\xcb\xfd\xfd\x5b\x3e\xe7\xbc\x80" + "\xd7\x40\xc5\xe0\xf0\x47\xf3\xe8\x5f\xc0\xd7\x58\x15\x77\x6a" + "\x6f\x3f\x23\xc5\xdc\x5e\x79\x71\x39\xa6\x88\x2e\x38\x33\x6a" + "\x4a\x5f\xb3\x61\x37\x62\x0f\xf3\x66\x3d\xba\xe3\x28\x47\x28" + "\x01\x86\x2f\x72\xf2\xf8\x7b\x20\x2b\x9c\x89\xad\xd7\xcd\x5b" + "\x0a\x07\x6f\x7c\x53\xe3\x50\x39\xf6\x7e\xd1\x7e\xc8\x15\xe5" + "\xb4\x30\x5c\xc6\x31\x97\x06\x8d\x5e\x6e\x57\x9b\xa6\xde\x5f" + "\x4e\x3e\x57\xdf\x5e\x4e\x07\x2f\xf2\xce\x4c\x66\xeb\x45\x23" + "\x39\x73\x87\x52\x75\x96\x39\xf0\x25\x7b\xf5\x7d\xbd\x5c\x44" + "\x3f\xb5\x15\x8c\xce\x0a\x3d\x36\xad\xc7\xba\x01\xf3\x3a\x0b" + "\xb6\xdb\xb2\xbf\x98\x9d\x60\x71\x12\xf2\x34\x4d\x99\x3e\x77" + "\xe5\x63\xc1\xd3\x61\xde\xdf\x57\xda\x96\xef\x2c\xfc\x68\x5f" + "\x00\x2b\x63\x82\x46\xa5\xb3\x09\xb9\x81\x82\x01\x00\xbd\x42" + "\xd6\x56\x9f\x65\x99\xae\xd4\x55\xf9\x6b\xc0\xed\x08\xed\x14" + "\x80\xbf\x36\xcd\x9e\x14\x67\xf9\xc6\xf7\x44\x61\xc9\xe3\xa7" + "\x49\x33\x4b\x2f\x64\x04\xaa\x5f\x9f\x6b\xaf\xe7\x6c\x34\x7d" + "\x06\x92\x50\xb3\x5d\x1c\x97\x0c\x79\x30\x59\xee\x73\x3a\x81" + "\x93\xf3\x0f\xa7\x8f\xec\x7c\xae\x45\x9e\x3d\xdf\xd7\x63\x38" + "\x05\xd4\x76\x94\x0d\x0c\xb5\x3d\x7f\xb3\x89\xdc\xda\xea\xf6" + "\xe8\xcf\x48\xc4\xb5\x63\x54\x30\xe4\xf2\xbc\xdf\xe5\x05\xc2" + "\xc0\xfc\x17\xb4\x0d\x93\xc7\xed\xb7\xc2\x61\xeb\xf4\x38\x95" + "\xa7\x05\xe0\x24\xaa\x05\x49\xa6\x60\xf7\x0a\x32\x15\x06\x47" + "\x52\x2d\xbe\x6b\x63\x52\x04\x97\xcf\xf8\xf8\xd5\xd7\x47\x68" + "\xa2\x7c\x5b\x86\xe5\x80\xbe\x3f\xcd\xc9\x6f\x19\x76\x29\x3c" + "\xba\x0d\x58\xdf\xc6\x0b\x51\x8b\x63\x2a\x6d\xc1\xe9\x50\xc4" + "\x3e\x23\x1f\xe1\xa3\x79\xaa\x6d\xdc\xc5\x2c\x70\xed\xf8\x51" + "\xc6\xc0\x12\x3a\x96\x42\x61\xcf\xdb\x38\x57\xcd\x6c\xd5\xad" + "\xc3\x7d\x8d\xa2\xcc\x92\x4e\xda\xe1\xd8\x4c\xf6\x12\x45\x87" + "\xf2\x74\xc1\xfa\x36\x97\xda\x29\x01\xf0\x26\x9f\x03\xb2\x43" + "\xc0\x3b\x61\x4e\x03\x85\xe1\x96\x1f\xac\x50\x00\xf9\xbb"s; + auto const rsa0EncodedCondition = + "\xa3\x27\x80\x20\xb3\x1f\xa8\x20\x6e\x4e\xa7\xe5\x15\x33\x7b" + "\x3b\x33\x08\x2b\x87\x76\x51\x80\x10\x85\xed\x84\xfb\x4d\xae" + "\xb2\x47\xbf\x69\x8d\x7f\x81\x03\x01\x00\x00"s; + auto const rsa0EncodedFingerprint = + "\x30\x82\x01\x04\x80\x82\x01\x00\xe1\xef\x8b\x24\xd6\xf7\x6b" + "\x09\xc8\x1e\xd7\x75\x2a\xa2\x62\xf0\x44\xf0\x4a\x87\x4d\x43" + "\x80\x9d\x31\xce\xa6\x12\xf9\x9b\x0c\x97\xa8\xb4\x37\x41\x53" + "\xe3\xee\xf3\xd6\x66\x16\x84\x3e\x0e\x41\xc2\x93\x26\x4b\x71" + "\xb6\x17\x3d\xb1\xcf\x0d\x6c\xd5\x58\xc5\x86\x57\x70\x6f\xcf" + "\x09\x7f\x70\x4c\x48\x3e\x59\xcb\xfd\xfd\x5b\x3e\xe7\xbc\x80" + "\xd7\x40\xc5\xe0\xf0\x47\xf3\xe8\x5f\xc0\xd7\x58\x15\x77\x6a" + "\x6f\x3f\x23\xc5\xdc\x5e\x79\x71\x39\xa6\x88\x2e\x38\x33\x6a" + "\x4a\x5f\xb3\x61\x37\x62\x0f\xf3\x66\x3d\xba\xe3\x28\x47\x28" + "\x01\x86\x2f\x72\xf2\xf8\x7b\x20\x2b\x9c\x89\xad\xd7\xcd\x5b" + "\x0a\x07\x6f\x7c\x53\xe3\x50\x39\xf6\x7e\xd1\x7e\xc8\x15\xe5" + "\xb4\x30\x5c\xc6\x31\x97\x06\x8d\x5e\x6e\x57\x9b\xa6\xde\x5f" + "\x4e\x3e\x57\xdf\x5e\x4e\x07\x2f\xf2\xce\x4c\x66\xeb\x45\x23" + "\x39\x73\x87\x52\x75\x96\x39\xf0\x25\x7b\xf5\x7d\xbd\x5c\x44" + "\x3f\xb5\x15\x8c\xce\x0a\x3d\x36\xad\xc7\xba\x01\xf3\x3a\x0b" + "\xb6\xdb\xb2\xbf\x98\x9d\x60\x71\x12\xf2\x34\x4d\x99\x3e\x77" + "\xe5\x63\xc1\xd3\x61\xde\xdf\x57\xda\x96\xef\x2c\xfc\x68\x5f" + "\x00\x2b\x63\x82\x46\xa5\xb3\x09\xb9"s; + check( + std::move(rsa0), + rsa0Msg, + std::move(rsa0EncodedFulfillment), + rsa0EncodedCondition, + rsa0EncodedFingerprint); + } + } + + void + testEd0() + { + testcase("Ed0"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * ed0 + + auto const ed0Msg = ""s; + std::array const ed0PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed0Sig{ + {0xe5, 0x56, 0x43, 0x00, 0xc3, 0x60, 0xac, 0x72, 0x90, 0x86, 0xe2, + 0xcc, 0x80, 0x6e, 0x82, 0x8a, 0x84, 0x87, 0x7f, 0x1e, 0xb8, 0xe5, + 0xd9, 0x74, 0xd8, 0x73, 0xe0, 0x65, 0x22, 0x49, 0x01, 0x55, 0x5f, + 0xb8, 0x82, 0x15, 0x90, 0xa3, 0x3b, 0xac, 0xc6, 0x1e, 0x39, 0x70, + 0x1c, 0xf9, 0xb4, 0x6b, 0xd2, 0x5b, 0xf5, 0xf0, 0x59, 0x5b, 0xbe, + 0x24, 0x65, 0x51, 0x41, 0x43, 0x8e, 0x7a, 0x10, 0x0b}}; + + auto ed0 = std::make_unique(ed0PublicKey, ed0Sig); + { + auto ed0EncodedFulfillment = + "\xa4\x64\x80\x20\xd7\x5a\x98\x01\x82\xb1\x0a\xb7\xd5\x4b\xfe" + "\xd3\xc9\x64\x07\x3a\x0e\xe1\x72\xf3\xda\xa6\x23\x25\xaf\x02" + "\x1a\x68\xf7\x07\x51\x1a\x81\x40\xe5\x56\x43\x00\xc3\x60\xac" + "\x72\x90\x86\xe2\xcc\x80\x6e\x82\x8a\x84\x87\x7f\x1e\xb8\xe5" + "\xd9\x74\xd8\x73\xe0\x65\x22\x49\x01\x55\x5f\xb8\x82\x15\x90" + "\xa3\x3b\xac\xc6\x1e\x39\x70\x1c\xf9\xb4\x6b\xd2\x5b\xf5\xf0" + "\x59\x5b\xbe\x24\x65\x51\x41\x43\x8e\x7a\x10\x0b"s; + auto const ed0EncodedCondition = + "\xa4\x27\x80\x20\x79\x92\x39\xab\xa8\xfc\x4f\xf7\xea\xbf\xbc" + "\x4c\x44\xe6\x9e\x8b\xdf\xed\x99\x33\x24\xe1\x2e\xd6\x47\x92" + "\xab\xe2\x89\xcf\x1d\x5f\x81\x03\x02\x00\x00"s; + auto const ed0EncodedFingerprint = + "\x30\x22\x80\x20\xd7\x5a\x98\x01\x82\xb1\x0a\xb7\xd5\x4b\xfe" + "\xd3\xc9\x64\x07\x3a\x0e\xe1\x72\xf3\xda\xa6\x23\x25\xaf\x02" + "\x1a\x68\xf7\x07\x51\x1a"s; + check( + std::move(ed0), + ed0Msg, + std::move(ed0EncodedFulfillment), + ed0EncodedCondition, + ed0EncodedFingerprint); + } + } + + void + testPreim1() + { + testcase("Preim1"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * preim0 + + auto const preim0Preimage = "aaa"s; + auto const preim0Msg = ""s; + + auto preim0 = + std::make_unique(makeSlice(preim0Preimage)); + { + auto preim0EncodedFulfillment = "\xa0\x05\x80\x03\x61\x61\x61"s; + auto const preim0EncodedCondition = + "\xa0\x25\x80\x20\x98\x34\x87\x6d\xcf\xb0\x5c\xb1\x67\xa5\xc2" + "\x49\x53\xeb\xa5\x8c\x4a\xc8\x9b\x1a\xdf\x57\xf2\x8f\x2f\x9d" + "\x09\xaf\x10\x7e\xe8\xf0\x81\x01\x03"s; + auto const preim0EncodedFingerprint = "\x61\x61\x61"s; + check( + std::move(preim0), + preim0Msg, + std::move(preim0EncodedFulfillment), + preim0EncodedCondition, + preim0EncodedFingerprint); + } + } + + void + testPrefix1() + { + testcase("Prefix1"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** ed1 + + auto const ed1Msg = ""s; + std::array const ed1PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed1Sig{ + {0x50, 0x6a, 0x1e, 0xa6, 0x83, 0x18, 0xe6, 0x2d, 0x40, 0x63, 0x5d, + 0xad, 0x04, 0x3e, 0x19, 0x87, 0xeb, 0xc2, 0x6e, 0x5b, 0x5c, 0x44, + 0x06, 0xf7, 0xbd, 0xf8, 0x5a, 0x73, 0x38, 0x8f, 0xbf, 0xe5, 0xc2, + 0x45, 0xac, 0x49, 0xf4, 0x77, 0x0e, 0xbc, 0x78, 0x77, 0x08, 0x27, + 0x0a, 0xa6, 0xa8, 0x76, 0x9f, 0xef, 0xe8, 0x93, 0x0f, 0xd0, 0xea, + 0x1e, 0xe6, 0x4b, 0x31, 0x40, 0x7d, 0x76, 0x95, 0x09}}; + auto const prefix0Prefix = "aaa"s; + auto const prefix0Msg = ""s; + auto const prefix0MaxMsgLength = 0; + + auto ed1 = std::make_unique(ed1PublicKey, ed1Sig); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(ed1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x70\x80\x03\x61\x61\x61\x81\x01\x00\xa2\x66\xa4\x64\x80" + "\x20\xd7\x5a\x98\x01\x82\xb1\x0a\xb7\xd5\x4b\xfe\xd3\xc9\x64" + "\x07\x3a\x0e\xe1\x72\xf3\xda\xa6\x23\x25\xaf\x02\x1a\x68\xf7" + "\x07\x51\x1a\x81\x40\x50\x6a\x1e\xa6\x83\x18\xe6\x2d\x40\x63" + "\x5d\xad\x04\x3e\x19\x87\xeb\xc2\x6e\x5b\x5c\x44\x06\xf7\xbd" + "\xf8\x5a\x73\x38\x8f\xbf\xe5\xc2\x45\xac\x49\xf4\x77\x0e\xbc" + "\x78\x77\x08\x27\x0a\xa6\xa8\x76\x9f\xef\xe8\x93\x0f\xd0\xea" + "\x1e\xe6\x4b\x31\x40\x7d\x76\x95\x09"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x45\x1f\xe1\x5f\x16\x29\x9d\x49\x59\x93\xfe" + "\x69\x2d\xb9\x89\xe5\x6a\x52\x30\xa9\x04\x76\xf7\x73\x92\xa3" + "\xcd\x32\x13\xc0\x73\x3f\x81\x03\x02\x04\x03\x82\x02\x03\x08"s; + auto const prefix0EncodedFingerprint = + "\x30\x33\x80\x03\x61\x61\x61\x81\x01\x00\xa2\x29\xa4\x27\x80" + "\x20\x79\x92\x39\xab\xa8\xfc\x4f\xf7\xea\xbf\xbc\x4c\x44\xe6" + "\x9e\x8b\xdf\xed\x99\x33\x24\xe1\x2e\xd6\x47\x92\xab\xe2\x89" + "\xcf\x1d\x5f\x81\x03\x02\x00\x00"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix2() + { + testcase("Prefix2"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** ed2 + + auto const ed2Msg = ""s; + std::array const ed2PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed2Sig{ + {0xa4, 0x23, 0x60, 0xf4, 0x7f, 0x7d, 0xb8, 0x6d, 0xb5, 0xf0, 0x37, + 0xc8, 0x10, 0x24, 0x22, 0x37, 0x20, 0x7d, 0x7a, 0xdd, 0x6e, 0x3e, + 0x53, 0x17, 0xe2, 0x12, 0xb2, 0x07, 0xe2, 0x5b, 0xed, 0x2a, 0xcb, + 0x48, 0x5a, 0xd0, 0xbc, 0xbb, 0x57, 0x75, 0x57, 0x26, 0x0e, 0xcb, + 0xbb, 0xd6, 0x77, 0x18, 0xd6, 0xca, 0xba, 0xdf, 0x45, 0xba, 0xd6, + 0x55, 0xd1, 0xb8, 0xce, 0x84, 0x60, 0x9e, 0x97, 0x01}}; + auto const prefix1Prefix = "aaa"s; + auto const prefix1Msg = ""s; + auto const prefix1MaxMsgLength = 6; + auto const prefix0Prefix = "bbb"s; + auto const prefix0Msg = "\x7A\x7A\x7A"s; + auto const prefix0MaxMsgLength = 3; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(ed2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x7c\x80\x03\x62\x62\x62\x81\x01\x03\xa2\x72\xa1\x70\x80" + "\x03\x61\x61\x61\x81\x01\x06\xa2\x66\xa4\x64\x80\x20\xd7\x5a" + "\x98\x01\x82\xb1\x0a\xb7\xd5\x4b\xfe\xd3\xc9\x64\x07\x3a\x0e" + "\xe1\x72\xf3\xda\xa6\x23\x25\xaf\x02\x1a\x68\xf7\x07\x51\x1a" + "\x81\x40\xa4\x23\x60\xf4\x7f\x7d\xb8\x6d\xb5\xf0\x37\xc8\x10" + "\x24\x22\x37\x20\x7d\x7a\xdd\x6e\x3e\x53\x17\xe2\x12\xb2\x07" + "\xe2\x5b\xed\x2a\xcb\x48\x5a\xd0\xbc\xbb\x57\x75\x57\x26\x0e" + "\xcb\xbb\xd6\x77\x18\xd6\xca\xba\xdf\x45\xba\xd6\x55\xd1\xb8" + "\xce\x84\x60\x9e\x97\x01"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x17\x73\x50\xad\x85\x66\xc5\x28\xb9\x2d\x9b" + "\x53\x82\xdf\x2c\x68\xd9\xba\x9f\x9f\xa4\x1d\x43\xdb\xdd\x8e" + "\x40\xb1\x18\xdd\x96\x41\x81\x03\x02\x08\x0f\x82\x02\x03\x08"s; + auto const prefix0EncodedFingerprint = + "\x30\x37\x80\x03\x62\x62\x62\x81\x01\x03\xa2\x2d\xa1\x2b\x80" + "\x20\x7f\x19\xc9\xbb\x3b\xc7\x67\xde\x39\x65\x7e\x11\xd1\x60" + "\x68\xf8\xca\xb0\x0e\x3e\x3c\x23\x91\x6d\xf9\x67\xb5\x84\xa2" + "\x8b\x26\xdc\x81\x03\x02\x04\x09\x82\x02\x03\x08"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testThresh1() + { + testcase("Thresh1"); + + // swd TBD Need clarification on this test + pass(); + return; + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Rsa4Cond + // ** prefix1 + // *** ed2 + // ** ed3 + + auto const ed2Msg = ""s; + std::array const ed2PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed2Sig{ + {0x34, 0x4c, 0x9d, 0x12, 0xa0, 0x2a, 0x57, 0xb3, 0x5f, 0xd9, 0x66, + 0x19, 0x3c, 0xee, 0x95, 0xd5, 0xdb, 0xbb, 0xc6, 0x77, 0x55, 0x3f, + 0xce, 0xbf, 0x41, 0x4c, 0x18, 0xda, 0x75, 0x00, 0x29, 0xdd, 0x39, + 0xc6, 0xe5, 0x3a, 0xdd, 0x89, 0x2c, 0xef, 0xe4, 0x42, 0x35, 0x83, + 0x1f, 0xf8, 0xe5, 0xf3, 0x68, 0x68, 0x8e, 0xf7, 0x7c, 0xcf, 0x6f, + 0x99, 0x7f, 0xd4, 0x11, 0xa6, 0xa7, 0xeb, 0xf9, 0x02}}; + auto const prefix1Prefix = "aaa"s; + auto const prefix1Msg = ""s; + auto const prefix1MaxMsgLength = 0; + auto const ed3Msg = ""s; + std::array const ed3PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed3Sig{ + {0x50, 0x6a, 0x1e, 0xa6, 0x83, 0x18, 0xe6, 0x2d, 0x40, 0x63, 0x5d, + 0xad, 0x04, 0x3e, 0x19, 0x87, 0xeb, 0xc2, 0x6e, 0x5b, 0x5c, 0x44, + 0x06, 0xf7, 0xbd, 0xf8, 0x5a, 0x73, 0x38, 0x8f, 0xbf, 0xe5, 0xc2, + 0x45, 0xac, 0x49, 0xf4, 0x77, 0x0e, 0xbc, 0x78, 0x77, 0x08, 0x27, + 0x0a, 0xa6, 0xa8, 0x76, 0x9f, 0xef, 0xe8, 0x93, 0x0f, 0xd0, 0xea, + 0x1e, 0xe6, 0x4b, 0x31, 0x40, 0x7d, 0x76, 0x95, 0x09}}; + auto const thresh0Msg = "\x61\x61\x61"s; + std::array const Rsa4CondConditionFingerprint = { + {0x4d, 0xd2, 0xea, 0x7f, 0x85, 0xb3, 0xea, 0xcb, 0x8f, 0x19, 0x05, + 0x8e, 0x83, 0x60, 0x95, 0x5c, 0x32, 0xe7, 0x4c, 0x12, 0x43, 0x92, + 0xa1, 0xf4, 0x46, 0x60, 0x73, 0x97, 0x09, 0xc5, 0x39, 0xc3}}; + Condition const Rsa4Cond{Type::rsaSha256, + 262144, + Rsa4CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(ed2)); + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(ed3)); + std::vector thresh0Subconditions{{Rsa4Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\x06\xa0\x81\xd8\xa1\x70\x80\x03\x61\x61\x61\x81" + "\x01\x00\xa2\x66\xa4\x64\x80\x20\xd7\x5a\x98\x01\x82\xb1\x0a" + "\xb7\xd5\x4b\xfe\xd3\xc9\x64\x07\x3a\x0e\xe1\x72\xf3\xda\xa6" + "\x23\x25\xaf\x02\x1a\x68\xf7\x07\x51\x1a\x81\x40\x34\x4c\x9d" + "\x12\xa0\x2a\x57\xb3\x5f\xd9\x66\x19\x3c\xee\x95\xd5\xdb\xbb" + "\xc6\x77\x55\x3f\xce\xbf\x41\x4c\x18\xda\x75\x00\x29\xdd\x39" + "\xc6\xe5\x3a\xdd\x89\x2c\xef\xe4\x42\x35\x83\x1f\xf8\xe5\xf3" + "\x68\x68\x8e\xf7\x7c\xcf\x6f\x99\x7f\xd4\x11\xa6\xa7\xeb\xf9" + "\x02\xa4\x64\x80\x20\xd7\x5a\x98\x01\x82\xb1\x0a\xb7\xd5\x4b" + "\xfe\xd3\xc9\x64\x07\x3a\x0e\xe1\x72\xf3\xda\xa6\x23\x25\xaf" + "\x02\x1a\x68\xf7\x07\x51\x1a\x81\x40\x50\x6a\x1e\xa6\x83\x18" + "\xe6\x2d\x40\x63\x5d\xad\x04\x3e\x19\x87\xeb\xc2\x6e\x5b\x5c" + "\x44\x06\xf7\xbd\xf8\x5a\x73\x38\x8f\xbf\xe5\xc2\x45\xac\x49" + "\xf4\x77\x0e\xbc\x78\x77\x08\x27\x0a\xa6\xa8\x76\x9f\xef\xe8" + "\x93\x0f\xd0\xea\x1e\xe6\x4b\x31\x40\x7d\x76\x95\x09\xa1\x29" + "\xa3\x27\x80\x20\x4d\xd2\xea\x7f\x85\xb3\xea\xcb\x8f\x19\x05" + "\x8e\x83\x60\x95\x5c\x32\xe7\x4c\x12\x43\x92\xa1\xf4\x46\x60" + "\x73\x97\x09\xc5\x39\xc3\x81\x03\x04\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xb6\xac\xf4\x08\x3e\x43\x8b\xe4\x35\x6f\x25" + "\xff\x92\xc2\x95\xe9\xc8\xe1\xba\xb1\x41\xb4\x60\x7b\xa4\x85" + "\x11\xeb\xa3\x5a\xef\xcc\x81\x03\x06\x10\x03\x82\x02\x03\x58"s; + auto const thresh0EncodedFingerprint = + "\x30\x81\x84\x80\x01\x02\xa1\x7f\xa1\x2b\x80\x20\x45\x1f\xe1" + "\x5f\x16\x29\x9d\x49\x59\x93\xfe\x69\x2d\xb9\x89\xe5\x6a\x52" + "\x30\xa9\x04\x76\xf7\x73\x92\xa3\xcd\x32\x13\xc0\x73\x3f\x81" + "\x03\x02\x04\x03\x82\x02\x03\x08\xa3\x27\x80\x20\x4d\xd2\xea" + "\x7f\x85\xb3\xea\xcb\x8f\x19\x05\x8e\x83\x60\x95\x5c\x32\xe7" + "\x4c\x12\x43\x92\xa1\xf4\x46\x60\x73\x97\x09\xc5\x39\xc3\x81" + "\x03\x04\x00\x00\xa4\x27\x80\x20\x79\x92\x39\xab\xa8\xfc\x4f" + "\xf7\xea\xbf\xbc\x4c\x44\xe6\x9e\x8b\xdf\xed\x99\x33\x24\xe1" + "\x2e\xd6\x47\x92\xab\xe2\x89\xcf\x1d\x5f\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh2() + { + testcase("Thresh2"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Prefix2Cond + // ** Rsa4Cond + // ** Prefix5Cond + // ** Rsa7Cond + // ** preim1 + + auto const preim1Preimage = "aaa"s; + auto const preim1Msg = ""s; + auto const thresh0Msg = ""s; + std::array const Prefix2CondConditionFingerprint = { + {0x45, 0x1f, 0xe1, 0x5f, 0x16, 0x29, 0x9d, 0x49, 0x59, 0x93, 0xfe, + 0x69, 0x2d, 0xb9, 0x89, 0xe5, 0x6a, 0x52, 0x30, 0xa9, 0x04, 0x76, + 0xf7, 0x73, 0x92, 0xa3, 0xcd, 0x32, 0x13, 0xc0, 0x73, 0x3f}}; + Condition const Prefix2Cond{Type::prefixSha256, + 132099, + Prefix2CondConditionFingerprint, + std::bitset<5>{16}}; + std::array const Rsa4CondConditionFingerprint = { + {0x4d, 0xd2, 0xea, 0x7f, 0x85, 0xb3, 0xea, 0xcb, 0x8f, 0x19, 0x05, + 0x8e, 0x83, 0x60, 0x95, 0x5c, 0x32, 0xe7, 0x4c, 0x12, 0x43, 0x92, + 0xa1, 0xf4, 0x46, 0x60, 0x73, 0x97, 0x09, 0xc5, 0x39, 0xc3}}; + Condition const Rsa4Cond{Type::rsaSha256, + 262144, + Rsa4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix5CondConditionFingerprint = { + {0x45, 0x1f, 0xe1, 0x5f, 0x16, 0x29, 0x9d, 0x49, 0x59, 0x93, 0xfe, + 0x69, 0x2d, 0xb9, 0x89, 0xe5, 0x6a, 0x52, 0x30, 0xa9, 0x04, 0x76, + 0xf7, 0x73, 0x92, 0xa3, 0xcd, 0x32, 0x13, 0xc0, 0x73, 0x3f}}; + Condition const Prefix5Cond{Type::prefixSha256, + 132099, + Prefix5CondConditionFingerprint, + std::bitset<5>{16}}; + std::array const Rsa7CondConditionFingerprint = { + {0x4d, 0xd2, 0xea, 0x7f, 0x85, 0xb3, 0xea, 0xcb, 0x8f, 0x19, 0x05, + 0x8e, 0x83, 0x60, 0x95, 0x5c, 0x32, 0xe7, 0x4c, 0x12, 0x43, 0x92, + 0xa1, 0xf4, 0x46, 0x60, 0x73, 0x97, 0x09, 0xc5, 0x39, 0xc3}}; + Condition const Rsa7Cond{Type::rsaSha256, + 262144, + Rsa7CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim1 = + std::make_unique(makeSlice(preim1Preimage)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(preim1)); + std::vector thresh0Subconditions{ + {Prefix2Cond, Rsa4Cond, Prefix5Cond, Rsa7Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x81\xb8\xa0\x07\xa0\x05\x80\x03\x61\x61\x61\xa1\x81\xac" + "\xa1\x2b\x80\x20\x45\x1f\xe1\x5f\x16\x29\x9d\x49\x59\x93\xfe" + "\x69\x2d\xb9\x89\xe5\x6a\x52\x30\xa9\x04\x76\xf7\x73\x92\xa3" + "\xcd\x32\x13\xc0\x73\x3f\x81\x03\x02\x04\x03\x82\x02\x03\x08" + "\xa1\x2b\x80\x20\x45\x1f\xe1\x5f\x16\x29\x9d\x49\x59\x93\xfe" + "\x69\x2d\xb9\x89\xe5\x6a\x52\x30\xa9\x04\x76\xf7\x73\x92\xa3" + "\xcd\x32\x13\xc0\x73\x3f\x81\x03\x02\x04\x03\x82\x02\x03\x08" + "\xa3\x27\x80\x20\x4d\xd2\xea\x7f\x85\xb3\xea\xcb\x8f\x19\x05" + "\x8e\x83\x60\x95\x5c\x32\xe7\x4c\x12\x43\x92\xa1\xf4\x46\x60" + "\x73\x97\x09\xc5\x39\xc3\x81\x03\x04\x00\x00\xa3\x27\x80\x20" + "\x4d\xd2\xea\x7f\x85\xb3\xea\xcb\x8f\x19\x05\x8e\x83\x60\x95" + "\x5c\x32\xe7\x4c\x12\x43\x92\xa1\xf4\x46\x60\x73\x97\x09\xc5" + "\x39\xc3\x81\x03\x04\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x9a\x0b\x2c\x63\xdf\x80\x68\x6e\x60\x20\xd0" + "\xca\x21\xcb\xfe\x66\x8c\xce\xc3\xd1\xaf\x82\x71\x3f\xea\xe9" + "\xb8\xdd\x4a\x0f\x9b\xb7\x81\x03\x04\x14\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x81\xd9\x80\x01\x01\xa1\x81\xd3\xa0\x25\x80\x20\x98\x34" + "\x87\x6d\xcf\xb0\x5c\xb1\x67\xa5\xc2\x49\x53\xeb\xa5\x8c\x4a" + "\xc8\x9b\x1a\xdf\x57\xf2\x8f\x2f\x9d\x09\xaf\x10\x7e\xe8\xf0" + "\x81\x01\x03\xa1\x2b\x80\x20\x45\x1f\xe1\x5f\x16\x29\x9d\x49" + "\x59\x93\xfe\x69\x2d\xb9\x89\xe5\x6a\x52\x30\xa9\x04\x76\xf7" + "\x73\x92\xa3\xcd\x32\x13\xc0\x73\x3f\x81\x03\x02\x04\x03\x82" + "\x02\x03\x08\xa1\x2b\x80\x20\x45\x1f\xe1\x5f\x16\x29\x9d\x49" + "\x59\x93\xfe\x69\x2d\xb9\x89\xe5\x6a\x52\x30\xa9\x04\x76\xf7" + "\x73\x92\xa3\xcd\x32\x13\xc0\x73\x3f\x81\x03\x02\x04\x03\x82" + "\x02\x03\x08\xa3\x27\x80\x20\x4d\xd2\xea\x7f\x85\xb3\xea\xcb" + "\x8f\x19\x05\x8e\x83\x60\x95\x5c\x32\xe7\x4c\x12\x43\x92\xa1" + "\xf4\x46\x60\x73\x97\x09\xc5\x39\xc3\x81\x03\x04\x00\x00\xa3" + "\x27\x80\x20\x4d\xd2\xea\x7f\x85\xb3\xea\xcb\x8f\x19\x05\x8e" + "\x83\x60\x95\x5c\x32\xe7\x4c\x12\x43\x92\xa1\xf4\x46\x60\x73" + "\x97\x09\xc5\x39\xc3\x81\x03\x04\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh3() + { + testcase("Thresh3"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** prefix1 + // *** ed2 + // ** ed3 + // ** prefix4 + // *** ed5 + // ** ed6 + + auto const ed2Msg = ""s; + std::array const ed2PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed2Sig{ + {0x50, 0x6a, 0x1e, 0xa6, 0x83, 0x18, 0xe6, 0x2d, 0x40, 0x63, 0x5d, + 0xad, 0x04, 0x3e, 0x19, 0x87, 0xeb, 0xc2, 0x6e, 0x5b, 0x5c, 0x44, + 0x06, 0xf7, 0xbd, 0xf8, 0x5a, 0x73, 0x38, 0x8f, 0xbf, 0xe5, 0xc2, + 0x45, 0xac, 0x49, 0xf4, 0x77, 0x0e, 0xbc, 0x78, 0x77, 0x08, 0x27, + 0x0a, 0xa6, 0xa8, 0x76, 0x9f, 0xef, 0xe8, 0x93, 0x0f, 0xd0, 0xea, + 0x1e, 0xe6, 0x4b, 0x31, 0x40, 0x7d, 0x76, 0x95, 0x09}}; + auto const prefix1Prefix = "aaa"s; + auto const prefix1Msg = ""s; + auto const prefix1MaxMsgLength = 0; + auto const ed3Msg = ""s; + std::array const ed3PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed3Sig{ + {0xe5, 0x56, 0x43, 0x00, 0xc3, 0x60, 0xac, 0x72, 0x90, 0x86, 0xe2, + 0xcc, 0x80, 0x6e, 0x82, 0x8a, 0x84, 0x87, 0x7f, 0x1e, 0xb8, 0xe5, + 0xd9, 0x74, 0xd8, 0x73, 0xe0, 0x65, 0x22, 0x49, 0x01, 0x55, 0x5f, + 0xb8, 0x82, 0x15, 0x90, 0xa3, 0x3b, 0xac, 0xc6, 0x1e, 0x39, 0x70, + 0x1c, 0xf9, 0xb4, 0x6b, 0xd2, 0x5b, 0xf5, 0xf0, 0x59, 0x5b, 0xbe, + 0x24, 0x65, 0x51, 0x41, 0x43, 0x8e, 0x7a, 0x10, 0x0b}}; + auto const ed5Msg = ""s; + std::array const ed5PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed5Sig{ + {0x50, 0x6a, 0x1e, 0xa6, 0x83, 0x18, 0xe6, 0x2d, 0x40, 0x63, 0x5d, + 0xad, 0x04, 0x3e, 0x19, 0x87, 0xeb, 0xc2, 0x6e, 0x5b, 0x5c, 0x44, + 0x06, 0xf7, 0xbd, 0xf8, 0x5a, 0x73, 0x38, 0x8f, 0xbf, 0xe5, 0xc2, + 0x45, 0xac, 0x49, 0xf4, 0x77, 0x0e, 0xbc, 0x78, 0x77, 0x08, 0x27, + 0x0a, 0xa6, 0xa8, 0x76, 0x9f, 0xef, 0xe8, 0x93, 0x0f, 0xd0, 0xea, + 0x1e, 0xe6, 0x4b, 0x31, 0x40, 0x7d, 0x76, 0x95, 0x09}}; + auto const prefix4Prefix = "aaa"s; + auto const prefix4Msg = ""s; + auto const prefix4MaxMsgLength = 0; + auto const ed6Msg = ""s; + std::array const ed6PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed6Sig{ + {0xe5, 0x56, 0x43, 0x00, 0xc3, 0x60, 0xac, 0x72, 0x90, 0x86, 0xe2, + 0xcc, 0x80, 0x6e, 0x82, 0x8a, 0x84, 0x87, 0x7f, 0x1e, 0xb8, 0xe5, + 0xd9, 0x74, 0xd8, 0x73, 0xe0, 0x65, 0x22, 0x49, 0x01, 0x55, 0x5f, + 0xb8, 0x82, 0x15, 0x90, 0xa3, 0x3b, 0xac, 0xc6, 0x1e, 0x39, 0x70, + 0x1c, 0xf9, 0xb4, 0x6b, 0xd2, 0x5b, 0xf5, 0xf0, 0x59, 0x5b, 0xbe, + 0x24, 0x65, 0x51, 0x41, 0x43, 0x8e, 0x7a, 0x10, 0x0b}}; + auto const thresh0Msg = ""s; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(ed2)); + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + auto ed5 = std::make_unique(ed5PublicKey, ed5Sig); + auto prefix4 = std::make_unique( + makeSlice(prefix4Prefix), prefix4MaxMsgLength, std::move(ed5)); + auto ed6 = std::make_unique(ed6PublicKey, ed6Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(ed3)); + thresh0Subfulfillments.emplace_back(std::move(prefix4)); + thresh0Subfulfillments.emplace_back(std::move(ed6)); + std::vector thresh0Subconditions{}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\xb6\xa0\x82\x01\xb0\xa1\x70\x80\x03\x61\x61\x61" + "\x81\x01\x00\xa2\x66\xa4\x64\x80\x20\xd7\x5a\x98\x01\x82\xb1" + "\x0a\xb7\xd5\x4b\xfe\xd3\xc9\x64\x07\x3a\x0e\xe1\x72\xf3\xda" + "\xa6\x23\x25\xaf\x02\x1a\x68\xf7\x07\x51\x1a\x81\x40\x50\x6a" + "\x1e\xa6\x83\x18\xe6\x2d\x40\x63\x5d\xad\x04\x3e\x19\x87\xeb" + "\xc2\x6e\x5b\x5c\x44\x06\xf7\xbd\xf8\x5a\x73\x38\x8f\xbf\xe5" + "\xc2\x45\xac\x49\xf4\x77\x0e\xbc\x78\x77\x08\x27\x0a\xa6\xa8" + "\x76\x9f\xef\xe8\x93\x0f\xd0\xea\x1e\xe6\x4b\x31\x40\x7d\x76" + "\x95\x09\xa1\x70\x80\x03\x61\x61\x61\x81\x01\x00\xa2\x66\xa4" + "\x64\x80\x20\xd7\x5a\x98\x01\x82\xb1\x0a\xb7\xd5\x4b\xfe\xd3" + "\xc9\x64\x07\x3a\x0e\xe1\x72\xf3\xda\xa6\x23\x25\xaf\x02\x1a" + "\x68\xf7\x07\x51\x1a\x81\x40\x50\x6a\x1e\xa6\x83\x18\xe6\x2d" + "\x40\x63\x5d\xad\x04\x3e\x19\x87\xeb\xc2\x6e\x5b\x5c\x44\x06" + "\xf7\xbd\xf8\x5a\x73\x38\x8f\xbf\xe5\xc2\x45\xac\x49\xf4\x77" + "\x0e\xbc\x78\x77\x08\x27\x0a\xa6\xa8\x76\x9f\xef\xe8\x93\x0f" + "\xd0\xea\x1e\xe6\x4b\x31\x40\x7d\x76\x95\x09\xa4\x64\x80\x20" + "\xd7\x5a\x98\x01\x82\xb1\x0a\xb7\xd5\x4b\xfe\xd3\xc9\x64\x07" + "\x3a\x0e\xe1\x72\xf3\xda\xa6\x23\x25\xaf\x02\x1a\x68\xf7\x07" + "\x51\x1a\x81\x40\xe5\x56\x43\x00\xc3\x60\xac\x72\x90\x86\xe2" + "\xcc\x80\x6e\x82\x8a\x84\x87\x7f\x1e\xb8\xe5\xd9\x74\xd8\x73" + "\xe0\x65\x22\x49\x01\x55\x5f\xb8\x82\x15\x90\xa3\x3b\xac\xc6" + "\x1e\x39\x70\x1c\xf9\xb4\x6b\xd2\x5b\xf5\xf0\x59\x5b\xbe\x24" + "\x65\x51\x41\x43\x8e\x7a\x10\x0b\xa4\x64\x80\x20\xd7\x5a\x98" + "\x01\x82\xb1\x0a\xb7\xd5\x4b\xfe\xd3\xc9\x64\x07\x3a\x0e\xe1" + "\x72\xf3\xda\xa6\x23\x25\xaf\x02\x1a\x68\xf7\x07\x51\x1a\x81" + "\x40\xe5\x56\x43\x00\xc3\x60\xac\x72\x90\x86\xe2\xcc\x80\x6e" + "\x82\x8a\x84\x87\x7f\x1e\xb8\xe5\xd9\x74\xd8\x73\xe0\x65\x22" + "\x49\x01\x55\x5f\xb8\x82\x15\x90\xa3\x3b\xac\xc6\x1e\x39\x70" + "\x1c\xf9\xb4\x6b\xd2\x5b\xf5\xf0\x59\x5b\xbe\x24\x65\x51\x41" + "\x43\x8e\x7a\x10\x0b\xa1\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x8e\x43\x3e\xf5\xd3\xea\xa0\x0a\x2b\x34\xa0" + "\x5c\xa7\xc2\x2d\xd3\x92\x97\x3a\x19\xf1\xa2\x43\x26\x8c\xb5" + "\x31\x11\xbd\xf1\xc8\x44\x81\x03\x08\x18\x06\x82\x02\x03\x48"s; + auto const thresh0EncodedFingerprint = + "\x30\x81\xb2\x80\x01\x04\xa1\x81\xac\xa1\x2b\x80\x20\x45\x1f" + "\xe1\x5f\x16\x29\x9d\x49\x59\x93\xfe\x69\x2d\xb9\x89\xe5\x6a" + "\x52\x30\xa9\x04\x76\xf7\x73\x92\xa3\xcd\x32\x13\xc0\x73\x3f" + "\x81\x03\x02\x04\x03\x82\x02\x03\x08\xa1\x2b\x80\x20\x45\x1f" + "\xe1\x5f\x16\x29\x9d\x49\x59\x93\xfe\x69\x2d\xb9\x89\xe5\x6a" + "\x52\x30\xa9\x04\x76\xf7\x73\x92\xa3\xcd\x32\x13\xc0\x73\x3f" + "\x81\x03\x02\x04\x03\x82\x02\x03\x08\xa4\x27\x80\x20\x79\x92" + "\x39\xab\xa8\xfc\x4f\xf7\xea\xbf\xbc\x4c\x44\xe6\x9e\x8b\xdf" + "\xed\x99\x33\x24\xe1\x2e\xd6\x47\x92\xab\xe2\x89\xcf\x1d\x5f" + "\x81\x03\x02\x00\x00\xa4\x27\x80\x20\x79\x92\x39\xab\xa8\xfc" + "\x4f\xf7\xea\xbf\xbc\x4c\x44\xe6\x9e\x8b\xdf\xed\x99\x33\x24" + "\xe1\x2e\xd6\x47\x92\xab\xe2\x89\xcf\x1d\x5f\x81\x03\x02\x00" + "\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh4() + { + testcase("Thresh4"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** thresh1 + // *** Rsa5Cond + // *** prefix2 + // **** ed3 + // *** ed4 + // ** preim6 + + auto const ed3Msg = ""s; + std::array const ed3PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed3Sig{ + {0x50, 0x6a, 0x1e, 0xa6, 0x83, 0x18, 0xe6, 0x2d, 0x40, 0x63, 0x5d, + 0xad, 0x04, 0x3e, 0x19, 0x87, 0xeb, 0xc2, 0x6e, 0x5b, 0x5c, 0x44, + 0x06, 0xf7, 0xbd, 0xf8, 0x5a, 0x73, 0x38, 0x8f, 0xbf, 0xe5, 0xc2, + 0x45, 0xac, 0x49, 0xf4, 0x77, 0x0e, 0xbc, 0x78, 0x77, 0x08, 0x27, + 0x0a, 0xa6, 0xa8, 0x76, 0x9f, 0xef, 0xe8, 0x93, 0x0f, 0xd0, 0xea, + 0x1e, 0xe6, 0x4b, 0x31, 0x40, 0x7d, 0x76, 0x95, 0x09}}; + auto const prefix2Prefix = "aaa"s; + auto const prefix2Msg = ""s; + auto const prefix2MaxMsgLength = 0; + auto const ed4Msg = ""s; + std::array const ed4PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed4Sig{ + {0xe5, 0x56, 0x43, 0x00, 0xc3, 0x60, 0xac, 0x72, 0x90, 0x86, 0xe2, + 0xcc, 0x80, 0x6e, 0x82, 0x8a, 0x84, 0x87, 0x7f, 0x1e, 0xb8, 0xe5, + 0xd9, 0x74, 0xd8, 0x73, 0xe0, 0x65, 0x22, 0x49, 0x01, 0x55, 0x5f, + 0xb8, 0x82, 0x15, 0x90, 0xa3, 0x3b, 0xac, 0xc6, 0x1e, 0x39, 0x70, + 0x1c, 0xf9, 0xb4, 0x6b, 0xd2, 0x5b, 0xf5, 0xf0, 0x59, 0x5b, 0xbe, + 0x24, 0x65, 0x51, 0x41, 0x43, 0x8e, 0x7a, 0x10, 0x0b}}; + auto const thresh1Msg = ""s; + std::array const Rsa5CondConditionFingerprint = { + {0x4d, 0xd2, 0xea, 0x7f, 0x85, 0xb3, 0xea, 0xcb, 0x8f, 0x19, 0x05, + 0x8e, 0x83, 0x60, 0x95, 0x5c, 0x32, 0xe7, 0x4c, 0x12, 0x43, 0x92, + 0xa1, 0xf4, 0x46, 0x60, 0x73, 0x97, 0x09, 0xc5, 0x39, 0xc3}}; + Condition const Rsa5Cond{Type::rsaSha256, + 262144, + Rsa5CondConditionFingerprint, + std::bitset<5>{0}}; + auto const preim6Preimage = "aaa"s; + auto const preim6Msg = ""s; + auto const thresh0Msg = ""s; + + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(ed3)); + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(prefix2)); + thresh1Subfulfillments.emplace_back(std::move(ed4)); + std::vector thresh1Subconditions{{Rsa5Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim6 = + std::make_unique(makeSlice(preim6Preimage)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim6)); + std::vector thresh0Subconditions{}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\x17\xa0\x82\x01\x11\xa0\x05\x80\x03\x61\x61\x61" + "\xa2\x82\x01\x06\xa0\x81\xd8\xa1\x70\x80\x03\x61\x61\x61\x81" + "\x01\x00\xa2\x66\xa4\x64\x80\x20\xd7\x5a\x98\x01\x82\xb1\x0a" + "\xb7\xd5\x4b\xfe\xd3\xc9\x64\x07\x3a\x0e\xe1\x72\xf3\xda\xa6" + "\x23\x25\xaf\x02\x1a\x68\xf7\x07\x51\x1a\x81\x40\x50\x6a\x1e" + "\xa6\x83\x18\xe6\x2d\x40\x63\x5d\xad\x04\x3e\x19\x87\xeb\xc2" + "\x6e\x5b\x5c\x44\x06\xf7\xbd\xf8\x5a\x73\x38\x8f\xbf\xe5\xc2" + "\x45\xac\x49\xf4\x77\x0e\xbc\x78\x77\x08\x27\x0a\xa6\xa8\x76" + "\x9f\xef\xe8\x93\x0f\xd0\xea\x1e\xe6\x4b\x31\x40\x7d\x76\x95" + "\x09\xa4\x64\x80\x20\xd7\x5a\x98\x01\x82\xb1\x0a\xb7\xd5\x4b" + "\xfe\xd3\xc9\x64\x07\x3a\x0e\xe1\x72\xf3\xda\xa6\x23\x25\xaf" + "\x02\x1a\x68\xf7\x07\x51\x1a\x81\x40\xe5\x56\x43\x00\xc3\x60" + "\xac\x72\x90\x86\xe2\xcc\x80\x6e\x82\x8a\x84\x87\x7f\x1e\xb8" + "\xe5\xd9\x74\xd8\x73\xe0\x65\x22\x49\x01\x55\x5f\xb8\x82\x15" + "\x90\xa3\x3b\xac\xc6\x1e\x39\x70\x1c\xf9\xb4\x6b\xd2\x5b\xf5" + "\xf0\x59\x5b\xbe\x24\x65\x51\x41\x43\x8e\x7a\x10\x0b\xa1\x29" + "\xa3\x27\x80\x20\x4d\xd2\xea\x7f\x85\xb3\xea\xcb\x8f\x19\x05" + "\x8e\x83\x60\x95\x5c\x32\xe7\x4c\x12\x43\x92\xa1\xf4\x46\x60" + "\x73\x97\x09\xc5\x39\xc3\x81\x03\x04\x00\x00\xa1\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x0c\x99\x63\x0a\x20\x1a\x99\xb0\x74\x8d\x2b" + "\xad\xb2\x05\xe5\xca\x93\x96\x92\xc6\x87\xd1\xc4\xa6\x97\xe3" + "\x9b\xa8\xba\x1e\xbe\x71\x81\x03\x06\x18\x06\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x59\x80\x01\x02\xa1\x54\xa0\x25\x80\x20\x98\x34\x87\x6d" + "\xcf\xb0\x5c\xb1\x67\xa5\xc2\x49\x53\xeb\xa5\x8c\x4a\xc8\x9b" + "\x1a\xdf\x57\xf2\x8f\x2f\x9d\x09\xaf\x10\x7e\xe8\xf0\x81\x01" + "\x03\xa2\x2b\x80\x20\xb6\xac\xf4\x08\x3e\x43\x8b\xe4\x35\x6f" + "\x25\xff\x92\xc2\x95\xe9\xc8\xe1\xba\xb1\x41\xb4\x60\x7b\xa4" + "\x85\x11\xeb\xa3\x5a\xef\xcc\x81\x03\x06\x10\x03\x82\x02\x03" + "\x58"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh5() + { + testcase("Thresh5"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim2Cond + // ** preim1 + + auto const preim1Preimage = "aaa"s; + auto const preim1Msg = ""s; + auto const thresh0Msg = ""s; + std::array const Preim2CondConditionFingerprint = { + {0x98, 0x34, 0x87, 0x6d, 0xcf, 0xb0, 0x5c, 0xb1, 0x67, 0xa5, 0xc2, + 0x49, 0x53, 0xeb, 0xa5, 0x8c, 0x4a, 0xc8, 0x9b, 0x1a, 0xdf, 0x57, + 0xf2, 0x8f, 0x2f, 0x9d, 0x09, 0xaf, 0x10, 0x7e, 0xe8, 0xf0}}; + Condition const Preim2Cond{Type::preimageSha256, + 3, + Preim2CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim1 = + std::make_unique(makeSlice(preim1Preimage)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(preim1)); + std::vector thresh0Subconditions{{Preim2Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x32\xa0\x07\xa0\x05\x80\x03\x61\x61\x61\xa1\x27\xa0\x25" + "\x80\x20\x98\x34\x87\x6d\xcf\xb0\x5c\xb1\x67\xa5\xc2\x49\x53" + "\xeb\xa5\x8c\x4a\xc8\x9b\x1a\xdf\x57\xf2\x8f\x2f\x9d\x09\xaf" + "\x10\x7e\xe8\xf0\x81\x01\x03"s; + auto const thresh0EncodedCondition = + "\xa2\x2a\x80\x20\xe4\xfd\xb4\x65\x2c\x6f\x17\xa3\x8b\x2a\xbe" + "\x9a\xa0\x06\x40\xb1\xe1\x84\xfe\x7a\x8d\x0c\x97\x1b\x5d\x24" + "\xf7\xed\xa6\xfc\x68\xbf\x81\x02\x08\x03\x82\x02\x07\x80"s; + auto const thresh0EncodedFingerprint = + "\x30\x53\x80\x01\x01\xa1\x4e\xa0\x25\x80\x20\x98\x34\x87\x6d" + "\xcf\xb0\x5c\xb1\x67\xa5\xc2\x49\x53\xeb\xa5\x8c\x4a\xc8\x9b" + "\x1a\xdf\x57\xf2\x8f\x2f\x9d\x09\xaf\x10\x7e\xe8\xf0\x81\x01" + "\x03\xa0\x25\x80\x20\x98\x34\x87\x6d\xcf\xb0\x5c\xb1\x67\xa5" + "\xc2\x49\x53\xeb\xa5\x8c\x4a\xc8\x9b\x1a\xdf\x57\xf2\x8f\x2f" + "\x9d\x09\xaf\x10\x7e\xe8\xf0\x81\x01\x03"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testRsa1() + { + testcase("Rsa1"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * rsa0 + + auto const rsa0Msg = "\x61\x61\x61"s; + std::array const rsa0PublicKey{ + {0xe1, 0xef, 0x8b, 0x24, 0xd6, 0xf7, 0x6b, 0x09, 0xc8, 0x1e, 0xd7, + 0x75, 0x2a, 0xa2, 0x62, 0xf0, 0x44, 0xf0, 0x4a, 0x87, 0x4d, 0x43, + 0x80, 0x9d, 0x31, 0xce, 0xa6, 0x12, 0xf9, 0x9b, 0x0c, 0x97, 0xa8, + 0xb4, 0x37, 0x41, 0x53, 0xe3, 0xee, 0xf3, 0xd6, 0x66, 0x16, 0x84, + 0x3e, 0x0e, 0x41, 0xc2, 0x93, 0x26, 0x4b, 0x71, 0xb6, 0x17, 0x3d, + 0xb1, 0xcf, 0x0d, 0x6c, 0xd5, 0x58, 0xc5, 0x86, 0x57, 0x70, 0x6f, + 0xcf, 0x09, 0x7f, 0x70, 0x4c, 0x48, 0x3e, 0x59, 0xcb, 0xfd, 0xfd, + 0x5b, 0x3e, 0xe7, 0xbc, 0x80, 0xd7, 0x40, 0xc5, 0xe0, 0xf0, 0x47, + 0xf3, 0xe8, 0x5f, 0xc0, 0xd7, 0x58, 0x15, 0x77, 0x6a, 0x6f, 0x3f, + 0x23, 0xc5, 0xdc, 0x5e, 0x79, 0x71, 0x39, 0xa6, 0x88, 0x2e, 0x38, + 0x33, 0x6a, 0x4a, 0x5f, 0xb3, 0x61, 0x37, 0x62, 0x0f, 0xf3, 0x66, + 0x3d, 0xba, 0xe3, 0x28, 0x47, 0x28, 0x01, 0x86, 0x2f, 0x72, 0xf2, + 0xf8, 0x7b, 0x20, 0x2b, 0x9c, 0x89, 0xad, 0xd7, 0xcd, 0x5b, 0x0a, + 0x07, 0x6f, 0x7c, 0x53, 0xe3, 0x50, 0x39, 0xf6, 0x7e, 0xd1, 0x7e, + 0xc8, 0x15, 0xe5, 0xb4, 0x30, 0x5c, 0xc6, 0x31, 0x97, 0x06, 0x8d, + 0x5e, 0x6e, 0x57, 0x9b, 0xa6, 0xde, 0x5f, 0x4e, 0x3e, 0x57, 0xdf, + 0x5e, 0x4e, 0x07, 0x2f, 0xf2, 0xce, 0x4c, 0x66, 0xeb, 0x45, 0x23, + 0x39, 0x73, 0x87, 0x52, 0x75, 0x96, 0x39, 0xf0, 0x25, 0x7b, 0xf5, + 0x7d, 0xbd, 0x5c, 0x44, 0x3f, 0xb5, 0x15, 0x8c, 0xce, 0x0a, 0x3d, + 0x36, 0xad, 0xc7, 0xba, 0x01, 0xf3, 0x3a, 0x0b, 0xb6, 0xdb, 0xb2, + 0xbf, 0x98, 0x9d, 0x60, 0x71, 0x12, 0xf2, 0x34, 0x4d, 0x99, 0x3e, + 0x77, 0xe5, 0x63, 0xc1, 0xd3, 0x61, 0xde, 0xdf, 0x57, 0xda, 0x96, + 0xef, 0x2c, 0xfc, 0x68, 0x5f, 0x00, 0x2b, 0x63, 0x82, 0x46, 0xa5, + 0xb3, 0x09, 0xb9}}; + std::array const rsa0Sig{ + {0x48, 0xe8, 0x94, 0x5e, 0xfe, 0x00, 0x75, 0x56, 0xd5, 0xbf, 0x4d, + 0x5f, 0x24, 0x9e, 0x48, 0x08, 0xf7, 0x30, 0x7e, 0x29, 0x51, 0x1d, + 0x32, 0x62, 0xda, 0xef, 0x61, 0xd8, 0x80, 0x98, 0xf9, 0xaa, 0x4a, + 0x8b, 0xc0, 0x62, 0x3a, 0x8c, 0x97, 0x57, 0x38, 0xf6, 0x5d, 0x6b, + 0xf4, 0x59, 0xd5, 0x43, 0xf2, 0x89, 0xd7, 0x3c, 0xbc, 0x7a, 0xf4, + 0xea, 0x3a, 0x33, 0xfb, 0xf3, 0xec, 0x44, 0x40, 0x44, 0x79, 0x11, + 0xd7, 0x22, 0x94, 0x09, 0x1e, 0x56, 0x18, 0x33, 0x62, 0x8e, 0x49, + 0xa7, 0x72, 0xed, 0x60, 0x8d, 0xe6, 0xc4, 0x45, 0x95, 0xa9, 0x1e, + 0x3e, 0x17, 0xd6, 0xcf, 0x5e, 0xc3, 0xb2, 0x52, 0x8d, 0x63, 0xd2, + 0xad, 0xd6, 0x46, 0x39, 0x89, 0xb1, 0x2e, 0xec, 0x57, 0x7d, 0xf6, + 0x47, 0x09, 0x60, 0xdf, 0x68, 0x32, 0xa9, 0xd8, 0x4c, 0x36, 0x0d, + 0x1c, 0x21, 0x7a, 0xd6, 0x4c, 0x86, 0x25, 0xbd, 0xb5, 0x94, 0xfb, + 0x0a, 0xda, 0x08, 0x6c, 0xde, 0xcb, 0xbd, 0xe5, 0x80, 0xd4, 0x24, + 0xbf, 0x97, 0x46, 0xd2, 0xf0, 0xc3, 0x12, 0x82, 0x6d, 0xbb, 0xb0, + 0x0a, 0xd6, 0x8b, 0x52, 0xc4, 0xcb, 0x7d, 0x47, 0x15, 0x6b, 0xa3, + 0x5e, 0x3a, 0x98, 0x1c, 0x97, 0x38, 0x63, 0x79, 0x2c, 0xc8, 0x0d, + 0x04, 0xa1, 0x80, 0x21, 0x0a, 0x52, 0x41, 0x58, 0x65, 0xb6, 0x4b, + 0x3a, 0x61, 0x77, 0x4b, 0x1d, 0x39, 0x75, 0xd7, 0x8a, 0x98, 0xb0, + 0x82, 0x1e, 0xe5, 0x5c, 0xa0, 0xf8, 0x63, 0x05, 0xd4, 0x25, 0x29, + 0xe1, 0x0e, 0xb0, 0x15, 0xce, 0xfd, 0x40, 0x2f, 0xb5, 0x9b, 0x2a, + 0xbb, 0x8d, 0xee, 0xe5, 0x2a, 0x6f, 0x24, 0x47, 0xd2, 0x28, 0x46, + 0x03, 0xd2, 0x19, 0xcd, 0x4e, 0x8c, 0xf9, 0xcf, 0xfd, 0xd5, 0x49, + 0x88, 0x89, 0xc3, 0x78, 0x0b, 0x59, 0xdd, 0x6a, 0x57, 0xef, 0x7d, + 0x73, 0x26, 0x20}}; + + auto rsa0 = std::make_unique( + makeSlice(rsa0PublicKey), makeSlice(rsa0Sig)); + { + auto rsa0EncodedFulfillment = + "\xa3\x82\x02\x08\x80\x82\x01\x00\xe1\xef\x8b\x24\xd6\xf7\x6b" + "\x09\xc8\x1e\xd7\x75\x2a\xa2\x62\xf0\x44\xf0\x4a\x87\x4d\x43" + "\x80\x9d\x31\xce\xa6\x12\xf9\x9b\x0c\x97\xa8\xb4\x37\x41\x53" + "\xe3\xee\xf3\xd6\x66\x16\x84\x3e\x0e\x41\xc2\x93\x26\x4b\x71" + "\xb6\x17\x3d\xb1\xcf\x0d\x6c\xd5\x58\xc5\x86\x57\x70\x6f\xcf" + "\x09\x7f\x70\x4c\x48\x3e\x59\xcb\xfd\xfd\x5b\x3e\xe7\xbc\x80" + "\xd7\x40\xc5\xe0\xf0\x47\xf3\xe8\x5f\xc0\xd7\x58\x15\x77\x6a" + "\x6f\x3f\x23\xc5\xdc\x5e\x79\x71\x39\xa6\x88\x2e\x38\x33\x6a" + "\x4a\x5f\xb3\x61\x37\x62\x0f\xf3\x66\x3d\xba\xe3\x28\x47\x28" + "\x01\x86\x2f\x72\xf2\xf8\x7b\x20\x2b\x9c\x89\xad\xd7\xcd\x5b" + "\x0a\x07\x6f\x7c\x53\xe3\x50\x39\xf6\x7e\xd1\x7e\xc8\x15\xe5" + "\xb4\x30\x5c\xc6\x31\x97\x06\x8d\x5e\x6e\x57\x9b\xa6\xde\x5f" + "\x4e\x3e\x57\xdf\x5e\x4e\x07\x2f\xf2\xce\x4c\x66\xeb\x45\x23" + "\x39\x73\x87\x52\x75\x96\x39\xf0\x25\x7b\xf5\x7d\xbd\x5c\x44" + "\x3f\xb5\x15\x8c\xce\x0a\x3d\x36\xad\xc7\xba\x01\xf3\x3a\x0b" + "\xb6\xdb\xb2\xbf\x98\x9d\x60\x71\x12\xf2\x34\x4d\x99\x3e\x77" + "\xe5\x63\xc1\xd3\x61\xde\xdf\x57\xda\x96\xef\x2c\xfc\x68\x5f" + "\x00\x2b\x63\x82\x46\xa5\xb3\x09\xb9\x81\x82\x01\x00\x48\xe8" + "\x94\x5e\xfe\x00\x75\x56\xd5\xbf\x4d\x5f\x24\x9e\x48\x08\xf7" + "\x30\x7e\x29\x51\x1d\x32\x62\xda\xef\x61\xd8\x80\x98\xf9\xaa" + "\x4a\x8b\xc0\x62\x3a\x8c\x97\x57\x38\xf6\x5d\x6b\xf4\x59\xd5" + "\x43\xf2\x89\xd7\x3c\xbc\x7a\xf4\xea\x3a\x33\xfb\xf3\xec\x44" + "\x40\x44\x79\x11\xd7\x22\x94\x09\x1e\x56\x18\x33\x62\x8e\x49" + "\xa7\x72\xed\x60\x8d\xe6\xc4\x45\x95\xa9\x1e\x3e\x17\xd6\xcf" + "\x5e\xc3\xb2\x52\x8d\x63\xd2\xad\xd6\x46\x39\x89\xb1\x2e\xec" + "\x57\x7d\xf6\x47\x09\x60\xdf\x68\x32\xa9\xd8\x4c\x36\x0d\x1c" + "\x21\x7a\xd6\x4c\x86\x25\xbd\xb5\x94\xfb\x0a\xda\x08\x6c\xde" + "\xcb\xbd\xe5\x80\xd4\x24\xbf\x97\x46\xd2\xf0\xc3\x12\x82\x6d" + "\xbb\xb0\x0a\xd6\x8b\x52\xc4\xcb\x7d\x47\x15\x6b\xa3\x5e\x3a" + "\x98\x1c\x97\x38\x63\x79\x2c\xc8\x0d\x04\xa1\x80\x21\x0a\x52" + "\x41\x58\x65\xb6\x4b\x3a\x61\x77\x4b\x1d\x39\x75\xd7\x8a\x98" + "\xb0\x82\x1e\xe5\x5c\xa0\xf8\x63\x05\xd4\x25\x29\xe1\x0e\xb0" + "\x15\xce\xfd\x40\x2f\xb5\x9b\x2a\xbb\x8d\xee\xe5\x2a\x6f\x24" + "\x47\xd2\x28\x46\x03\xd2\x19\xcd\x4e\x8c\xf9\xcf\xfd\xd5\x49" + "\x88\x89\xc3\x78\x0b\x59\xdd\x6a\x57\xef\x7d\x73\x26\x20"s; + auto const rsa0EncodedCondition = + "\xa3\x27\x80\x20\xb3\x1f\xa8\x20\x6e\x4e\xa7\xe5\x15\x33\x7b" + "\x3b\x33\x08\x2b\x87\x76\x51\x80\x10\x85\xed\x84\xfb\x4d\xae" + "\xb2\x47\xbf\x69\x8d\x7f\x81\x03\x01\x00\x00"s; + auto const rsa0EncodedFingerprint = + "\x30\x82\x01\x04\x80\x82\x01\x00\xe1\xef\x8b\x24\xd6\xf7\x6b" + "\x09\xc8\x1e\xd7\x75\x2a\xa2\x62\xf0\x44\xf0\x4a\x87\x4d\x43" + "\x80\x9d\x31\xce\xa6\x12\xf9\x9b\x0c\x97\xa8\xb4\x37\x41\x53" + "\xe3\xee\xf3\xd6\x66\x16\x84\x3e\x0e\x41\xc2\x93\x26\x4b\x71" + "\xb6\x17\x3d\xb1\xcf\x0d\x6c\xd5\x58\xc5\x86\x57\x70\x6f\xcf" + "\x09\x7f\x70\x4c\x48\x3e\x59\xcb\xfd\xfd\x5b\x3e\xe7\xbc\x80" + "\xd7\x40\xc5\xe0\xf0\x47\xf3\xe8\x5f\xc0\xd7\x58\x15\x77\x6a" + "\x6f\x3f\x23\xc5\xdc\x5e\x79\x71\x39\xa6\x88\x2e\x38\x33\x6a" + "\x4a\x5f\xb3\x61\x37\x62\x0f\xf3\x66\x3d\xba\xe3\x28\x47\x28" + "\x01\x86\x2f\x72\xf2\xf8\x7b\x20\x2b\x9c\x89\xad\xd7\xcd\x5b" + "\x0a\x07\x6f\x7c\x53\xe3\x50\x39\xf6\x7e\xd1\x7e\xc8\x15\xe5" + "\xb4\x30\x5c\xc6\x31\x97\x06\x8d\x5e\x6e\x57\x9b\xa6\xde\x5f" + "\x4e\x3e\x57\xdf\x5e\x4e\x07\x2f\xf2\xce\x4c\x66\xeb\x45\x23" + "\x39\x73\x87\x52\x75\x96\x39\xf0\x25\x7b\xf5\x7d\xbd\x5c\x44" + "\x3f\xb5\x15\x8c\xce\x0a\x3d\x36\xad\xc7\xba\x01\xf3\x3a\x0b" + "\xb6\xdb\xb2\xbf\x98\x9d\x60\x71\x12\xf2\x34\x4d\x99\x3e\x77" + "\xe5\x63\xc1\xd3\x61\xde\xdf\x57\xda\x96\xef\x2c\xfc\x68\x5f" + "\x00\x2b\x63\x82\x46\xa5\xb3\x09\xb9"s; + check( + std::move(rsa0), + rsa0Msg, + std::move(rsa0EncodedFulfillment), + rsa0EncodedCondition, + rsa0EncodedFingerprint); + } + } + + void + testRsa2() + { + testcase("Rsa2"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * rsa0 + + auto const rsa0Msg = "\x61\x61\x61"s; + std::array const rsa0PublicKey{ + {0xbb, 0xb0, 0xa1, 0xa3, 0x14, 0xff, 0x6a, 0x2f, 0xc7, 0x9a, 0xe0, + 0x6f, 0x61, 0x0d, 0xc8, 0xd4, 0x42, 0x1c, 0x93, 0x3e, 0xd0, 0xc4, + 0x35, 0x4e, 0x6a, 0xea, 0xd9, 0x1e, 0xf9, 0x47, 0xea, 0x4f, 0x8f, + 0x63, 0x2b, 0x2e, 0x2f, 0x78, 0xb8, 0xa0, 0x7a, 0x78, 0xc3, 0x32, + 0x48, 0x95, 0xc7, 0xcb, 0x09, 0x16, 0xeb, 0x33, 0x4c, 0x10, 0x09, + 0x0e, 0x5e, 0xdb, 0x9e, 0x02, 0x95, 0xed, 0x2f, 0xf1, 0xde, 0xaf, + 0xd1, 0xf4, 0x9f, 0x54, 0x41, 0x2e, 0x43, 0xed, 0xe2, 0xcb, 0x06, + 0xcf, 0xfc, 0x39, 0x53, 0x03, 0x30, 0x9a, 0x4c, 0xe3, 0xea, 0xc2, + 0x34, 0x1d, 0x9a, 0xf3, 0x18, 0x83, 0x37, 0xee, 0xba, 0xbd, 0x3d, + 0x4a, 0x4a, 0xf8, 0xf4, 0x3e, 0x15, 0x7d, 0x6f, 0x02, 0xf9, 0xd1, + 0xf2, 0x4a, 0x42, 0x77, 0x70, 0x49, 0xc9, 0x30, 0xaa, 0x23, 0x3f, + 0xed, 0x5c, 0x63, 0xb0, 0x7f, 0x72, 0x5c, 0xde, 0x6b, 0xb2, 0x44, + 0x04, 0xfc, 0xbf, 0xc0, 0xb8, 0x72, 0x47, 0xea, 0xcb, 0x7d, 0xb0, + 0x44, 0x78, 0x5b, 0xa6, 0x6e, 0xde, 0x8e, 0x79, 0x21, 0x12, 0x47, + 0x01, 0x50, 0x40, 0x1e, 0x0a, 0x84, 0x71, 0xbd, 0xe3, 0x6f, 0x2d, + 0x5e, 0xcb, 0x96, 0x0f, 0x57, 0x1b, 0xa1, 0x7d, 0xaf, 0x38, 0x1d, + 0x83, 0x78, 0xde, 0xc2, 0x1e, 0x10, 0x12, 0xe4, 0xb3, 0x76, 0xc9, + 0xe6, 0xc4, 0x6b, 0xb6, 0x7d, 0x68, 0xee, 0xf1, 0x2b, 0xa9, 0xa1, + 0x59, 0x67, 0xf4, 0x86, 0xd8, 0xbc, 0x91, 0xb3, 0xe2, 0xb0, 0x6f, + 0xa5, 0xfc, 0xa6, 0x9b, 0x75, 0x24, 0x26, 0xaf, 0x02, 0x9c, 0xb1, + 0x49, 0xea, 0x58, 0x6d, 0xed, 0x85, 0x1e, 0xba, 0x16, 0x08, 0x76, + 0xac, 0xd8, 0x5f, 0x06, 0x22, 0x71, 0xfa, 0xd7, 0x3d, 0x15, 0xf5, + 0xf0, 0xf0, 0x22, 0xe2, 0x61, 0x30, 0x92, 0x26, 0xbe, 0xe3, 0x56, + 0x7a, 0xd0, 0x52, 0xf9, 0x74, 0x6c, 0xa8, 0xbf, 0xac, 0xf0, 0xd4, + 0xf4, 0x17, 0x30, 0x08, 0x5c, 0x09, 0x7a, 0x02, 0x02, 0x83, 0x01, + 0xd9, 0x2a, 0x0c, 0x54, 0x5c, 0x03, 0x97, 0x47, 0x2c, 0x2e, 0xee, + 0x5b, 0x61, 0x22, 0x20, 0x25, 0xd6, 0x34, 0x70, 0xee, 0x68, 0x1c, + 0xe3, 0x25, 0x27, 0x47, 0xce, 0x9c, 0xa2, 0x3f, 0x19, 0xe6, 0x6f, + 0x2f, 0x63, 0x86, 0xe6, 0xad, 0x13, 0x91, 0x1d, 0x7a, 0xda, 0xcd, + 0x38, 0xce, 0x5c, 0xa8, 0xff, 0x2c, 0x2d, 0x99, 0xab, 0xb0, 0xf5, + 0xc3, 0xba, 0x84, 0x75, 0x09, 0x61, 0x3e, 0x66, 0x32, 0xa1, 0x2c, + 0xe6, 0xef, 0x78, 0xda, 0x4c, 0x82, 0x0e, 0x90, 0x83, 0x40, 0x53, + 0x00, 0x3d, 0x11, 0x97, 0xf6, 0xa5, 0x7b, 0x01, 0x00, 0xfe, 0xe1, + 0x52, 0xc8, 0x4c, 0x8b, 0x1b, 0x33, 0xbb, 0x96, 0x57, 0x19, 0x88, + 0x78, 0x0f, 0xaf, 0xbd, 0x69, 0x7c, 0xf8, 0x37, 0x0a, 0x99, 0xda, + 0x8f, 0xaa, 0xf7, 0x56, 0x87, 0xd9, 0x51, 0xcc, 0x65, 0x33, 0xc7, + 0x8b, 0x8e, 0x1c, 0xe2, 0xe1, 0xd5, 0xce, 0xb9, 0xa1, 0x16, 0x29, + 0x20, 0x1a, 0xf4, 0x37, 0x47, 0x5c, 0x94, 0x02, 0x7f, 0xa5, 0x26, + 0x14, 0xb4, 0x30, 0x0b, 0x77, 0xdc, 0xf1, 0x80, 0xac, 0x49, 0xca, + 0xa3, 0x40, 0x16, 0x8f, 0x32, 0x62, 0xfd, 0x1e, 0xe8, 0xb1, 0x38, + 0x02, 0xce, 0xa3, 0x57, 0x54, 0xb4, 0x23, 0xb8, 0x33, 0xfa, 0x14, + 0xc5, 0xdd, 0x0c, 0x47, 0x6d, 0xde, 0x5d, 0x5e, 0x7b, 0xf7, 0x37, + 0x4d, 0x61, 0xf2, 0x48, 0xc3, 0xba, 0xb9, 0x1c, 0xb0, 0x55, 0x0b, + 0xd1, 0xcb, 0xef, 0x70, 0x50, 0x7e, 0xe8, 0xdb, 0x1c, 0xf3, 0x99, + 0x30, 0x7e, 0x22, 0x8d, 0x4f, 0x45, 0x92, 0xa6, 0x6c, 0x58, 0x57, + 0x3c, 0xfe, 0xcc, 0x63, 0x96, 0x68, 0x06, 0xfa, 0xf8, 0x81, 0x09, + 0xcc, 0xb0, 0x99, 0x23, 0xea, 0x5b}}; + std::array const rsa0Sig{ + {0x41, 0x20, 0x0e, 0x42, 0x96, 0x1e, 0xea, 0x46, 0x0c, 0x82, 0x76, + 0xf2, 0x39, 0xab, 0x66, 0xb7, 0x6f, 0x8f, 0x28, 0x69, 0xea, 0xcc, + 0xc5, 0xf9, 0xe9, 0x94, 0x5c, 0x0a, 0xbc, 0x63, 0xb1, 0x43, 0x06, + 0x56, 0xf3, 0xda, 0x2d, 0x21, 0x7a, 0x43, 0x32, 0x7e, 0xe8, 0xce, + 0x11, 0x27, 0xd1, 0x4a, 0x85, 0xd7, 0x4a, 0xf4, 0x12, 0xfe, 0x93, + 0x70, 0x34, 0x5b, 0xa6, 0xb4, 0x40, 0x03, 0xd7, 0x71, 0xae, 0xdd, + 0x2b, 0xa0, 0xfc, 0x25, 0x06, 0x27, 0xfd, 0xf6, 0x16, 0x31, 0xaf, + 0xd6, 0x4e, 0x9b, 0xee, 0x71, 0x4b, 0x1b, 0xaf, 0xb6, 0x9f, 0x90, + 0x1b, 0xee, 0xb6, 0xf9, 0x59, 0xb1, 0x6a, 0x54, 0xb3, 0x28, 0xa9, + 0xa6, 0x74, 0xc8, 0x83, 0xca, 0xfc, 0x4f, 0xc2, 0xf7, 0xb0, 0x47, + 0x6d, 0xbc, 0xaa, 0x8d, 0x9b, 0xfd, 0x47, 0xf7, 0x34, 0xe3, 0x47, + 0x36, 0xbf, 0x66, 0xe9, 0x73, 0xb3, 0x15, 0xc2, 0xab, 0xf4, 0x72, + 0x7b, 0x06, 0x2c, 0xa3, 0xc4, 0x02, 0x93, 0x6e, 0xb5, 0x08, 0x49, + 0xe1, 0x81, 0x5d, 0xd1, 0x60, 0x4a, 0x60, 0x4d, 0xef, 0xa6, 0x68, + 0xcf, 0xe8, 0x23, 0xb0, 0x08, 0xbf, 0x8f, 0x7b, 0xf5, 0x7c, 0xeb, + 0x1b, 0x41, 0xe5, 0x18, 0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3, + 0x0b, 0x49, 0x25, 0x12, 0xd2, 0x95, 0x74, 0x52, 0x17, 0xdd, 0x65, + 0xec, 0xfe, 0xcb, 0x9c, 0xa1, 0x8d, 0x21, 0x2f, 0x84, 0xa5, 0x06, + 0xd7, 0x00, 0x26, 0xed, 0x33, 0x28, 0x96, 0xbd, 0x24, 0xa6, 0x30, + 0x5a, 0x0c, 0xbd, 0xee, 0x9d, 0xfd, 0x8a, 0xbb, 0x85, 0x07, 0xf8, + 0x40, 0xeb, 0x94, 0xcf, 0xa8, 0xe9, 0x28, 0xe6, 0x91, 0x0c, 0x27, + 0x5f, 0x7b, 0x68, 0xd1, 0x1f, 0x96, 0x46, 0x3c, 0x10, 0x2a, 0x59, + 0x66, 0x13, 0x47, 0x86, 0x95, 0xbc, 0x76, 0x71, 0xfb, 0x27, 0x30, + 0x91, 0x39, 0xc6, 0xcd, 0x2f, 0x15, 0xca, 0x7e, 0x24, 0x05, 0x2e, + 0x47, 0xf4, 0xe3, 0x4e, 0xf8, 0xb8, 0x44, 0xec, 0x36, 0x4a, 0x85, + 0xbd, 0xc9, 0xbe, 0x84, 0x25, 0xcf, 0xf7, 0x2a, 0x77, 0xbe, 0x98, + 0xd9, 0x01, 0x69, 0x86, 0xa6, 0x67, 0x10, 0x98, 0x25, 0xf1, 0xef, + 0x18, 0xe0, 0x81, 0x70, 0xa8, 0x7b, 0x43, 0x68, 0xe7, 0xc1, 0x42, + 0xc1, 0x9d, 0xad, 0x10, 0x60, 0x5c, 0x4f, 0x34, 0x1d, 0x52, 0x09, + 0x98, 0x7a, 0xf3, 0x1a, 0xba, 0x8e, 0x2e, 0x49, 0x63, 0xf3, 0xe0, + 0x79, 0x4d, 0xd1, 0x1f, 0x0b, 0x72}}; + + auto rsa0 = std::make_unique( + makeSlice(rsa0PublicKey), makeSlice(rsa0Sig)); + { + auto rsa0EncodedFulfillment = + "\xa3\x82\x04\x08\x80\x82\x02\x00\xbb\xb0\xa1\xa3\x14\xff\x6a" + "\x2f\xc7\x9a\xe0\x6f\x61\x0d\xc8\xd4\x42\x1c\x93\x3e\xd0\xc4" + "\x35\x4e\x6a\xea\xd9\x1e\xf9\x47\xea\x4f\x8f\x63\x2b\x2e\x2f" + "\x78\xb8\xa0\x7a\x78\xc3\x32\x48\x95\xc7\xcb\x09\x16\xeb\x33" + "\x4c\x10\x09\x0e\x5e\xdb\x9e\x02\x95\xed\x2f\xf1\xde\xaf\xd1" + "\xf4\x9f\x54\x41\x2e\x43\xed\xe2\xcb\x06\xcf\xfc\x39\x53\x03" + "\x30\x9a\x4c\xe3\xea\xc2\x34\x1d\x9a\xf3\x18\x83\x37\xee\xba" + "\xbd\x3d\x4a\x4a\xf8\xf4\x3e\x15\x7d\x6f\x02\xf9\xd1\xf2\x4a" + "\x42\x77\x70\x49\xc9\x30\xaa\x23\x3f\xed\x5c\x63\xb0\x7f\x72" + "\x5c\xde\x6b\xb2\x44\x04\xfc\xbf\xc0\xb8\x72\x47\xea\xcb\x7d" + "\xb0\x44\x78\x5b\xa6\x6e\xde\x8e\x79\x21\x12\x47\x01\x50\x40" + "\x1e\x0a\x84\x71\xbd\xe3\x6f\x2d\x5e\xcb\x96\x0f\x57\x1b\xa1" + "\x7d\xaf\x38\x1d\x83\x78\xde\xc2\x1e\x10\x12\xe4\xb3\x76\xc9" + "\xe6\xc4\x6b\xb6\x7d\x68\xee\xf1\x2b\xa9\xa1\x59\x67\xf4\x86" + "\xd8\xbc\x91\xb3\xe2\xb0\x6f\xa5\xfc\xa6\x9b\x75\x24\x26\xaf" + "\x02\x9c\xb1\x49\xea\x58\x6d\xed\x85\x1e\xba\x16\x08\x76\xac" + "\xd8\x5f\x06\x22\x71\xfa\xd7\x3d\x15\xf5\xf0\xf0\x22\xe2\x61" + "\x30\x92\x26\xbe\xe3\x56\x7a\xd0\x52\xf9\x74\x6c\xa8\xbf\xac" + "\xf0\xd4\xf4\x17\x30\x08\x5c\x09\x7a\x02\x02\x83\x01\xd9\x2a" + "\x0c\x54\x5c\x03\x97\x47\x2c\x2e\xee\x5b\x61\x22\x20\x25\xd6" + "\x34\x70\xee\x68\x1c\xe3\x25\x27\x47\xce\x9c\xa2\x3f\x19\xe6" + "\x6f\x2f\x63\x86\xe6\xad\x13\x91\x1d\x7a\xda\xcd\x38\xce\x5c" + "\xa8\xff\x2c\x2d\x99\xab\xb0\xf5\xc3\xba\x84\x75\x09\x61\x3e" + "\x66\x32\xa1\x2c\xe6\xef\x78\xda\x4c\x82\x0e\x90\x83\x40\x53" + "\x00\x3d\x11\x97\xf6\xa5\x7b\x01\x00\xfe\xe1\x52\xc8\x4c\x8b" + "\x1b\x33\xbb\x96\x57\x19\x88\x78\x0f\xaf\xbd\x69\x7c\xf8\x37" + "\x0a\x99\xda\x8f\xaa\xf7\x56\x87\xd9\x51\xcc\x65\x33\xc7\x8b" + "\x8e\x1c\xe2\xe1\xd5\xce\xb9\xa1\x16\x29\x20\x1a\xf4\x37\x47" + "\x5c\x94\x02\x7f\xa5\x26\x14\xb4\x30\x0b\x77\xdc\xf1\x80\xac" + "\x49\xca\xa3\x40\x16\x8f\x32\x62\xfd\x1e\xe8\xb1\x38\x02\xce" + "\xa3\x57\x54\xb4\x23\xb8\x33\xfa\x14\xc5\xdd\x0c\x47\x6d\xde" + "\x5d\x5e\x7b\xf7\x37\x4d\x61\xf2\x48\xc3\xba\xb9\x1c\xb0\x55" + "\x0b\xd1\xcb\xef\x70\x50\x7e\xe8\xdb\x1c\xf3\x99\x30\x7e\x22" + "\x8d\x4f\x45\x92\xa6\x6c\x58\x57\x3c\xfe\xcc\x63\x96\x68\x06" + "\xfa\xf8\x81\x09\xcc\xb0\x99\x23\xea\x5b\x81\x82\x02\x00\x41" + "\x20\x0e\x42\x96\x1e\xea\x46\x0c\x82\x76\xf2\x39\xab\x66\xb7" + "\x6f\x8f\x28\x69\xea\xcc\xc5\xf9\xe9\x94\x5c\x0a\xbc\x63\xb1" + "\x43\x06\x56\xf3\xda\x2d\x21\x7a\x43\x32\x7e\xe8\xce\x11\x27" + "\xd1\x4a\x85\xd7\x4a\xf4\x12\xfe\x93\x70\x34\x5b\xa6\xb4\x40" + "\x03\xd7\x71\xae\xdd\x2b\xa0\xfc\x25\x06\x27\xfd\xf6\x16\x31" + "\xaf\xd6\x4e\x9b\xee\x71\x4b\x1b\xaf\xb6\x9f\x90\x1b\xee\xb6" + "\xf9\x59\xb1\x6a\x54\xb3\x28\xa9\xa6\x74\xc8\x83\xca\xfc\x4f" + "\xc2\xf7\xb0\x47\x6d\xbc\xaa\x8d\x9b\xfd\x47\xf7\x34\xe3\x47" + "\x36\xbf\x66\xe9\x73\xb3\x15\xc2\xab\xf4\x72\x7b\x06\x2c\xa3" + "\xc4\x02\x93\x6e\xb5\x08\x49\xe1\x81\x5d\xd1\x60\x4a\x60\x4d" + "\xef\xa6\x68\xcf\xe8\x23\xb0\x08\xbf\x8f\x7b\xf5\x7c\xeb\x1b" + "\x41\xe5\x18\xff\x53\xae\x91\x1e\xf9\x88\x05\x71\xb3\xd1\x74" + "\x23\x41\xd6\x0e\x3c\xb2\xbe\xb9\x3e\xb5\xf1\x78\xf8\xef\x7b" + "\xa0\xc6\xf2\x29\x0b\x99\x55\xd8\x3d\x60\xf9\x43\xd6\x44\x57" + "\x1e\xc8\xd5\xf0\x64\xd9\x5f\x1d\xa1\xe7\x59\xd6\x92\x0d\x84" + "\xa5\x4c\xbc\x49\x78\x36\x40\xa7\xb0\xcf\x3d\x02\x8e\x62\x7e" + "\xc7\xad\x25\xa9\x15\xf6\xd8\xc2\x4b\x2e\x09\x91\x52\x8a\x02" + "\xc5\xbe\xf0\x10\x6c\x18\xb3\xf3\x9c\x59\x99\x56\xeb\x7a\x27" + "\xb3\x37\x31\x3d\xcf\x93\xe7\x58\x67\x60\x6a\x4a\xc5\xa1\xab" + "\x6f\x9b\xb4\x44\xdc\x1d\xad\x1f\x54\x6f\xae\xde\x6a\xe9\x34" + "\x88\x40\x49\x01\x76\x91\x37\x1d\x51\xee\x1d\x65\x0e\xfc\xe5" + "\x81\xb3\x0c\x68\x43\x08\x7e\x70\x14\x19\x0f\x44\x60\x26\x7d" + "\x89\x4d\x52\x58\x14\xdd\xa3\x43\xb9\xa0\x48\x9d\xc0\x8c\x6a" + "\x34\x33\x47\x42\xce\xa3\x0b\x49\x25\x12\xd2\x95\x74\x52\x17" + "\xdd\x65\xec\xfe\xcb\x9c\xa1\x8d\x21\x2f\x84\xa5\x06\xd7\x00" + "\x26\xed\x33\x28\x96\xbd\x24\xa6\x30\x5a\x0c\xbd\xee\x9d\xfd" + "\x8a\xbb\x85\x07\xf8\x40\xeb\x94\xcf\xa8\xe9\x28\xe6\x91\x0c" + "\x27\x5f\x7b\x68\xd1\x1f\x96\x46\x3c\x10\x2a\x59\x66\x13\x47" + "\x86\x95\xbc\x76\x71\xfb\x27\x30\x91\x39\xc6\xcd\x2f\x15\xca" + "\x7e\x24\x05\x2e\x47\xf4\xe3\x4e\xf8\xb8\x44\xec\x36\x4a\x85" + "\xbd\xc9\xbe\x84\x25\xcf\xf7\x2a\x77\xbe\x98\xd9\x01\x69\x86" + "\xa6\x67\x10\x98\x25\xf1\xef\x18\xe0\x81\x70\xa8\x7b\x43\x68" + "\xe7\xc1\x42\xc1\x9d\xad\x10\x60\x5c\x4f\x34\x1d\x52\x09\x98" + "\x7a\xf3\x1a\xba\x8e\x2e\x49\x63\xf3\xe0\x79\x4d\xd1\x1f\x0b" + "\x72"s; + auto const rsa0EncodedCondition = + "\xa3\x27\x80\x20\x4d\xd2\xea\x7f\x85\xb3\xea\xcb\x8f\x19\x05" + "\x8e\x83\x60\x95\x5c\x32\xe7\x4c\x12\x43\x92\xa1\xf4\x46\x60" + "\x73\x97\x09\xc5\x39\xc3\x81\x03\x04\x00\x00"s; + auto const rsa0EncodedFingerprint = + "\x30\x82\x02\x04\x80\x82\x02\x00\xbb\xb0\xa1\xa3\x14\xff\x6a" + "\x2f\xc7\x9a\xe0\x6f\x61\x0d\xc8\xd4\x42\x1c\x93\x3e\xd0\xc4" + "\x35\x4e\x6a\xea\xd9\x1e\xf9\x47\xea\x4f\x8f\x63\x2b\x2e\x2f" + "\x78\xb8\xa0\x7a\x78\xc3\x32\x48\x95\xc7\xcb\x09\x16\xeb\x33" + "\x4c\x10\x09\x0e\x5e\xdb\x9e\x02\x95\xed\x2f\xf1\xde\xaf\xd1" + "\xf4\x9f\x54\x41\x2e\x43\xed\xe2\xcb\x06\xcf\xfc\x39\x53\x03" + "\x30\x9a\x4c\xe3\xea\xc2\x34\x1d\x9a\xf3\x18\x83\x37\xee\xba" + "\xbd\x3d\x4a\x4a\xf8\xf4\x3e\x15\x7d\x6f\x02\xf9\xd1\xf2\x4a" + "\x42\x77\x70\x49\xc9\x30\xaa\x23\x3f\xed\x5c\x63\xb0\x7f\x72" + "\x5c\xde\x6b\xb2\x44\x04\xfc\xbf\xc0\xb8\x72\x47\xea\xcb\x7d" + "\xb0\x44\x78\x5b\xa6\x6e\xde\x8e\x79\x21\x12\x47\x01\x50\x40" + "\x1e\x0a\x84\x71\xbd\xe3\x6f\x2d\x5e\xcb\x96\x0f\x57\x1b\xa1" + "\x7d\xaf\x38\x1d\x83\x78\xde\xc2\x1e\x10\x12\xe4\xb3\x76\xc9" + "\xe6\xc4\x6b\xb6\x7d\x68\xee\xf1\x2b\xa9\xa1\x59\x67\xf4\x86" + "\xd8\xbc\x91\xb3\xe2\xb0\x6f\xa5\xfc\xa6\x9b\x75\x24\x26\xaf" + "\x02\x9c\xb1\x49\xea\x58\x6d\xed\x85\x1e\xba\x16\x08\x76\xac" + "\xd8\x5f\x06\x22\x71\xfa\xd7\x3d\x15\xf5\xf0\xf0\x22\xe2\x61" + "\x30\x92\x26\xbe\xe3\x56\x7a\xd0\x52\xf9\x74\x6c\xa8\xbf\xac" + "\xf0\xd4\xf4\x17\x30\x08\x5c\x09\x7a\x02\x02\x83\x01\xd9\x2a" + "\x0c\x54\x5c\x03\x97\x47\x2c\x2e\xee\x5b\x61\x22\x20\x25\xd6" + "\x34\x70\xee\x68\x1c\xe3\x25\x27\x47\xce\x9c\xa2\x3f\x19\xe6" + "\x6f\x2f\x63\x86\xe6\xad\x13\x91\x1d\x7a\xda\xcd\x38\xce\x5c" + "\xa8\xff\x2c\x2d\x99\xab\xb0\xf5\xc3\xba\x84\x75\x09\x61\x3e" + "\x66\x32\xa1\x2c\xe6\xef\x78\xda\x4c\x82\x0e\x90\x83\x40\x53" + "\x00\x3d\x11\x97\xf6\xa5\x7b\x01\x00\xfe\xe1\x52\xc8\x4c\x8b" + "\x1b\x33\xbb\x96\x57\x19\x88\x78\x0f\xaf\xbd\x69\x7c\xf8\x37" + "\x0a\x99\xda\x8f\xaa\xf7\x56\x87\xd9\x51\xcc\x65\x33\xc7\x8b" + "\x8e\x1c\xe2\xe1\xd5\xce\xb9\xa1\x16\x29\x20\x1a\xf4\x37\x47" + "\x5c\x94\x02\x7f\xa5\x26\x14\xb4\x30\x0b\x77\xdc\xf1\x80\xac" + "\x49\xca\xa3\x40\x16\x8f\x32\x62\xfd\x1e\xe8\xb1\x38\x02\xce" + "\xa3\x57\x54\xb4\x23\xb8\x33\xfa\x14\xc5\xdd\x0c\x47\x6d\xde" + "\x5d\x5e\x7b\xf7\x37\x4d\x61\xf2\x48\xc3\xba\xb9\x1c\xb0\x55" + "\x0b\xd1\xcb\xef\x70\x50\x7e\xe8\xdb\x1c\xf3\x99\x30\x7e\x22" + "\x8d\x4f\x45\x92\xa6\x6c\x58\x57\x3c\xfe\xcc\x63\x96\x68\x06" + "\xfa\xf8\x81\x09\xcc\xb0\x99\x23\xea\x5b"s; + check( + std::move(rsa0), + rsa0Msg, + std::move(rsa0EncodedFulfillment), + rsa0EncodedCondition, + rsa0EncodedFingerprint); + } + } + + void + testEd1() + { + testcase("Ed1"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * ed0 + + auto const ed0Msg = "\x61\x61\x61"s; + std::array const ed0PublicKey{ + {0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, + 0xd3, 0xc9, 0x64, 0x07, 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa6, + 0x23, 0x25, 0xaf, 0x02, 0x1a, 0x68, 0xf7, 0x07, 0x51, 0x1a}}; + std::array const ed0Sig{ + {0x50, 0x6a, 0x1e, 0xa6, 0x83, 0x18, 0xe6, 0x2d, 0x40, 0x63, 0x5d, + 0xad, 0x04, 0x3e, 0x19, 0x87, 0xeb, 0xc2, 0x6e, 0x5b, 0x5c, 0x44, + 0x06, 0xf7, 0xbd, 0xf8, 0x5a, 0x73, 0x38, 0x8f, 0xbf, 0xe5, 0xc2, + 0x45, 0xac, 0x49, 0xf4, 0x77, 0x0e, 0xbc, 0x78, 0x77, 0x08, 0x27, + 0x0a, 0xa6, 0xa8, 0x76, 0x9f, 0xef, 0xe8, 0x93, 0x0f, 0xd0, 0xea, + 0x1e, 0xe6, 0x4b, 0x31, 0x40, 0x7d, 0x76, 0x95, 0x09}}; + + auto ed0 = std::make_unique(ed0PublicKey, ed0Sig); + { + auto ed0EncodedFulfillment = + "\xa4\x64\x80\x20\xd7\x5a\x98\x01\x82\xb1\x0a\xb7\xd5\x4b\xfe" + "\xd3\xc9\x64\x07\x3a\x0e\xe1\x72\xf3\xda\xa6\x23\x25\xaf\x02" + "\x1a\x68\xf7\x07\x51\x1a\x81\x40\x50\x6a\x1e\xa6\x83\x18\xe6" + "\x2d\x40\x63\x5d\xad\x04\x3e\x19\x87\xeb\xc2\x6e\x5b\x5c\x44" + "\x06\xf7\xbd\xf8\x5a\x73\x38\x8f\xbf\xe5\xc2\x45\xac\x49\xf4" + "\x77\x0e\xbc\x78\x77\x08\x27\x0a\xa6\xa8\x76\x9f\xef\xe8\x93" + "\x0f\xd0\xea\x1e\xe6\x4b\x31\x40\x7d\x76\x95\x09"s; + auto const ed0EncodedCondition = + "\xa4\x27\x80\x20\x79\x92\x39\xab\xa8\xfc\x4f\xf7\xea\xbf\xbc" + "\x4c\x44\xe6\x9e\x8b\xdf\xed\x99\x33\x24\xe1\x2e\xd6\x47\x92" + "\xab\xe2\x89\xcf\x1d\x5f\x81\x03\x02\x00\x00"s; + auto const ed0EncodedFingerprint = + "\x30\x22\x80\x20\xd7\x5a\x98\x01\x82\xb1\x0a\xb7\xd5\x4b\xfe" + "\xd3\xc9\x64\x07\x3a\x0e\xe1\x72\xf3\xda\xa6\x23\x25\xaf\x02" + "\x1a\x68\xf7\x07\x51\x1a"s; + check( + std::move(ed0), + ed0Msg, + std::move(ed0EncodedFulfillment), + ed0EncodedCondition, + ed0EncodedFingerprint); + } + } + + void + testThresh6() + { + testcase("Thresh6"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** prefix1 + // *** ed2 + // ** preim3 + + auto const ed2Msg = ""s; + std::array const ed2PublicKey{ + {0x2e, 0x53, 0x1e, 0x88, 0xbf, 0xe8, 0xc4, 0x19, 0xf9, 0x61, 0xad, + 0x9c, 0x90, 0x1d, 0xe2, 0xbd, 0xd8, 0xe7, 0xa0, 0xe7, 0x14, 0x84, + 0x55, 0x05, 0x9e, 0x89, 0xeb, 0x79, 0x98, 0x6b, 0x25, 0x24}}; + std::array const ed2Sig{ + {0xe5, 0xfd, 0xdb, 0xbe, 0xc2, 0xe8, 0xdb, 0x59, 0xbc, 0xb6, 0xa6, + 0x80, 0xe4, 0xa7, 0x05, 0x6f, 0xdd, 0x46, 0x50, 0x0b, 0x4e, 0x99, + 0xa3, 0x71, 0x9f, 0x25, 0x73, 0x50, 0x36, 0xa1, 0x49, 0x28, 0x3e, + 0x28, 0x7c, 0xed, 0xed, 0xcd, 0x9e, 0x5a, 0x50, 0xcd, 0x97, 0x6a, + 0xb4, 0x11, 0xf8, 0x4f, 0xf5, 0x69, 0xaa, 0xbd, 0xe6, 0xf6, 0xe0, + 0xce, 0x6a, 0x0b, 0xdd, 0x0c, 0x4a, 0x82, 0x46, 0x08}}; + auto const prefix1Prefix = + "https://notary.example/cases/657c12da-8dca-43b0-97ca-8ee8c38ab9f7/state/executed"s; + auto const prefix1Msg = ""s; + auto const prefix1MaxMsgLength = 0; + auto const preim3Preimage = + "https://notary.example/cases/657c12da-8dca-43b0-97ca-8ee8c38ab9f7/state/executed"s; + auto const preim3Msg = ""s; + auto const thresh0Msg = ""s; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(ed2)); + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim3)); + std::vector thresh0Subconditions{}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\x1a\xa0\x82\x01\x14\xa0\x52\x80\x50\x68\x74\x74" + "\x70\x73\x3a\x2f\x2f\x6e\x6f\x74\x61\x72\x79\x2e\x65\x78\x61" + "\x6d\x70\x6c\x65\x2f\x63\x61\x73\x65\x73\x2f\x36\x35\x37\x63" + "\x31\x32\x64\x61\x2d\x38\x64\x63\x61\x2d\x34\x33\x62\x30\x2d" + "\x39\x37\x63\x61\x2d\x38\x65\x65\x38\x63\x33\x38\x61\x62\x39" + "\x66\x37\x2f\x73\x74\x61\x74\x65\x2f\x65\x78\x65\x63\x75\x74" + "\x65\x64\xa1\x81\xbd\x80\x50\x68\x74\x74\x70\x73\x3a\x2f\x2f" + "\x6e\x6f\x74\x61\x72\x79\x2e\x65\x78\x61\x6d\x70\x6c\x65\x2f" + "\x63\x61\x73\x65\x73\x2f\x36\x35\x37\x63\x31\x32\x64\x61\x2d" + "\x38\x64\x63\x61\x2d\x34\x33\x62\x30\x2d\x39\x37\x63\x61\x2d" + "\x38\x65\x65\x38\x63\x33\x38\x61\x62\x39\x66\x37\x2f\x73\x74" + "\x61\x74\x65\x2f\x65\x78\x65\x63\x75\x74\x65\x64\x81\x01\x00" + "\xa2\x66\xa4\x64\x80\x20\x2e\x53\x1e\x88\xbf\xe8\xc4\x19\xf9" + "\x61\xad\x9c\x90\x1d\xe2\xbd\xd8\xe7\xa0\xe7\x14\x84\x55\x05" + "\x9e\x89\xeb\x79\x98\x6b\x25\x24\x81\x40\xe5\xfd\xdb\xbe\xc2" + "\xe8\xdb\x59\xbc\xb6\xa6\x80\xe4\xa7\x05\x6f\xdd\x46\x50\x0b" + "\x4e\x99\xa3\x71\x9f\x25\x73\x50\x36\xa1\x49\x28\x3e\x28\x7c" + "\xed\xed\xcd\x9e\x5a\x50\xcd\x97\x6a\xb4\x11\xf8\x4f\xf5\x69" + "\xaa\xbd\xe6\xf6\xe0\xce\x6a\x0b\xdd\x0c\x4a\x82\x46\x08\xa1" + "\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x09\xe3\x91\x00\x46\x28\x72\x5e\x88\xf8\x55" + "\x7e\x95\x4f\xb2\xa0\xea\xe2\xb7\xc1\x51\xc4\x7d\xf3\xc4\xaf" + "\x22\xf8\xc1\x69\x88\xf9\x81\x03\x02\x0c\xa0\x82\x02\x03\xc8"s; + auto const thresh0EncodedFingerprint = + "\x30\x59\x80\x01\x02\xa1\x54\xa0\x25\x80\x20\x0b\x4a\xc3\xa1" + "\xe0\x93\x2c\xb7\x1b\x74\x30\x9f\xad\x7d\x15\xdf\x51\xbd\x4d" + "\x13\x59\xed\x59\xff\x7c\x91\x7b\x35\xdf\x24\x46\x4a\x81\x01" + "\x50\xa1\x2b\x80\x20\x3f\x94\x52\x55\x55\xcf\x4c\x52\x34\xbf" + "\x77\xcb\x10\x85\x01\xd9\x7b\x9d\x8a\x28\xd1\xe7\xa3\xa7\xfe" + "\x8d\x3d\x7f\x03\x1f\xde\xbd\x81\x03\x02\x04\x50\x82\x02\x03" + "\x08"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh7() + { + testcase("Thresh7"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** prefix1 + // *** thresh2 + // **** Prefix9Cond + // **** prefix3 + // ***** ed4 + // **** prefix5 + // ***** ed6 + // **** prefix7 + // ***** ed8 + // ** preim11 + + auto const ed4Msg = ""s; + std::array const ed4PublicKey{ + {0x2e, 0x53, 0x1e, 0x88, 0xbf, 0xe8, 0xc4, 0x19, 0xf9, 0x61, 0xad, + 0x9c, 0x90, 0x1d, 0xe2, 0xbd, 0xd8, 0xe7, 0xa0, 0xe7, 0x14, 0x84, + 0x55, 0x05, 0x9e, 0x89, 0xeb, 0x79, 0x98, 0x6b, 0x25, 0x24}}; + std::array const ed4Sig{ + {0x87, 0x30, 0x1a, 0x18, 0x08, 0xf7, 0x3c, 0x20, 0x3f, 0x0e, 0x9c, + 0x81, 0x06, 0xf1, 0x30, 0x71, 0x08, 0x81, 0xda, 0xcd, 0xac, 0x80, + 0x7c, 0x10, 0xd3, 0x49, 0xb7, 0x98, 0x20, 0xdc, 0xb3, 0x40, 0x7c, + 0x77, 0xb9, 0xd2, 0x3d, 0xb4, 0x28, 0x27, 0x64, 0x0b, 0xdc, 0x41, + 0x38, 0x3f, 0xdc, 0x4e, 0xca, 0x76, 0x19, 0xc1, 0x70, 0x37, 0xe8, + 0x70, 0x37, 0xa5, 0xc7, 0xcf, 0x33, 0x81, 0x7a, 0x0e}}; + auto const prefix3Prefix = "https://notary1.example/"s; + auto const prefix3Msg = ""s; + auto const prefix3MaxMsgLength = 1024; + auto const ed6Msg = ""s; + std::array const ed6PublicKey{ + {0x59, 0x02, 0x3e, 0x76, 0x8a, 0x9c, 0x85, 0x87, 0x6c, 0x61, 0xeb, + 0xaa, 0xa3, 0x4e, 0xc1, 0x8e, 0x64, 0x85, 0x7f, 0xa7, 0x66, 0x92, + 0xc5, 0x5a, 0x99, 0x63, 0x5f, 0x9b, 0x88, 0xe5, 0xaf, 0x90}}; + std::array const ed6Sig{ + {0xac, 0xf9, 0xee, 0x83, 0x88, 0x5b, 0xa5, 0x8f, 0x62, 0xc4, 0x2b, + 0x48, 0x99, 0xe8, 0xce, 0xa9, 0x15, 0xa9, 0x19, 0x2f, 0x74, 0x88, + 0xc1, 0x59, 0x2c, 0xe9, 0x59, 0x56, 0x0b, 0x52, 0xf8, 0x7a, 0x37, + 0x90, 0xe0, 0x36, 0xd3, 0xc6, 0x95, 0x4b, 0x87, 0x55, 0x41, 0x48, + 0xd1, 0x31, 0xcc, 0xba, 0xf3, 0x69, 0xc6, 0x8a, 0x66, 0xa3, 0x13, + 0x7f, 0xe8, 0xfa, 0x43, 0x68, 0xa1, 0x65, 0xa0, 0x0a}}; + auto const prefix5Prefix = "https://notary2.example/"s; + auto const prefix5Msg = ""s; + auto const prefix5MaxMsgLength = 1024; + auto const ed8Msg = ""s; + std::array const ed8PublicKey{ + {0x9a, 0x98, 0xac, 0x6d, 0xbf, 0xf0, 0x90, 0xe9, 0x6e, 0x38, 0xd8, + 0x1f, 0x05, 0x47, 0x7d, 0xf8, 0x6b, 0x3b, 0xbb, 0x0e, 0xff, 0xc3, + 0x11, 0xbc, 0x7b, 0x42, 0xcd, 0xac, 0x99, 0xd6, 0xbd, 0xd9}}; + std::array const ed8Sig{ + {0x97, 0xa3, 0x2b, 0x0c, 0x61, 0xce, 0x15, 0x10, 0x36, 0xca, 0xd3, + 0x59, 0x69, 0xc9, 0xf9, 0x5e, 0xb5, 0x44, 0x65, 0xea, 0x5d, 0x62, + 0x9b, 0xa9, 0x65, 0xab, 0xf8, 0xa6, 0xa9, 0x17, 0xf1, 0x0d, 0xd1, + 0x4a, 0xbe, 0x55, 0xd3, 0x30, 0x54, 0x43, 0x8e, 0x68, 0xc9, 0x15, + 0xa6, 0xb6, 0x7c, 0x1d, 0xdf, 0x8a, 0x0c, 0x16, 0xd2, 0xd8, 0x01, + 0xf8, 0xd0, 0xba, 0x85, 0xef, 0xee, 0x9b, 0xbf, 0x0f}}; + auto const prefix7Prefix = "https://notary3.example/"s; + auto const prefix7Msg = ""s; + auto const prefix7MaxMsgLength = 1024; + auto const thresh2Msg = ""s; + std::array const Prefix9CondConditionFingerprint = { + {0xee, 0x0b, 0xc0, 0x2f, 0x97, 0x7c, 0x26, 0x4b, 0x6c, 0x30, 0x6e, + 0xd1, 0xb1, 0x68, 0xfe, 0xb4, 0xfd, 0x60, 0x09, 0x50, 0xad, 0x21, + 0x75, 0x0c, 0xe8, 0xa8, 0x6e, 0xcb, 0xd4, 0x60, 0x35, 0x38}}; + Condition const Prefix9Cond{Type::prefixSha256, + 133145, + Prefix9CondConditionFingerprint, + std::bitset<5>{16}}; + auto const prefix1Prefix = + "cases/657c12da-8dca-43b0-97ca-8ee8c38ab9f7/state/executed"s; + auto const prefix1Msg = ""s; + auto const prefix1MaxMsgLength = 0; + auto const preim11Preimage = + "https://notary.example/cases/657c12da-8dca-43b0-97ca-8ee8c38ab9f7/state/executed"s; + auto const preim11Msg = ""s; + auto const thresh0Msg = ""s; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + auto prefix3 = std::make_unique( + makeSlice(prefix3Prefix), prefix3MaxMsgLength, std::move(ed4)); + auto ed6 = std::make_unique(ed6PublicKey, ed6Sig); + auto prefix5 = std::make_unique( + makeSlice(prefix5Prefix), prefix5MaxMsgLength, std::move(ed6)); + auto ed8 = std::make_unique(ed8PublicKey, ed8Sig); + auto prefix7 = std::make_unique( + makeSlice(prefix7Prefix), prefix7MaxMsgLength, std::move(ed8)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(prefix3)); + thresh2Subfulfillments.emplace_back(std::move(prefix5)); + thresh2Subfulfillments.emplace_back(std::move(prefix7)); + std::vector thresh2Subconditions{{Prefix9Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto preim11 = + std::make_unique(makeSlice(preim11Preimage)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim11)); + std::vector thresh0Subconditions{}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x02\x72\xa0\x82\x02\x6c\xa0\x52\x80\x50\x68\x74\x74" + "\x70\x73\x3a\x2f\x2f\x6e\x6f\x74\x61\x72\x79\x2e\x65\x78\x61" + "\x6d\x70\x6c\x65\x2f\x63\x61\x73\x65\x73\x2f\x36\x35\x37\x63" + "\x31\x32\x64\x61\x2d\x38\x64\x63\x61\x2d\x34\x33\x62\x30\x2d" + "\x39\x37\x63\x61\x2d\x38\x65\x65\x38\x63\x33\x38\x61\x62\x39" + "\x66\x37\x2f\x73\x74\x61\x74\x65\x2f\x65\x78\x65\x63\x75\x74" + "\x65\x64\xa1\x82\x02\x14\x80\x39\x63\x61\x73\x65\x73\x2f\x36" + "\x35\x37\x63\x31\x32\x64\x61\x2d\x38\x64\x63\x61\x2d\x34\x33" + "\x62\x30\x2d\x39\x37\x63\x61\x2d\x38\x65\x65\x38\x63\x33\x38" + "\x61\x62\x39\x66\x37\x2f\x73\x74\x61\x74\x65\x2f\x65\x78\x65" + "\x63\x75\x74\x65\x64\x81\x01\x00\xa2\x82\x01\xd2\xa2\x82\x01" + "\xce\xa0\x82\x01\x9b\xa1\x81\x86\x80\x18\x68\x74\x74\x70\x73" + "\x3a\x2f\x2f\x6e\x6f\x74\x61\x72\x79\x31\x2e\x65\x78\x61\x6d" + "\x70\x6c\x65\x2f\x81\x02\x04\x00\xa2\x66\xa4\x64\x80\x20\x2e" + "\x53\x1e\x88\xbf\xe8\xc4\x19\xf9\x61\xad\x9c\x90\x1d\xe2\xbd" + "\xd8\xe7\xa0\xe7\x14\x84\x55\x05\x9e\x89\xeb\x79\x98\x6b\x25" + "\x24\x81\x40\x87\x30\x1a\x18\x08\xf7\x3c\x20\x3f\x0e\x9c\x81" + "\x06\xf1\x30\x71\x08\x81\xda\xcd\xac\x80\x7c\x10\xd3\x49\xb7" + "\x98\x20\xdc\xb3\x40\x7c\x77\xb9\xd2\x3d\xb4\x28\x27\x64\x0b" + "\xdc\x41\x38\x3f\xdc\x4e\xca\x76\x19\xc1\x70\x37\xe8\x70\x37" + "\xa5\xc7\xcf\x33\x81\x7a\x0e\xa1\x81\x86\x80\x18\x68\x74\x74" + "\x70\x73\x3a\x2f\x2f\x6e\x6f\x74\x61\x72\x79\x32\x2e\x65\x78" + "\x61\x6d\x70\x6c\x65\x2f\x81\x02\x04\x00\xa2\x66\xa4\x64\x80" + "\x20\x59\x02\x3e\x76\x8a\x9c\x85\x87\x6c\x61\xeb\xaa\xa3\x4e" + "\xc1\x8e\x64\x85\x7f\xa7\x66\x92\xc5\x5a\x99\x63\x5f\x9b\x88" + "\xe5\xaf\x90\x81\x40\xac\xf9\xee\x83\x88\x5b\xa5\x8f\x62\xc4" + "\x2b\x48\x99\xe8\xce\xa9\x15\xa9\x19\x2f\x74\x88\xc1\x59\x2c" + "\xe9\x59\x56\x0b\x52\xf8\x7a\x37\x90\xe0\x36\xd3\xc6\x95\x4b" + "\x87\x55\x41\x48\xd1\x31\xcc\xba\xf3\x69\xc6\x8a\x66\xa3\x13" + "\x7f\xe8\xfa\x43\x68\xa1\x65\xa0\x0a\xa1\x81\x86\x80\x18\x68" + "\x74\x74\x70\x73\x3a\x2f\x2f\x6e\x6f\x74\x61\x72\x79\x33\x2e" + "\x65\x78\x61\x6d\x70\x6c\x65\x2f\x81\x02\x04\x00\xa2\x66\xa4" + "\x64\x80\x20\x9a\x98\xac\x6d\xbf\xf0\x90\xe9\x6e\x38\xd8\x1f" + "\x05\x47\x7d\xf8\x6b\x3b\xbb\x0e\xff\xc3\x11\xbc\x7b\x42\xcd" + "\xac\x99\xd6\xbd\xd9\x81\x40\x97\xa3\x2b\x0c\x61\xce\x15\x10" + "\x36\xca\xd3\x59\x69\xc9\xf9\x5e\xb5\x44\x65\xea\x5d\x62\x9b" + "\xa9\x65\xab\xf8\xa6\xa9\x17\xf1\x0d\xd1\x4a\xbe\x55\xd3\x30" + "\x54\x43\x8e\x68\xc9\x15\xa6\xb6\x7c\x1d\xdf\x8a\x0c\x16\xd2" + "\xd8\x01\xf8\xd0\xba\x85\xef\xee\x9b\xbf\x0f\xa1\x2d\xa1\x2b" + "\x80\x20\xee\x0b\xc0\x2f\x97\x7c\x26\x4b\x6c\x30\x6e\xd1\xb1" + "\x68\xfe\xb4\xfd\x60\x09\x50\xad\x21\x75\x0c\xe8\xa8\x6e\xcb" + "\xd4\x60\x35\x38\x81\x03\x02\x08\x19\x82\x02\x03\x08\xa1\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x42\x4a\x70\x49\x49\x52\x92\x67\xb6\x21\xb3" + "\xd7\x91\x19\xd7\x29\xb2\x38\x2c\xed\x8b\x29\x6c\x3c\x02\x8f" + "\xa9\x7d\x35\x0f\x6d\x07\x81\x03\x06\x34\xd2\x82\x02\x03\xc8"s; + auto const thresh0EncodedFingerprint = + "\x30\x59\x80\x01\x02\xa1\x54\xa0\x25\x80\x20\x0b\x4a\xc3\xa1" + "\xe0\x93\x2c\xb7\x1b\x74\x30\x9f\xad\x7d\x15\xdf\x51\xbd\x4d" + "\x13\x59\xed\x59\xff\x7c\x91\x7b\x35\xdf\x24\x46\x4a\x81\x01" + "\x50\xa1\x2b\x80\x20\x06\x2f\x2c\x1b\xdd\x08\x66\x1f\xe7\xfe" + "\xfa\xc2\x0e\x02\xda\x8b\x01\x84\xfc\xd3\x6f\x6c\x6c\x54\xc5" + "\x3c\xc2\x8d\x2e\x54\xdd\x11\x81\x03\x06\x2c\x82\x82\x02\x03" + "\x28"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + run() + { + testPreim0(); + testPrefix0(); + testThresh0(); + testRsa0(); + testEd0(); + testPreim1(); + testPrefix1(); + testPrefix2(); + testThresh1(); + testThresh2(); + testThresh3(); + testThresh4(); + testThresh5(); + testRsa1(); + testRsa2(); + testEd1(); + testThresh6(); + testThresh7(); + } +}; + +BEAST_DEFINE_TESTSUITE(Conditions_json, conditions, ripple); +} // cryptoconditions +} // ripple diff --git a/src/test/conditions/Conditions_generated_test_prefix.cpp b/src/test/conditions/Conditions_generated_test_prefix.cpp new file mode 100644 index 00000000000..af7be7e3b36 --- /dev/null +++ b/src/test/conditions/Conditions_generated_test_prefix.cpp @@ -0,0 +1,2811 @@ + +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include + +namespace ripple { +namespace cryptoconditions { + +class Conditions_prefix_test : public ConditionsTestBase +{ + void + testPrefix0() + { + testcase("Prefix0"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** preim1 + + auto const preim1Preimage = "I am root"s; + auto const preim1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto preim1 = + std::make_unique(makeSlice(preim1Preimage)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(preim1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x16\x80\x02\x50\x30\x81\x01\x1a\xa2\x0d\xa0\x0b\x80\x09" + "\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74"s; + auto const prefix0EncodedCondition = + "\xa1\x2a\x80\x20\x33\x0a\xc8\x0a\xa2\x01\xee\x65\x14\x12\x81" + "\x29\x6a\xc7\x2e\x21\x8d\xed\x54\x94\xfc\xef\x19\x98\x21\xe5" + "\xa9\x79\xb4\xd9\x97\xb2\x81\x02\x04\x25\x82\x02\x07\x80"s; + auto const prefix0EncodedFingerprint = + "\x30\x30\x80\x02\x50\x30\x81\x01\x1a\xa2\x27\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix1() + { + testcase("Prefix1"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** preim2 + + auto const preim2Preimage = "I am root"s; + auto const preim2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto preim2 = + std::make_unique(makeSlice(preim2Preimage)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(preim2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x21\x80\x02\x50\x30\x81\x01\x1a\xa2\x18\xa1\x16\x80\x02" + "\x50\x31\x81\x01\x1c\xa2\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d" + "\x20\x72\x6f\x6f\x74"s; + auto const prefix0EncodedCondition = + "\xa1\x2a\x80\x20\x46\x33\x5a\x85\xdf\x1f\x18\xe9\x2b\xb5\x1b" + "\x46\x81\xbc\x27\x4c\x69\x92\xf5\xcd\xe4\x46\x30\x3f\x1f\x27" + "\x62\x96\x76\x91\x14\xa1\x81\x02\x08\x43\x82\x02\x07\x80"s; + auto const prefix0EncodedFingerprint = + "\x30\x35\x80\x02\x50\x30\x81\x01\x1a\xa2\x2c\xa1\x2a\x80\x20" + "\x27\xd6\x44\x0f\xee\x75\x21\x3b\xb6\xb2\x4b\xa5\x42\x06\x58" + "\x7e\x19\x9c\x02\x18\xb5\x7e\x95\x36\x06\x03\x76\xb5\x8a\xa8" + "\x33\x7b\x81\x02\x04\x27\x82\x02\x07\x80"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix2() + { + testcase("Prefix2"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** prefix2 + // **** preim3 + + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "P2P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 30; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(preim3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x2c\x80\x02\x50\x30\x81\x01\x1a\xa2\x23\xa1\x21\x80\x02" + "\x50\x31\x81\x01\x1c\xa2\x18\xa1\x16\x80\x02\x50\x32\x81\x01" + "\x1e\xa2\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f" + "\x74"s; + auto const prefix0EncodedCondition = + "\xa1\x2a\x80\x20\x4d\xe0\x07\xec\xab\xaa\xa4\x4d\x86\x5f\xaa" + "\x4d\x59\x17\x5d\x0b\x5e\xd3\x1a\x37\xae\x22\xd2\x04\x2d\xba" + "\xc2\xc8\xc9\x85\xb0\x16\x81\x02\x0c\x63\x82\x02\x07\x80"s; + auto const prefix0EncodedFingerprint = + "\x30\x35\x80\x02\x50\x30\x81\x01\x1a\xa2\x2c\xa1\x2a\x80\x20" + "\x04\x88\xf9\x90\x7f\xf3\xc2\x57\x40\xe4\x29\x51\x2c\xbb\xaa" + "\xf5\x39\xa8\x21\xb8\x39\x70\xb7\xa9\xb1\x3d\xa9\x69\xfc\xc8" + "\xf9\x1e\x81\x02\x08\x47\x82\x02\x07\x80"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix3() + { + testcase("Prefix3"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** preim3 + + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(preim3)); + std::vector thresh2Subconditions{}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x27\x80\x02\x50\x30\x81\x01\x1a\xa2\x1e\xa1\x1c\x80\x02" + "\x50\x31\x81\x01\x1c\xa2\x13\xa2\x11\xa0\x0d\xa0\x0b\x80\x09" + "\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2a\x80\x20\x94\xf0\xed\xf8\x53\x29\x14\x10\x6c\xae\x30" + "\x7c\xee\x37\x61\x46\xd0\xc7\x16\xeb\xb9\xbb\x92\xba\x5f\xf8" + "\x2b\x7c\x67\xe6\xae\x56\x81\x02\x0c\x43\x82\x02\x05\xa0"s; + auto const prefix0EncodedFingerprint = + "\x30\x35\x80\x02\x50\x30\x81\x01\x1a\xa2\x2c\xa1\x2a\x80\x20" + "\x78\x72\x04\x67\x9d\x13\xe0\x57\x73\xcb\x59\xd0\xb4\xdb\x25" + "\xe5\xf3\xb9\x61\xd5\x7c\x56\x6e\xf1\x40\x18\x17\xe3\x3c\x58" + "\x6b\x43\x81\x02\x08\x27\x82\x02\x05\xa0"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix4() + { + testcase("Prefix4"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** Preim4Cond + // **** Rsa5Cond + // **** Ed6Cond + // **** preim3 + + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim4CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim4Cond{Type::preimageSha256, + 9, + Preim4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa5CondConditionFingerprint = { + {0x99, 0xfb, 0x0b, 0x38, 0x94, 0x4d, 0x20, 0x85, 0xc8, 0xda, 0x3a, + 0x64, 0x31, 0x44, 0x6f, 0x6c, 0x3b, 0x46, 0x25, 0x50, 0xd7, 0x7f, + 0xdf, 0xee, 0x75, 0x72, 0x71, 0xf9, 0x61, 0x40, 0x63, 0xfa}}; + Condition const Rsa5Cond{Type::rsaSha256, + 65536, + Rsa5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed6CondConditionFingerprint = { + {0x00, 0xd3, 0xc9, 0x24, 0x3f, 0x2d, 0x2e, 0x64, 0x93, 0xa8, 0x49, + 0x29, 0x82, 0x75, 0xea, 0xbf, 0xe3, 0x53, 0x7f, 0x8e, 0x45, 0x16, + 0xdb, 0x5e, 0xc6, 0xdf, 0x39, 0xd2, 0xcb, 0xea, 0x62, 0xfb}}; + Condition const Ed6Cond{Type::ed25519Sha256, + 131072, + Ed6CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(preim3)); + std::vector thresh2Subconditions{ + {Preim4Cond, Rsa5Cond, Ed6Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x81\xa4\x80\x02\x50\x30\x81\x01\x1a\xa2\x81\x9a\xa1\x81" + "\x97\x80\x02\x50\x31\x81\x01\x1c\xa2\x81\x8d\xa2\x81\x8a\xa0" + "\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1" + "\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x99" + "\xfb\x0b\x38\x94\x4d\x20\x85\xc8\xda\x3a\x64\x31\x44\x6f\x6c" + "\x3b\x46\x25\x50\xd7\x7f\xdf\xee\x75\x72\x71\xf9\x61\x40\x63" + "\xfa\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\xd3\xc9\x24\x3f" + "\x2d\x2e\x64\x93\xa8\x49\x29\x82\x75\xea\xbf\xe3\x53\x7f\x8e" + "\x45\x16\xdb\x5e\xc6\xdf\x39\xd2\xcb\xea\x62\xfb\x81\x03\x02" + "\x00\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x8d\x16\xce\xa7\x52\x75\x97\xa4\xdc\xfc\x01" + "\xf5\xb6\x72\xfe\x4a\x2c\x04\x58\x23\xee\x23\x31\x37\xd5\xb0" + "\x84\xb1\x03\x0f\x03\x47\x81\x03\x02\x18\x3a\x82\x02\x03\xb8"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x71\x89\x06\xbc\xe3\xb8\x3f\x0b\x8c\x97\xea\x83\x77\xb2\x90" + "\xf2\xbc\xa3\x24\x4a\xe0\x8b\x82\xbc\x1e\xf9\xf0\x38\x98\x86" + "\x3e\x6c\x81\x03\x02\x14\x1e\x82\x02\x03\xb8"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix5() + { + testcase("Prefix5"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** Preim9Cond + // **** Rsa10Cond + // **** Ed11Cond + // **** preim3 + // **** thresh4 + // ***** Preim6Cond + // ***** Rsa7Cond + // ***** Ed8Cond + // ***** preim5 + + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const preim5Preimage = "I am root"s; + auto const preim5Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const thresh4Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim6CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim6Cond{Type::preimageSha256, + 9, + Preim6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa7CondConditionFingerprint = { + {0x6c, 0x7b, 0xea, 0x83, 0xa1, 0xf4, 0x82, 0x3d, 0x36, 0xe7, 0x6e, + 0xae, 0x1a, 0xbc, 0xa0, 0xba, 0x90, 0x3d, 0x96, 0xc1, 0xe6, 0xad, + 0x3a, 0x47, 0xa5, 0xcb, 0x88, 0xab, 0x3c, 0x5f, 0xcc, 0xd5}}; + Condition const Rsa7Cond{Type::rsaSha256, + 65536, + Rsa7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed8CondConditionFingerprint = { + {0xf1, 0x68, 0x96, 0xa6, 0x2e, 0xef, 0x7f, 0x47, 0x06, 0x51, 0x4c, + 0xc6, 0x7e, 0x24, 0xf7, 0x29, 0x84, 0x9c, 0xd6, 0xb0, 0xd9, 0x4b, + 0xd9, 0x0f, 0xc9, 0x34, 0x01, 0x9d, 0x92, 0xeb, 0xbc, 0x0a}}; + Condition const Ed8Cond{Type::ed25519Sha256, + 131072, + Ed8CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + auto preim5 = + std::make_unique(makeSlice(preim5Preimage)); + std::vector> thresh4Subfulfillments; + thresh4Subfulfillments.emplace_back(std::move(preim5)); + std::vector thresh4Subconditions{ + {Preim6Cond, Rsa7Cond, Ed8Cond}}; + auto thresh4 = std::make_unique( + std::move(thresh4Subfulfillments), std::move(thresh4Subconditions)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(preim3)); + thresh2Subfulfillments.emplace_back(std::move(thresh4)); + std::vector thresh2Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x01\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x01\x2b" + "\xa1\x82\x01\x27\x80\x02\x50\x31\x81\x01\x1c\xa2\x82\x01\x1c" + "\xa2\x82\x01\x18\xa0\x81\x9a\xa0\x0b\x80\x09\x49\x20\x61\x6d" + "\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49" + "\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\x6c\x7b\xea\x83\xa1\xf4\x82" + "\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba\x90\x3d\x96\xc1\xe6\xad" + "\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc\xd5\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06\x51\x4c" + "\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f\xc9\x34" + "\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00\xa1\x79\xa0\x25" + "\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54" + "\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee" + "\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x3c\x73\x38\xcf" + "\x23\xc6\x31\x53\x28\xc4\x27\xf8\x95\x87\x99\x83\x2d\x35\x3c" + "\x03\x9b\xd1\xff\xff\x2e\x53\x20\xe9\x5e\x62\xb9\xb7\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x41\x80\x08\xb2\x60\x74\x57\x6d" + "\xac\xed\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95\xa1\x49\x17" + "\xc7\x65\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02\x00\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x7b\x7c\x48\x90\x3f\x1b\x5e\x0f\x4d\x64\x09" + "\x3d\x4b\xfd\x3e\x6f\xd5\x7d\xe7\x56\xeb\x14\x98\xdb\xc2\x65" + "\xfb\x62\x22\x95\x43\x71\x81\x03\x04\x2c\x3a\x82\x02\x03\xb8"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x8c\xae\x47\xce\xb9\xc1\xd5\x3b\xa4\x9a\xc3\xce\x00\xde\x1a" + "\x5e\xd6\x6f\x55\x5a\x7a\xfd\x73\xa0\xc1\x37\x8e\xdf\x98\x02" + "\xd7\x27\x81\x03\x04\x28\x1e\x82\x02\x03\xb8"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix6() + { + testcase("Prefix6"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** Preim9Cond + // **** Rsa10Cond + // **** Ed11Cond + // **** Thresh12Cond + // **** preim3 + // **** thresh4 + // ***** Preim6Cond + // ***** Rsa7Cond + // ***** Ed8Cond + // ***** preim5 + + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const preim5Preimage = "I am root"s; + auto const preim5Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const thresh4Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim6CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim6Cond{Type::preimageSha256, + 9, + Preim6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa7CondConditionFingerprint = { + {0x6c, 0x7b, 0xea, 0x83, 0xa1, 0xf4, 0x82, 0x3d, 0x36, 0xe7, 0x6e, + 0xae, 0x1a, 0xbc, 0xa0, 0xba, 0x90, 0x3d, 0x96, 0xc1, 0xe6, 0xad, + 0x3a, 0x47, 0xa5, 0xcb, 0x88, 0xab, 0x3c, 0x5f, 0xcc, 0xd5}}; + Condition const Rsa7Cond{Type::rsaSha256, + 65536, + Rsa7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed8CondConditionFingerprint = { + {0xf1, 0x68, 0x96, 0xa6, 0x2e, 0xef, 0x7f, 0x47, 0x06, 0x51, 0x4c, + 0xc6, 0x7e, 0x24, 0xf7, 0x29, 0x84, 0x9c, 0xd6, 0xb0, 0xd9, 0x4b, + 0xd9, 0x0f, 0xc9, 0x34, 0x01, 0x9d, 0x92, 0xeb, 0xbc, 0x0a}}; + Condition const Ed8Cond{Type::ed25519Sha256, + 131072, + Ed8CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh12CondConditionFingerprint = { + {0x2b, 0x40, 0xdc, 0x99, 0x90, 0xf5, 0xc1, 0xc1, 0x79, 0x66, 0x76, + 0xa2, 0xc6, 0x2e, 0xb7, 0x46, 0xeb, 0x34, 0xa9, 0x67, 0x07, 0xb2, + 0xe3, 0xd4, 0x31, 0x8e, 0x61, 0xbf, 0x80, 0x1a, 0x20, 0x4a}}; + Condition const Thresh12Cond{Type::thresholdSha256, + 135168, + Thresh12CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + auto preim5 = + std::make_unique(makeSlice(preim5Preimage)); + std::vector> thresh4Subfulfillments; + thresh4Subfulfillments.emplace_back(std::move(preim5)); + std::vector thresh4Subconditions{ + {Preim6Cond, Rsa7Cond, Ed8Cond}}; + auto thresh4 = std::make_unique( + std::move(thresh4Subfulfillments), std::move(thresh4Subconditions)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(preim3)); + thresh2Subfulfillments.emplace_back(std::move(thresh4)); + std::vector thresh2Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond, Thresh12Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x01\x64\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x01\x59" + "\xa1\x82\x01\x55\x80\x02\x50\x31\x81\x01\x1c\xa2\x82\x01\x4a" + "\xa2\x82\x01\x46\xa0\x81\x9a\xa0\x0b\x80\x09\x49\x20\x61\x6d" + "\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49" + "\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\x6c\x7b\xea\x83\xa1\xf4\x82" + "\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba\x90\x3d\x96\xc1\xe6\xad" + "\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc\xd5\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06\x51\x4c" + "\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f\xc9\x34" + "\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00\xa1\x81\xa6\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\x2b\x40\xdc" + "\x99\x90\xf5\xc1\xc1\x79\x66\x76\xa2\xc6\x2e\xb7\x46\xeb\x34" + "\xa9\x67\x07\xb2\xe3\xd4\x31\x8e\x61\xbf\x80\x1a\x20\x4a\x81" + "\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x3c\x73\x38" + "\xcf\x23\xc6\x31\x53\x28\xc4\x27\xf8\x95\x87\x99\x83\x2d\x35" + "\x3c\x03\x9b\xd1\xff\xff\x2e\x53\x20\xe9\x5e\x62\xb9\xb7\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x41\x80\x08\xb2\x60\x74\x57" + "\x6d\xac\xed\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95\xa1\x49" + "\x17\xc7\x65\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02\x00\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x13\xbd\xba\xaf\x44\x4e\x80\xf6\xc1\xe3\xc4" + "\xd9\x80\x0e\x50\xa7\xa8\x01\xe5\xcc\x55\xf4\xa1\x5e\x3b\x6c" + "\xe5\x67\x6f\x53\xc5\x8c\x81\x03\x04\x40\x3a\x82\x02\x03\xb8"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x73\x58\x3e\xdc\xf8\xd0\x7d\x80\xea\x8b\xa9\x1e\xc2\x36\x57" + "\xd5\xbc\x07\xdc\x2d\x6c\xfc\x33\xcb\xc5\x98\x37\xf9\x40\xa5" + "\xdb\x2f\x81\x03\x04\x3c\x1e\x82\x02\x03\xb8"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix7() + { + testcase("Prefix7"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** rsa1 + + auto const rsa1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa1PublicKey{ + {0xc4, 0x1b, 0xc9, 0x7a, 0x96, 0x81, 0xce, 0x2e, 0xf2, 0x53, 0xc0, + 0xd4, 0xa8, 0xb9, 0xa8, 0x12, 0x92, 0x45, 0x06, 0xf1, 0xf4, 0xcd, + 0x27, 0x7d, 0xff, 0xc1, 0x65, 0x75, 0xae, 0xb7, 0xc4, 0x98, 0x53, + 0xd8, 0xfa, 0x6d, 0x86, 0x63, 0xd8, 0x4e, 0xf5, 0x20, 0xe2, 0x9e, + 0x96, 0x04, 0x36, 0x0c, 0x3f, 0xac, 0x7d, 0x09, 0x42, 0x11, 0x13, + 0x30, 0x2d, 0x7f, 0x60, 0x2c, 0xec, 0x2a, 0x34, 0xc3, 0xd8, 0xba, + 0x6d, 0x14, 0x75, 0x28, 0x56, 0xdc, 0x73, 0x6c, 0xb7, 0xd6, 0xba, + 0x8a, 0xa3, 0x9e, 0x09, 0x0e, 0xa4, 0xf3, 0x6b, 0x5d, 0x12, 0xc6, + 0xe4, 0xdd, 0x8c, 0xb1, 0x98, 0xcd, 0xde, 0xca, 0xad, 0xff, 0x86, + 0xb6, 0x06, 0x25, 0x9b, 0x71, 0x84, 0xa0, 0x9b, 0x19, 0x14, 0x88, + 0xd0, 0xc7, 0x55, 0x99, 0xe0, 0x1e, 0x0e, 0x39, 0x67, 0x74, 0xdf, + 0xf6, 0x29, 0xfa, 0x92, 0xb6, 0xbb, 0xe6, 0xe1, 0x1c, 0xd9, 0xee, + 0x65, 0xda, 0x13, 0xec, 0x50, 0x6a, 0x11, 0x7e, 0xae, 0xb4, 0xac, + 0x85, 0xa5, 0xc7, 0xcb, 0x43, 0x42, 0x36, 0x73, 0x34, 0x31, 0xb6, + 0x0b, 0x5e, 0xf0, 0x9e, 0x80, 0x49, 0xab, 0xc7, 0x79, 0xc5, 0xa7, + 0xe3, 0x16, 0x35, 0x3a, 0x48, 0xe6, 0xc0, 0x69, 0xe2, 0x70, 0x30, + 0x20, 0x74, 0x47, 0x3e, 0x3a, 0x51, 0x01, 0x21, 0x60, 0x15, 0x53, + 0x40, 0x68, 0x6e, 0xe7, 0x9f, 0x73, 0xb6, 0x98, 0x3b, 0x6e, 0x50, + 0xb8, 0xb2, 0xe7, 0x42, 0x90, 0x77, 0x61, 0xd4, 0x22, 0x6c, 0x0b, + 0x3d, 0x66, 0xe0, 0x1b, 0x7d, 0xb0, 0xa1, 0xa9, 0xa9, 0xea, 0x0e, + 0xf2, 0xab, 0xe0, 0x32, 0xf4, 0x49, 0x44, 0xcb, 0xae, 0x60, 0x1d, + 0xe1, 0xac, 0xd3, 0x34, 0x2b, 0x03, 0x97, 0x98, 0x2d, 0xda, 0xf8, + 0xe8, 0x0b, 0x81, 0x94, 0x98, 0x3a, 0xbd, 0x6d, 0x17, 0x18, 0x42, + 0x58, 0x0c, 0xa3}}; + std::array const rsa1Sig{ + {0x4e, 0xf6, 0x2b, 0x2c, 0x0a, 0x42, 0x8c, 0xdd, 0xd3, 0x9d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c, 0xba, 0xfb, 0x72, 0x83, 0xbd, 0xe9, + 0xf3, 0x4c, 0x49, 0xb9, 0xbb, 0x64, 0xf2, 0xf8, 0x87, 0x3f, 0x55, + 0x3a, 0xc8, 0xcf, 0x18, 0x2e, 0xaa, 0x6c, 0xa6, 0x91, 0x48, 0x94, + 0x2f, 0xf3, 0xca, 0x7c, 0x11, 0x55, 0xce, 0xf3, 0x97, 0xf8, 0xb2, + 0xa5, 0x43, 0x5d, 0xc8, 0xc6, 0x37, 0x14, 0xaa, 0x5b, 0x59, 0x9d, + 0x73, 0x52, 0x05, 0x9e, 0x36, 0xa1, 0x92, 0x4c, 0x95, 0x4c, 0x38, + 0xc4, 0xae, 0x72}}; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto rsa1 = std::make_unique( + makeSlice(rsa1PublicKey), makeSlice(rsa1Sig)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(rsa1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x02\x17\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x02\x0c" + "\xa3\x82\x02\x08\x80\x82\x01\x00\xc4\x1b\xc9\x7a\x96\x81\xce" + "\x2e\xf2\x53\xc0\xd4\xa8\xb9\xa8\x12\x92\x45\x06\xf1\xf4\xcd" + "\x27\x7d\xff\xc1\x65\x75\xae\xb7\xc4\x98\x53\xd8\xfa\x6d\x86" + "\x63\xd8\x4e\xf5\x20\xe2\x9e\x96\x04\x36\x0c\x3f\xac\x7d\x09" + "\x42\x11\x13\x30\x2d\x7f\x60\x2c\xec\x2a\x34\xc3\xd8\xba\x6d" + "\x14\x75\x28\x56\xdc\x73\x6c\xb7\xd6\xba\x8a\xa3\x9e\x09\x0e" + "\xa4\xf3\x6b\x5d\x12\xc6\xe4\xdd\x8c\xb1\x98\xcd\xde\xca\xad" + "\xff\x86\xb6\x06\x25\x9b\x71\x84\xa0\x9b\x19\x14\x88\xd0\xc7" + "\x55\x99\xe0\x1e\x0e\x39\x67\x74\xdf\xf6\x29\xfa\x92\xb6\xbb" + "\xe6\xe1\x1c\xd9\xee\x65\xda\x13\xec\x50\x6a\x11\x7e\xae\xb4" + "\xac\x85\xa5\xc7\xcb\x43\x42\x36\x73\x34\x31\xb6\x0b\x5e\xf0" + "\x9e\x80\x49\xab\xc7\x79\xc5\xa7\xe3\x16\x35\x3a\x48\xe6\xc0" + "\x69\xe2\x70\x30\x20\x74\x47\x3e\x3a\x51\x01\x21\x60\x15\x53" + "\x40\x68\x6e\xe7\x9f\x73\xb6\x98\x3b\x6e\x50\xb8\xb2\xe7\x42" + "\x90\x77\x61\xd4\x22\x6c\x0b\x3d\x66\xe0\x1b\x7d\xb0\xa1\xa9" + "\xa9\xea\x0e\xf2\xab\xe0\x32\xf4\x49\x44\xcb\xae\x60\x1d\xe1" + "\xac\xd3\x34\x2b\x03\x97\x98\x2d\xda\xf8\xe8\x0b\x81\x94\x98" + "\x3a\xbd\x6d\x17\x18\x42\x58\x0c\xa3\x81\x82\x01\x00\x4e\xf6" + "\x2b\x2c\x0a\x42\x8c\xdd\xd3\x9d\xd6\xb0\x4f\xa3\x54\x77\xc6" + "\x51\xaa\x17\x8a\xc8\x19\x41\xf8\xd3\x34\x28\xcc\xef\x39\xc8" + "\x0d\x31\x44\xba\x1b\x5e\x15\x8f\x63\x51\x73\x35\x74\x97\x6e" + "\x67\x94\xb1\x53\x20\x1b\x09\xf2\xd2\xaf\x74\xc9\x6b\xab\x2d" + "\x65\xee\xfd\x78\xbe\x5b\xff\xf6\x34\x35\xc2\x3c\x08\xae\x5b" + "\x36\x22\x98\x5b\x0f\xf1\xe9\x8f\x6f\xea\x3d\x00\xa1\x0f\x08" + "\x41\x06\x67\x4a\x9d\x46\xf7\x26\x88\x61\xec\x65\xf9\x8f\xe7" + "\x5a\x07\x89\x44\xe7\x43\x3a\x54\x4c\x5a\x0f\x53\x6b\x4a\x40" + "\xf8\xb0\x7d\xe9\x06\x5c\x7c\xfb\xcb\xf4\x10\x95\x5c\xa0\xea" + "\x5e\x47\xf6\x6f\x66\xfc\xca\x0c\x8c\x22\x96\x29\x5c\x7e\xdf" + "\xeb\x60\x5c\x22\xa1\x12\x7f\x85\x12\xf2\x40\x18\x61\x44\x7a" + "\xb7\xa1\x09\xe4\x94\x9a\x01\x73\xe0\xc9\x86\x6f\x8d\xf4\xca" + "\x9c\xb6\xc5\xe4\xf5\x40\x6a\xa1\x64\x3c\xba\xfb\x72\x83\xbd" + "\xe9\xf3\x4c\x49\xb9\xbb\x64\xf2\xf8\x87\x3f\x55\x3a\xc8\xcf" + "\x18\x2e\xaa\x6c\xa6\x91\x48\x94\x2f\xf3\xca\x7c\x11\x55\xce" + "\xf3\x97\xf8\xb2\xa5\x43\x5d\xc8\xc6\x37\x14\xaa\x5b\x59\x9d" + "\x73\x52\x05\x9e\x36\xa1\x92\x4c\x95\x4c\x38\xc4\xae\x72"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\xcf\x47\x4b\x1f\xf9\xde\xac\x78\x72\xcc\x38" + "\x0d\x3f\x7f\xe2\xe2\xe2\x49\x1f\x65\xa0\xd2\xad\xfb\x72\x1a" + "\xc5\x19\xb0\x91\x5d\x55\x81\x03\x01\x04\x1c\x82\x02\x04\x10"s; + auto const prefix0EncodedFingerprint = + "\x30\x32\x80\x02\x50\x30\x81\x01\x1a\xa2\x29\xa3\x27\x80\x20" + "\x23\xc9\xfd\x99\xdc\xf3\x74\x06\xe3\x11\x57\x5e\x7a\x90\x4b" + "\x0d\x0c\x36\xa7\x8d\x25\xbc\xd5\x5f\x0d\x1f\x25\x08\x2e\x4f" + "\xca\x1a\x81\x03\x01\x00\x00"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix8() + { + testcase("Prefix8"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** rsa2 + + auto const rsa2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa2PublicKey{ + {0xba, 0x2c, 0x3b, 0x50, 0xb6, 0xbf, 0xf9, 0x0f, 0x1d, 0xd7, 0x32, + 0x4c, 0x01, 0x5f, 0xff, 0x2f, 0x2a, 0xf6, 0x33, 0xd0, 0xfb, 0xea, + 0x1f, 0xa4, 0xf2, 0x2d, 0x22, 0x8a, 0x19, 0x95, 0xa9, 0x17, 0xb7, + 0x4f, 0x17, 0xcf, 0x55, 0xcd, 0x1a, 0x3a, 0x5f, 0x07, 0x73, 0xcc, + 0xaa, 0x21, 0x70, 0x64, 0xb3, 0xa0, 0xf4, 0xb7, 0x30, 0xa3, 0x82, + 0x37, 0x93, 0xc6, 0x59, 0xde, 0x1b, 0xa1, 0x16, 0x90, 0x5a, 0x1a, + 0xf6, 0x73, 0xab, 0x92, 0xc8, 0x2f, 0xf4, 0x6f, 0x5c, 0xf2, 0x22, + 0x1d, 0x30, 0xf8, 0x03, 0xd8, 0x9b, 0x5f, 0x73, 0x72, 0x8e, 0x5f, + 0xd5, 0x37, 0x4b, 0x43, 0xda, 0xfe, 0x84, 0x21, 0x67, 0xe8, 0xe3, + 0xd7, 0x91, 0x3f, 0x24, 0x1d, 0xfb, 0x1f, 0x12, 0x6e, 0xcb, 0xfc, + 0xb7, 0x5b, 0x0a, 0x35, 0x73, 0x3b, 0xce, 0x44, 0x34, 0x8e, 0xcd, + 0x53, 0xa4, 0xcf, 0xa7, 0x63, 0x73, 0xcd, 0x31, 0x0f, 0xe0, 0x75, + 0x8d, 0xe4, 0xa9, 0xdc, 0xfe, 0xf0, 0xc9, 0x3d, 0x26, 0xaf, 0xbf, + 0x7b, 0x0f, 0x0e, 0x17, 0xb9, 0xd0, 0x4a, 0x32, 0x80, 0x64, 0x6b, + 0x54, 0x73, 0x5a, 0x50, 0xc7, 0x31, 0x59, 0xf9, 0x73, 0x72, 0xa5, + 0x79, 0xba, 0xdb, 0xa1, 0x14, 0x8d, 0x77, 0x67, 0x3e, 0xc0, 0x5b, + 0xec, 0x6f, 0x0b, 0xf7, 0xc5, 0xee, 0x5a, 0xa6, 0x8d, 0x49, 0x63, + 0x81, 0xbb, 0xd1, 0xf9, 0x9e, 0xbb, 0xed, 0xb2, 0xa9, 0x18, 0x60, + 0xa7, 0xee, 0xeb, 0x30, 0xa1, 0x92, 0x93, 0xe8, 0xd8, 0x34, 0x9e, + 0xac, 0xd6, 0x23, 0xfc, 0x7f, 0xcb, 0xe7, 0xfe, 0xa7, 0xe6, 0x42, + 0xac, 0x77, 0x11, 0xc0, 0x67, 0x77, 0xd1, 0xaa, 0x5e, 0xed, 0x3b, + 0xd5, 0xa5, 0x8d, 0x34, 0x7c, 0xd9, 0x57, 0x44, 0xa7, 0xc5, 0x44, + 0x2e, 0x1e, 0xe7, 0x63, 0xd8, 0x53, 0x1b, 0x9a, 0xd9, 0x67, 0x02, + 0x13, 0x32, 0x61}}; + std::array const rsa2Sig{ + {0xb5, 0x9a, 0x0e, 0xfd, 0xb4, 0x7c, 0xe4, 0xa5, 0x43, 0xf5, 0xc2, + 0x03, 0x91, 0x13, 0xef, 0xcd, 0x7f, 0xcb, 0x41, 0xb0, 0xf3, 0x2a, + 0x08, 0xcf, 0x87, 0xd3, 0xf2, 0x20, 0x98, 0x9d, 0x3c, 0x4a, 0x4c, + 0xc2, 0x26, 0xce, 0xb6, 0xf7, 0x60, 0xe1, 0xd2, 0xcd, 0xf3, 0xed, + 0x50, 0x65, 0xa5, 0x72, 0x64, 0x76, 0x1f, 0xd5, 0x79, 0x74, 0x2b, + 0xe7, 0x87, 0x4b, 0x64, 0x36, 0xae, 0x87, 0x57, 0x2c, 0x7c, 0x46, + 0xb1, 0xb6, 0x62, 0xac, 0xda, 0x4e, 0x34, 0xb0, 0x10, 0xe7, 0xc9, + 0x0c, 0x66, 0xb1, 0xd9, 0x39, 0xdc, 0xc5, 0x29, 0x06, 0x50, 0x3d, + 0xda, 0x9f, 0x34, 0xa1, 0xd9, 0xca, 0xbc, 0x52, 0xdc, 0x4c, 0x70, + 0x87, 0x97, 0xe8, 0x96, 0xe0, 0x0d, 0x19, 0x30, 0x2b, 0x1a, 0x6c, + 0x96, 0x39, 0x35, 0x51, 0xcf, 0x9b, 0xa8, 0xa2, 0xc6, 0xf1, 0x3d, + 0x15, 0x30, 0x63, 0xef, 0x52, 0x10, 0x58, 0xe8, 0x87, 0x67, 0xe4, + 0x29, 0xe6, 0x94, 0x75, 0xba, 0x39, 0x01, 0x0c, 0x80, 0x44, 0x85, + 0x2a, 0x1a, 0x3d, 0x18, 0x40, 0x9d, 0x62, 0x80, 0x85, 0xd6, 0x6e, + 0x08, 0x35, 0xdf, 0xf6, 0x5e, 0x29, 0x0c, 0x7a, 0x62, 0xe2, 0x93, + 0x8f, 0xb9, 0xf9, 0xd0, 0xb9, 0x89, 0xf0, 0x1d, 0x79, 0xd0, 0x52, + 0xdc, 0xf4, 0x7a, 0x1f, 0xe5, 0xb9, 0x38, 0x7d, 0xee, 0x5d, 0x3a, + 0x48, 0xe7, 0x51, 0x71, 0x84, 0xb5, 0x08, 0xf2, 0xbd, 0x53, 0x68, + 0xd9, 0x38, 0x57, 0x30, 0xf5, 0xf5, 0x24, 0x22, 0x3b, 0x59, 0xda, + 0xe4, 0x44, 0x60, 0xf1, 0x76, 0x4e, 0xef, 0xd9, 0x36, 0x63, 0x25, + 0xf1, 0xf5, 0xb3, 0x80, 0xd2, 0x85, 0x90, 0xc8, 0x9a, 0x90, 0xc7, + 0x58, 0x0d, 0x2e, 0x91, 0xf4, 0xf8, 0xfc, 0x54, 0xc6, 0x75, 0x2e, + 0x52, 0xdd, 0x81, 0x43, 0xed, 0xe6, 0x71, 0x9b, 0xa7, 0x1a, 0xb5, + 0xa7, 0x41, 0xc7}}; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto rsa2 = std::make_unique( + makeSlice(rsa2PublicKey), makeSlice(rsa2Sig)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(rsa2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x02\x26\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x02\x1b" + "\xa1\x82\x02\x17\x80\x02\x50\x31\x81\x01\x1c\xa2\x82\x02\x0c" + "\xa3\x82\x02\x08\x80\x82\x01\x00\xba\x2c\x3b\x50\xb6\xbf\xf9" + "\x0f\x1d\xd7\x32\x4c\x01\x5f\xff\x2f\x2a\xf6\x33\xd0\xfb\xea" + "\x1f\xa4\xf2\x2d\x22\x8a\x19\x95\xa9\x17\xb7\x4f\x17\xcf\x55" + "\xcd\x1a\x3a\x5f\x07\x73\xcc\xaa\x21\x70\x64\xb3\xa0\xf4\xb7" + "\x30\xa3\x82\x37\x93\xc6\x59\xde\x1b\xa1\x16\x90\x5a\x1a\xf6" + "\x73\xab\x92\xc8\x2f\xf4\x6f\x5c\xf2\x22\x1d\x30\xf8\x03\xd8" + "\x9b\x5f\x73\x72\x8e\x5f\xd5\x37\x4b\x43\xda\xfe\x84\x21\x67" + "\xe8\xe3\xd7\x91\x3f\x24\x1d\xfb\x1f\x12\x6e\xcb\xfc\xb7\x5b" + "\x0a\x35\x73\x3b\xce\x44\x34\x8e\xcd\x53\xa4\xcf\xa7\x63\x73" + "\xcd\x31\x0f\xe0\x75\x8d\xe4\xa9\xdc\xfe\xf0\xc9\x3d\x26\xaf" + "\xbf\x7b\x0f\x0e\x17\xb9\xd0\x4a\x32\x80\x64\x6b\x54\x73\x5a" + "\x50\xc7\x31\x59\xf9\x73\x72\xa5\x79\xba\xdb\xa1\x14\x8d\x77" + "\x67\x3e\xc0\x5b\xec\x6f\x0b\xf7\xc5\xee\x5a\xa6\x8d\x49\x63" + "\x81\xbb\xd1\xf9\x9e\xbb\xed\xb2\xa9\x18\x60\xa7\xee\xeb\x30" + "\xa1\x92\x93\xe8\xd8\x34\x9e\xac\xd6\x23\xfc\x7f\xcb\xe7\xfe" + "\xa7\xe6\x42\xac\x77\x11\xc0\x67\x77\xd1\xaa\x5e\xed\x3b\xd5" + "\xa5\x8d\x34\x7c\xd9\x57\x44\xa7\xc5\x44\x2e\x1e\xe7\x63\xd8" + "\x53\x1b\x9a\xd9\x67\x02\x13\x32\x61\x81\x82\x01\x00\xb5\x9a" + "\x0e\xfd\xb4\x7c\xe4\xa5\x43\xf5\xc2\x03\x91\x13\xef\xcd\x7f" + "\xcb\x41\xb0\xf3\x2a\x08\xcf\x87\xd3\xf2\x20\x98\x9d\x3c\x4a" + "\x4c\xc2\x26\xce\xb6\xf7\x60\xe1\xd2\xcd\xf3\xed\x50\x65\xa5" + "\x72\x64\x76\x1f\xd5\x79\x74\x2b\xe7\x87\x4b\x64\x36\xae\x87" + "\x57\x2c\x7c\x46\xb1\xb6\x62\xac\xda\x4e\x34\xb0\x10\xe7\xc9" + "\x0c\x66\xb1\xd9\x39\xdc\xc5\x29\x06\x50\x3d\xda\x9f\x34\xa1" + "\xd9\xca\xbc\x52\xdc\x4c\x70\x87\x97\xe8\x96\xe0\x0d\x19\x30" + "\x2b\x1a\x6c\x96\x39\x35\x51\xcf\x9b\xa8\xa2\xc6\xf1\x3d\x15" + "\x30\x63\xef\x52\x10\x58\xe8\x87\x67\xe4\x29\xe6\x94\x75\xba" + "\x39\x01\x0c\x80\x44\x85\x2a\x1a\x3d\x18\x40\x9d\x62\x80\x85" + "\xd6\x6e\x08\x35\xdf\xf6\x5e\x29\x0c\x7a\x62\xe2\x93\x8f\xb9" + "\xf9\xd0\xb9\x89\xf0\x1d\x79\xd0\x52\xdc\xf4\x7a\x1f\xe5\xb9" + "\x38\x7d\xee\x5d\x3a\x48\xe7\x51\x71\x84\xb5\x08\xf2\xbd\x53" + "\x68\xd9\x38\x57\x30\xf5\xf5\x24\x22\x3b\x59\xda\xe4\x44\x60" + "\xf1\x76\x4e\xef\xd9\x36\x63\x25\xf1\xf5\xb3\x80\xd2\x85\x90" + "\xc8\x9a\x90\xc7\x58\x0d\x2e\x91\xf4\xf8\xfc\x54\xc6\x75\x2e" + "\x52\xdd\x81\x43\xed\xe6\x71\x9b\xa7\x1a\xb5\xa7\x41\xc7"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x7b\xb9\x5c\x7b\xbd\xcc\xb0\xce\xd7\xa0\xb6" + "\x77\x4d\x69\xa8\x33\x03\xd2\xaf\xaa\xd4\x28\xcc\xfc\x34\xe5" + "\xd0\x27\x52\xd8\x9f\xb6\x81\x03\x01\x08\x3a\x82\x02\x04\x10"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x2f\x18\x13\x7f\xfa\x8a\x0e\x82\x17\x17\x42\x75\x2c\x21\x9e" + "\x65\x1d\xae\x69\x15\xd2\x7d\xf2\xe5\xff\x48\xde\x5a\x7a\xed" + "\x7b\x64\x81\x03\x01\x04\x1e\x82\x02\x04\x10"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix9() + { + testcase("Prefix9"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** prefix2 + // **** rsa3 + + auto const rsa3Msg = "P2P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa3PublicKey{ + {0xbd, 0xd1, 0xc7, 0xf0, 0xb0, 0x3a, 0xa5, 0x5b, 0x3e, 0x49, 0x8d, + 0x4e, 0x00, 0x54, 0x89, 0xb9, 0x89, 0xcd, 0x4b, 0x43, 0xde, 0x59, + 0xf6, 0x7a, 0x67, 0x5c, 0x3a, 0xc6, 0xcf, 0x82, 0x3f, 0x35, 0x9c, + 0xcc, 0xda, 0xcd, 0xd3, 0x97, 0x86, 0x5b, 0xe9, 0xf6, 0x05, 0x55, + 0x0b, 0x26, 0xef, 0x1e, 0x88, 0xd5, 0xb6, 0xba, 0x14, 0x0a, 0xb2, + 0x76, 0xb9, 0xb3, 0x46, 0x0c, 0xc0, 0x80, 0x17, 0x13, 0x68, 0x23, + 0xdc, 0xec, 0x10, 0x18, 0xfc, 0xaa, 0xbe, 0xb3, 0xc4, 0xc7, 0xa9, + 0x84, 0xa6, 0x4e, 0x5c, 0x08, 0x6b, 0x7b, 0x4c, 0x81, 0x91, 0x79, + 0x5d, 0x90, 0x06, 0x15, 0xbb, 0x76, 0x2f, 0x5c, 0x53, 0x60, 0x0f, + 0xac, 0xf3, 0x7c, 0x49, 0xc5, 0x47, 0xec, 0xb3, 0xda, 0x93, 0x87, + 0xc1, 0xb9, 0xcf, 0x2c, 0xb5, 0xf0, 0x85, 0xad, 0xb4, 0x38, 0x67, + 0x88, 0xda, 0x3d, 0xfa, 0x01, 0xb7, 0x54, 0xd9, 0x41, 0x0b, 0x7b, + 0x8a, 0x09, 0xe0, 0x84, 0x7d, 0xbb, 0x89, 0xb2, 0xfc, 0x0b, 0x70, + 0x36, 0x93, 0x56, 0x62, 0xcc, 0xb4, 0xfc, 0xf9, 0x1f, 0x37, 0x92, + 0x9b, 0x3a, 0x4e, 0x7c, 0xad, 0x4b, 0xa6, 0x76, 0x6f, 0xda, 0xc4, + 0x2f, 0x83, 0x53, 0xbd, 0x93, 0xa9, 0x76, 0x89, 0x53, 0xe1, 0x4d, + 0xee, 0x27, 0x11, 0x6f, 0xbc, 0x21, 0xad, 0x42, 0x9f, 0x29, 0xf6, + 0x03, 0xdd, 0xec, 0xfa, 0xa1, 0x78, 0xd2, 0xde,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0x10, 0xb3, 0x8e, 0x8e, 0xf7, 0xd7, 0x85, + 0x1b, 0x07, 0x49, 0xa5, 0x18, 0x9a, 0x05, 0x4e, 0xee, 0xec, 0x7e, + 0x00, 0x26, 0x3c, 0xd6, 0xb0, 0xc6, 0xc2, 0x0c, 0xbf, 0x1a, 0x68, + 0x23, 0xf0, 0x26, 0x0a, 0x86, 0x0f, 0xa8, 0xd6, 0xea, 0x2b, 0xca, + 0x6d, 0x0c, 0xd5, 0xe8, 0xcc, 0xd9, 0x0c, 0x8c, 0x0a, 0x3a, 0x1a, + 0x09, 0x29, 0x58, 0x27, 0x47, 0xd3, 0x21, 0x0a, 0x58, 0x80, 0xa8, + 0xe8, 0x99, 0x84, 0xde, 0x81, 0x16, 0xea, 0xe7, 0x02, 0x8b, 0x53, + 0x7a, 0xff, 0xbf, 0x6d, 0xe2, 0x61, 0x78, 0x5b, 0x8f, 0x4c, 0x04, + 0x7d, 0xc4, 0x49, 0xe6, 0x0c, 0x50, 0x3b, 0xa3, 0xb0, 0xc2, 0x89, + 0x24, 0xe6, 0x52, 0xab, 0xe5, 0xc8, 0x4d, 0xaa, 0x4e, 0x89, 0x97, + 0xc2, 0x93, 0xb1, 0x43, 0xb3, 0xcd, 0x7a, 0xb0, 0x33, 0xa1, 0x19, + 0xa8, 0xc5, 0xac, 0x87, 0x72, 0x67, 0x36, 0xcd, 0xae, 0xfc, 0xd9, + 0xba, 0x77, 0xf9, 0xab, 0x6f, 0x4a, 0xb4, 0xd5, 0x84, 0xb8, 0xab, + 0x03, 0x7a, 0x88}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 30; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto rsa3 = std::make_unique( + makeSlice(rsa3PublicKey), makeSlice(rsa3Sig)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(rsa3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x02\x35\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x02\x2a" + "\xa1\x82\x02\x26\x80\x02\x50\x31\x81\x01\x1c\xa2\x82\x02\x1b" + "\xa1\x82\x02\x17\x80\x02\x50\x32\x81\x01\x1e\xa2\x82\x02\x0c" + "\xa3\x82\x02\x08\x80\x82\x01\x00\xbd\xd1\xc7\xf0\xb0\x3a\xa5" + "\x5b\x3e\x49\x8d\x4e\x00\x54\x89\xb9\x89\xcd\x4b\x43\xde\x59" + "\xf6\x7a\x67\x5c\x3a\xc6\xcf\x82\x3f\x35\x9c\xcc\xda\xcd\xd3" + "\x97\x86\x5b\xe9\xf6\x05\x55\x0b\x26\xef\x1e\x88\xd5\xb6\xba" + "\x14\x0a\xb2\x76\xb9\xb3\x46\x0c\xc0\x80\x17\x13\x68\x23\xdc" + "\xec\x10\x18\xfc\xaa\xbe\xb3\xc4\xc7\xa9\x84\xa6\x4e\x5c\x08" + "\x6b\x7b\x4c\x81\x91\x79\x5d\x90\x06\x15\xbb\x76\x2f\x5c\x53" + "\x60\x0f\xac\xf3\x7c\x49\xc5\x47\xec\xb3\xda\x93\x87\xc1\xb9" + "\xcf\x2c\xb5\xf0\x85\xad\xb4\x38\x67\x88\xda\x3d\xfa\x01\xb7" + "\x54\xd9\x41\x0b\x7b\x8a\x09\xe0\x84\x7d\xbb\x89\xb2\xfc\x0b" + "\x70\x36\x93\x56\x62\xcc\xb4\xfc\xf9\x1f\x37\x92\x9b\x3a\x4e" + "\x7c\xad\x4b\xa6\x76\x6f\xda\xc4\x2f\x83\x53\xbd\x93\xa9\x76" + "\x89\x53\xe1\x4d\xee\x27\x11\x6f\xbc\x21\xad\x42\x9f\x29\xf6" + "\x03\xdd\xec\xfa\xa1\x78\xd2\xde\x29\x2e\xd8\x3a\x7f\xe9\x9b" + "\x5d\xeb\x37\xb8\xb0\xa0\x66\x3f\x02\xcd\x2a\x6e\xd3\x1c\xa5" + "\x65\xdc\x73\xbe\x93\x54\x9a\x2b\xf8\x32\x8b\xe8\xce\x9a\x59" + "\xd0\x05\xeb\xbb\xac\xfc\x4c\x4b\x2e\xac\x2a\xc3\x0f\x0a\xd7" + "\x46\xaf\xfd\x22\x0d\x0d\x54\xcc\x2f\x81\x82\x01\x00\xad\xed" + "\x85\x93\x7f\xe1\x8f\xa6\x1b\xda\xde\x0a\x73\xcd\xf5\x5b\x24" + "\x51\xfc\x2d\xad\x99\xb0\x88\xfa\xe0\xa3\x0b\x69\xf1\xa1\x78" + "\xa3\xfc\x2e\x9e\xa5\x9b\x92\xf2\x69\x8b\x01\x60\x8e\x28\xcb" + "\x96\x33\x19\x8d\x16\xe4\xcf\x97\xf0\xda\xc5\x5d\xee\xcd\x74" + "\xbb\xce\x56\xc9\x60\xc9\x4c\xa7\x5b\xe5\xcc\x5a\xd0\x04\xc6" + "\xbe\xcf\x16\xda\x71\x82\x8d\x8e\x22\xb6\x3b\x1c\xf3\xe2\x3a" + "\xf7\x78\xec\x22\x8f\x8c\xc9\xe8\x3c\x8b\x3e\xbc\x7f\x0a\x95" + "\x66\x94\x7e\xb7\xae\x7f\xc8\x10\xb3\x8e\x8e\xf7\xd7\x85\x1b" + "\x07\x49\xa5\x18\x9a\x05\x4e\xee\xec\x7e\x00\x26\x3c\xd6\xb0" + "\xc6\xc2\x0c\xbf\x1a\x68\x23\xf0\x26\x0a\x86\x0f\xa8\xd6\xea" + "\x2b\xca\x6d\x0c\xd5\xe8\xcc\xd9\x0c\x8c\x0a\x3a\x1a\x09\x29" + "\x58\x27\x47\xd3\x21\x0a\x58\x80\xa8\xe8\x99\x84\xde\x81\x16" + "\xea\xe7\x02\x8b\x53\x7a\xff\xbf\x6d\xe2\x61\x78\x5b\x8f\x4c" + "\x04\x7d\xc4\x49\xe6\x0c\x50\x3b\xa3\xb0\xc2\x89\x24\xe6\x52" + "\xab\xe5\xc8\x4d\xaa\x4e\x89\x97\xc2\x93\xb1\x43\xb3\xcd\x7a" + "\xb0\x33\xa1\x19\xa8\xc5\xac\x87\x72\x67\x36\xcd\xae\xfc\xd9" + "\xba\x77\xf9\xab\x6f\x4a\xb4\xd5\x84\xb8\xab\x03\x7a\x88"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\xa9\x5b\xbe\xc2\xfd\x4b\x3b\x17\xf8\x7c\x09" + "\xaf\x8b\x23\xaa\x18\xe9\xa5\x10\x9e\x8c\x21\x6e\xc1\x5c\x02" + "\x90\x0e\x25\x12\xb1\x27\x81\x03\x01\x0c\x5a\x82\x02\x04\x10"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x2d\xee\x1c\xf5\x83\xf7\x51\x65\x58\x17\x0a\xf6\x35\xbf\x36" + "\xe0\x08\x4a\x32\x87\x0e\x38\x3c\xd7\x13\x6f\x01\x43\xb2\x5d" + "\x11\xb5\x81\x03\x01\x08\x3e\x82\x02\x04\x10"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix10() + { + testcase("Prefix10"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** rsa3 + + auto const rsa3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa3PublicKey{ + {0xbd, 0xd1, 0xc7, 0xf0, 0xb0, 0x3a, 0xa5, 0x5b, 0x3e, 0x49, 0x8d, + 0x4e, 0x00, 0x54, 0x89, 0xb9, 0x89, 0xcd, 0x4b, 0x43, 0xde, 0x59, + 0xf6, 0x7a, 0x67, 0x5c, 0x3a, 0xc6, 0xcf, 0x82, 0x3f, 0x35, 0x9c, + 0xcc, 0xda, 0xcd, 0xd3, 0x97, 0x86, 0x5b, 0xe9, 0xf6, 0x05, 0x55, + 0x0b, 0x26, 0xef, 0x1e, 0x88, 0xd5, 0xb6, 0xba, 0x14, 0x0a, 0xb2, + 0x76, 0xb9, 0xb3, 0x46, 0x0c, 0xc0, 0x80, 0x17, 0x13, 0x68, 0x23, + 0xdc, 0xec, 0x10, 0x18, 0xfc, 0xaa, 0xbe, 0xb3, 0xc4, 0xc7, 0xa9, + 0x84, 0xa6, 0x4e, 0x5c, 0x08, 0x6b, 0x7b, 0x4c, 0x81, 0x91, 0x79, + 0x5d, 0x90, 0x06, 0x15, 0xbb, 0x76, 0x2f, 0x5c, 0x53, 0x60, 0x0f, + 0xac, 0xf3, 0x7c, 0x49, 0xc5, 0x47, 0xec, 0xb3, 0xda, 0x93, 0x87, + 0xc1, 0xb9, 0xcf, 0x2c, 0xb5, 0xf0, 0x85, 0xad, 0xb4, 0x38, 0x67, + 0x88, 0xda, 0x3d, 0xfa, 0x01, 0xb7, 0x54, 0xd9, 0x41, 0x0b, 0x7b, + 0x8a, 0x09, 0xe0, 0x84, 0x7d, 0xbb, 0x89, 0xb2, 0xfc, 0x0b, 0x70, + 0x36, 0x93, 0x56, 0x62, 0xcc, 0xb4, 0xfc, 0xf9, 0x1f, 0x37, 0x92, + 0x9b, 0x3a, 0x4e, 0x7c, 0xad, 0x4b, 0xa6, 0x76, 0x6f, 0xda, 0xc4, + 0x2f, 0x83, 0x53, 0xbd, 0x93, 0xa9, 0x76, 0x89, 0x53, 0xe1, 0x4d, + 0xee, 0x27, 0x11, 0x6f, 0xbc, 0x21, 0xad, 0x42, 0x9f, 0x29, 0xf6, + 0x03, 0xdd, 0xec, 0xf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xa4, 0x67, 0xfd, 0xdc, 0xe0, 0x60, 0xcc, 0x2d, 0xa7, 0x99, + 0xf7, 0x92, 0x6f, 0x33, 0x18, 0x71, 0x4a, 0x07, 0x4a, 0x59, 0x8a, + 0x29, 0x49, 0xc0, 0xdd, 0x07, 0x0b, 0xa3, 0xd5, 0xe2, 0x36, 0xb6, + 0x13, 0xfc, 0x45, 0x47, 0xf5, 0x7c, 0xe4, 0xe2, 0x84, 0x29, 0x1e, + 0x3c, 0x08, 0xb3, 0xae, 0xc7, 0xaf, 0xef, 0x4a, 0xd8, 0x58, 0x2d, + 0x68, 0x29, 0x4c, 0xfe, 0xc1, 0xba, 0x76, 0x53, 0xf7, 0x88, 0xdb, + 0xce, 0x29, 0x9c, 0x97, 0x99, 0xe8, 0x43, 0x73, 0x79, 0x74, 0x0a, + 0x20, 0x72, 0xa5, 0xc5, 0x79, 0xad, 0xbb, 0xf8, 0x94, 0x2f, 0xaa, + 0xc8, 0x09, 0x41, 0x0d, 0x61, 0x64, 0x1a, 0x21, 0x8b, 0xad, 0x42, + 0x41, 0x80, 0xc7, 0x6c, 0x9a, 0x57, 0x8a, 0xf2, 0xd8, 0xf2, 0xba, + 0xbf, 0xae, 0x8c, 0x55, 0x4f, 0x8d, 0x58, 0x41, 0x58, 0x28, 0x32, + 0xe7, 0xe8, 0x7b, 0x3b, 0xe6, 0x99, 0x4e, 0x58, 0x82, 0xc8, 0x3a, + 0x43, 0xbd, 0x26, 0x30, 0x45, 0x38, 0xb8, 0xf5, 0x00, 0x4d, 0x2c, + 0xb4, 0x7d, 0x90}}; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto rsa3 = std::make_unique( + makeSlice(rsa3PublicKey), makeSlice(rsa3Sig)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(rsa3)); + std::vector thresh2Subconditions{}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x02\x30\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x02\x25" + "\xa1\x82\x02\x21\x80\x02\x50\x31\x81\x01\x1c\xa2\x82\x02\x16" + "\xa2\x82\x02\x12\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01" + "\x00\xbd\xd1\xc7\xf0\xb0\x3a\xa5\x5b\x3e\x49\x8d\x4e\x00\x54" + "\x89\xb9\x89\xcd\x4b\x43\xde\x59\xf6\x7a\x67\x5c\x3a\xc6\xcf" + "\x82\x3f\x35\x9c\xcc\xda\xcd\xd3\x97\x86\x5b\xe9\xf6\x05\x55" + "\x0b\x26\xef\x1e\x88\xd5\xb6\xba\x14\x0a\xb2\x76\xb9\xb3\x46" + "\x0c\xc0\x80\x17\x13\x68\x23\xdc\xec\x10\x18\xfc\xaa\xbe\xb3" + "\xc4\xc7\xa9\x84\xa6\x4e\x5c\x08\x6b\x7b\x4c\x81\x91\x79\x5d" + "\x90\x06\x15\xbb\x76\x2f\x5c\x53\x60\x0f\xac\xf3\x7c\x49\xc5" + "\x47\xec\xb3\xda\x93\x87\xc1\xb9\xcf\x2c\xb5\xf0\x85\xad\xb4" + "\x38\x67\x88\xda\x3d\xfa\x01\xb7\x54\xd9\x41\x0b\x7b\x8a\x09" + "\xe0\x84\x7d\xbb\x89\xb2\xfc\x0b\x70\x36\x93\x56\x62\xcc\xb4" + "\xfc\xf9\x1f\x37\x92\x9b\x3a\x4e\x7c\xad\x4b\xa6\x76\x6f\xda" + "\xc4\x2f\x83\x53\xbd\x93\xa9\x76\x89\x53\xe1\x4d\xee\x27\x11" + "\x6f\xbc\x21\xad\x42\x9f\x29\xf6\x03\xdd\xec\xfa\xa1\x78\xd2" + "\xde\x29\x2e\xd8\x3a\x7f\xe9\x9b\x5d\xeb\x37\xb8\xb0\xa0\x66" + "\x3f\x02\xcd\x2a\x6e\xd3\x1c\xa5\x65\xdc\x73\xbe\x93\x54\x9a" + "\x2b\xf8\x32\x8b\xe8\xce\x9a\x59\xd0\x05\xeb\xbb\xac\xfc\x4c" + "\x4b\x2e\xac\x2a\xc3\x0f\x0a\xd7\x46\xaf\xfd\x22\x0d\x0d\x54" + "\xcc\x2f\x81\x82\x01\x00\x3e\x7f\x0d\xdf\x6b\xa4\x40\x02\x48" + "\xd2\xdf\x93\x31\x6c\xeb\xc5\xa0\xa5\x5c\x3e\x9b\xa7\x50\x46" + "\x2f\x6f\x8a\x05\xea\x42\x2a\x83\x81\x0d\x39\x0b\x24\x93\x86" + "\x67\xc3\x42\x2f\xae\x41\x7f\x0e\xc6\xbd\xe5\xdb\x1b\x76\x7f" + "\x9b\x40\x79\x4b\xa1\x95\x80\x0f\x7b\x97\x34\x77\x31\x31\x8d" + "\x70\x15\x1f\x25\x24\x9d\x52\x0d\x57\xdf\xba\x27\xe6\xe0\x5d" + "\x6e\x48\x7c\x68\xd1\x40\xbf\xba\xd7\x3c\xf4\x71\x52\x28\x5c" + "\x03\xb0\x74\x0e\x23\xbd\x36\x8e\x51\xf3\xdc\x3a\xa4\x67\xfd" + "\xdc\xe0\x60\xcc\x2d\xa7\x99\xf7\x92\x6f\x33\x18\x71\x4a\x07" + "\x4a\x59\x8a\x29\x49\xc0\xdd\x07\x0b\xa3\xd5\xe2\x36\xb6\x13" + "\xfc\x45\x47\xf5\x7c\xe4\xe2\x84\x29\x1e\x3c\x08\xb3\xae\xc7" + "\xaf\xef\x4a\xd8\x58\x2d\x68\x29\x4c\xfe\xc1\xba\x76\x53\xf7" + "\x88\xdb\xce\x29\x9c\x97\x99\xe8\x43\x73\x79\x74\x0a\x20\x72" + "\xa5\xc5\x79\xad\xbb\xf8\x94\x2f\xaa\xc8\x09\x41\x0d\x61\x64" + "\x1a\x21\x8b\xad\x42\x41\x80\xc7\x6c\x9a\x57\x8a\xf2\xd8\xf2" + "\xba\xbf\xae\x8c\x55\x4f\x8d\x58\x41\x58\x28\x32\xe7\xe8\x7b" + "\x3b\xe6\x99\x4e\x58\x82\xc8\x3a\x43\xbd\x26\x30\x45\x38\xb8" + "\xf5\x00\x4d\x2c\xb4\x7d\x90\xa1\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x90\x18\x4a\x84\xba\x52\x59\xa7\x18\xbe\xe2" + "\x73\xb3\xc3\x59\xca\xf5\x01\x62\xb6\xd1\xcf\xfc\xe8\x64\x50" + "\xee\xb6\x35\x58\x08\xeb\x81\x03\x01\x0c\x3a\x82\x02\x04\x30"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x03\x55\x19\x2f\x8d\xc8\x6c\x6c\xbb\xb6\x73\x15\xe1\x10\x76" + "\x4b\x7c\xe1\x3d\x81\x4c\x51\x0f\x35\xe8\xee\x05\x35\xef\x9c" + "\x30\xef\x81\x03\x01\x08\x1e\x82\x02\x04\x30"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix11() + { + testcase("Prefix11"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** Preim4Cond + // **** Rsa5Cond + // **** Ed6Cond + // **** rsa3 + + auto const rsa3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa3PublicKey{ + {0xbd, 0xd1, 0xc7, 0xf0, 0xb0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b8, 0xc2, 0xcd, 0xad, + 0x92, 0x01, 0x09, 0x04, 0xbd, 0x8f, 0x9d, 0x24, 0x32, 0x04, 0x54, + 0xaf, 0x2a, 0xef, 0xd0, 0x36, 0x91, 0xce, 0xd3, 0xbc, 0xc9, 0x60, + 0x9d, 0xd0, 0xaf, 0x79, 0xe0, 0xfd, 0x42, 0x67, 0xc4, 0xcf, 0x5c, + 0xf0, 0x69, 0xd1, 0xf6, 0x5c, 0xd7, 0x83, 0x6a, 0xb2, 0x6f, 0xe0, + 0xb9, 0xc6, 0x08, 0x07, 0x93, 0xfe, 0x32, 0x49, 0x8c, 0xdd, 0xd6, + 0x21, 0xfc, 0x95, 0x0d, 0x2b, 0x93, 0x09, 0xa7, 0xa7, 0x78, 0x6b, + 0x47, 0x13, 0xce, 0x18, 0xc1, 0xaa, 0x8c, 0x55, 0x57, 0x4a, 0x94, + 0xae, 0x5a, 0xe8, 0x8f, 0x7e, 0x61, 0x1c, 0x70, 0xc8, 0x6a, 0x67, + 0x59, 0x72, 0x5c, 0x4d, 0x42, 0xc7, 0x58, 0x3f, 0x85, 0xd1, 0x06, + 0x3a, 0x25, 0xd5, 0x30, 0xe2, 0xf1, 0xc7, 0x80, 0x58, 0x06, 0x3b, + 0x0c, 0x65, 0x7a, 0x41, 0x33, 0x96, 0x4e, 0x81, 0x0a, 0x2a, 0xfa, + 0x20, 0x29, 0x98, 0xfb, 0xef, 0x82, 0x8c, 0xff, 0x91, 0x05, 0x35, + 0xde, 0xa7, 0xb3, 0x2b, 0x34, 0xf0, 0x6f, 0x61, 0xf0, 0x06, 0x9c, + 0x0c, 0x36, 0x27}}; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim4CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim4Cond{Type::preimageSha256, + 9, + Preim4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa5CondConditionFingerprint = { + {0x99, 0xfb, 0x0b, 0x38, 0x94, 0x4d, 0x20, 0x85, 0xc8, 0xda, 0x3a, + 0x64, 0x31, 0x44, 0x6f, 0x6c, 0x3b, 0x46, 0x25, 0x50, 0xd7, 0x7f, + 0xdf, 0xee, 0x75, 0x72, 0x71, 0xf9, 0x61, 0x40, 0x63, 0xfa}}; + Condition const Rsa5Cond{Type::rsaSha256, + 65536, + Rsa5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed6CondConditionFingerprint = { + {0x00, 0xd3, 0xc9, 0x24, 0x3f, 0x2d, 0x2e, 0x64, 0x93, 0xa8, 0x49, + 0x29, 0x82, 0x75, 0xea, 0xbf, 0xe3, 0x53, 0x7f, 0x8e, 0x45, 0x16, + 0xdb, 0x5e, 0xc6, 0xdf, 0x39, 0xd2, 0xcb, 0xea, 0x62, 0xfb}}; + Condition const Ed6Cond{Type::ed25519Sha256, + 131072, + Ed6CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto rsa3 = std::make_unique( + makeSlice(rsa3PublicKey), makeSlice(rsa3Sig)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(rsa3)); + std::vector thresh2Subconditions{ + {Preim4Cond, Rsa5Cond, Ed6Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x02\xa9\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x02\x9e" + "\xa1\x82\x02\x9a\x80\x02\x50\x31\x81\x01\x1c\xa2\x82\x02\x8f" + "\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01" + "\x00\xbd\xd1\xc7\xf0\xb0\x3a\xa5\x5b\x3e\x49\x8d\x4e\x00\x54" + "\x89\xb9\x89\xcd\x4b\x43\xde\x59\xf6\x7a\x67\x5c\x3a\xc6\xcf" + "\x82\x3f\x35\x9c\xcc\xda\xcd\xd3\x97\x86\x5b\xe9\xf6\x05\x55" + "\x0b\x26\xef\x1e\x88\xd5\xb6\xba\x14\x0a\xb2\x76\xb9\xb3\x46" + "\x0c\xc0\x80\x17\x13\x68\x23\xdc\xec\x10\x18\xfc\xaa\xbe\xb3" + "\xc4\xc7\xa9\x84\xa6\x4e\x5c\x08\x6b\x7b\x4c\x81\x91\x79\x5d" + "\x90\x06\x15\xbb\x76\x2f\x5c\x53\x60\x0f\xac\xf3\x7c\x49\xc5" + "\x47\xec\xb3\xda\x93\x87\xc1\xb9\xcf\x2c\xb5\xf0\x85\xad\xb4" + "\x38\x67\x88\xda\x3d\xfa\x01\xb7\x54\xd9\x41\x0b\x7b\x8a\x09" + "\xe0\x84\x7d\xbb\x89\xb2\xfc\x0b\x70\x36\x93\x56\x62\xcc\xb4" + "\xfc\xf9\x1f\x37\x92\x9b\x3a\x4e\x7c\xad\x4b\xa6\x76\x6f\xda" + "\xc4\x2f\x83\x53\xbd\x93\xa9\x76\x89\x53\xe1\x4d\xee\x27\x11" + "\x6f\xbc\x21\xad\x42\x9f\x29\xf6\x03\xdd\xec\xfa\xa1\x78\xd2" + "\xde\x29\x2e\xd8\x3a\x7f\xe9\x9b\x5d\xeb\x37\xb8\xb0\xa0\x66" + "\x3f\x02\xcd\x2a\x6e\xd3\x1c\xa5\x65\xdc\x73\xbe\x93\x54\x9a" + "\x2b\xf8\x32\x8b\xe8\xce\x9a\x59\xd0\x05\xeb\xbb\xac\xfc\x4c" + "\x4b\x2e\xac\x2a\xc3\x0f\x0a\xd7\x46\xaf\xfd\x22\x0d\x0d\x54" + "\xcc\x2f\x81\x82\x01\x00\x94\x90\xe3\xb1\xc0\x9c\xf6\xf7\xf3" + "\xeb\xdd\x77\xdc\x11\xb3\xcf\xf9\x02\xac\x26\xcc\xe9\xc3\xc2" + "\x2a\x4d\xa4\xae\x01\x0c\x9f\xc7\x44\xce\x7e\x77\xba\x3b\xf5" + "\xc5\x7a\xf2\x79\xd9\x8c\xa9\xff\xbe\xbe\xd8\x79\x8d\x2b\xd1" + "\x60\x8a\x51\x96\x98\x5d\xcc\x03\x25\xd0\x91\x2b\x88\xd8\xe5" + "\x3c\x9c\x8c\xae\xab\x0e\x2b\x56\x0a\xe5\x89\x11\x53\xe0\x94" + "\x60\x20\x27\xb0\x1b\xd4\x07\xbe\x09\x28\x7c\xad\x3f\x17\x70" + "\xac\x2a\xe6\x7e\xd3\x2c\x34\xb8\xc2\xcd\xad\x92\x01\x09\x04" + "\xbd\x8f\x9d\x24\x32\x04\x54\xaf\x2a\xef\xd0\x36\x91\xce\xd3" + "\xbc\xc9\x60\x9d\xd0\xaf\x79\xe0\xfd\x42\x67\xc4\xcf\x5c\xf0" + "\x69\xd1\xf6\x5c\xd7\x83\x6a\xb2\x6f\xe0\xb9\xc6\x08\x07\x93" + "\xfe\x32\x49\x8c\xdd\xd6\x21\xfc\x95\x0d\x2b\x93\x09\xa7\xa7" + "\x78\x6b\x47\x13\xce\x18\xc1\xaa\x8c\x55\x57\x4a\x94\xae\x5a" + "\xe8\x8f\x7e\x61\x1c\x70\xc8\x6a\x67\x59\x72\x5c\x4d\x42\xc7" + "\x58\x3f\x85\xd1\x06\x3a\x25\xd5\x30\xe2\xf1\xc7\x80\x58\x06" + "\x3b\x0c\x65\x7a\x41\x33\x96\x4e\x81\x0a\x2a\xfa\x20\x29\x98" + "\xfb\xef\x82\x8c\xff\x91\x05\x35\xde\xa7\xb3\x2b\x34\xf0\x6f" + "\x61\xf0\x06\x9c\x0c\x36\x27\xa1\x79\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa3\x27\x80\x20\x99\xfb\x0b\x38\x94\x4d\x20\x85" + "\xc8\xda\x3a\x64\x31\x44\x6f\x6c\x3b\x46\x25\x50\xd7\x7f\xdf" + "\xee\x75\x72\x71\xf9\x61\x40\x63\xfa\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\x00\xd3\xc9\x24\x3f\x2d\x2e\x64\x93\xa8\x49\x29" + "\x82\x75\xea\xbf\xe3\x53\x7f\x8e\x45\x16\xdb\x5e\xc6\xdf\x39" + "\xd2\xcb\xea\x62\xfb\x81\x03\x02\x00\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x21\x8d\xd5\x70\x37\xbc\x0c\xd8\x38\xbc\xe0" + "\xae\x11\x19\xca\xb1\xa6\xf4\x90\x0b\xbe\xd0\xc4\x51\xbb\x9d" + "\x66\xec\x8e\xb5\x04\x2c\x81\x03\x02\x18\x3a\x82\x02\x03\xb8"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x6d\xb6\xcd\x26\xa1\xcd\x09\x4d\xd1\x49\x12\x2f\xdd\x9b\xfe" + "\x07\x39\x5a\xd1\x45\x49\xba\x23\x78\x0c\xb1\x3b\x5d\x7b\xb7" + "\xd8\xf6\x81\x03\x02\x14\x1e\x82\x02\x03\xb8"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix12() + { + testcase("Prefix12"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** Preim9Cond + // **** Rsa10Cond + // **** Ed11Cond + // **** rsa3 + // **** thresh4 + // ***** Preim6Cond + // ***** Rsa7Cond + // ***** Ed8Cond + // ***** rsa5 + + auto const rsa3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa3PublicKey{ + {0xbd, 0xd1, 0xc7, 0xf0, 0xb0, 0x3a, 0xa5, 0x5b, 0x3e, 0x49, 0x8d, + 0x4e, 0x00, 0x54, 0x89, 0xb9, 0x89, 0xcd, 0x4b, 0x43, 0xde, 0x59, + 0xf6, 0x7a, 0x67, 0x5c, 0x3a, 0xc6, 0xcf, 0x82, 0x3f, 0x35, 0x9c, + 0xcc, 0xda, 0xcd, 0xd3, 0x97, 0x86, 0x5b, 0xe9, 0xf6, 0x05, 0x55, + 0x0b, 0x26, 0xef, 0x1e, 0x88, 0xd5, 0xb6, 0xba, 0x14, 0x0a, 0xb2, + 0x76, 0xb9, 0xb3, 0x46, 0x0c, 0xc0, 0x80, 0x17, 0x13, 0x68, 0x23, + 0xdc, 0xec, 0x10, 0x18, 0xfc, 0xaa, 0xbe, 0xb3, 0xc4, 0xc7, 0xa9, + 0x84, 0xa6, 0x4e, 0x5c, 0x08, 0x6b, 0x7b, 0x4c, 0x81, 0x91, 0x79, + 0x5d, 0x90, 0x06, 0x15, 0xbb, 0x76, 0x2f, 0x5c, 0x53, 0x60, 0x0f, + 0xac, 0xf3, 0x7c, 0x49, 0xc5, 0x47, 0xec, 0xb3, 0xda, 0x93, 0x87, + 0xc1, 0xb9, 0xcf, 0x2c, 0xb5, 0xf0, 0x85, 0xad, 0xb4, 0x38, 0x67, + 0x88, 0xda, 0x3d, 0xfa, 0x01, 0xb7, 0x54, 0xd9, 0x41, 0x0b, 0x7b, + 0x8a, 0x09, 0xe0, 0x84, 0x7d, 0xbb, 0x89, 0xb2, 0xfc, 0x0b, 0x70, + 0x36, 0x93, 0x56, 0x62, 0xcc, 0xb4, 0xfc, 0xf9, 0x1f, 0x37, 0x92, + 0x9b, 0x3a, 0x4e, 0x7c, 0xad, 0x4b, 0xa6, 0x76, 0x6f, 0xda, 0xc4, + 0x2f, 0x83, 0x53, 0xbd, 0x93, 0xa9, 0x76, 0x89, 0x53, 0xe1, 0x4d, + 0xee, 0x27, 0x11, 0x6f, 0xbc, 0x21, 0xad, 0x42, 0x9f, 0x29, 0xf6, + 0x03, 0xdd, 0xec, 0xfa, 0xa1, 0x78, 0xd2, 0xde, 0x29, 0x2e, 0xd8, + 0x3a, 0x7f, 0xe9, 0x9b, 0x5d, 0xeb, 0x37, 0xb8, 0xb0, 0xa0, 0x66, + 0x3f, 0x02, 0xcd, 0x2a, 0x6e, 0xd3, 0x1c, 0xa5, 0x65, 0xdc, 0x73, + 0xbe, 0x93, 0x54, 0x9a, 0x2b, 0xf8, 0x32, 0x8b, 0xe8, 0xce, 0x9a, + 0x59, 0xd0, 0x05, 0xeb, 0xbb, 0xac, 0xfc, 0x4c, 0x4b, 0x2e, 0xac, + 0x2a, 0xc3, 0x0f, 0x0a, 0xd7, 0x46, 0xaf, 0xfd, 0x22, 0x0d, 0x0d, + 0x54, 0xcc, 0x2f}}; + std::array const rsa3Sig{ + {0x6b, 0x0a, 0x58, 0xaa, 0x74, 0xbd, 0xd8, 0x27, 0x65, 0x5b, 0x21, + 0x39, 0x60, 0x5a, 0xcb, 0x12, 0x37, 0xae, 0xc8, 0x4e, 0xcd, 0xea, + 0x96, 0x4e, 0x4f, 0x1d, 0x56, 0x10, 0xc1, 0xdc, 0x35, 0xa4, 0xd6, + 0xc2, 0x41, 0x65, 0xec, 0xe5, 0x33, 0xc6, 0xd9, 0x55, 0x1d, 0x49, + 0x0e, 0xae, 0xb6, 0x72, 0x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5, 0xd2, 0x28, + 0xa3, 0x7e, 0x70, 0xd2, 0xec, 0x37, 0xc7, 0xe4, 0xf2, 0x44, 0x60, + 0x5c, 0xd5, 0xe2, 0xc5, 0x18, 0x00, 0x04, 0x6b, 0xb3, 0xec, 0x11, + 0xc3, 0x1e, 0x1c}}; + auto const rsa5Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa5PublicKey{ + {0xc0, 0x00, 0xef, 0x8f, 0x4b, 0x81, 0x10, 0x1e, 0x52, 0xe0, 0x07, + 0x9f, 0x68, 0xe7, 0x2f, 0x92, 0xd4, 0x77, 0x3c, 0x1f, 0xa3, 0xff, + 0x72, 0x64, 0x5b, 0x37, 0xf1, 0xf3, 0xa3, 0xc5, 0xfb, 0xcd, 0xfb, + 0xda, 0xcc, 0x8b, 0x52, 0xe1, 0xde, 0xbc, 0x28, 0x8d, 0xe5, 0xad, + 0xab, 0x86, 0x61, 0x45, 0x97, 0x65, 0x37, 0x68, 0x26, 0x21, 0x92, + 0x17, 0xa3, 0xb0, 0x74, 0x5c, 0x8a, 0x45, 0x8d, 0x87, 0x5b, 0x9b, + 0xd1, 0x7b, 0x07, 0xc4, 0x8c, 0x67, 0xa0, 0xe9, 0x82, 0x0c, 0xe0, + 0x6b, 0xea, 0x91, 0x5c, 0xba, 0xe3, 0xd9, 0x9d, 0x39, 0xfd, 0x77, + 0xac, 0xcb, 0x33, 0x9b, 0x28, 0x51, 0x8d, 0xbf, 0x3e, 0xe4, 0x94, + 0x1c, 0x9a, 0x60, 0x71, 0x4b, 0x34, 0x07, 0x30, 0xda, 0x42, 0x46, + 0x0e, 0xb8, 0xb7, 0x2c, 0xf5, 0x2f, 0x4b, 0x9e, 0xe7, 0x64, 0x81, + 0xa1, 0xa2, 0x05, 0x66, 0x92, 0xe6, 0x75, 0x9f, 0x37, 0xae, 0x40, + 0xa9, 0x16, 0x08, 0x19, 0xe8, 0xdc, 0x47, 0xd6, 0x03, 0x29, 0xab, + 0xcc, 0x58, 0xa2, 0x37, 0x2a, 0x32, 0xb8, 0x15, 0xc7, 0x51, 0x91, + 0x73, 0xb9, 0x1d, 0xc6, 0xd0, 0x4f, 0x85, 0x86, 0xd5, 0xb3, 0x21, + 0x1a, 0x2a, 0x6c, 0xeb, 0x7f, 0xfe, 0x84, 0x17, 0x10, 0x2d, 0x0e, + 0xb4, 0xe1, 0xc2, 0x48, 0x4c, 0x3f, 0x61, 0xc7, 0x59, 0x75, 0xa7, + 0xc1, 0x75, 0xce, 0x67, 0x17, 0x42, 0x2a, 0x2f, 0x96, 0xef, 0x8a, + 0x2d, 0x74, 0xd2, 0x13, 0x68, 0xe1, 0xe9, 0xea, 0xfb, 0x73, 0x68, + 0xed, 0x8d, 0xd3, 0xac, 0x49, 0x09, 0xf9, 0xec, 0x62, 0xdf, 0x53, + 0xab, 0xfe, 0x90, 0x64, 0x4b, 0x92, 0x60, 0x0d, 0xdd, 0x00, 0xfe, + 0x02, 0xe6, 0xf3, 0x9b, 0x2b, 0xac, 0x4f, 0x70, 0xe8, 0x5b, 0x69, + 0x9c, 0x40, 0xd3, 0xeb, 0x37, 0xad, 0x6f, 0x37, 0xab, 0xf3, 0x79, + 0x8e, 0xcb, 0x1d}}; + std::array const rsa5Sig{ + {0x00, 0xc1, 0x8c, 0xd8, 0x71, 0xd5, 0xf4, 0xd9, 0x32, 0xd2, 0xeb, + 0x87, 0x26, 0x58, 0x26, 0x88, 0xf7, 0x44, 0x90, 0x1e, 0x91, 0xa9, + 0x48, 0xb4, 0x1c, 0x78, 0x36, 0x0e, 0x22, 0x8a, 0x9c, 0x91, 0xcf, + 0x7f, 0x7a, 0xfa, 0x60, 0xb5, 0x1d, 0x25, 0x6f, 0x77, 0xfc, 0xa7, + 0x2e, 0x9d, 0xba, 0x2e, 0x72, 0x06, 0xb9, 0x75, 0x00, 0x3c, 0x36, + 0x92, 0xdf, 0x85, 0x9f, 0xc8, 0xec, 0xcc, 0x79, 0xf5, 0xb5, 0xac, + 0xc7, 0x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, 0xe8, 0x6b, 0x2d, 0x56, 0x07, + 0x4c, 0x22, 0x52}}; + auto const thresh4Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim6CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim6Cond{Type::preimageSha256, + 9, + Preim6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa7CondConditionFingerprint = { + {0x6c, 0x7b, 0xea, 0x83, 0xa1, 0xf4, 0x82, 0x3d, 0x36, 0xe7, 0x6e, + 0xae, 0x1a, 0xbc, 0xa0, 0xba, 0x90, 0x3d, 0x96, 0xc1, 0xe6, 0xad, + 0x3a, 0x47, 0xa5, 0xcb, 0x88, 0xab, 0x3c, 0x5f, 0xcc, 0xd5}}; + Condition const Rsa7Cond{Type::rsaSha256, + 65536, + Rsa7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed8CondConditionFingerprint = { + {0xf1, 0x68, 0x96, 0xa6, 0x2e, 0xef, 0x7f, 0x47, 0x06, 0x51, 0x4c, + 0xc6, 0x7e, 0x24, 0xf7, 0x29, 0x84, 0x9c, 0xd6, 0xb0, 0xd9, 0x4b, + 0xd9, 0x0f, 0xc9, 0x34, 0x01, 0x9d, 0x92, 0xeb, 0xbc, 0x0a}}; + Condition const Ed8Cond{Type::ed25519Sha256, + 131072, + Ed8CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto rsa3 = std::make_unique( + makeSlice(rsa3PublicKey), makeSlice(rsa3Sig)); + auto rsa5 = std::make_unique( + makeSlice(rsa5PublicKey), makeSlice(rsa5Sig)); + std::vector> thresh4Subfulfillments; + thresh4Subfulfillments.emplace_back(std::move(rsa5)); + std::vector thresh4Subconditions{ + {Preim6Cond, Rsa7Cond, Ed8Cond}}; + auto thresh4 = std::make_unique( + std::move(thresh4Subfulfillments), std::move(thresh4Subconditions)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(rsa3)); + thresh2Subfulfillments.emplace_back(std::move(thresh4)); + std::vector thresh2Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x05\x38\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x05\x2d" + "\xa1\x82\x05\x29\x80\x02\x50\x31\x81\x01\x1c\xa2\x82\x05\x1e" + "\xa2\x82\x05\x1a\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82\x02" + "\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xc0\x00\xef\x8f\x4b\x81" + "\x10\x1e\x52\xe0\x07\x9f\x68\xe7\x2f\x92\xd4\x77\x3c\x1f\xa3" + "\xff\x72\x64\x5b\x37\xf1\xf3\xa3\xc5\xfb\xcd\xfb\xda\xcc\x8b" + "\x52\xe1\xde\xbc\x28\x8d\xe5\xad\xab\x86\x61\x45\x97\x65\x37" + "\x68\x26\x21\x92\x17\xa3\xb0\x74\x5c\x8a\x45\x8d\x87\x5b\x9b" + "\xd1\x7b\x07\xc4\x8c\x67\xa0\xe9\x82\x0c\xe0\x6b\xea\x91\x5c" + "\xba\xe3\xd9\x9d\x39\xfd\x77\xac\xcb\x33\x9b\x28\x51\x8d\xbf" + "\x3e\xe4\x94\x1c\x9a\x60\x71\x4b\x34\x07\x30\xda\x42\x46\x0e" + "\xb8\xb7\x2c\xf5\x2f\x4b\x9e\xe7\x64\x81\xa1\xa2\x05\x66\x92" + "\xe6\x75\x9f\x37\xae\x40\xa9\x16\x08\x19\xe8\xdc\x47\xd6\x03" + "\x29\xab\xcc\x58\xa2\x37\x2a\x32\xb8\x15\xc7\x51\x91\x73\xb9" + "\x1d\xc6\xd0\x4f\x85\x86\xd5\xb3\x21\x1a\x2a\x6c\xeb\x7f\xfe" + "\x84\x17\x10\x2d\x0e\xb4\xe1\xc2\x48\x4c\x3f\x61\xc7\x59\x75" + "\xa7\xc1\x75\xce\x67\x17\x42\x2a\x2f\x96\xef\x8a\x2d\x74\xd2" + "\x13\x68\xe1\xe9\xea\xfb\x73\x68\xed\x8d\xd3\xac\x49\x09\xf9" + "\xec\x62\xdf\x53\xab\xfe\x90\x64\x4b\x92\x60\x0d\xdd\x00\xfe" + "\x02\xe6\xf3\x9b\x2b\xac\x4f\x70\xe8\x5b\x69\x9c\x40\xd3\xeb" + "\x37\xad\x6f\x37\xab\xf3\x79\x8e\xcb\x1d\x81\x82\x01\x00\x00" + "\xc1\x8c\xd8\x71\xd5\xf4\xd9\x32\xd2\xeb\x87\x26\x58\x26\x88" + "\xf7\x44\x90\x1e\x91\xa9\x48\xb4\x1c\x78\x36\x0e\x22\x8a\x9c" + "\x91\xcf\x7f\x7a\xfa\x60\xb5\x1d\x25\x6f\x77\xfc\xa7\x2e\x9d" + "\xba\x2e\x72\x06\xb9\x75\x00\x3c\x36\x92\xdf\x85\x9f\xc8\xec" + "\xcc\x79\xf5\xb5\xac\xc7\x71\x33\x09\x09\xd2\xf3\x3b\x0d\x4d" + "\x9f\x03\x5b\x91\x9f\x4b\x3f\x06\xf5\x3b\xc9\xbd\x96\x3b\x6c" + "\xb0\x3c\x2c\x48\x12\xd9\x1c\xcf\x04\xcf\x63\x6f\x85\x7b\x20" + "\xd7\x3f\x48\x34\x8e\x4e\x49\xde\x27\xca\xe6\x1f\xe9\x23\xdb" + "\x88\x0b\x8e\xe0\xe8\xda\xe9\xf1\x32\xdc\xab\xc9\xa0\x21\x01" + "\xe3\x6f\xcb\xcd\x06\x02\xb9\x97\xd3\xdd\xc4\x9e\xf8\xc4\xef" + "\x0b\x75\x06\xfb\x2f\xa8\x69\x38\x2d\x90\x50\x82\x35\xbd\x03" + "\xa2\xb9\xd4\xc1\x90\x9e\xeb\xd3\x5b\xf8\x2b\x2e\xcc\xd5\x02" + "\x30\x39\xff\xf0\xb4\x7d\x29\x11\xab\xa7\x42\xfa\x39\x2c\x08" + "\xc9\xcf\x3b\xf8\xbc\x00\x77\xb1\x04\x92\xc3\x6c\xb6\x14\xba" + "\x6d\x28\x66\xde\x70\x5c\xb0\x80\xc6\x4b\xf1\xf7\x1d\x4e\x84" + "\x87\x40\x47\x7f\x3d\x16\x6b\xee\x49\x74\x04\xac\x5d\x03\x9f" + "\x5d\xa0\x1a\x2d\x0e\xee\x1c\xe8\x6b\x2d\x56\x07\x4c\x22\x52" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\x6c\x7b\xea\x83\xa1\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0" + "\xba\x90\x3d\x96\xc1\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f" + "\xcc\xd5\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xf1\x68\x96\xa6" + "\x2e\xef\x7f\x47\x06\x51\x4c\xc6\x7e\x24\xf7\x29\x84\x9c\xd6" + "\xb0\xd9\x4b\xd9\x0f\xc9\x34\x01\x9d\x92\xeb\xbc\x0a\x81\x03" + "\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xbd\xd1\xc7\xf0" + "\xb0\x3a\xa5\x5b\x3e\x49\x8d\x4e\x00\x54\x89\xb9\x89\xcd\x4b" + "\x43\xde\x59\xf6\x7a\x67\x5c\x3a\xc6\xcf\x82\x3f\x35\x9c\xcc" + "\xda\xcd\xd3\x97\x86\x5b\xe9\xf6\x05\x55\x0b\x26\xef\x1e\x88" + "\xd5\xb6\xba\x14\x0a\xb2\x76\xb9\xb3\x46\x0c\xc0\x80\x17\x13" + "\x68\x23\xdc\xec\x10\x18\xfc\xaa\xbe\xb3\xc4\xc7\xa9\x84\xa6" + "\x4e\x5c\x08\x6b\x7b\x4c\x81\x91\x79\x5d\x90\x06\x15\xbb\x76" + "\x2f\x5c\x53\x60\x0f\xac\xf3\x7c\x49\xc5\x47\xec\xb3\xda\x93" + "\x87\xc1\xb9\xcf\x2c\xb5\xf0\x85\xad\xb4\x38\x67\x88\xda\x3d" + "\xfa\x01\xb7\x54\xd9\x41\x0b\x7b\x8a\x09\xe0\x84\x7d\xbb\x89" + "\xb2\xfc\x0b\x70\x36\x93\x56\x62\xcc\xb4\xfc\xf9\x1f\x37\x92" + "\x9b\x3a\x4e\x7c\xad\x4b\xa6\x76\x6f\xda\xc4\x2f\x83\x53\xbd" + "\x93\xa9\x76\x89\x53\xe1\x4d\xee\x27\x11\x6f\xbc\x21\xad\x42" + "\x9f\x29\xf6\x03\xdd\xec\xfa\xa1\x78\xd2\xde\x29\x2e\xd8\x3a" + "\x7f\xe9\x9b\x5d\xeb\x37\xb8\xb0\xa0\x66\x3f\x02\xcd\x2a\x6e" + "\xd3\x1c\xa5\x65\xdc\x73\xbe\x93\x54\x9a\x2b\xf8\x32\x8b\xe8" + "\xce\x9a\x59\xd0\x05\xeb\xbb\xac\xfc\x4c\x4b\x2e\xac\x2a\xc3" + "\x0f\x0a\xd7\x46\xaf\xfd\x22\x0d\x0d\x54\xcc\x2f\x81\x82\x01" + "\x00\x6b\x0a\x58\xaa\x74\xbd\xd8\x27\x65\x5b\x21\x39\x60\x5a" + "\xcb\x12\x37\xae\xc8\x4e\xcd\xea\x96\x4e\x4f\x1d\x56\x10\xc1" + "\xdc\x35\xa4\xd6\xc2\x41\x65\xec\xe5\x33\xc6\xd9\x55\x1d\x49" + "\x0e\xae\xb6\x72\x00\x56\xd1\x13\xdb\xef\x5c\xe7\xc9\xa7\xe9" + "\x62\x37\xea\x0c\x0d\xf3\x6c\x41\x50\xa1\x37\xbc\xb5\xa3\x55" + "\x11\xbd\x94\xb6\x6e\xab\xde\xaf\x47\xfd\x66\x1e\x91\xa5\x21" + "\xd5\xbc\xc5\x8d\x65\x01\x3d\x24\x56\x2a\x4d\xfa\x32\x0d\x3f" + "\x40\xef\x9a\xa0\xf7\xa2\xc6\x19\x89\xd5\x71\x1a\x79\xe4\x8c" + "\x88\xcd\x76\xf0\x33\x0c\x7d\x42\x39\x21\xa2\x3e\xc5\x55\x0b" + "\xde\x51\x23\xbc\x5d\x57\x19\x78\xd0\x6a\x8e\x67\x0a\x57\xad" + "\x86\xf5\xd5\x87\x5d\xf3\x74\x02\x0f\x78\x5c\x6d\x1f\x4a\x6b" + "\x8c\x5c\xe7\xec\xfe\xc1\xbc\xbd\xd1\xcb\xf6\x3b\x12\x34\xe8" + "\x6d\xbb\xe8\x5f\xdd\x37\x96\x3c\x0f\x5c\x5c\x29\x44\x2a\xf9" + "\x96\x63\x03\x93\xbe\x0f\xce\x64\xa1\x8d\xef\x4f\x40\x7c\xe5" + "\xb9\x19\x1f\xfe\x20\x1d\x4c\x3a\xc8\x72\xaa\xeb\x4f\xba\x4a" + "\x68\xc1\x73\x72\xf5\xd2\x28\xa3\x7e\x70\xd2\xec\x37\xc7\xe4" + "\xf2\x44\x60\x5c\xd5\xe2\xc5\x18\x00\x04\x6b\xb3\xec\x11\xc3" + "\x1e\x1c\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27" + "\x80\x20\x3c\x73\x38\xcf\x23\xc6\x31\x53\x28\xc4\x27\xf8\x95" + "\x87\x99\x83\x2d\x35\x3c\x03\x9b\xd1\xff\xff\x2e\x53\x20\xe9" + "\x5e\x62\xb9\xb7\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x41\x80" + "\x08\xb2\x60\x74\x57\x6d\xac\xed\x74\x7f\x54\xdb\x96\x18\x91" + "\x06\x0a\x95\xa1\x49\x17\xc7\x65\xe3\x94\xc8\x5e\x2c\x92\x20" + "\x81\x03\x02\x00\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x5d\xd0\xa2\x70\xb1\x19\x12\x97\x29\xb9\xff" + "\x0b\xfd\xa8\xe4\x8a\x59\x43\x07\x33\x5b\x8d\x04\x04\x7c\x2e" + "\x49\x7d\x9e\xda\xe1\x72\x81\x03\x04\x2c\x3a\x82\x02\x03\xb8"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x06\xdf\x91\x00\x69\x8b\xd4\xab\x4e\xeb\x67\x25\xf2\x2d\xc7" + "\x6b\x48\x24\x90\x5c\x6f\xaf\x09\x47\x1e\x94\xf8\x0d\x93\x3f" + "\xde\xf3\x81\x03\x04\x28\x1e\x82\x02\x03\xb8"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix13() + { + testcase("Prefix13"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** Preim9Cond + // **** Rsa10Cond + // **** Ed11Cond + // **** Thresh12Cond + // **** rsa3 + // **** thresh4 + // ***** Preim6Cond + // ***** Rsa7Cond + // ***** Ed8Cond + // ***** rsa5 + + auto const rsa3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa3PublicKey{ + {0xbd, 0xd1, 0xc7, 0xf0, 0xb0, 0x3a, 0xa5, 0x5b, 0x3e, 0x49, 0x8d, + 0x4e, 0x00, 0x54, 0x89, 0xb9, 0x89, 0xcd, 0x4b, 0x43, 0xde, 0x59, + 0xf6, 0x7a, 0x67, 0x5c, 0x3a, 0xc6, 0xcf, 0x82, 0x3f, 0x35, 0x9c, + 0xcc, 0xda, 0xcd, 0xd3, 0x97, 0x86, 0x5b, 0xe9, 0xf6, 0x05, 0x55, + 0x0b, 0x26, 0xef, 0x1e, 0x88, 0xd5, 0xb6, 0xba, 0x14, 0x0a, 0xb2, + 0x76, 0xb9, 0xb3, 0x46, 0x0c, 0xc0, 0x80, 0x17, 0x13, 0x68, 0x23, + 0xdc, 0xec, 0x10, 0x18, 0xfc, 0xaa, 0xbe, 0xb3, 0xc4, 0xc7, 0xa9, + 0x84, 0xa6, 0x4e, 0x5c, 0x08, 0x6b, 0x7b, 0x4c, 0x81, 0x91, 0x79, + 0x5d, 0x90, 0x06, 0x15, 0xbb, 0x76, 0x2f, 0x5c, 0x53, 0x60, 0x0f, + 0xac, 0xf3, 0x7c, 0x49, 0xc5, 0x47, 0xec, 0xb3, 0xda, 0x93, 0x87, + 0xc1, 0xb9, 0xcf, 0x2c, 0xb5, 0xf0, 0x85, 0xad, 0xb4, 0x38, 0x67, + 0x88, 0xda, 0x3d, 0xfa, 0x01, 0xb7, 0x54, 0xd9, 0x41, 0x0b, 0x7b, + 0x8a, 0x09, 0xe0, 0x84, 0x7d, 0xbb, 0x89, 0xb2, 0xfc, 0x0b, 0x70, + 0x36, 0x93, 0x56, 0x62, 0xcc, 0xb4, 0xfc, 0xf9, 0x1f, 0x37, 0x92, + 0x9b, 0x3a, 0x4e, 0x7c, 0xad, 0x4b, 0xa6, 0x76, 0x6f, 0xda, 0xc4, + 0x2f, 0x83, 0x53, 0xbd, 0x93, 0xa9, 0x76, 0x89, 0x53, 0xe1, 0x4d, + 0xee, 0x27, 0x11, 0x6f, 0xbc, 0x21, 0xad, 0x42, 0x9f, 0x29, 0xf6, + 0x03, 0xdd, 0xec, 0xfa, 0xa1, 0x78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xaa, 0x45, 0xa4, 0x2a, 0x5d, 0x96, 0x3d, 0x5a, 0xb6, + 0xa5, 0x26, 0x76, 0xa8, 0x39, 0x78, 0xd4, 0x88, 0xa4, 0xfd, 0x5c, + 0x94, 0x1e, 0xce, 0xb0, 0xd7, 0x87, 0x4c, 0x83, 0xae, 0xac, 0xfa, + 0x4e, 0x1d, 0xf2, 0xfa, 0xfb, 0x86, 0x9d, 0x2c, 0x26, 0x76, 0x0c, + 0xfb, 0xbd, 0x30, 0xe8, 0x56, 0x7c, 0x23, 0xda, 0x01, 0x02, 0xcd, + 0x1e, 0xea, 0x9c, 0x04, 0xbf, 0xfe, 0x9f, 0xa9, 0x1d, 0x49, 0xcd, + 0x6e, 0x21, 0x58, 0x3b, 0xed, 0xac, 0xc4, 0xaa, 0xb4, 0x15, 0x11, + 0xe5, 0xdb, 0x31, 0x52, 0xbf, 0xfc, 0x76, 0xa5, 0xff, 0xf2, 0xda, + 0x77, 0x1f, 0xa0, 0xc5, 0x49, 0xeb, 0x04, 0x5c, 0x9f, 0xad, 0xcb, + 0x75, 0xfb, 0xcd, 0x0d, 0x03, 0x5c, 0x38, 0x90, 0x57, 0x47, 0xd8, + 0x42, 0xbe, 0xb3, 0x3e, 0xa1, 0xaf, 0xe9, 0x37, 0x27, 0x01, 0x52, + 0x68, 0xab, 0xe9, 0x9e, 0x12, 0x5e, 0x9d, 0xe2, 0x22, 0xde, 0xe4, + 0x85, 0x95, 0x60, 0x74, 0x02, 0xbc, 0x91, 0xf1, 0x5c, 0xf8, 0xb8, + 0x26, 0x53, 0x7f}}; + auto const rsa5Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa5PublicKey{ + {0xc0, 0x00, 0xef, 0x8f, 0x4b, 0x81, 0x10, 0x1e, 0x52, 0xe0, 0x07, + 0x9f, 0x68, 0xe7, 0x2f, 0x92, 0xd4, 0x77, 0x3c, 0x1f, 0xa3, 0xff, + 0x72, 0x64, 0x5b, 0x37, 0xf1, 0xf3, 0xa3, 0xc5, 0xfb, 0xcd, 0xfb, + 0xda, 0xcc, 0x8b, 0x52, 0xe1, 0xde, 0xbc, 0x28, 0x8d, 0xe5, 0xad, + 0xab, 0x86, 0x61, 0x45, 0x97, 0x65, 0x37, 0x68, 0x26, 0x21, 0x92, + 0x17, 0xa3, 0xb0, 0x74, 0x5c, 0x8a, 0x45, 0x8d, 0x87, 0x5b, 0x9b, + 0xd1, 0x7b, 0x07, 0xc4, 0x8c, 0x67, 0xa0, 0xe9, 0x82, 0x0c, 0xe0, + 0x6b, 0xea, 0x91, 0x5c, 0xba, 0xe3, 0xd9, 0x9d, 0x39, 0xfd, 0x77, + 0xac, 0xcb, 0x33, 0x9b, 0x28, 0x51, 0x8d, 0xbf, 0x3e, 0xe4, 0x94, + 0x1c, 0x9a, 0x60, 0x71, 0x4b, 0x34, 0x07, 0x30, 0xda, 0x42, 0x46, + 0x0e, 0xb8, 0xb7, 0x2c, 0xf5, 0x2f, 0x4b, 0x9e, 0xe7, 0x64, 0x81, + 0xa1, 0xa2, 0x05, 0x66, 0x92, 0xe6, 0x75, 0x9f, 0x37, 0xae, 0x40, + 0xa9, 0x16, 0x08, 0x19, 0xe8, 0xdc, 0x47, 0xd6, 0x03, 0x29, 0xab, + 0xcc, 0x58, 0xa2, 0x37, 0x2a, 0x32, 0xb8, 0x15, 0xc7, 0x51, 0x91, + 0x73, 0xb9, 0x1d, 0xc6, 0xd0, 0x4f, 0x85, 0x86, 0xd5, 0xb3, 0x21, + 0x1a, 0x2a, 0x6c, 0xeb, 0x7f, 0xfe, 0x84, 0x17, 0x10, 0x2d, 0x0e, + 0xb4, 0xe1, 0xc2, 0x48, 0x4c, 0x3f, 0x61, 0xc7, 0x59, 0x75, 0xa7, + 0xc1, 0x75, 0xce, 0x67, 0x17, 0x42, 0x2a, 0x2f, 0x96, 0xef, 0x8a, + 0x2d, 0x74, 0xd2, 0x13, 0x68, 0xe1, 0xe9, 0xea, 0xfb, 0x73, 0x68, + 0xed, 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0xa2, + 0x28, 0xaa, 0xd5, 0x7f, 0xaa, 0xd6, 0xfe, 0xf4, 0xeb, 0x0a, 0x04, + 0x9c, 0x96, 0x7f, 0xa9, 0x76, 0x65, 0xf2, 0x74, 0x17, 0xc6, 0x9d, + 0x52, 0x09, 0x05, 0xca, 0x51, 0x54, 0x2a, 0x52, 0xdc, 0x41, 0x33, + 0xd0, 0x5c, 0x50, 0x8e, 0xf1, 0x7d, 0x1d, 0xb2, 0xb0, 0x07, 0x20, + 0xe1, 0x69, 0x7b, 0x7d, 0x97, 0xe8, 0x06, 0x00, 0xde, 0x42, 0x36, + 0xbc, 0x19, 0x43, 0xa6, 0xc8, 0x7b, 0x53, 0x00, 0xe8, 0xd8, 0x76, + 0x97, 0x53, 0x79, 0x84, 0xd4, 0xcc, 0xeb, 0x20, 0x9c, 0x94, 0x97, + 0xd5, 0x7d, 0x72, 0x02, 0x90, 0x7d, 0xb4, 0x49, 0xda, 0x06, 0xa8, + 0xf2, 0x09, 0x35, 0xea, 0x6d, 0xf7, 0x6f, 0xbb, 0x24, 0xb1, 0x1d, + 0x3f, 0xfc, 0x87, 0x97, 0x09, 0x3c, 0xd2, 0xc6, 0xe3, 0xf7, 0x88, + 0x44, 0x20, 0x04, 0xa7, 0x1f, 0xb1, 0xf5, 0x07, 0xdf, 0x5f, 0x26, + 0xdd, 0xcc, 0x91}}; + auto const thresh4Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim6CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim6Cond{Type::preimageSha256, + 9, + Preim6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa7CondConditionFingerprint = { + {0x6c, 0x7b, 0xea, 0x83, 0xa1, 0xf4, 0x82, 0x3d, 0x36, 0xe7, 0x6e, + 0xae, 0x1a, 0xbc, 0xa0, 0xba, 0x90, 0x3d, 0x96, 0xc1, 0xe6, 0xad, + 0x3a, 0x47, 0xa5, 0xcb, 0x88, 0xab, 0x3c, 0x5f, 0xcc, 0xd5}}; + Condition const Rsa7Cond{Type::rsaSha256, + 65536, + Rsa7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed8CondConditionFingerprint = { + {0xf1, 0x68, 0x96, 0xa6, 0x2e, 0xef, 0x7f, 0x47, 0x06, 0x51, 0x4c, + 0xc6, 0x7e, 0x24, 0xf7, 0x29, 0x84, 0x9c, 0xd6, 0xb0, 0xd9, 0x4b, + 0xd9, 0x0f, 0xc9, 0x34, 0x01, 0x9d, 0x92, 0xeb, 0xbc, 0x0a}}; + Condition const Ed8Cond{Type::ed25519Sha256, + 131072, + Ed8CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh12CondConditionFingerprint = { + {0x03, 0xb7, 0x57, 0xb9, 0x56, 0x68, 0xc6, 0x36, 0x20, 0x05, 0x2b, + 0xd6, 0x6f, 0x92, 0x23, 0x03, 0x30, 0xa8, 0x6f, 0x6e, 0xd9, 0x64, + 0x9c, 0xd0, 0xc2, 0x02, 0x89, 0xc3, 0xcf, 0xe9, 0xce, 0x85}}; + Condition const Thresh12Cond{Type::thresholdSha256, + 135168, + Thresh12CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto rsa3 = std::make_unique( + makeSlice(rsa3PublicKey), makeSlice(rsa3Sig)); + auto rsa5 = std::make_unique( + makeSlice(rsa5PublicKey), makeSlice(rsa5Sig)); + std::vector> thresh4Subfulfillments; + thresh4Subfulfillments.emplace_back(std::move(rsa5)); + std::vector thresh4Subconditions{ + {Preim6Cond, Rsa7Cond, Ed8Cond}}; + auto thresh4 = std::make_unique( + std::move(thresh4Subfulfillments), std::move(thresh4Subconditions)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(rsa3)); + thresh2Subfulfillments.emplace_back(std::move(thresh4)); + std::vector thresh2Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond, Thresh12Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x05\x66\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x05\x5b" + "\xa1\x82\x05\x57\x80\x02\x50\x31\x81\x01\x1c\xa2\x82\x05\x4c" + "\xa2\x82\x05\x48\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82\x02" + "\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xc0\x00\xef\x8f\x4b\x81" + "\x10\x1e\x52\xe0\x07\x9f\x68\xe7\x2f\x92\xd4\x77\x3c\x1f\xa3" + "\xff\x72\x64\x5b\x37\xf1\xf3\xa3\xc5\xfb\xcd\xfb\xda\xcc\x8b" + "\x52\xe1\xde\xbc\x28\x8d\xe5\xad\xab\x86\x61\x45\x97\x65\x37" + "\x68\x26\x21\x92\x17\xa3\xb0\x74\x5c\x8a\x45\x8d\x87\x5b\x9b" + "\xd1\x7b\x07\xc4\x8c\x67\xa0\xe9\x82\x0c\xe0\x6b\xea\x91\x5c" + "\xba\xe3\xd9\x9d\x39\xfd\x77\xac\xcb\x33\x9b\x28\x51\x8d\xbf" + "\x3e\xe4\x94\x1c\x9a\x60\x71\x4b\x34\x07\x30\xda\x42\x46\x0e" + "\xb8\xb7\x2c\xf5\x2f\x4b\x9e\xe7\x64\x81\xa1\xa2\x05\x66\x92" + "\xe6\x75\x9f\x37\xae\x40\xa9\x16\x08\x19\xe8\xdc\x47\xd6\x03" + "\x29\xab\xcc\x58\xa2\x37\x2a\x32\xb8\x15\xc7\x51\x91\x73\xb9" + "\x1d\xc6\xd0\x4f\x85\x86\xd5\xb3\x21\x1a\x2a\x6c\xeb\x7f\xfe" + "\x84\x17\x10\x2d\x0e\xb4\xe1\xc2\x48\x4c\x3f\x61\xc7\x59\x75" + "\xa7\xc1\x75\xce\x67\x17\x42\x2a\x2f\x96\xef\x8a\x2d\x74\xd2" + "\x13\x68\xe1\xe9\xea\xfb\x73\x68\xed\x8d\xd3\xac\x49\x09\xf9" + "\xec\x62\xdf\x53\xab\xfe\x90\x64\x4b\x92\x60\x0d\xdd\x00\xfe" + "\x02\xe6\xf3\x9b\x2b\xac\x4f\x70\xe8\x5b\x69\x9c\x40\xd3\xeb" + "\x37\xad\x6f\x37\xab\xf3\x79\x8e\xcb\x1d\x81\x82\x01\x00\x8e" + "\x9d\x0d\x51\xd2\xad\x9f\x98\xb7\x8b\x84\x54\x18\xb9\xc1\x8e" + "\x6d\xfe\xdf\x1e\x90\x0c\x68\x6c\xa4\x21\x57\x97\x39\xd7\x12" + "\x24\x31\x08\x3a\xc6\xc3\x05\xb2\x8d\x0b\xf2\x80\x3c\x25\x42" + "\xe4\x8e\x02\xfa\x01\xfe\x08\x6f\xe3\x37\xb4\x29\x9f\x97\xbf" + "\x5f\xbd\xe3\xa8\x44\xa7\x9d\x60\x31\xdd\x46\x6a\xa7\xfd\xbf" + "\xb5\xaa\xa4\x5d\x71\x6f\xf2\xe3\x15\xc2\xb5\x39\x5d\x7c\xb9" + "\xb5\x39\xc4\xcb\x1f\xe4\xee\x0f\x1f\xc6\x5a\xb5\x29\x1c\xe7" + "\xa7\x53\x5d\xa4\x3f\x89\x35\x4b\x33\x66\xe5\xb8\x78\x64\x74" + "\xab\x3f\x7c\x88\xe8\x3e\x4a\xda\xf0\x52\xa2\x28\xaa\xd5\x7f" + "\xaa\xd6\xfe\xf4\xeb\x0a\x04\x9c\x96\x7f\xa9\x76\x65\xf2\x74" + "\x17\xc6\x9d\x52\x09\x05\xca\x51\x54\x2a\x52\xdc\x41\x33\xd0" + "\x5c\x50\x8e\xf1\x7d\x1d\xb2\xb0\x07\x20\xe1\x69\x7b\x7d\x97" + "\xe8\x06\x00\xde\x42\x36\xbc\x19\x43\xa6\xc8\x7b\x53\x00\xe8" + "\xd8\x76\x97\x53\x79\x84\xd4\xcc\xeb\x20\x9c\x94\x97\xd5\x7d" + "\x72\x02\x90\x7d\xb4\x49\xda\x06\xa8\xf2\x09\x35\xea\x6d\xf7" + "\x6f\xbb\x24\xb1\x1d\x3f\xfc\x87\x97\x09\x3c\xd2\xc6\xe3\xf7" + "\x88\x44\x20\x04\xa7\x1f\xb1\xf5\x07\xdf\x5f\x26\xdd\xcc\x91" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\x6c\x7b\xea\x83\xa1\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0" + "\xba\x90\x3d\x96\xc1\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f" + "\xcc\xd5\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xf1\x68\x96\xa6" + "\x2e\xef\x7f\x47\x06\x51\x4c\xc6\x7e\x24\xf7\x29\x84\x9c\xd6" + "\xb0\xd9\x4b\xd9\x0f\xc9\x34\x01\x9d\x92\xeb\xbc\x0a\x81\x03" + "\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xbd\xd1\xc7\xf0" + "\xb0\x3a\xa5\x5b\x3e\x49\x8d\x4e\x00\x54\x89\xb9\x89\xcd\x4b" + "\x43\xde\x59\xf6\x7a\x67\x5c\x3a\xc6\xcf\x82\x3f\x35\x9c\xcc" + "\xda\xcd\xd3\x97\x86\x5b\xe9\xf6\x05\x55\x0b\x26\xef\x1e\x88" + "\xd5\xb6\xba\x14\x0a\xb2\x76\xb9\xb3\x46\x0c\xc0\x80\x17\x13" + "\x68\x23\xdc\xec\x10\x18\xfc\xaa\xbe\xb3\xc4\xc7\xa9\x84\xa6" + "\x4e\x5c\x08\x6b\x7b\x4c\x81\x91\x79\x5d\x90\x06\x15\xbb\x76" + "\x2f\x5c\x53\x60\x0f\xac\xf3\x7c\x49\xc5\x47\xec\xb3\xda\x93" + "\x87\xc1\xb9\xcf\x2c\xb5\xf0\x85\xad\xb4\x38\x67\x88\xda\x3d" + "\xfa\x01\xb7\x54\xd9\x41\x0b\x7b\x8a\x09\xe0\x84\x7d\xbb\x89" + "\xb2\xfc\x0b\x70\x36\x93\x56\x62\xcc\xb4\xfc\xf9\x1f\x37\x92" + "\x9b\x3a\x4e\x7c\xad\x4b\xa6\x76\x6f\xda\xc4\x2f\x83\x53\xbd" + "\x93\xa9\x76\x89\x53\xe1\x4d\xee\x27\x11\x6f\xbc\x21\xad\x42" + "\x9f\x29\xf6\x03\xdd\xec\xfa\xa1\x78\xd2\xde\x29\x2e\xd8\x3a" + "\x7f\xe9\x9b\x5d\xeb\x37\xb8\xb0\xa0\x66\x3f\x02\xcd\x2a\x6e" + "\xd3\x1c\xa5\x65\xdc\x73\xbe\x93\x54\x9a\x2b\xf8\x32\x8b\xe8" + "\xce\x9a\x59\xd0\x05\xeb\xbb\xac\xfc\x4c\x4b\x2e\xac\x2a\xc3" + "\x0f\x0a\xd7\x46\xaf\xfd\x22\x0d\x0d\x54\xcc\x2f\x81\x82\x01" + "\x00\x14\x77\x7a\x2e\x34\xc6\x4c\x31\x8f\x2a\x11\x56\x3a\x63" + "\x62\xb1\x99\x5b\x7e\x63\x2b\xe3\x1f\x36\xdf\x96\xe6\xfc\xb8" + "\x5f\xf4\xaa\xa8\xa3\xf7\x4f\x71\xd6\x59\x76\x0c\x05\xa3\x9b" + "\xdb\x40\x80\x28\x68\xe1\x74\x8c\x29\x67\x20\x96\x4f\x1a\xfd" + "\x1e\x0a\x55\x4a\x2f\x49\x43\x66\x53\x2a\xa2\xd1\x08\xcf\xe3" + "\x52\xce\xd8\x96\x32\x05\x6c\xb8\x90\x2b\x5e\x18\x62\x6c\xe1" + "\xd9\x35\xa4\x7d\x0d\x01\x31\x8b\xfa\x98\xe0\xa2\xb3\x2a\x6e" + "\xc5\x4c\xe2\x9f\x37\xb7\x4f\xd1\xaa\x45\xa4\x2a\x5d\x96\x3d" + "\x5a\xb6\xa5\x26\x76\xa8\x39\x78\xd4\x88\xa4\xfd\x5c\x94\x1e" + "\xce\xb0\xd7\x87\x4c\x83\xae\xac\xfa\x4e\x1d\xf2\xfa\xfb\x86" + "\x9d\x2c\x26\x76\x0c\xfb\xbd\x30\xe8\x56\x7c\x23\xda\x01\x02" + "\xcd\x1e\xea\x9c\x04\xbf\xfe\x9f\xa9\x1d\x49\xcd\x6e\x21\x58" + "\x3b\xed\xac\xc4\xaa\xb4\x15\x11\xe5\xdb\x31\x52\xbf\xfc\x76" + "\xa5\xff\xf2\xda\x77\x1f\xa0\xc5\x49\xeb\x04\x5c\x9f\xad\xcb" + "\x75\xfb\xcd\x0d\x03\x5c\x38\x90\x57\x47\xd8\x42\xbe\xb3\x3e" + "\xa1\xaf\xe9\x37\x27\x01\x52\x68\xab\xe9\x9e\x12\x5e\x9d\xe2" + "\x22\xde\xe4\x85\x95\x60\x74\x02\xbc\x91\xf1\x5c\xf8\xb8\x26" + "\x53\x7f\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2" + "\x2b\x80\x20\x03\xb7\x57\xb9\x56\x68\xc6\x36\x20\x05\x2b\xd6" + "\x6f\x92\x23\x03\x30\xa8\x6f\x6e\xd9\x64\x9c\xd0\xc2\x02\x89" + "\xc3\xcf\xe9\xce\x85\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x3c\x73\x38\xcf\x23\xc6\x31\x53\x28\xc4\x27\xf8" + "\x95\x87\x99\x83\x2d\x35\x3c\x03\x9b\xd1\xff\xff\x2e\x53\x20" + "\xe9\x5e\x62\xb9\xb7\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x41" + "\x80\x08\xb2\x60\x74\x57\x6d\xac\xed\x74\x7f\x54\xdb\x96\x18" + "\x91\x06\x0a\x95\xa1\x49\x17\xc7\x65\xe3\x94\xc8\x5e\x2c\x92" + "\x20\x81\x03\x02\x00\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\xa8\x19\x40\x38\x3a\xfc\x00\x41\xbb\x50\xc0" + "\x30\x63\x87\x66\x78\x36\x31\x44\xe6\xa6\xc7\xab\x97\xbf\xad" + "\x0c\x76\x8f\xbc\xdd\x29\x81\x03\x04\x40\x3a\x82\x02\x03\xb8"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x4d\xe1\xc9\xcf\x63\xf6\x4a\xb7\x4d\x5e\x2a\x54\xfb\xdd\x21" + "\x35\xfd\xb2\x2d\x3e\x74\x5b\xc5\x8d\x01\xd6\x47\x71\x13\xac" + "\x66\xbc\x81\x03\x04\x3c\x1e\x82\x02\x03\xb8"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix14() + { + testcase("Prefix14"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** ed1 + + auto const ed1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + std::array const ed1PublicKey{ + {0x63, 0x99, 0x70, 0x0c, 0xa9, 0x50, 0x9c, 0xd4, 0xf5, 0x06, 0xdd, + 0x19, 0xc8, 0xa1, 0xd2, 0x9e, 0x03, 0x10, 0xb9, 0x89, 0x2e, 0x02, + 0x34, 0x62, 0x2d, 0x23, 0xca, 0xa1, 0x1d, 0xde, 0x23, 0x6a}}; + std::array const ed1Sig{ + {0x6c, 0x25, 0xd0, 0x01, 0x10, 0x29, 0x70, 0x01, 0x05, 0xc0, 0xfb, + 0x51, 0xd8, 0x59, 0x5b, 0x7b, 0x83, 0x32, 0xd6, 0x18, 0x63, 0x35, + 0x07, 0xcf, 0xdf, 0x63, 0x90, 0x39, 0xd1, 0x24, 0x42, 0x8a, 0xc0, + 0xd1, 0xac, 0xd3, 0x55, 0xf6, 0x5c, 0x96, 0xda, 0x7b, 0x2e, 0xaa, + 0xfc, 0x72, 0x1b, 0x1e, 0x2e, 0xb2, 0x97, 0xad, 0x8d, 0x04, 0x32, + 0xd9, 0x9c, 0xb7, 0xf4, 0x32, 0x38, 0x4e, 0xd7, 0x0c}}; + std::array const ed1SigningKey{ + {0xe9, 0x20, 0xaa, 0x41, 0x73, 0x35, 0x2f, 0xae, 0xa2, 0x4b, 0x4b, + 0x19, 0x64, 0xda, 0xc0, 0xd5, 0x7b, 0xfd, 0x99, 0x06, 0x90, 0x80, + 0x48, 0xe4, 0x6a, 0xc4, 0x86, 0x30, 0x7d, 0x53, 0x37, 0xb9}}; + (void)ed1SigningKey; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto ed1 = std::make_unique(ed1PublicKey, ed1Sig); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(ed1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x6f\x80\x02\x50\x30\x81\x01\x1a\xa2\x66\xa4\x64\x80\x20" + "\x63\x99\x70\x0c\xa9\x50\x9c\xd4\xf5\x06\xdd\x19\xc8\xa1\xd2" + "\x9e\x03\x10\xb9\x89\x2e\x02\x34\x62\x2d\x23\xca\xa1\x1d\xde" + "\x23\x6a\x81\x40\x6c\x25\xd0\x01\x10\x29\x70\x01\x05\xc0\xfb" + "\x51\xd8\x59\x5b\x7b\x83\x32\xd6\x18\x63\x35\x07\xcf\xdf\x63" + "\x90\x39\xd1\x24\x42\x8a\xc0\xd1\xac\xd3\x55\xf6\x5c\x96\xda" + "\x7b\x2e\xaa\xfc\x72\x1b\x1e\x2e\xb2\x97\xad\x8d\x04\x32\xd9" + "\x9c\xb7\xf4\x32\x38\x4e\xd7\x0c"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x83\xa7\x40\x23\xe2\xa9\xfa\x80\x9a\x63\xb4" + "\xf8\xa2\x05\x92\xb9\xf6\xdf\xff\xff\x24\xca\x3c\x8e\x3c\x09" + "\xcd\xf9\x24\xbc\xe2\x13\x81\x03\x02\x04\x1c\x82\x02\x03\x08"s; + auto const prefix0EncodedFingerprint = + "\x30\x32\x80\x02\x50\x30\x81\x01\x1a\xa2\x29\xa4\x27\x80\x20" + "\x42\x58\xea\xf4\xb3\xac\xde\x0b\xd9\x1e\x0c\x53\xe5\xae\x63" + "\x84\xee\xc0\xf5\xcf\x88\xa7\x43\x7b\x05\x47\x87\xee\x73\x3e" + "\xa3\x83\x81\x03\x02\x00\x00"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix15() + { + testcase("Prefix15"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** ed2 + + auto const ed2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const ed2PublicKey{ + {0xb1, 0x2f, 0x54, 0xbe, 0xb6, 0xf8, 0x76, 0x71, 0x72, 0xed, 0x44, + 0x03, 0x71, 0x74, 0x2d, 0x7f, 0x98, 0x10, 0x4b, 0x57, 0xf2, 0x45, + 0xfb, 0x3e, 0xea, 0xfd, 0xdd, 0x39, 0x42, 0xbf, 0x24, 0x4d}}; + std::array const ed2Sig{ + {0xbd, 0xa7, 0x4d, 0x84, 0x5f, 0xfd, 0x7c, 0x9b, 0xd0, 0xef, 0x41, + 0x2c, 0x54, 0x50, 0xd8, 0x26, 0xf0, 0x06, 0x61, 0x22, 0x5c, 0x90, + 0xc2, 0x72, 0x5e, 0x7a, 0x3b, 0x6f, 0xba, 0xa7, 0x22, 0x04, 0xa6, + 0x6c, 0x67, 0xbb, 0x58, 0x28, 0xf7, 0xd8, 0x0c, 0x8e, 0xd3, 0x62, + 0x66, 0x66, 0x2c, 0xe9, 0x71, 0xd0, 0x38, 0xab, 0x33, 0xfa, 0x10, + 0x10, 0x53, 0x4f, 0xf2, 0xf1, 0x97, 0x0d, 0xbd, 0x06}}; + std::array const ed2SigningKey{ + {0xa7, 0xeb, 0x15, 0xc5, 0x2a, 0x41, 0x59, 0xf9, 0xf7, 0xb4, 0x78, + 0x5f, 0xdb, 0x79, 0xe5, 0x5b, 0x16, 0x44, 0xf7, 0xc7, 0xcf, 0xe2, + 0x46, 0xc5, 0xb3, 0x54, 0x64, 0xb5, 0x2f, 0x6c, 0x8e, 0x8e}}; + (void)ed2SigningKey; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(ed2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x7a\x80\x02\x50\x30\x81\x01\x1a\xa2\x71\xa1\x6f\x80\x02" + "\x50\x31\x81\x01\x1c\xa2\x66\xa4\x64\x80\x20\xb1\x2f\x54\xbe" + "\xb6\xf8\x76\x71\x72\xed\x44\x03\x71\x74\x2d\x7f\x98\x10\x4b" + "\x57\xf2\x45\xfb\x3e\xea\xfd\xdd\x39\x42\xbf\x24\x4d\x81\x40" + "\xbd\xa7\x4d\x84\x5f\xfd\x7c\x9b\xd0\xef\x41\x2c\x54\x50\xd8" + "\x26\xf0\x06\x61\x22\x5c\x90\xc2\x72\x5e\x7a\x3b\x6f\xba\xa7" + "\x22\x04\xa6\x6c\x67\xbb\x58\x28\xf7\xd8\x0c\x8e\xd3\x62\x66" + "\x66\x2c\xe9\x71\xd0\x38\xab\x33\xfa\x10\x10\x53\x4f\xf2\xf1" + "\x97\x0d\xbd\x06"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x51\x26\xdf\x1b\xd5\x14\xf3\xb8\x50\x22\x02" + "\x97\xda\x45\x7d\x91\x9e\xeb\x48\xc6\x35\xf3\xff\x52\xbf\xed" + "\x07\x76\x72\xa8\xcf\xd3\x81\x03\x02\x08\x3a\x82\x02\x03\x08"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x67\x52\xef\xad\xb9\x51\x22\x0f\x21\xb3\xac\x10\xa8\x51\xfc" + "\xfe\x2f\x60\xe9\xf7\x80\x15\xad\x24\x7f\x8b\x4f\x49\xb8\xb3" + "\x22\xaa\x81\x03\x02\x04\x1e\x82\x02\x03\x08"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix16() + { + testcase("Prefix16"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** prefix2 + // **** ed3 + + auto const ed3Msg = "P2P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const ed3PublicKey{ + {0x42, 0x0a, 0x60, 0x63, 0x9e, 0xca, 0xaa, 0x48, 0xac, 0xcb, 0x2c, + 0xd9, 0x46, 0x79, 0x69, 0x34, 0x35, 0xf3, 0x8e, 0x29, 0xd5, 0x4b, + 0x24, 0x57, 0x9d, 0xd7, 0x3b, 0x04, 0x5d, 0x9c, 0x2f, 0x32}}; + std::array const ed3Sig{ + {0x33, 0x01, 0x0b, 0xe8, 0x91, 0xa9, 0xa0, 0x9b, 0x54, 0x9a, 0xfc, + 0xde, 0xcd, 0xac, 0x70, 0x42, 0xeb, 0x1e, 0x41, 0x7f, 0xb8, 0xe0, + 0x62, 0x39, 0x8d, 0x55, 0xa8, 0xe8, 0xc5, 0xba, 0x2b, 0xfd, 0xf6, + 0xfb, 0xc9, 0x96, 0x83, 0x17, 0x54, 0x06, 0xa9, 0xb3, 0xa9, 0x64, + 0xe8, 0xd3, 0xa7, 0x92, 0xde, 0xb2, 0x4d, 0x85, 0x49, 0x2c, 0x2a, + 0xeb, 0x48, 0x1f, 0x7a, 0x33, 0x60, 0x83, 0x56, 0x0f}}; + std::array const ed3SigningKey{ + {0x1b, 0x90, 0xf2, 0x2c, 0xd5, 0x5d, 0xcd, 0xe5, 0x2d, 0x71, 0x84, + 0x66, 0x10, 0xf0, 0xf1, 0x91, 0xfe, 0xb5, 0xbe, 0x94, 0x85, 0xc1, + 0xc8, 0xf3, 0x61, 0x91, 0xc3, 0xa4, 0x41, 0x58, 0xcd, 0xfc}}; + (void)ed3SigningKey; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 30; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(ed3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x81\x85\x80\x02\x50\x30\x81\x01\x1a\xa2\x7c\xa1\x7a\x80" + "\x02\x50\x31\x81\x01\x1c\xa2\x71\xa1\x6f\x80\x02\x50\x32\x81" + "\x01\x1e\xa2\x66\xa4\x64\x80\x20\x42\x0a\x60\x63\x9e\xca\xaa" + "\x48\xac\xcb\x2c\xd9\x46\x79\x69\x34\x35\xf3\x8e\x29\xd5\x4b" + "\x24\x57\x9d\xd7\x3b\x04\x5d\x9c\x2f\x32\x81\x40\x33\x01\x0b" + "\xe8\x91\xa9\xa0\x9b\x54\x9a\xfc\xde\xcd\xac\x70\x42\xeb\x1e" + "\x41\x7f\xb8\xe0\x62\x39\x8d\x55\xa8\xe8\xc5\xba\x2b\xfd\xf6" + "\xfb\xc9\x96\x83\x17\x54\x06\xa9\xb3\xa9\x64\xe8\xd3\xa7\x92" + "\xde\xb2\x4d\x85\x49\x2c\x2a\xeb\x48\x1f\x7a\x33\x60\x83\x56" + "\x0f"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x35\x20\xd9\xcf\xd3\x4d\x95\xe3\xa9\xd6\x60" + "\x72\x8c\xa7\xa5\xa9\x78\xea\x69\x7d\x5b\xa6\xf7\x02\x6f\x51" + "\xd1\x27\xc8\xcc\x86\x55\x81\x03\x02\x0c\x5a\x82\x02\x03\x08"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\xae\x13\x99\x34\x3d\x07\xe4\xb4\x04\xfd\x8b\x6f\x5f\x3b\xcc" + "\xbe\x88\x2c\x68\xb0\xdc\x7c\x0c\xa2\x78\x99\xd1\x46\x2e\x9f" + "\x3e\x7e\x81\x03\x02\x08\x3e\x82\x02\x03\x08"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix17() + { + testcase("Prefix17"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** ed3 + + auto const ed3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const ed3PublicKey{ + {0x42, 0x0a, 0x60, 0x63, 0x9e, 0xca, 0xaa, 0x48, 0xac, 0xcb, 0x2c, + 0xd9, 0x46, 0x79, 0x69, 0x34, 0x35, 0xf3, 0x8e, 0x29, 0xd5, 0x4b, + 0x24, 0x57, 0x9d, 0xd7, 0x3b, 0x04, 0x5d, 0x9c, 0x2f, 0x32}}; + std::array const ed3Sig{ + {0x8e, 0xa4, 0xd9, 0x6a, 0x9b, 0x3e, 0x19, 0xe8, 0x89, 0xa4, 0x4e, + 0xf2, 0xa8, 0x1c, 0xc2, 0xbd, 0xd3, 0xe0, 0x6f, 0xe0, 0xd1, 0x6b, + 0x85, 0x47, 0x9a, 0x58, 0x2e, 0x9f, 0x38, 0x09, 0x1f, 0x6d, 0x02, + 0x9a, 0xf6, 0x9c, 0x60, 0x3f, 0x16, 0x6c, 0xa5, 0x0e, 0xfb, 0xa3, + 0x08, 0xd6, 0xb6, 0x97, 0x5f, 0x2e, 0x94, 0xfb, 0x49, 0x56, 0xbe, + 0x2c, 0x58, 0x48, 0x15, 0x49, 0x73, 0xa2, 0xae, 0x09}}; + std::array const ed3SigningKey{ + {0x1b, 0x90, 0xf2, 0x2c, 0xd5, 0x5d, 0xcd, 0xe5, 0x2d, 0x71, 0x84, + 0x66, 0x10, 0xf0, 0xf1, 0x91, 0xfe, 0xb5, 0xbe, 0x94, 0x85, 0xc1, + 0xc8, 0xf3, 0x61, 0x91, 0xc3, 0xa4, 0x41, 0x58, 0xcd, 0xfc}}; + (void)ed3SigningKey; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(ed3)); + std::vector thresh2Subconditions{}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x81\x80\x80\x02\x50\x30\x81\x01\x1a\xa2\x77\xa1\x75\x80" + "\x02\x50\x31\x81\x01\x1c\xa2\x6c\xa2\x6a\xa0\x66\xa4\x64\x80" + "\x20\x42\x0a\x60\x63\x9e\xca\xaa\x48\xac\xcb\x2c\xd9\x46\x79" + "\x69\x34\x35\xf3\x8e\x29\xd5\x4b\x24\x57\x9d\xd7\x3b\x04\x5d" + "\x9c\x2f\x32\x81\x40\x8e\xa4\xd9\x6a\x9b\x3e\x19\xe8\x89\xa4" + "\x4e\xf2\xa8\x1c\xc2\xbd\xd3\xe0\x6f\xe0\xd1\x6b\x85\x47\x9a" + "\x58\x2e\x9f\x38\x09\x1f\x6d\x02\x9a\xf6\x9c\x60\x3f\x16\x6c" + "\xa5\x0e\xfb\xa3\x08\xd6\xb6\x97\x5f\x2e\x94\xfb\x49\x56\xbe" + "\x2c\x58\x48\x15\x49\x73\xa2\xae\x09\xa1\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x4c\x15\x59\xc5\x8b\x8c\x33\x5b\x8b\xe0\x67" + "\x85\xd4\xa2\x3f\xde\x46\xc3\xe8\x00\xa0\x57\xc0\xf9\x65\x50" + "\x89\x8f\xa9\x64\x22\x16\x81\x03\x02\x0c\x3a\x82\x02\x03\x28"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\xc8\x81\x32\xa7\x94\xba\x41\x23\xce\x25\xcb\xfa\xda\xb5\xcd" + "\xef\x9c\x74\xe4\x19\xe9\x90\x84\x92\xbd\xc5\xef\x4c\x06\x2f" + "\xfa\xcc\x81\x03\x02\x08\x1e\x82\x02\x03\x28"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix18() + { + testcase("Prefix18"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** Preim4Cond + // **** Rsa5Cond + // **** Ed6Cond + // **** ed3 + + auto const ed3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const ed3PublicKey{ + {0x42, 0x0a, 0x60, 0x63, 0x9e, 0xca, 0xaa, 0x48, 0xac, 0xcb, 0x2c, + 0xd9, 0x46, 0x79, 0x69, 0x34, 0x35, 0xf3, 0x8e, 0x29, 0xd5, 0x4b, + 0x24, 0x57, 0x9d, 0xd7, 0x3b, 0x04, 0x5d, 0x9c, 0x2f, 0x32}}; + std::array const ed3Sig{ + {0x8e, 0xa4, 0xd9, 0x6a, 0x9b, 0x3e, 0x19, 0xe8, 0x89, 0xa4, 0x4e, + 0xf2, 0xa8, 0x1c, 0xc2, 0xbd, 0xd3, 0xe0, 0x6f, 0xe0, 0xd1, 0x6b, + 0x85, 0x47, 0x9a, 0x58, 0x2e, 0x9f, 0x38, 0x09, 0x1f, 0x6d, 0x02, + 0x9a, 0xf6, 0x9c, 0x60, 0x3f, 0x16, 0x6c, 0xa5, 0x0e, 0xfb, 0xa3, + 0x08, 0xd6, 0xb6, 0x97, 0x5f, 0x2e, 0x94, 0xfb, 0x49, 0x56, 0xbe, + 0x2c, 0x58, 0x48, 0x15, 0x49, 0x73, 0xa2, 0xae, 0x09}}; + std::array const ed3SigningKey{ + {0x1b, 0x90, 0xf2, 0x2c, 0xd5, 0x5d, 0xcd, 0xe5, 0x2d, 0x71, 0x84, + 0x66, 0x10, 0xf0, 0xf1, 0x91, 0xfe, 0xb5, 0xbe, 0x94, 0x85, 0xc1, + 0xc8, 0xf3, 0x61, 0x91, 0xc3, 0xa4, 0x41, 0x58, 0xcd, 0xfc}}; + (void)ed3SigningKey; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim4CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim4Cond{Type::preimageSha256, + 9, + Preim4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa5CondConditionFingerprint = { + {0x99, 0xfb, 0x0b, 0x38, 0x94, 0x4d, 0x20, 0x85, 0xc8, 0xda, 0x3a, + 0x64, 0x31, 0x44, 0x6f, 0x6c, 0x3b, 0x46, 0x25, 0x50, 0xd7, 0x7f, + 0xdf, 0xee, 0x75, 0x72, 0x71, 0xf9, 0x61, 0x40, 0x63, 0xfa}}; + Condition const Rsa5Cond{Type::rsaSha256, + 65536, + Rsa5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed6CondConditionFingerprint = { + {0x00, 0xd3, 0xc9, 0x24, 0x3f, 0x2d, 0x2e, 0x64, 0x93, 0xa8, 0x49, + 0x29, 0x82, 0x75, 0xea, 0xbf, 0xe3, 0x53, 0x7f, 0x8e, 0x45, 0x16, + 0xdb, 0x5e, 0xc6, 0xdf, 0x39, 0xd2, 0xcb, 0xea, 0x62, 0xfb}}; + Condition const Ed6Cond{Type::ed25519Sha256, + 131072, + Ed6CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(ed3)); + std::vector thresh2Subconditions{ + {Preim4Cond, Rsa5Cond, Ed6Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x81\xfd\x80\x02\x50\x30\x81\x01\x1a\xa2\x81\xf3\xa1\x81" + "\xf0\x80\x02\x50\x31\x81\x01\x1c\xa2\x81\xe6\xa2\x81\xe3\xa0" + "\x66\xa4\x64\x80\x20\x42\x0a\x60\x63\x9e\xca\xaa\x48\xac\xcb" + "\x2c\xd9\x46\x79\x69\x34\x35\xf3\x8e\x29\xd5\x4b\x24\x57\x9d" + "\xd7\x3b\x04\x5d\x9c\x2f\x32\x81\x40\x8e\xa4\xd9\x6a\x9b\x3e" + "\x19\xe8\x89\xa4\x4e\xf2\xa8\x1c\xc2\xbd\xd3\xe0\x6f\xe0\xd1" + "\x6b\x85\x47\x9a\x58\x2e\x9f\x38\x09\x1f\x6d\x02\x9a\xf6\x9c" + "\x60\x3f\x16\x6c\xa5\x0e\xfb\xa3\x08\xd6\xb6\x97\x5f\x2e\x94" + "\xfb\x49\x56\xbe\x2c\x58\x48\x15\x49\x73\xa2\xae\x09\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x99\xfb" + "\x0b\x38\x94\x4d\x20\x85\xc8\xda\x3a\x64\x31\x44\x6f\x6c\x3b" + "\x46\x25\x50\xd7\x7f\xdf\xee\x75\x72\x71\xf9\x61\x40\x63\xfa" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\xd3\xc9\x24\x3f\x2d" + "\x2e\x64\x93\xa8\x49\x29\x82\x75\xea\xbf\xe3\x53\x7f\x8e\x45" + "\x16\xdb\x5e\xc6\xdf\x39\xd2\xcb\xea\x62\xfb\x81\x03\x02\x00" + "\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\xc2\x7a\x27\xd3\x91\x16\x58\x27\x2f\x53\xe0" + "\x23\x4b\xe3\x3b\xeb\xfa\x83\xb1\xb7\x13\x38\x60\x79\x00\x38" + "\xc2\x15\x25\x2e\x17\x18\x81\x03\x02\x18\x3a\x82\x02\x03\xb8"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x63\xdf\xba\x5a\x14\xb6\xb3\x15\xfb\xbd\x44\xf2\x29\x36\xdc" + "\x71\x34\x88\x94\x52\xf3\x57\xf6\x6a\xde\xe3\x70\x51\x65\x67" + "\xfb\xed\x81\x03\x02\x14\x1e\x82\x02\x03\xb8"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix19() + { + testcase("Prefix19"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** Preim9Cond + // **** Rsa10Cond + // **** Ed11Cond + // **** ed3 + // **** thresh4 + // ***** Preim6Cond + // ***** Rsa7Cond + // ***** Ed8Cond + // ***** ed5 + + auto const ed3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const ed3PublicKey{ + {0x42, 0x0a, 0x60, 0x63, 0x9e, 0xca, 0xaa, 0x48, 0xac, 0xcb, 0x2c, + 0xd9, 0x46, 0x79, 0x69, 0x34, 0x35, 0xf3, 0x8e, 0x29, 0xd5, 0x4b, + 0x24, 0x57, 0x9d, 0xd7, 0x3b, 0x04, 0x5d, 0x9c, 0x2f, 0x32}}; + std::array const ed3Sig{ + {0x8e, 0xa4, 0xd9, 0x6a, 0x9b, 0x3e, 0x19, 0xe8, 0x89, 0xa4, 0x4e, + 0xf2, 0xa8, 0x1c, 0xc2, 0xbd, 0xd3, 0xe0, 0x6f, 0xe0, 0xd1, 0x6b, + 0x85, 0x47, 0x9a, 0x58, 0x2e, 0x9f, 0x38, 0x09, 0x1f, 0x6d, 0x02, + 0x9a, 0xf6, 0x9c, 0x60, 0x3f, 0x16, 0x6c, 0xa5, 0x0e, 0xfb, 0xa3, + 0x08, 0xd6, 0xb6, 0x97, 0x5f, 0x2e, 0x94, 0xfb, 0x49, 0x56, 0xbe, + 0x2c, 0x58, 0x48, 0x15, 0x49, 0x73, 0xa2, 0xae, 0x09}}; + std::array const ed3SigningKey{ + {0x1b, 0x90, 0xf2, 0x2c, 0xd5, 0x5d, 0xcd, 0xe5, 0x2d, 0x71, 0x84, + 0x66, 0x10, 0xf0, 0xf1, 0x91, 0xfe, 0xb5, 0xbe, 0x94, 0x85, 0xc1, + 0xc8, 0xf3, 0x61, 0x91, 0xc3, 0xa4, 0x41, 0x58, 0xcd, 0xfc}}; + (void)ed3SigningKey; + auto const ed5Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const ed5PublicKey{ + {0xae, 0xbc, 0xe5, 0x4b, 0x88, 0x09, 0x8d, 0x4f, 0xc4, 0xe1, 0x22, + 0xa0, 0x7c, 0x41, 0x05, 0xd7, 0x9f, 0xbe, 0xc8, 0x3d, 0x1d, 0x7e, + 0xd6, 0x55, 0xf4, 0x01, 0x67, 0x68, 0x93, 0x55, 0x85, 0xdf}}; + std::array const ed5Sig{ + {0x1a, 0xdc, 0xf3, 0xaa, 0xc3, 0x2e, 0xe4, 0xed, 0x1d, 0x40, 0xe0, + 0xac, 0xfa, 0x29, 0xec, 0xe4, 0xc4, 0x9e, 0x92, 0xbd, 0x49, 0x0d, + 0x18, 0xc7, 0xeb, 0x01, 0xa6, 0x6a, 0x92, 0xa3, 0xc4, 0xc2, 0x92, + 0xd6, 0x62, 0x26, 0x6a, 0x3f, 0x8b, 0x0b, 0xa7, 0x11, 0xe0, 0x37, + 0x3e, 0x71, 0x77, 0x97, 0x7e, 0x66, 0x69, 0x4f, 0x58, 0x2e, 0xc0, + 0x05, 0xd5, 0x2e, 0x3f, 0x2b, 0xec, 0xc7, 0x48, 0x02}}; + std::array const ed5SigningKey{ + {0x42, 0x67, 0x67, 0xc0, 0xba, 0xdf, 0xb4, 0xd3, 0xf5, 0xc5, 0x1f, + 0x71, 0x97, 0x8a, 0xb4, 0x8e, 0x9a, 0xea, 0x3e, 0xec, 0xaf, 0xdc, + 0xc7, 0x2b, 0x01, 0x1b, 0x06, 0x8f, 0x05, 0x56, 0x63, 0xbc}}; + (void)ed5SigningKey; + auto const thresh4Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim6CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim6Cond{Type::preimageSha256, + 9, + Preim6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa7CondConditionFingerprint = { + {0x6c, 0x7b, 0xea, 0x83, 0xa1, 0xf4, 0x82, 0x3d, 0x36, 0xe7, 0x6e, + 0xae, 0x1a, 0xbc, 0xa0, 0xba, 0x90, 0x3d, 0x96, 0xc1, 0xe6, 0xad, + 0x3a, 0x47, 0xa5, 0xcb, 0x88, 0xab, 0x3c, 0x5f, 0xcc, 0xd5}}; + Condition const Rsa7Cond{Type::rsaSha256, + 65536, + Rsa7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed8CondConditionFingerprint = { + {0xf1, 0x68, 0x96, 0xa6, 0x2e, 0xef, 0x7f, 0x47, 0x06, 0x51, 0x4c, + 0xc6, 0x7e, 0x24, 0xf7, 0x29, 0x84, 0x9c, 0xd6, 0xb0, 0xd9, 0x4b, + 0xd9, 0x0f, 0xc9, 0x34, 0x01, 0x9d, 0x92, 0xeb, 0xbc, 0x0a}}; + Condition const Ed8Cond{Type::ed25519Sha256, + 131072, + Ed8CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + auto ed5 = std::make_unique(ed5PublicKey, ed5Sig); + std::vector> thresh4Subfulfillments; + thresh4Subfulfillments.emplace_back(std::move(ed5)); + std::vector thresh4Subconditions{ + {Preim6Cond, Rsa7Cond, Ed8Cond}}; + auto thresh4 = std::make_unique( + std::move(thresh4Subfulfillments), std::move(thresh4Subconditions)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(ed3)); + thresh2Subfulfillments.emplace_back(std::move(thresh4)); + std::vector thresh2Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x01\xe9\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x01\xde" + "\xa1\x82\x01\xda\x80\x02\x50\x31\x81\x01\x1c\xa2\x82\x01\xcf" + "\xa2\x82\x01\xcb\xa0\x82\x01\x4c\xa2\x81\xe3\xa0\x66\xa4\x64" + "\x80\x20\xae\xbc\xe5\x4b\x88\x09\x8d\x4f\xc4\xe1\x22\xa0\x7c" + "\x41\x05\xd7\x9f\xbe\xc8\x3d\x1d\x7e\xd6\x55\xf4\x01\x67\x68" + "\x93\x55\x85\xdf\x81\x40\x1a\xdc\xf3\xaa\xc3\x2e\xe4\xed\x1d" + "\x40\xe0\xac\xfa\x29\xec\xe4\xc4\x9e\x92\xbd\x49\x0d\x18\xc7" + "\xeb\x01\xa6\x6a\x92\xa3\xc4\xc2\x92\xd6\x62\x26\x6a\x3f\x8b" + "\x0b\xa7\x11\xe0\x37\x3e\x71\x77\x97\x7e\x66\x69\x4f\x58\x2e" + "\xc0\x05\xd5\x2e\x3f\x2b\xec\xc7\x48\x02\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x6c\x7b\xea\x83\xa1" + "\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba\x90\x3d\x96\xc1" + "\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc\xd5\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06" + "\x51\x4c\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f" + "\xc9\x34\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00\xa4\x64" + "\x80\x20\x42\x0a\x60\x63\x9e\xca\xaa\x48\xac\xcb\x2c\xd9\x46" + "\x79\x69\x34\x35\xf3\x8e\x29\xd5\x4b\x24\x57\x9d\xd7\x3b\x04" + "\x5d\x9c\x2f\x32\x81\x40\x8e\xa4\xd9\x6a\x9b\x3e\x19\xe8\x89" + "\xa4\x4e\xf2\xa8\x1c\xc2\xbd\xd3\xe0\x6f\xe0\xd1\x6b\x85\x47" + "\x9a\x58\x2e\x9f\x38\x09\x1f\x6d\x02\x9a\xf6\x9c\x60\x3f\x16" + "\x6c\xa5\x0e\xfb\xa3\x08\xd6\xb6\x97\x5f\x2e\x94\xfb\x49\x56" + "\xbe\x2c\x58\x48\x15\x49\x73\xa2\xae\x09\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x3c\x73\x38\xcf\x23" + "\xc6\x31\x53\x28\xc4\x27\xf8\x95\x87\x99\x83\x2d\x35\x3c\x03" + "\x9b\xd1\xff\xff\x2e\x53\x20\xe9\x5e\x62\xb9\xb7\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\x41\x80\x08\xb2\x60\x74\x57\x6d\xac" + "\xed\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95\xa1\x49\x17\xc7" + "\x65\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02\x00\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\x0e\xed\xea\x70\x12\x69\x3e\x06\x78\xb6\xfc" + "\x3b\xa4\x53\x2f\x95\x74\xcd\x52\x70\x76\xd3\xee\x3e\x5b\xb9" + "\x10\xbb\x34\x48\x21\x4c\x81\x03\x04\x2c\x3a\x82\x02\x03\xb8"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x93\xc4\x8b\x6e\x4e\x9b\xab\x04\x5c\x8e\xf9\x36\x24\xef\x21" + "\xa2\x8b\x40\xef\x0c\x11\xaa\x18\x3e\x32\x3c\xa4\xe6\x94\xdc" + "\xe7\xb7\x81\x03\x04\x28\x1e\x82\x02\x03\xb8"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + testPrefix20() + { + testcase("Prefix20"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * prefix0 + // ** prefix1 + // *** thresh2 + // **** Preim9Cond + // **** Rsa10Cond + // **** Ed11Cond + // **** Thresh12Cond + // **** ed3 + // **** thresh4 + // ***** Preim6Cond + // ***** Rsa7Cond + // ***** Ed8Cond + // ***** ed5 + + auto const ed3Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const ed3PublicKey{ + {0x42, 0x0a, 0x60, 0x63, 0x9e, 0xca, 0xaa, 0x48, 0xac, 0xcb, 0x2c, + 0xd9, 0x46, 0x79, 0x69, 0x34, 0x35, 0xf3, 0x8e, 0x29, 0xd5, 0x4b, + 0x24, 0x57, 0x9d, 0xd7, 0x3b, 0x04, 0x5d, 0x9c, 0x2f, 0x32}}; + std::array const ed3Sig{ + {0x8e, 0xa4, 0xd9, 0x6a, 0x9b, 0x3e, 0x19, 0xe8, 0x89, 0xa4, 0x4e, + 0xf2, 0xa8, 0x1c, 0xc2, 0xbd, 0xd3, 0xe0, 0x6f, 0xe0, 0xd1, 0x6b, + 0x85, 0x47, 0x9a, 0x58, 0x2e, 0x9f, 0x38, 0x09, 0x1f, 0x6d, 0x02, + 0x9a, 0xf6, 0x9c, 0x60, 0x3f, 0x16, 0x6c, 0xa5, 0x0e, 0xfb, 0xa3, + 0x08, 0xd6, 0xb6, 0x97, 0x5f, 0x2e, 0x94, 0xfb, 0x49, 0x56, 0xbe, + 0x2c, 0x58, 0x48, 0x15, 0x49, 0x73, 0xa2, 0xae, 0x09}}; + std::array const ed3SigningKey{ + {0x1b, 0x90, 0xf2, 0x2c, 0xd5, 0x5d, 0xcd, 0xe5, 0x2d, 0x71, 0x84, + 0x66, 0x10, 0xf0, 0xf1, 0x91, 0xfe, 0xb5, 0xbe, 0x94, 0x85, 0xc1, + 0xc8, 0xf3, 0x61, 0x91, 0xc3, 0xa4, 0x41, 0x58, 0xcd, 0xfc}}; + (void)ed3SigningKey; + auto const ed5Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const ed5PublicKey{ + {0xae, 0xbc, 0xe5, 0x4b, 0x88, 0x09, 0x8d, 0x4f, 0xc4, 0xe1, 0x22, + 0xa0, 0x7c, 0x41, 0x05, 0xd7, 0x9f, 0xbe, 0xc8, 0x3d, 0x1d, 0x7e, + 0xd6, 0x55, 0xf4, 0x01, 0x67, 0x68, 0x93, 0x55, 0x85, 0xdf}}; + std::array const ed5Sig{ + {0x1a, 0xdc, 0xf3, 0xaa, 0xc3, 0x2e, 0xe4, 0xed, 0x1d, 0x40, 0xe0, + 0xac, 0xfa, 0x29, 0xec, 0xe4, 0xc4, 0x9e, 0x92, 0xbd, 0x49, 0x0d, + 0x18, 0xc7, 0xeb, 0x01, 0xa6, 0x6a, 0x92, 0xa3, 0xc4, 0xc2, 0x92, + 0xd6, 0x62, 0x26, 0x6a, 0x3f, 0x8b, 0x0b, 0xa7, 0x11, 0xe0, 0x37, + 0x3e, 0x71, 0x77, 0x97, 0x7e, 0x66, 0x69, 0x4f, 0x58, 0x2e, 0xc0, + 0x05, 0xd5, 0x2e, 0x3f, 0x2b, 0xec, 0xc7, 0x48, 0x02}}; + std::array const ed5SigningKey{ + {0x42, 0x67, 0x67, 0xc0, 0xba, 0xdf, 0xb4, 0xd3, 0xf5, 0xc5, 0x1f, + 0x71, 0x97, 0x8a, 0xb4, 0x8e, 0x9a, 0xea, 0x3e, 0xec, 0xaf, 0xdc, + 0xc7, 0x2b, 0x01, 0x1b, 0x06, 0x8f, 0x05, 0x56, 0x63, 0xbc}}; + (void)ed5SigningKey; + auto const thresh4Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim6CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim6Cond{Type::preimageSha256, + 9, + Preim6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa7CondConditionFingerprint = { + {0x6c, 0x7b, 0xea, 0x83, 0xa1, 0xf4, 0x82, 0x3d, 0x36, 0xe7, 0x6e, + 0xae, 0x1a, 0xbc, 0xa0, 0xba, 0x90, 0x3d, 0x96, 0xc1, 0xe6, 0xad, + 0x3a, 0x47, 0xa5, 0xcb, 0x88, 0xab, 0x3c, 0x5f, 0xcc, 0xd5}}; + Condition const Rsa7Cond{Type::rsaSha256, + 65536, + Rsa7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed8CondConditionFingerprint = { + {0xf1, 0x68, 0x96, 0xa6, 0x2e, 0xef, 0x7f, 0x47, 0x06, 0x51, 0x4c, + 0xc6, 0x7e, 0x24, 0xf7, 0x29, 0x84, 0x9c, 0xd6, 0xb0, 0xd9, 0x4b, + 0xd9, 0x0f, 0xc9, 0x34, 0x01, 0x9d, 0x92, 0xeb, 0xbc, 0x0a}}; + Condition const Ed8Cond{Type::ed25519Sha256, + 131072, + Ed8CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh2Msg = "P1P0abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh12CondConditionFingerprint = { + {0x16, 0x7f, 0xbc, 0x09, 0xc8, 0x59, 0x71, 0x7b, 0x2e, 0xb0, 0x65, + 0x72, 0xdf, 0x23, 0xe9, 0x85, 0x65, 0x99, 0x10, 0x58, 0x49, 0x09, + 0x94, 0xda, 0x03, 0x4d, 0x77, 0xf8, 0xcc, 0x91, 0xac, 0x32}}; + Condition const Thresh12Cond{Type::thresholdSha256, + 135168, + Thresh12CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "P0abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 28; + auto const prefix0Prefix = "P0"s; + auto const prefix0Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix0MaxMsgLength = 26; + + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + auto ed5 = std::make_unique(ed5PublicKey, ed5Sig); + std::vector> thresh4Subfulfillments; + thresh4Subfulfillments.emplace_back(std::move(ed5)); + std::vector thresh4Subconditions{ + {Preim6Cond, Rsa7Cond, Ed8Cond}}; + auto thresh4 = std::make_unique( + std::move(thresh4Subfulfillments), std::move(thresh4Subconditions)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(ed3)); + thresh2Subfulfillments.emplace_back(std::move(thresh4)); + std::vector thresh2Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond, Thresh12Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(thresh2)); + auto prefix0 = std::make_unique( + makeSlice(prefix0Prefix), prefix0MaxMsgLength, std::move(prefix1)); + { + auto prefix0EncodedFulfillment = + "\xa1\x82\x02\x17\x80\x02\x50\x30\x81\x01\x1a\xa2\x82\x02\x0c" + "\xa1\x82\x02\x08\x80\x02\x50\x31\x81\x01\x1c\xa2\x82\x01\xfd" + "\xa2\x82\x01\xf9\xa0\x82\x01\x4c\xa2\x81\xe3\xa0\x66\xa4\x64" + "\x80\x20\xae\xbc\xe5\x4b\x88\x09\x8d\x4f\xc4\xe1\x22\xa0\x7c" + "\x41\x05\xd7\x9f\xbe\xc8\x3d\x1d\x7e\xd6\x55\xf4\x01\x67\x68" + "\x93\x55\x85\xdf\x81\x40\x1a\xdc\xf3\xaa\xc3\x2e\xe4\xed\x1d" + "\x40\xe0\xac\xfa\x29\xec\xe4\xc4\x9e\x92\xbd\x49\x0d\x18\xc7" + "\xeb\x01\xa6\x6a\x92\xa3\xc4\xc2\x92\xd6\x62\x26\x6a\x3f\x8b" + "\x0b\xa7\x11\xe0\x37\x3e\x71\x77\x97\x7e\x66\x69\x4f\x58\x2e" + "\xc0\x05\xd5\x2e\x3f\x2b\xec\xc7\x48\x02\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x6c\x7b\xea\x83\xa1" + "\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba\x90\x3d\x96\xc1" + "\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc\xd5\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06" + "\x51\x4c\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f" + "\xc9\x34\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00\xa4\x64" + "\x80\x20\x42\x0a\x60\x63\x9e\xca\xaa\x48\xac\xcb\x2c\xd9\x46" + "\x79\x69\x34\x35\xf3\x8e\x29\xd5\x4b\x24\x57\x9d\xd7\x3b\x04" + "\x5d\x9c\x2f\x32\x81\x40\x8e\xa4\xd9\x6a\x9b\x3e\x19\xe8\x89" + "\xa4\x4e\xf2\xa8\x1c\xc2\xbd\xd3\xe0\x6f\xe0\xd1\x6b\x85\x47" + "\x9a\x58\x2e\x9f\x38\x09\x1f\x6d\x02\x9a\xf6\x9c\x60\x3f\x16" + "\x6c\xa5\x0e\xfb\xa3\x08\xd6\xb6\x97\x5f\x2e\x94\xfb\x49\x56" + "\xbe\x2c\x58\x48\x15\x49\x73\xa2\xae\x09\xa1\x81\xa6\xa0\x25" + "\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54" + "\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee" + "\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\x16\x7f\xbc\x09" + "\xc8\x59\x71\x7b\x2e\xb0\x65\x72\xdf\x23\xe9\x85\x65\x99\x10" + "\x58\x49\x09\x94\xda\x03\x4d\x77\xf8\xcc\x91\xac\x32\x81\x03" + "\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x3c\x73\x38\xcf" + "\x23\xc6\x31\x53\x28\xc4\x27\xf8\x95\x87\x99\x83\x2d\x35\x3c" + "\x03\x9b\xd1\xff\xff\x2e\x53\x20\xe9\x5e\x62\xb9\xb7\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x41\x80\x08\xb2\x60\x74\x57\x6d" + "\xac\xed\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95\xa1\x49\x17" + "\xc7\x65\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02\x00\x00"s; + auto const prefix0EncodedCondition = + "\xa1\x2b\x80\x20\xb5\x1f\x67\xde\x5c\xd9\xff\xeb\xfd\xd0\xd8" + "\x47\xad\xdb\xd3\x0c\xaa\x76\xb3\x07\xdf\xac\x77\x09\xb0\xd7" + "\x22\x32\x05\x4b\x72\x6f\x81\x03\x04\x40\x3a\x82\x02\x03\xb8"s; + auto const prefix0EncodedFingerprint = + "\x30\x36\x80\x02\x50\x30\x81\x01\x1a\xa2\x2d\xa1\x2b\x80\x20" + "\x19\xda\x6c\x14\xec\x59\xe3\xba\x19\x5b\xc5\x0e\x52\xa1\x75" + "\xc1\xfa\x37\x4d\x2d\x5f\xb5\x73\x7c\xd9\x33\x67\x1d\xd5\x2f" + "\xce\xfa\x81\x03\x04\x3c\x1e\x82\x02\x03\xb8"s; + check( + std::move(prefix0), + prefix0Msg, + std::move(prefix0EncodedFulfillment), + prefix0EncodedCondition, + prefix0EncodedFingerprint); + } + } + + void + run() + { + testPrefix0(); + testPrefix1(); + testPrefix2(); + testPrefix3(); + testPrefix4(); + testPrefix5(); + testPrefix6(); + testPrefix7(); + testPrefix8(); + testPrefix9(); + testPrefix10(); + testPrefix11(); + testPrefix12(); + testPrefix13(); + testPrefix14(); + testPrefix15(); + testPrefix16(); + testPrefix17(); + testPrefix18(); + testPrefix19(); + testPrefix20(); + } +}; + +BEAST_DEFINE_TESTSUITE(Conditions_prefix, conditions, ripple); +} // cryptoconditions +} // ripple diff --git a/src/test/conditions/Conditions_generated_test_preim.cpp b/src/test/conditions/Conditions_generated_test_preim.cpp new file mode 100644 index 00000000000..1f836f6dcee --- /dev/null +++ b/src/test/conditions/Conditions_generated_test_preim.cpp @@ -0,0 +1,71 @@ + +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include + +namespace ripple { +namespace cryptoconditions { + +class Conditions_preim_test : public ConditionsTestBase +{ + void + testPreim0() + { + testcase("Preim0"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * preim0 + + auto const preim0Preimage = "I am root"s; + auto const preim0Msg = "abcdefghijklmnopqrstuvwxyz"s; + + auto preim0 = + std::make_unique(makeSlice(preim0Preimage)); + { + auto preim0EncodedFulfillment = + "\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74"s; + auto const preim0EncodedCondition = + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09"s; + auto const preim0EncodedFingerprint = + "\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74"s; + check( + std::move(preim0), + preim0Msg, + std::move(preim0EncodedFulfillment), + preim0EncodedCondition, + preim0EncodedFingerprint); + } + } + + void + run() + { + testPreim0(); + } +}; + +BEAST_DEFINE_TESTSUITE(Conditions_preim, conditions, ripple); +} // cryptoconditions +} // ripple diff --git a/src/test/conditions/Conditions_generated_test_rsa.cpp b/src/test/conditions/Conditions_generated_test_rsa.cpp new file mode 100644 index 00000000000..835208319a4 --- /dev/null +++ b/src/test/conditions/Conditions_generated_test_rsa.cpp @@ -0,0 +1,171 @@ + +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include + +namespace ripple { +namespace cryptoconditions { + +class Conditions_rsa_test : public ConditionsTestBase +{ + void + testRsa0() + { + testcase("Rsa0"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * rsa0 + + auto const rsa0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa0PublicKey{ + {0xa7, 0x6c, 0x6f, 0x92, 0x15, 0x7c, 0x56, 0xe8, 0xad, 0x03, 0x9a, + 0x2b, 0x04, 0x6c, 0xb6, 0x41, 0x02, 0x4a, 0x73, 0x12, 0x87, 0x86, + 0xc2, 0x58, 0x3c, 0xd0, 0x04, 0xa4, 0x8c, 0x98, 0xa7, 0x7b, 0x79, + 0x21, 0xba, 0xde, 0x38, 0xca, 0x67, 0xef, 0xdd, 0xb4, 0x9e, 0x37, + 0x8b, 0x65, 0xf5, 0x5a, 0xce, 0xfe, 0x16, 0xfd, 0xad, 0x62, 0x7b, + 0xa7, 0xba, 0x5e, 0x2c, 0x10, 0x99, 0x40, 0x30, 0xf6, 0xee, 0x26, + 0x49, 0x27, 0x3b, 0xc5, 0xb8, 0x21, 0x30, 0x5c, 0x3e, 0x46, 0xb6, + 0x02, 0x15, 0xc4, 0x0f, 0x18, 0x24, 0xf2, 0xcb, 0x38, 0x8b, 0x47, + 0x77, 0x31, 0x63, 0x71, 0x48, 0xee, 0x76, 0xb3, 0xfd, 0xb6, 0xa2, + 0xa0, 0x8e, 0x5a, 0x01, 0x73, 0x32, 0x35, 0xbf, 0x98, 0x39, 0x3e, + 0x1a, 0xab, 0x87, 0xda, 0xbf, 0x82, 0x0c, 0x71, 0x2e, 0xb5, 0x8a, + 0x54, 0xcc, 0x7f, 0xc2, 0xbf, 0xb4, 0x7f, 0xe2, 0xe5, 0xb9, 0x0f, + 0x6e, 0xee, 0x4a, 0x2f, 0x8b, 0x20, 0xb1, 0xea, 0xaa, 0xdc, 0x89, + 0x59, 0x34, 0x7c, 0xba, 0x9b, 0x3a, 0xa5, 0xe1, 0x57, 0x70, 0x64, + 0x68, 0xf1, 0xbb, 0xae, 0x40, 0xf6, 0xf8, 0x90, 0x63, 0x55, 0x75, + 0x3a, 0x3a, 0x9e, 0x71, 0x6a, 0x93, 0x50, 0x8d, 0x62, 0xfd, 0xaf, + 0x89, 0x8a, 0x1f, 0x27, 0x57, 0xdd, 0x30, 0xd3, 0xca, 0x7d, 0x8f, + 0xa5, 0x59, 0xca, 0x4e, 0xe4, 0xec, 0x9d, 0x25, 0x20, 0xa7, 0x81, + 0x6a, 0x06, 0xa6, 0xbb, 0xb2, 0xf1, 0x75, 0xf9, 0x6b, 0x29, 0xc7, + 0x75, 0xc0, 0x9f, 0xcc, 0x87, 0x42, 0x19, 0x9f, 0x8b, 0xb5, 0x2b, + 0xa6, 0x9a, 0xc3, 0x61, 0x88, 0x74, 0x82, 0x91, 0x76, 0xf5, 0x46, + 0x8c, 0xe7, 0x81, 0xf5, 0x2c, 0x25, 0x6d, 0x5d, 0x50, 0x18, 0x03, + 0xd6, 0x1d, 0xed, 0x8d, 0x74, 0x7f, 0x05, 0xae, 0xbb, 0x35, 0xb9, + 0xe7, 0x6f, 0xe1}}; + std::array const rsa0Sig{ + {0x73, 0x78, 0x37, 0xfc, 0x66, 0x28, 0x75, 0x62, 0xd9, 0xd1, 0x7e, + 0x23, 0x82, 0x65, 0xe7, 0xef, 0x73, 0x31, 0xd8, 0x6a, 0xdc, 0xbb, + 0xeb, 0xa8, 0x81, 0x84, 0xa8, 0x2d, 0x48, 0x77, 0xd0, 0xa6, 0xfd, + 0x60, 0x36, 0x05, 0x8a, 0x9a, 0xc0, 0xf9, 0xb0, 0x62, 0x2c, 0x9a, + 0xab, 0xb0, 0x50, 0x57, 0x37, 0x23, 0x42, 0x43, 0x92, 0x84, 0xa8, + 0x75, 0x88, 0x11, 0x05, 0xc3, 0x24, 0x65, 0xa7, 0x65, 0x6d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 0x2a, 0x36, 0xe9, 0x1b, 0x25, 0xb6, 0xfe, 0xf2, + 0xfa, 0x6a, 0x93}}; + + auto rsa0 = std::make_unique( + makeSlice(rsa0PublicKey), makeSlice(rsa0Sig)); + { + auto rsa0EncodedFulfillment = + "\xa3\x82\x02\x08\x80\x82\x01\x00\xa7\x6c\x6f\x92\x15\x7c\x56" + "\xe8\xad\x03\x9a\x2b\x04\x6c\xb6\x41\x02\x4a\x73\x12\x87\x86" + "\xc2\x58\x3c\xd0\x04\xa4\x8c\x98\xa7\x7b\x79\x21\xba\xde\x38" + "\xca\x67\xef\xdd\xb4\x9e\x37\x8b\x65\xf5\x5a\xce\xfe\x16\xfd" + "\xad\x62\x7b\xa7\xba\x5e\x2c\x10\x99\x40\x30\xf6\xee\x26\x49" + "\x27\x3b\xc5\xb8\x21\x30\x5c\x3e\x46\xb6\x02\x15\xc4\x0f\x18" + "\x24\xf2\xcb\x38\x8b\x47\x77\x31\x63\x71\x48\xee\x76\xb3\xfd" + "\xb6\xa2\xa0\x8e\x5a\x01\x73\x32\x35\xbf\x98\x39\x3e\x1a\xab" + "\x87\xda\xbf\x82\x0c\x71\x2e\xb5\x8a\x54\xcc\x7f\xc2\xbf\xb4" + "\x7f\xe2\xe5\xb9\x0f\x6e\xee\x4a\x2f\x8b\x20\xb1\xea\xaa\xdc" + "\x89\x59\x34\x7c\xba\x9b\x3a\xa5\xe1\x57\x70\x64\x68\xf1\xbb" + "\xae\x40\xf6\xf8\x90\x63\x55\x75\x3a\x3a\x9e\x71\x6a\x93\x50" + "\x8d\x62\xfd\xaf\x89\x8a\x1f\x27\x57\xdd\x30\xd3\xca\x7d\x8f" + "\xa5\x59\xca\x4e\xe4\xec\x9d\x25\x20\xa7\x81\x6a\x06\xa6\xbb" + "\xb2\xf1\x75\xf9\x6b\x29\xc7\x75\xc0\x9f\xcc\x87\x42\x19\x9f" + "\x8b\xb5\x2b\xa6\x9a\xc3\x61\x88\x74\x82\x91\x76\xf5\x46\x8c" + "\xe7\x81\xf5\x2c\x25\x6d\x5d\x50\x18\x03\xd6\x1d\xed\x8d\x74" + "\x7f\x05\xae\xbb\x35\xb9\xe7\x6f\xe1\x81\x82\x01\x00\x73\x78" + "\x37\xfc\x66\x28\x75\x62\xd9\xd1\x7e\x23\x82\x65\xe7\xef\x73" + "\x31\xd8\x6a\xdc\xbb\xeb\xa8\x81\x84\xa8\x2d\x48\x77\xd0\xa6" + "\xfd\x60\x36\x05\x8a\x9a\xc0\xf9\xb0\x62\x2c\x9a\xab\xb0\x50" + "\x57\x37\x23\x42\x43\x92\x84\xa8\x75\x88\x11\x05\xc3\x24\x65" + "\xa7\x65\x6d\xf1\x30\x5e\x03\x44\x7d\x62\x7f\xb4\xfd\x4e\x52" + "\x6e\xfe\xf5\x66\x50\x91\x42\xd8\x9c\x40\x23\x8f\x4c\xc4\x88" + "\xca\xdd\xb5\x47\xca\x0b\x07\x6d\x09\x7d\xa4\x4e\xeb\x30\x15" + "\x18\x00\x1c\x12\xc8\x06\x96\xbc\xdb\xc9\x64\xa0\x16\xa2\xfb" + "\xe5\xe2\x0f\x3c\x79\x25\xa0\x55\x05\xdf\xfb\x11\x54\xdd\x14" + "\x2e\x3b\x2b\x3c\x3b\x0e\x57\x36\xe0\x37\xa9\x85\xfc\xc4\xbc" + "\x39\xcd\xf8\xa6\xb3\xa5\xf3\x97\xb8\x73\x6c\xef\xc9\x58\x1a" + "\xec\xa1\x69\x2d\xfc\x8f\x94\x13\xfa\x61\xf9\x8a\x38\x92\x0c" + "\x2f\x4d\x6e\x10\x0d\xe3\x6d\x6d\xc3\xc1\x23\x5b\x52\x50\x3e" + "\x8c\xff\xaa\xe6\xbd\x0d\x52\xcb\x2c\xcb\x54\xfa\x25\x85\x57" + "\x4c\x89\xa6\x37\xc2\x28\xaf\xf2\x90\xe5\x88\x2c\xc8\xa8\xb4" + "\xa3\xbc\x9b\x0d\x83\x56\xea\xf8\x44\x77\x12\x1c\x05\x86\x1a" + "\x45\xc5\x32\x2a\x36\xe9\x1b\x25\xb6\xfe\xf2\xfa\x6a\x93"s; + auto const rsa0EncodedCondition = + "\xa3\x27\x80\x20\x07\x62\xb2\xf0\x74\x9d\x30\xf9\xaa\xf6\x56" + "\x29\x05\x9d\xb1\x00\x4b\xd6\x8f\x1e\x1d\xa7\x38\xb0\x34\x9c" + "\x27\xaa\x3a\xfa\x12\x09\x81\x03\x01\x00\x00"s; + auto const rsa0EncodedFingerprint = + "\x30\x82\x01\x04\x80\x82\x01\x00\xa7\x6c\x6f\x92\x15\x7c\x56" + "\xe8\xad\x03\x9a\x2b\x04\x6c\xb6\x41\x02\x4a\x73\x12\x87\x86" + "\xc2\x58\x3c\xd0\x04\xa4\x8c\x98\xa7\x7b\x79\x21\xba\xde\x38" + "\xca\x67\xef\xdd\xb4\x9e\x37\x8b\x65\xf5\x5a\xce\xfe\x16\xfd" + "\xad\x62\x7b\xa7\xba\x5e\x2c\x10\x99\x40\x30\xf6\xee\x26\x49" + "\x27\x3b\xc5\xb8\x21\x30\x5c\x3e\x46\xb6\x02\x15\xc4\x0f\x18" + "\x24\xf2\xcb\x38\x8b\x47\x77\x31\x63\x71\x48\xee\x76\xb3\xfd" + "\xb6\xa2\xa0\x8e\x5a\x01\x73\x32\x35\xbf\x98\x39\x3e\x1a\xab" + "\x87\xda\xbf\x82\x0c\x71\x2e\xb5\x8a\x54\xcc\x7f\xc2\xbf\xb4" + "\x7f\xe2\xe5\xb9\x0f\x6e\xee\x4a\x2f\x8b\x20\xb1\xea\xaa\xdc" + "\x89\x59\x34\x7c\xba\x9b\x3a\xa5\xe1\x57\x70\x64\x68\xf1\xbb" + "\xae\x40\xf6\xf8\x90\x63\x55\x75\x3a\x3a\x9e\x71\x6a\x93\x50" + "\x8d\x62\xfd\xaf\x89\x8a\x1f\x27\x57\xdd\x30\xd3\xca\x7d\x8f" + "\xa5\x59\xca\x4e\xe4\xec\x9d\x25\x20\xa7\x81\x6a\x06\xa6\xbb" + "\xb2\xf1\x75\xf9\x6b\x29\xc7\x75\xc0\x9f\xcc\x87\x42\x19\x9f" + "\x8b\xb5\x2b\xa6\x9a\xc3\x61\x88\x74\x82\x91\x76\xf5\x46\x8c" + "\xe7\x81\xf5\x2c\x25\x6d\x5d\x50\x18\x03\xd6\x1d\xed\x8d\x74" + "\x7f\x05\xae\xbb\x35\xb9\xe7\x6f\xe1"s; + check( + std::move(rsa0), + rsa0Msg, + std::move(rsa0EncodedFulfillment), + rsa0EncodedCondition, + rsa0EncodedFingerprint); + } + } + + void + run() + { + testRsa0(); + } +}; + +BEAST_DEFINE_TESTSUITE(Conditions_rsa, conditions, ripple); +} // cryptoconditions +} // ripple diff --git a/src/test/conditions/Conditions_generated_test_thresh.cpp b/src/test/conditions/Conditions_generated_test_thresh.cpp new file mode 100644 index 00000000000..5d91598eb09 --- /dev/null +++ b/src/test/conditions/Conditions_generated_test_thresh.cpp @@ -0,0 +1,25057 @@ + +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include + +namespace ripple { +namespace cryptoconditions { + +class Conditions_thresh_test : public ConditionsTestBase +{ + void + testThresh0() + { + testcase("Thresh0"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** preim1 + + auto const preim1Preimage = "I am root"s; + auto const preim1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + + auto preim1 = + std::make_unique(makeSlice(preim1Preimage)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(preim1)); + std::vector thresh0Subconditions{}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x11\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f" + "\x6f\x74\xa1\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2a\x80\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9\x42\x8c\x85" + "\x8f\x27\x2d\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25\x22\x0d\xef" + "\x3f\x73\xd9\xcf\x02\xc9\x81\x02\x04\x09\x82\x02\x07\x80"s; + auto const thresh0EncodedFingerprint = + "\x30\x2c\x80\x01\x01\xa1\x27\xa0\x25\x80\x20\x5d\xa0\x30\xef" + "\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9" + "\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01" + "\x09"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh1() + { + testcase("Thresh1"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim2Cond + // ** Rsa3Cond + // ** Ed4Cond + // ** preim1 + + auto const preim1Preimage = "I am root"s; + auto const preim1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim2CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim2Cond{Type::preimageSha256, + 9, + Preim2CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa3CondConditionFingerprint = { + {0xc2, 0x20, 0xd2, 0xd9, 0x00, 0x97, 0x9f, 0xb2, 0x4d, 0x72, 0x2b, + 0x28, 0x34, 0x99, 0xf6, 0xb5, 0x51, 0xee, 0x40, 0x07, 0x1b, 0x8d, + 0x96, 0x78, 0x14, 0xe2, 0x64, 0x1e, 0xea, 0x05, 0x71, 0xfb}}; + Condition const Rsa3Cond{Type::rsaSha256, + 65536, + Rsa3CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed4CondConditionFingerprint = { + {0xfa, 0xa5, 0xd8, 0x25, 0xe0, 0xb2, 0x1e, 0x1b, 0x7f, 0x79, 0xa8, + 0xfe, 0x46, 0x2d, 0xb1, 0xc0, 0x14, 0x91, 0xcb, 0x33, 0x9e, 0x03, + 0xe7, 0x48, 0x13, 0x41, 0xa9, 0xe3, 0x58, 0x0e, 0x5d, 0xdd}}; + Condition const Ed4Cond{Type::ed25519Sha256, + 131072, + Ed4CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim1 = + std::make_unique(makeSlice(preim1Preimage)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(preim1)); + std::vector thresh0Subconditions{ + {Preim2Cond, Rsa3Cond, Ed4Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72" + "\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\xc2\x20\xd2\xd9\x00\x97\x9f\xb2\x4d\x72\x2b\x28" + "\x34\x99\xf6\xb5\x51\xee\x40\x07\x1b\x8d\x96\x78\x14\xe2\x64" + "\x1e\xea\x05\x71\xfb\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xfa" + "\xa5\xd8\x25\xe0\xb2\x1e\x1b\x7f\x79\xa8\xfe\x46\x2d\xb1\xc0" + "\x14\x91\xcb\x33\x9e\x03\xe7\x48\x13\x41\xa9\xe3\x58\x0e\x5d" + "\xdd\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xaf\xec\x4c\x75\x19\xac\x0c\xf1\xff\xf5\x88" + "\x5d\xa6\x5f\x98\x80\xb4\x40\x34\xa0\xce\x16\x79\xc9\xc0\xae" + "\x9b\x98\xe9\x77\x49\x52\x81\x03\x02\x10\x00\x82\x02\x03\x98"s; + auto const thresh0EncodedFingerprint = + "\x30\x81\xa6\x80\x01\x01\xa1\x81\xa0\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xc2\x20\xd2\xd9\x00\x97\x9f\xb2\x4d\x72\x2b\x28\x34\x99" + "\xf6\xb5\x51\xee\x40\x07\x1b\x8d\x96\x78\x14\xe2\x64\x1e\xea" + "\x05\x71\xfb\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xfa\xa5\xd8" + "\x25\xe0\xb2\x1e\x1b\x7f\x79\xa8\xfe\x46\x2d\xb1\xc0\x14\x91" + "\xcb\x33\x9e\x03\xe7\x48\x13\x41\xa9\xe3\x58\x0e\x5d\xdd\x81" + "\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh2() + { + testcase("Thresh2"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim7Cond + // ** Rsa8Cond + // ** Ed9Cond + // ** preim1 + // ** thresh2 + // *** Preim4Cond + // *** Rsa5Cond + // *** Ed6Cond + // *** preim3 + + auto const preim1Preimage = "I am root"s; + auto const preim1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim4CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim4Cond{Type::preimageSha256, + 9, + Preim4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa5CondConditionFingerprint = { + {0x99, 0xfb, 0x0b, 0x38, 0x94, 0x4d, 0x20, 0x85, 0xc8, 0xda, 0x3a, + 0x64, 0x31, 0x44, 0x6f, 0x6c, 0x3b, 0x46, 0x25, 0x50, 0xd7, 0x7f, + 0xdf, 0xee, 0x75, 0x72, 0x71, 0xf9, 0x61, 0x40, 0x63, 0xfa}}; + Condition const Rsa5Cond{Type::rsaSha256, + 65536, + Rsa5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed6CondConditionFingerprint = { + {0x00, 0xd3, 0xc9, 0x24, 0x3f, 0x2d, 0x2e, 0x64, 0x93, 0xa8, 0x49, + 0x29, 0x82, 0x75, 0xea, 0xbf, 0xe3, 0x53, 0x7f, 0x8e, 0x45, 0x16, + 0xdb, 0x5e, 0xc6, 0xdf, 0x39, 0xd2, 0xcb, 0xea, 0x62, 0xfb}}; + Condition const Ed6Cond{Type::ed25519Sha256, + 131072, + Ed6CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim1 = + std::make_unique(makeSlice(preim1Preimage)); + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(preim3)); + std::vector thresh2Subconditions{ + {Preim4Cond, Rsa5Cond, Ed6Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(preim1)); + thresh0Subfulfillments.emplace_back(std::move(thresh2)); + std::vector thresh0Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\x18\xa0\x81\x9a\xa0\x0b\x80\x09\x49\x20\x61\x6d" + "\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49" + "\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\x99\xfb\x0b\x38\x94\x4d\x20" + "\x85\xc8\xda\x3a\x64\x31\x44\x6f\x6c\x3b\x46\x25\x50\xd7\x7f" + "\xdf\xee\x75\x72\x71\xf9\x61\x40\x63\xfa\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x00\xd3\xc9\x24\x3f\x2d\x2e\x64\x93\xa8\x49" + "\x29\x82\x75\xea\xbf\xe3\x53\x7f\x8e\x45\x16\xdb\x5e\xc6\xdf" + "\x39\xd2\xcb\xea\x62\xfb\x81\x03\x02\x00\x00\xa1\x79\xa0\x25" + "\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54" + "\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee" + "\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xd1\xb5\x1d\x35" + "\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c" + "\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d" + "\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0" + "\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x8c\x31\x81\x22\x5a\x55\xcf\xb4\xed\x56\x1a" + "\xe6\x41\x6c\xef\x46\xa6\xdf\x81\x18\xfc\xb1\xf6\x05\x44\xea" + "\x00\xd1\x2a\x37\xf6\x88\x81\x03\x04\x24\x00\x82\x02\x03\x98"s; + auto const thresh0EncodedFingerprint = + "\x30\x81\xd3\x80\x01\x02\xa1\x81\xcd\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80" + "\x20\xf1\x11\x26\xc0\x4c\x93\x00\x8b\x62\x92\xb1\xfc\x62\xbf" + "\x29\x71\x90\x46\x6d\xb4\xee\x30\x7a\xe2\x3f\x8d\x46\xe8\x81" + "\x70\x11\x4f\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80" + "\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9" + "\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2" + "\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc" + "\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36" + "\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81" + "\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh3() + { + testcase("Thresh3"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim7Cond + // ** Rsa8Cond + // ** Ed9Cond + // ** Thresh10Cond + // ** preim1 + // ** thresh2 + // *** Preim4Cond + // *** Rsa5Cond + // *** Ed6Cond + // *** preim3 + + auto const preim1Preimage = "I am root"s; + auto const preim1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim4CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim4Cond{Type::preimageSha256, + 9, + Preim4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa5CondConditionFingerprint = { + {0x99, 0xfb, 0x0b, 0x38, 0x94, 0x4d, 0x20, 0x85, 0xc8, 0xda, 0x3a, + 0x64, 0x31, 0x44, 0x6f, 0x6c, 0x3b, 0x46, 0x25, 0x50, 0xd7, 0x7f, + 0xdf, 0xee, 0x75, 0x72, 0x71, 0xf9, 0x61, 0x40, 0x63, 0xfa}}; + Condition const Rsa5Cond{Type::rsaSha256, + 65536, + Rsa5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed6CondConditionFingerprint = { + {0x00, 0xd3, 0xc9, 0x24, 0x3f, 0x2d, 0x2e, 0x64, 0x93, 0xa8, 0x49, + 0x29, 0x82, 0x75, 0xea, 0xbf, 0xe3, 0x53, 0x7f, 0x8e, 0x45, 0x16, + 0xdb, 0x5e, 0xc6, 0xdf, 0x39, 0xd2, 0xcb, 0xea, 0x62, 0xfb}}; + Condition const Ed6Cond{Type::ed25519Sha256, + 131072, + Ed6CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh10CondConditionFingerprint = { + {0x3f, 0xdc, 0xe5, 0x2e, 0x5b, 0xa8, 0x02, 0x75, 0xbc, 0xec, 0x28, + 0x88, 0xde, 0x80, 0x1e, 0x1e, 0xfc, 0x04, 0x21, 0x0e, 0x1a, 0x8c, + 0xc0, 0xf5, 0xaf, 0x0a, 0x0a, 0x38, 0x9f, 0xd2, 0x94, 0x16}}; + Condition const Thresh10Cond{Type::thresholdSha256, + 135168, + Thresh10CondConditionFingerprint, + std::bitset<5>{25}}; + + auto preim1 = + std::make_unique(makeSlice(preim1Preimage)); + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(preim3)); + std::vector thresh2Subconditions{ + {Preim4Cond, Rsa5Cond, Ed6Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(preim1)); + thresh0Subfulfillments.emplace_back(std::move(thresh2)); + std::vector thresh0Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond, Thresh10Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\x46\xa0\x81\x9a\xa0\x0b\x80\x09\x49\x20\x61\x6d" + "\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49" + "\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\x99\xfb\x0b\x38\x94\x4d\x20" + "\x85\xc8\xda\x3a\x64\x31\x44\x6f\x6c\x3b\x46\x25\x50\xd7\x7f" + "\xdf\xee\x75\x72\x71\xf9\x61\x40\x63\xfa\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x00\xd3\xc9\x24\x3f\x2d\x2e\x64\x93\xa8\x49" + "\x29\x82\x75\xea\xbf\xe3\x53\x7f\x8e\x45\x16\xdb\x5e\xc6\xdf" + "\x39\xd2\xcb\xea\x62\xfb\x81\x03\x02\x00\x00\xa1\x81\xa6\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\x3f\xdc\xe5" + "\x2e\x5b\xa8\x02\x75\xbc\xec\x28\x88\xde\x80\x1e\x1e\xfc\x04" + "\x21\x0e\x1a\x8c\xc0\xf5\xaf\x0a\x0a\x38\x9f\xd2\x94\x16\x81" + "\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xd1\xb5\x1d" + "\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5" + "\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d" + "\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b" + "\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x38\x06\x63\xf9\xbf\xc4\xe4\x39\x86\x8e\x6b" + "\x12\xf8\xda\xb8\x41\xf4\x96\xa4\xa5\x3c\xd3\x3d\x66\xff\x1e" + "\x65\xf8\x83\xbb\xa2\xc5\x81\x03\x04\x38\x00\x82\x02\x03\x98"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x00\x80\x01\x02\xa1\x81\xfa\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b" + "\x80\x20\x3f\xdc\xe5\x2e\x5b\xa8\x02\x75\xbc\xec\x28\x88\xde" + "\x80\x1e\x1e\xfc\x04\x21\x0e\x1a\x8c\xc0\xf5\xaf\x0a\x0a\x38" + "\x9f\xd2\x94\x16\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa2\x2b" + "\x80\x20\xf1\x11\x26\xc0\x4c\x93\x00\x8b\x62\x92\xb1\xfc\x62" + "\xbf\x29\x71\x90\x46\x6d\xb4\xee\x30\x7a\xe2\x3f\x8d\x46\xe8" + "\x81\x70\x11\x4f\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27" + "\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e" + "\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e" + "\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa" + "\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f" + "\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9" + "\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh4() + { + testcase("Thresh4"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim9Cond + // ** Rsa10Cond + // ** Ed11Cond + // ** prefix1 + // *** prefix2 + // **** preim3 + // ** prefix4 + // *** prefix5 + // **** preim6 + // ** thresh7 + // *** preim8 + + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim6Preimage = "I am root"s; + auto const preim6Msg = "P5P4abcdefghijklmnopqrstuvwxyz"s; + auto const prefix5Prefix = "P5"s; + auto const prefix5Msg = "P4abcdefghijklmnopqrstuvwxyz"s; + auto const prefix5MaxMsgLength = 28; + auto const prefix4Prefix = "P4"s; + auto const prefix4Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix4MaxMsgLength = 26; + auto const preim8Preimage = "I am root"s; + auto const preim8Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh7Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(preim3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim6 = + std::make_unique(makeSlice(preim6Preimage)); + auto prefix5 = std::make_unique( + makeSlice(prefix5Prefix), prefix5MaxMsgLength, std::move(preim6)); + auto prefix4 = std::make_unique( + makeSlice(prefix4Prefix), prefix4MaxMsgLength, std::move(prefix5)); + auto preim8 = + std::make_unique(makeSlice(preim8Preimage)); + std::vector> thresh7Subfulfillments; + thresh7Subfulfillments.emplace_back(std::move(preim8)); + std::vector thresh7Subconditions{}; + auto thresh7 = std::make_unique( + std::move(thresh7Subfulfillments), std::move(thresh7Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix4)); + thresh0Subfulfillments.emplace_back(std::move(thresh7)); + std::vector thresh0Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x81\xd6\xa0\x59\xa1\x21\x80\x02\x50\x31\x81\x01\x1a\xa2" + "\x18\xa1\x16\x80\x02\x50\x32\x81\x01\x1c\xa2\x0d\xa0\x0b\x80" + "\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x21\x80\x02\x50" + "\x34\x81\x01\x1a\xa2\x18\xa1\x16\x80\x02\x50\x35\x81\x01\x1c" + "\xa2\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74" + "\xa2\x11\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f" + "\x6f\x74\xa1\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa3\x27\x80\x20\x3c\x73\x38\xcf\x23\xc6\x31\x53\x28\xc4\x27" + "\xf8\x95\x87\x99\x83\x2d\x35\x3c\x03\x9b\xd1\xff\xff\x2e\x53" + "\x20\xe9\x5e\x62\xb9\xb7\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\x41\x80\x08\xb2\x60\x74\x57\x6d\xac\xed\x74\x7f\x54\xdb\x96" + "\x18\x91\x06\x0a\x95\xa1\x49\x17\xc7\x65\xe3\x94\xc8\x5e\x2c" + "\x92\x20\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xed\x4b\xfb\xbb\x4f\x0d\x14\x58\x2f\x54\x91" + "\x80\xe9\xd0\xba\x00\xf6\x0e\x61\x49\xd3\x1c\xa3\xde\xaf\xd5" + "\xe8\xe1\xba\x95\x06\x51\x81\x03\x03\x20\x43\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x03\x80\x01\x03\xa1\x81\xfd\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2a\x80\x20\x6b\xd2\xbc\x2a\x35\x12\x91" + "\xf7\xff\xea\x56\xbc\xe5\x45\x1a\xa7\xdb\x52\x26\x02\x8d\xdb" + "\x5c\xb0\x4b\xe9\x5c\x25\x1f\xc2\xbe\x6f\x81\x02\x08\x43\x82" + "\x02\x07\x80\xa1\x2a\x80\x20\xd6\x93\x63\x2d\xf7\x5e\xd3\xb4" + "\x6c\x41\xbd\x4e\x6f\x3a\xcd\x18\x3a\xbc\xb0\x28\x41\x3b\xc3" + "\x94\xbf\xa7\xdf\xff\xc0\x2e\x42\x69\x81\x02\x08\x43\x82\x02" + "\x07\x80\xa2\x2a\x80\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9\x42" + "\x8c\x85\x8f\x27\x2d\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25\x22" + "\x0d\xef\x3f\x73\xd9\xcf\x02\xc9\x81\x02\x04\x09\x82\x02\x07" + "\x80\xa3\x27\x80\x20\x3c\x73\x38\xcf\x23\xc6\x31\x53\x28\xc4" + "\x27\xf8\x95\x87\x99\x83\x2d\x35\x3c\x03\x9b\xd1\xff\xff\x2e" + "\x53\x20\xe9\x5e\x62\xb9\xb7\x81\x03\x01\x00\x00\xa4\x27\x80" + "\x20\x41\x80\x08\xb2\x60\x74\x57\x6d\xac\xed\x74\x7f\x54\xdb" + "\x96\x18\x91\x06\x0a\x95\xa1\x49\x17\xc7\x65\xe3\x94\xc8\x5e" + "\x2c\x92\x20\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh5() + { + testcase("Thresh5"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim7Cond + // ** Rsa8Cond + // ** Ed9Cond + // ** Prefix10Cond + // ** Thresh13Cond + // ** prefix1 + // *** prefix2 + // **** preim3 + // ** preim4 + // ** rsa5 + // ** ed6 + + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa5Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa5PublicKey{ + {0xc0, 0x00, 0xef, 0x8f, 0x4b, 0x81, 0x10, 0x1e, 0x52, 0xe0, 0x07, + 0x9f, 0x68, 0xe7, 0x2f, 0x92, 0xd4, 0x77, 0x3c, 0x1f, 0xa3, 0xff, + 0x72, 0x64, 0x5b, 0x37, 0xf1, 0xf3, 0xa3, 0xc5, 0xfb, 0xcd, 0xfb, + 0xda, 0xcc, 0x8b, 0x52, 0xe1, 0xde, 0xbc, 0x28, 0x8d, 0xe5, 0xad, + 0xab, 0x86, 0x61, 0x45, 0x97, 0x65, 0x37, 0x68, 0x26, 0x21, 0x92, + 0x17, 0xa3, 0xb0, 0x74, 0x5c, 0x8a, 0x45, 0x8d, 0x87, 0x5b, 0x9b, + 0xd1, 0x7b, 0x07, 0xc4, 0x8c, 0x67, 0xa0, 0xe9, 0x82, 0x0c, 0xe0, + 0x6b, 0xea, 0x91, 0x5c, 0xba, 0xe3, 0xd9, 0x9d, 0x39, 0xfd, 0x77, + 0xac, 0xcb, 0x33, 0x9b, 0x28, 0x51, 0x8d, 0xbf, 0x3e, 0xe4, 0x94, + 0x1c, 0x9a, 0x60, 0x71, 0x4b, 0x34, 0x07, 0x30, 0xda, 0x42, 0x46, + 0x0e, 0xb8, 0xb7, 0x2c, 0xf5, 0x2f, 0x4b, 0x9e, 0xe7, 0x64, 0x81, + 0xa1, 0xa2, 0x05, 0x66, 0x92, 0xe6, 0x75, 0x9f, 0x37, 0xae, 0x40, + 0xa9, 0x16, 0x08, 0x19, 0xe8, 0xdc, 0x47, 0xd6, 0x03, 0x29, 0xab, + 0xcc, 0x58, 0xa2, 0x37, 0x2a, 0x32, 0xb8, 0x15, 0xc7, 0x51, 0x91, + 0x73, 0xb9, 0x1d, 0xc6, 0xd0, 0x4f, 0x85, 0x86, 0xd5, 0xb3, 0x21, + 0x1a, 0x2a, 0x6c, 0xeb, 0x7f, 0xfe, 0x84, 0x17, 0x10, 0x2d, 0x0e, + 0xb4, 0xe1, 0xc2, 0x48, 0x4c, 0x3f, 0x61, 0xc7, 0x59, 0x75, 0xa7, + 0xc1, 0x75, 0xce, 0x67, 0x17, 0x42, 0x2a, 0x2f, 0x96, 0xef, 0x8a, + 0x2d, 0x74, 0xd2, 0x13, 0x68, 0xe1, 0xe9, 0xea, 0xfb, 0x73, 0x68, + 0xed, 0x8d, 0xd3, 0xac, 0x49, 0x09, 0xf9, 0xec, 0x62, 0xdf, 0x53, + 0xab, 0xfe, 0x90, 0x64, 0x4b, 0x92, 0x60, 0x0d, 0xdd, 0x00, 0xfe, + 0x02, 0xe6, 0xf3, 0x9b, 0x2b, 0xac, 0x4f, 0x70, 0xe8, 0x5b, 0x69, + 0x9c, 0x40, 0xd3, 0xeb, 0x37, 0xad, 0x6f, 0x37, 0xab, 0xf3, 0x79, + 0x8e, 0xcb, 0x1d}}; + std::array const rsa5Sig{ + {0x0d, 0xbb, 0xf1, 0x9d, 0x46, 0x91, 0x62, 0xda, 0xf4, 0xee, 0xf7, + 0xa2, 0x11, 0xfa, 0x0a, 0x0c, 0x12, 0xf7, 0xa9, 0x1e, 0xea, 0x27, + 0x54, 0x80, 0x34, 0x9c, 0xfa, 0xab, 0x7e, 0x5e, 0xbe, 0x2a, 0xed, + 0x85, 0x91, 0x68, 0xc9, 0x60, 0x80, 0x2e, 0x2c, 0xe3, 0x22, 0x71, + 0xd6, 0xc9, 0xd0, 0xe1, 0x2b, 0x04, 0x51, 0x97, 0x78, 0x68, 0x71, + 0xab, 0x3d, 0xa4, 0x1f, 0x7a, 0x00, 0xfc, 0x9d, 0x76, 0xf3, 0xbc, + 0xeb, 0xbf, 0x50, 0xef, 0x3c, 0x29, 0xdd, 0x4f, 0xe2, 0x1e, 0xeb, + 0x04, 0x7d, 0x27, 0x74, 0x61, 0x50, 0x20, 0x74, 0x49, 0x39, 0xe2, + 0x56, 0x81, 0x61, 0xee, 0x73, 0x7e, 0x5b, 0xfb, 0x2f, 0x0c, 0xdc, + 0x94, 0x42, 0x36, 0x72, 0x98, 0xa5, 0x25, 0xf2, 0x58, 0xae, 0xa5, + 0xdc, 0xb7, 0xbb, 0xdf, 0x68, 0x18, 0x5f, 0xdc, 0x44, 0x08, 0x70, + 0x5d, 0xb5, 0x55, 0xcb, 0xe3, 0xe7, 0xde, 0xec, 0xfa, 0xa9, 0xd5, + 0xce, 0xaa, 0x61, 0x23, 0x1a, 0xed, 0x80, 0xec, 0x5e, 0x50, 0x1b, + 0x0d, 0x8a, 0xc0, 0xbc, 0x6a, 0x1c, 0xf0, 0x1a, 0x54, 0xdf, 0x87, + 0x2b, 0x5b, 0x75, 0x50, 0xbc, 0x2b, 0x93, 0x91, 0x14, 0x2e, 0xda, + 0x49, 0x50, 0x31, 0x42, 0x0e, 0xa7, 0xd5, 0xa4, 0x29, 0xd9, 0x21, + 0x86, 0x10, 0xdb, 0x0d, 0x8b, 0x7e, 0xcb, 0x99, 0x9d, 0x40, 0x00, + 0x20, 0x01, 0x21, 0x3a, 0x8a, 0xcb, 0x61, 0x8a, 0x0b, 0x53, 0x30, + 0x20, 0xae, 0x27, 0x3c, 0x86, 0xb5, 0xe0, 0xb4, 0xd1, 0xfc, 0x4f, + 0x1f, 0x1e, 0x1f, 0x28, 0xee, 0x61, 0x1e, 0x5f, 0xec, 0x65, 0x00, + 0x36, 0x1a, 0xb3, 0x49, 0xcc, 0x38, 0x65, 0x27, 0x71, 0x98, 0x27, + 0x39, 0x7d, 0x2a, 0xe8, 0xf7, 0x2c, 0xfc, 0x59, 0x93, 0x92, 0x0a, + 0x51, 0xca, 0xf6, 0x21, 0x82, 0x0d, 0xcc, 0xc1, 0x79, 0x15, 0xd0, + 0x4b, 0x98, 0x0e}}; + auto const ed6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed6PublicKey{ + {0xa0, 0x45, 0x26, 0xcf, 0xee, 0x7e, 0xda, 0x68, 0xd9, 0x70, 0x23, + 0xac, 0x68, 0x48, 0x9e, 0x20, 0xa4, 0x5e, 0xf8, 0x51, 0xcb, 0xfe, + 0x72, 0xc1, 0x11, 0x5d, 0x25, 0x9c, 0xbc, 0xfd, 0xbb, 0x8b}}; + std::array const ed6Sig{ + {0x2a, 0x1d, 0xc0, 0x92, 0x24, 0x9a, 0x87, 0x5a, 0xc6, 0xaf, 0xa4, + 0x7f, 0xe1, 0x63, 0xc7, 0xca, 0xfd, 0x08, 0x47, 0xae, 0x2f, 0x98, + 0x07, 0xdc, 0x56, 0x9a, 0xfc, 0x2f, 0x0e, 0xa9, 0x37, 0x16, 0xe0, + 0x81, 0xff, 0x94, 0xb2, 0xab, 0x40, 0x2f, 0x9c, 0xa6, 0xc0, 0xe4, + 0xdf, 0xdf, 0xcd, 0x01, 0xf2, 0xdb, 0x9c, 0xff, 0x62, 0xe7, 0x2f, + 0x9d, 0x51, 0x6e, 0x80, 0xd1, 0x0c, 0x86, 0xd2, 0x01}}; + std::array const ed6SigningKey{ + {0x8f, 0xac, 0x15, 0x02, 0xce, 0xb4, 0x10, 0x27, 0x56, 0x91, 0x2b, + 0xd0, 0x57, 0xe7, 0x6c, 0xe0, 0xc5, 0x46, 0x65, 0x38, 0xf0, 0xc8, + 0x09, 0xe0, 0xb4, 0x57, 0xfb, 0x11, 0xfc, 0x00, 0xe9, 0xdf}}; + (void)ed6SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix10CondConditionFingerprint = { + {0x61, 0x08, 0x88, 0x30, 0x87, 0xa7, 0x2c, 0x00, 0xe9, 0x98, 0x24, + 0x53, 0x38, 0x61, 0x82, 0xb3, 0x35, 0x81, 0xed, 0x80, 0x33, 0xe7, + 0x68, 0x5b, 0x65, 0xff, 0x56, 0x67, 0x43, 0x7e, 0x53, 0x0b}}; + Condition const Prefix10Cond{Type::prefixSha256, + 2092, + Prefix10CondConditionFingerprint, + std::bitset<5>{1}}; + std::array const Thresh13CondConditionFingerprint = { + {0x57, 0xb7, 0x93, 0x0b, 0xb8, 0xe2, 0x21, 0xe9, 0x42, 0x8c, 0x85, + 0x8f, 0x27, 0x2d, 0x4c, 0xa0, 0x85, 0xa0, 0x40, 0x6c, 0x4c, 0xed, + 0x25, 0x22, 0x0d, 0xef, 0x3f, 0x73, 0xd9, 0xcf, 0x02, 0xc9}}; + Condition const Thresh13Cond{Type::thresholdSha256, + 1033, + Thresh13CondConditionFingerprint, + std::bitset<5>{1}}; + + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(preim3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + auto rsa5 = std::make_unique( + makeSlice(rsa5PublicKey), makeSlice(rsa5Sig)); + auto ed6 = std::make_unique(ed6PublicKey, ed6Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim4)); + thresh0Subfulfillments.emplace_back(std::move(rsa5)); + thresh0Subfulfillments.emplace_back(std::move(ed6)); + std::vector thresh0Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond, Prefix10Cond, Thresh13Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\x7a\xa0\x82\x02\xa2\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x21\x80\x02\x50\x31\x81\x01\x1a" + "\xa2\x18\xa1\x16\x80\x02\x50\x32\x81\x01\x1c\xa2\x0d\xa0\x0b" + "\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa3\x82\x02\x08" + "\x80\x82\x01\x00\xc0\x00\xef\x8f\x4b\x81\x10\x1e\x52\xe0\x07" + "\x9f\x68\xe7\x2f\x92\xd4\x77\x3c\x1f\xa3\xff\x72\x64\x5b\x37" + "\xf1\xf3\xa3\xc5\xfb\xcd\xfb\xda\xcc\x8b\x52\xe1\xde\xbc\x28" + "\x8d\xe5\xad\xab\x86\x61\x45\x97\x65\x37\x68\x26\x21\x92\x17" + "\xa3\xb0\x74\x5c\x8a\x45\x8d\x87\x5b\x9b\xd1\x7b\x07\xc4\x8c" + "\x67\xa0\xe9\x82\x0c\xe0\x6b\xea\x91\x5c\xba\xe3\xd9\x9d\x39" + "\xfd\x77\xac\xcb\x33\x9b\x28\x51\x8d\xbf\x3e\xe4\x94\x1c\x9a" + "\x60\x71\x4b\x34\x07\x30\xda\x42\x46\x0e\xb8\xb7\x2c\xf5\x2f" + "\x4b\x9e\xe7\x64\x81\xa1\xa2\x05\x66\x92\xe6\x75\x9f\x37\xae" + "\x40\xa9\x16\x08\x19\xe8\xdc\x47\xd6\x03\x29\xab\xcc\x58\xa2" + "\x37\x2a\x32\xb8\x15\xc7\x51\x91\x73\xb9\x1d\xc6\xd0\x4f\x85" + "\x86\xd5\xb3\x21\x1a\x2a\x6c\xeb\x7f\xfe\x84\x17\x10\x2d\x0e" + "\xb4\xe1\xc2\x48\x4c\x3f\x61\xc7\x59\x75\xa7\xc1\x75\xce\x67" + "\x17\x42\x2a\x2f\x96\xef\x8a\x2d\x74\xd2\x13\x68\xe1\xe9\xea" + "\xfb\x73\x68\xed\x8d\xd3\xac\x49\x09\xf9\xec\x62\xdf\x53\xab" + "\xfe\x90\x64\x4b\x92\x60\x0d\xdd\x00\xfe\x02\xe6\xf3\x9b\x2b" + "\xac\x4f\x70\xe8\x5b\x69\x9c\x40\xd3\xeb\x37\xad\x6f\x37\xab" + "\xf3\x79\x8e\xcb\x1d\x81\x82\x01\x00\x0d\xbb\xf1\x9d\x46\x91" + "\x62\xda\xf4\xee\xf7\xa2\x11\xfa\x0a\x0c\x12\xf7\xa9\x1e\xea" + "\x27\x54\x80\x34\x9c\xfa\xab\x7e\x5e\xbe\x2a\xed\x85\x91\x68" + "\xc9\x60\x80\x2e\x2c\xe3\x22\x71\xd6\xc9\xd0\xe1\x2b\x04\x51" + "\x97\x78\x68\x71\xab\x3d\xa4\x1f\x7a\x00\xfc\x9d\x76\xf3\xbc" + "\xeb\xbf\x50\xef\x3c\x29\xdd\x4f\xe2\x1e\xeb\x04\x7d\x27\x74" + "\x61\x50\x20\x74\x49\x39\xe2\x56\x81\x61\xee\x73\x7e\x5b\xfb" + "\x2f\x0c\xdc\x94\x42\x36\x72\x98\xa5\x25\xf2\x58\xae\xa5\xdc" + "\xb7\xbb\xdf\x68\x18\x5f\xdc\x44\x08\x70\x5d\xb5\x55\xcb\xe3" + "\xe7\xde\xec\xfa\xa9\xd5\xce\xaa\x61\x23\x1a\xed\x80\xec\x5e" + "\x50\x1b\x0d\x8a\xc0\xbc\x6a\x1c\xf0\x1a\x54\xdf\x87\x2b\x5b" + "\x75\x50\xbc\x2b\x93\x91\x14\x2e\xda\x49\x50\x31\x42\x0e\xa7" + "\xd5\xa4\x29\xd9\x21\x86\x10\xdb\x0d\x8b\x7e\xcb\x99\x9d\x40" + "\x00\x20\x01\x21\x3a\x8a\xcb\x61\x8a\x0b\x53\x30\x20\xae\x27" + "\x3c\x86\xb5\xe0\xb4\xd1\xfc\x4f\x1f\x1e\x1f\x28\xee\x61\x1e" + "\x5f\xec\x65\x00\x36\x1a\xb3\x49\xcc\x38\x65\x27\x71\x98\x27" + "\x39\x7d\x2a\xe8\xf7\x2c\xfc\x59\x93\x92\x0a\x51\xca\xf6\x21" + "\x82\x0d\xcc\xc1\x79\x15\xd0\x4b\x98\x0e\xa4\x64\x80\x20\xa0" + "\x45\x26\xcf\xee\x7e\xda\x68\xd9\x70\x23\xac\x68\x48\x9e\x20" + "\xa4\x5e\xf8\x51\xcb\xfe\x72\xc1\x11\x5d\x25\x9c\xbc\xfd\xbb" + "\x8b\x81\x40\x2a\x1d\xc0\x92\x24\x9a\x87\x5a\xc6\xaf\xa4\x7f" + "\xe1\x63\xc7\xca\xfd\x08\x47\xae\x2f\x98\x07\xdc\x56\x9a\xfc" + "\x2f\x0e\xa9\x37\x16\xe0\x81\xff\x94\xb2\xab\x40\x2f\x9c\xa6" + "\xc0\xe4\xdf\xdf\xcd\x01\xf2\xdb\x9c\xff\x62\xe7\x2f\x9d\x51" + "\x6e\x80\xd1\x0c\x86\xd2\x01\xa1\x81\xd1\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2a\x80\x20\x61\x08\x88\x30\x87\xa7\x2c" + "\x00\xe9\x98\x24\x53\x38\x61\x82\xb3\x35\x81\xed\x80\x33\xe7" + "\x68\x5b\x65\xff\x56\x67\x43\x7e\x53\x0b\x81\x02\x08\x2c\x82" + "\x02\x07\x80\xa2\x2a\x80\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9" + "\x42\x8c\x85\x8f\x27\x2d\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25" + "\x22\x0d\xef\x3f\x73\xd9\xcf\x02\xc9\x81\x02\x04\x09\x82\x02" + "\x07\x80\xa3\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa" + "\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf" + "\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab" + "\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5" + "\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x5f\xf7\x0e\xbb\x45\x41\xd4\x10\x8f\xde\x95" + "\x6c\x4b\xb3\xc4\x15\x0b\xff\xea\x13\x74\x8a\xd6\xf8\xc2\xf4" + "\x50\x9e\xb5\x4f\x9b\xaf\x81\x03\x06\x24\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x7d\x80\x01\x04\xa1\x82\x01\x76\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2a\x80\x20\x61\x08\x88\x30\x87\xa7\x2c\x00\xe9\x98\x24\x53" + "\x38\x61\x82\xb3\x35\x81\xed\x80\x33\xe7\x68\x5b\x65\xff\x56" + "\x67\x43\x7e\x53\x0b\x81\x02\x08\x2c\x82\x02\x07\x80\xa1\x2a" + "\x80\x20\x6b\xd2\xbc\x2a\x35\x12\x91\xf7\xff\xea\x56\xbc\xe5" + "\x45\x1a\xa7\xdb\x52\x26\x02\x8d\xdb\x5c\xb0\x4b\xe9\x5c\x25" + "\x1f\xc2\xbe\x6f\x81\x02\x08\x43\x82\x02\x07\x80\xa2\x2a\x80" + "\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9\x42\x8c\x85\x8f\x27\x2d" + "\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25\x22\x0d\xef\x3f\x73\xd9" + "\xcf\x02\xc9\x81\x02\x04\x09\x82\x02\x07\x80\xa3\x27\x80\x20" + "\x99\xfb\x0b\x38\x94\x4d\x20\x85\xc8\xda\x3a\x64\x31\x44\x6f" + "\x6c\x3b\x46\x25\x50\xd7\x7f\xdf\xee\x75\x72\x71\xf9\x61\x40" + "\x63\xfa\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xd1\xb5\x1d\x35" + "\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c" + "\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x00\xd3\xc9\x24\x3f\x2d\x2e\x64" + "\x93\xa8\x49\x29\x82\x75\xea\xbf\xe3\x53\x7f\x8e\x45\x16\xdb" + "\x5e\xc6\xdf\x39\xd2\xcb\xea\x62\xfb\x81\x03\x02\x00\x00\xa4" + "\x27\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46" + "\xab\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00" + "\xd5\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh6() + { + testcase("Thresh6"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim14Cond + // ** Rsa15Cond + // ** Ed16Cond + // ** prefix1 + // *** prefix2 + // **** prefix3 + // ***** preim4 + // ** prefix5 + // *** prefix6 + // **** prefix7 + // ***** preim8 + // ** thresh9 + // *** Preim11Cond + // *** Rsa12Cond + // *** Ed13Cond + // *** preim10 + + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "P3P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3Prefix = "P3"s; + auto const prefix3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3MaxMsgLength = 30; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim8Preimage = "I am root"s; + auto const preim8Msg = "P7P6P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix7Prefix = "P7"s; + auto const prefix7Msg = "P6P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix7MaxMsgLength = 30; + auto const prefix6Prefix = "P6"s; + auto const prefix6Msg = "P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6MaxMsgLength = 28; + auto const prefix5Prefix = "P5"s; + auto const prefix5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix5MaxMsgLength = 26; + auto const preim10Preimage = "I am root"s; + auto const preim10Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim11CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim11Cond{Type::preimageSha256, + 9, + Preim11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa12CondConditionFingerprint = { + {0x38, 0xb9, 0xf0, 0xeb, 0x68, 0x8b, 0x9f, 0x55, 0x37, 0x9a, 0xec, + 0x07, 0xd4, 0xa2, 0x13, 0xac, 0x34, 0xa1, 0x67, 0x31, 0x34, 0xea, + 0xc2, 0x2f, 0xef, 0x13, 0xe3, 0x5c, 0xcf, 0x8f, 0x90, 0x1e}}; + Condition const Rsa12Cond{Type::rsaSha256, + 65536, + Rsa12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed13CondConditionFingerprint = { + {0x7c, 0x54, 0x6a, 0x6d, 0x7f, 0x00, 0x52, 0x31, 0x03, 0xe7, 0xb4, + 0x5b, 0x1c, 0x9f, 0x72, 0xeb, 0x3c, 0x18, 0x08, 0xa3, 0x24, 0xb2, + 0x63, 0x5f, 0x77, 0x55, 0x4a, 0x42, 0xdb, 0x1e, 0xff, 0x1e}}; + Condition const Ed13Cond{Type::ed25519Sha256, + 131072, + Ed13CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim14CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim14Cond{Type::preimageSha256, + 9, + Preim14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa15CondConditionFingerprint = { + {0x55, 0x6b, 0x6d, 0xe3, 0x00, 0xd4, 0xf3, 0x7e, 0x75, 0x3a, 0x68, + 0xfc, 0x25, 0xdf, 0xf2, 0xf7, 0x18, 0x54, 0xa5, 0x55, 0x0c, 0xa5, + 0xa9, 0x65, 0xbf, 0x66, 0x9e, 0x4e, 0x49, 0x56, 0x1e, 0xf1}}; + Condition const Rsa15Cond{Type::rsaSha256, + 65536, + Rsa15CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed16CondConditionFingerprint = { + {0xe4, 0x66, 0x69, 0x86, 0x87, 0x57, 0x0e, 0xac, 0xf1, 0xfd, 0x06, + 0x81, 0x48, 0x90, 0x82, 0x42, 0x48, 0x50, 0x75, 0x8e, 0xd4, 0x2d, + 0xf3, 0x02, 0x37, 0x89, 0x28, 0xc5, 0x68, 0xd7, 0xa0, 0x11}}; + Condition const Ed16Cond{Type::ed25519Sha256, + 131072, + Ed16CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + auto prefix3 = std::make_unique( + makeSlice(prefix3Prefix), prefix3MaxMsgLength, std::move(preim4)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(prefix3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim8 = + std::make_unique(makeSlice(preim8Preimage)); + auto prefix7 = std::make_unique( + makeSlice(prefix7Prefix), prefix7MaxMsgLength, std::move(preim8)); + auto prefix6 = std::make_unique( + makeSlice(prefix6Prefix), prefix6MaxMsgLength, std::move(prefix7)); + auto prefix5 = std::make_unique( + makeSlice(prefix5Prefix), prefix5MaxMsgLength, std::move(prefix6)); + auto preim10 = + std::make_unique(makeSlice(preim10Preimage)); + std::vector> thresh9Subfulfillments; + thresh9Subfulfillments.emplace_back(std::move(preim10)); + std::vector thresh9Subconditions{ + {Preim11Cond, Rsa12Cond, Ed13Cond}}; + auto thresh9 = std::make_unique( + std::move(thresh9Subfulfillments), std::move(thresh9Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix5)); + thresh0Subfulfillments.emplace_back(std::move(thresh9)); + std::vector thresh0Subconditions{ + {Preim14Cond, Rsa15Cond, Ed16Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\x67\xa0\x81\xe9\xa1\x2c\x80\x02\x50\x31\x81\x01" + "\x1a\xa2\x23\xa1\x21\x80\x02\x50\x32\x81\x01\x1c\xa2\x18\xa1" + "\x16\x80\x02\x50\x33\x81\x01\x1e\xa2\x0d\xa0\x0b\x80\x09\x49" + "\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x2c\x80\x02\x50\x35\x81" + "\x01\x1a\xa2\x23\xa1\x21\x80\x02\x50\x36\x81\x01\x1c\xa2\x18" + "\xa1\x16\x80\x02\x50\x37\x81\x01\x1e\xa2\x0d\xa0\x0b\x80\x09" + "\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0" + "\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x38\xb9\xf0" + "\xeb\x68\x8b\x9f\x55\x37\x9a\xec\x07\xd4\xa2\x13\xac\x34\xa1" + "\x67\x31\x34\xea\xc2\x2f\xef\x13\xe3\x5c\xcf\x8f\x90\x1e\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x7c\x54\x6a\x6d\x7f\x00\x52" + "\x31\x03\xe7\xb4\x5b\x1c\x9f\x72\xeb\x3c\x18\x08\xa3\x24\xb2" + "\x63\x5f\x77\x55\x4a\x42\xdb\x1e\xff\x1e\x81\x03\x02\x00\x00" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\x55\x6b\x6d\xe3\x00\xd4\xf3\x7e\x75\x3a\x68\xfc\x25\xdf\xf2" + "\xf7\x18\x54\xa5\x55\x0c\xa5\xa9\x65\xbf\x66\x9e\x4e\x49\x56" + "\x1e\xf1\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xe4\x66\x69\x86" + "\x87\x57\x0e\xac\xf1\xfd\x06\x81\x48\x90\x82\x42\x48\x50\x75" + "\x8e\xd4\x2d\xf3\x02\x37\x89\x28\xc5\x68\xd7\xa0\x11\x81\x03" + "\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xcf\x49\xb8\x7b\x57\xd5\xe0\x2d\x87\xd3\xa2" + "\x4d\x1a\xc5\x09\xde\x93\x60\xce\xb7\x67\x8e\x62\xdd\x0a\xe5" + "\xdc\xbd\x99\xc1\x80\x6f\x81\x03\x05\x28\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x04\x80\x01\x03\xa1\x81\xfe\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2a\x80\x20\x79\xd6\xb7\x59\x71\x2d\x6e" + "\x8c\x36\x8a\xdb\x04\x59\xc9\xba\xee\xb5\x0e\xb3\x66\x88\xea" + "\xcf\x3f\x0a\x42\xcd\x76\xfb\x9a\x6d\x7c\x81\x02\x0c\x63\x82" + "\x02\x07\x80\xa1\x2a\x80\x20\xda\xb4\x67\x2a\xc7\xfd\xd3\x62" + "\x60\x13\x5a\xd4\x95\xda\xf4\xa1\xe4\xdc\xf9\x4b\x44\x3d\xf1" + "\x65\xf5\x6a\xbd\xe0\x5e\xcf\x5f\x01\x81\x02\x0c\x63\x82\x02" + "\x07\x80\xa2\x2b\x80\x20\xa2\x3a\x32\xd1\x76\xb4\x02\xa3\xcd" + "\x4f\x70\xa2\xd8\x41\xf5\x95\x9c\x3e\x1d\xb0\x9f\x4c\xc2\x43" + "\x5e\xc1\x8a\x06\x8c\x77\xf3\x7f\x81\x03\x02\x10\x00\x82\x02" + "\x03\x98\xa3\x27\x80\x20\x55\x6b\x6d\xe3\x00\xd4\xf3\x7e\x75" + "\x3a\x68\xfc\x25\xdf\xf2\xf7\x18\x54\xa5\x55\x0c\xa5\xa9\x65" + "\xbf\x66\x9e\x4e\x49\x56\x1e\xf1\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\xe4\x66\x69\x86\x87\x57\x0e\xac\xf1\xfd\x06\x81\x48" + "\x90\x82\x42\x48\x50\x75\x8e\xd4\x2d\xf3\x02\x37\x89\x28\xc5" + "\x68\xd7\xa0\x11\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh7() + { + testcase("Thresh7"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim8Cond + // ** Rsa9Cond + // ** Ed10Cond + // ** Prefix11Cond + // ** Thresh15Cond + // ** prefix1 + // *** prefix2 + // **** prefix3 + // ***** preim4 + // ** preim5 + // ** rsa6 + // ** ed7 + + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "P3P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3Prefix = "P3"s; + auto const prefix3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3MaxMsgLength = 30; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim5Preimage = "I am root"s; + auto const preim5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 0x40, 0xe4, 0x52, 0x30, + 0x42, 0x74, 0xfd, 0x35, 0x04, 0xde, 0x45, 0x68, 0xb3, 0x22, 0xdd, + 0xff, 0x41, 0x43, 0x69, 0x33, 0xc0, 0xff, 0x35, 0xb6, 0x6d, 0x15, + 0xe9, 0x54, 0x15, 0xeb, 0x1d, 0x07, 0xe2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df, 0x7b, 0x40, 0x5d, 0x21, 0x1e, 0xfe, 0x62, 0x58, 0xde, 0xfb, + 0x14, 0x91, 0x18, 0xf3, 0x4f, 0x9b, 0x36, 0x55, 0xcf, 0xb3, 0x5e, + 0xec, 0x4f, 0xcc, 0x6d, 0x13, 0x58, 0xc8, 0xa3, 0xa3, 0xee, 0x23, + 0x8a, 0xc2, 0xbf}}; + std::array const rsa6Sig{ + {0x37, 0x78, 0x52, 0x9e, 0xfb, 0xcc, 0x39, 0x78, 0x25, 0x3c, 0x62, + 0xba, 0xe7, 0x81, 0x03, 0xdb, 0x17, 0xdb, 0xd5, 0x98, 0xe6, 0xf3, + 0x84, 0xdd, 0x57, 0xc5, 0x3f, 0x8f, 0x8b, 0x98, 0x1d, 0xba, 0x37, + 0xca, 0x1b, 0xbe, 0x11, 0xf8, 0x71, 0x21, 0xee, 0xb8, 0x0b, 0xe8, + 0xd6, 0x4b, 0x78, 0x7b, 0x35, 0x38, 0xa6, 0x5a, 0xcd, 0xc5, 0x07, + 0x7b, 0x31, 0x03, 0x4d, 0x46, 0x79, 0x23, 0x2a, 0x16, 0xf5, 0x1e, + 0xe4, 0x1f, 0x79, 0x81, 0x44, 0xb3, 0x7d, 0x33, 0x55, 0x06, 0xae, + 0xce, 0x01, 0x21, 0x5e, 0x26, 0x05, 0x90, 0x64, 0x22, 0x14, 0xf3, + 0xc2, 0x7c, 0xed, 0xf2, 0xb9, 0x54, 0x8c, 0x6d, 0x28, 0xd6, 0xbc, + 0x40, 0xd0, 0x27, 0x64, 0xe2, 0x22, 0xba, 0xd4, 0xf0, 0x18, 0x59, + 0xc8, 0x56, 0x61, 0x89, 0x76, 0xf4, 0xbb, 0x4d, 0x1a, 0x5c, 0xa6, + 0x1e, 0x8c, 0x89, 0xa1, 0x18, 0x59, 0x22, 0xe1, 0x1c, 0x37, 0x2e, + 0xe4, 0xce, 0x63, 0x25, 0xd1, 0x64, 0x47, 0x23, 0xda, 0x24, 0xa7, + 0xe0, 0xbe, 0x06, 0x4f, 0xa8, 0x2a, 0x6b, 0xd0, 0xda, 0xcf, 0x45, + 0x29, 0x08, 0x13, 0x61, 0x32, 0xe0, 0x13, 0x07, 0xde, 0x32, 0xea, + 0x5e, 0x8d, 0x72, 0xd3, 0x20, 0x19, 0x21, 0x3a, 0xf0, 0x9b, 0x5e, + 0x4a, 0x59, 0x50, 0x3c, 0xa8, 0x89, 0x3d, 0x18, 0x49, 0xc2, 0x4f, + 0x0d, 0xfb, 0x9d, 0xb9, 0xbf, 0x97, 0xde, 0x9f, 0xb9, 0x99, 0xc7, + 0x84, 0x75, 0x52, 0xf3, 0xcc, 0x21, 0x7a, 0x10, 0xbe, 0xbb, 0xb6, + 0xe5, 0xc5, 0xc4, 0xba, 0x52, 0x53, 0xba, 0xc8, 0x0e, 0x89, 0x87, + 0x2c, 0x98, 0x24, 0x57, 0xb8, 0xaf, 0xd7, 0x95, 0x5b, 0xe2, 0x10, + 0x37, 0xaa, 0x39, 0x02, 0xa9, 0x03, 0xd4, 0x6b, 0x0d, 0x9d, 0xa1, + 0x77, 0x82, 0x94, 0xe8, 0x61, 0x57, 0x77, 0xf0, 0x5d, 0x35, 0x89, + 0x6a, 0xb6, 0xf1}}; + auto const ed7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed7PublicKey{ + {0x58, 0xcf, 0x4b, 0xc5, 0x59, 0xdb, 0xba, 0x62, 0x25, 0x14, 0x3a, + 0xc0, 0xad, 0xab, 0x5e, 0x35, 0xa1, 0xb4, 0x0e, 0xc1, 0xaf, 0x3c, + 0xa8, 0x2f, 0x69, 0x2c, 0xb6, 0x25, 0xd7, 0xea, 0x15, 0xb3}}; + std::array const ed7Sig{ + {0xd0, 0xd1, 0x17, 0xe2, 0xb5, 0x40, 0x14, 0x81, 0x0b, 0x12, 0xd8, + 0xbe, 0x1d, 0x1c, 0xb0, 0x88, 0x27, 0xaf, 0x6e, 0xc3, 0x13, 0x71, + 0xea, 0xac, 0xf3, 0xd8, 0x6f, 0x38, 0x21, 0xe2, 0x6d, 0x77, 0xe9, + 0xa6, 0xba, 0x03, 0x2a, 0xe3, 0x50, 0xcb, 0x38, 0xbe, 0x36, 0xba, + 0x62, 0x6e, 0x37, 0x5c, 0x8d, 0x69, 0x9f, 0xf0, 0x43, 0x64, 0x83, + 0x82, 0x8e, 0xbe, 0xf5, 0xa6, 0x96, 0x35, 0xb7, 0x03}}; + std::array const ed7SigningKey{ + {0x9c, 0x02, 0x4b, 0x5e, 0x6a, 0x83, 0x35, 0x8a, 0x2a, 0x71, 0x70, + 0x4e, 0xab, 0x74, 0x72, 0x22, 0x33, 0x5a, 0x82, 0xd9, 0x8e, 0x9c, + 0x8c, 0x41, 0x62, 0x6b, 0x02, 0x62, 0xbd, 0x59, 0x31, 0xcb}}; + (void)ed7SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix11CondConditionFingerprint = { + {0x40, 0x12, 0xc5, 0x21, 0x95, 0x7f, 0x57, 0xf7, 0xca, 0xb8, 0xed, + 0xc5, 0x36, 0xac, 0x18, 0x13, 0x75, 0xd6, 0xf5, 0x68, 0xef, 0x8b, + 0x57, 0xed, 0x06, 0xc0, 0x37, 0x94, 0x3d, 0xe6, 0x6e, 0x21}}; + Condition const Prefix11Cond{Type::prefixSha256, + 3144, + Prefix11CondConditionFingerprint, + std::bitset<5>{1}}; + std::array const Thresh15CondConditionFingerprint = { + {0xd1, 0x6d, 0xda, 0x96, 0x60, 0x90, 0x20, 0x59, 0x46, 0x02, 0x38, + 0x55, 0x20, 0xf4, 0x49, 0xcb, 0x2d, 0x28, 0x4a, 0x11, 0x09, 0x6d, + 0xe2, 0xbe, 0xd0, 0x67, 0x23, 0x7d, 0xeb, 0xb4, 0xf3, 0xc8}}; + Condition const Thresh15Cond{Type::thresholdSha256, + 135168, + Thresh15CondConditionFingerprint, + std::bitset<5>{25}}; + + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + auto prefix3 = std::make_unique( + makeSlice(prefix3Prefix), prefix3MaxMsgLength, std::move(preim4)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(prefix3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim5 = + std::make_unique(makeSlice(preim5Preimage)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + auto ed7 = std::make_unique(ed7PublicKey, ed7Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim5)); + thresh0Subfulfillments.emplace_back(std::move(rsa6)); + thresh0Subfulfillments.emplace_back(std::move(ed7)); + std::vector thresh0Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Prefix11Cond, Thresh15Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\x86\xa0\x82\x02\xad\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x2c\x80\x02\x50\x31\x81\x01\x1a" + "\xa2\x23\xa1\x21\x80\x02\x50\x32\x81\x01\x1c\xa2\x18\xa1\x16" + "\x80\x02\x50\x33\x81\x01\x1e\xa2\x0d\xa0\x0b\x80\x09\x49\x20" + "\x61\x6d\x20\x72\x6f\x6f\x74\xa3\x82\x02\x08\x80\x82\x01\x00" + "\xd0\x07\xfc\x9d\xb0\xa1\xa6\x40\xe4\x52\x30\x42\x74\xfd\x35" + "\x04\xde\x45\x68\xb3\x22\xdd\xff\x41\x43\x69\x33\xc0\xff\x35" + "\xb6\x6d\x15\xe9\x54\x15\xeb\x1d\x07\xe2\x25\x2b\xdb\xaa\x16" + "\x8d\x0d\x7f\x05\xf0\xd2\x7d\xb4\x9b\x51\x19\x20\x1e\x3d\xba" + "\x50\x9e\x51\x13\x81\x43\x55\x96\xca\xdb\x88\x1f\xef\x2d\x38" + "\x3f\xae\x8d\xac\xc8\x6f\x2b\xd5\xf0\x34\x1a\x99\x00\x7c\x6d" + "\xb3\x1b\x1d\x68\xdb\xf8\x1c\x59\x3a\x63\x38\x7c\x1c\x14\xbc" + "\x22\xcf\xc8\x9a\xc6\x96\x6f\x3d\x03\x0b\x61\x6b\x7d\x75\x97" + "\xe8\x25\xb8\x2f\xfa\xf4\x07\x44\xdf\x00\x3d\xff\x0d\xd5\x7f" + "\x7f\xf3\x0c\x13\xac\x8d\xf8\x8c\x79\xc5\xf3\x29\xdc\x23\x65" + "\xd3\xd1\x1c\xa6\x14\x78\x6a\x1a\xe3\x15\x8d\x8b\xdc\xa0\x5a" + "\xc7\x82\xb0\x03\x6c\x71\x43\x59\x24\xc7\x50\x64\xb2\xa7\x69" + "\xf5\xbd\xe6\x5e\xaa\x77\x59\x60\x36\xc0\xe3\x42\x7f\x05\x3b" + "\x4c\x02\x0e\x70\x5a\x70\xc5\x2a\xeb\x94\x4d\x15\x09\xef\xbb" + "\x58\x42\x68\x05\x59\x70\xa0\x17\xb2\x8e\xdf\x7b\x40\x5d\x21" + "\x1e\xfe\x62\x58\xde\xfb\x14\x91\x18\xf3\x4f\x9b\x36\x55\xcf" + "\xb3\x5e\xec\x4f\xcc\x6d\x13\x58\xc8\xa3\xa3\xee\x23\x8a\xc2" + "\xbf\x81\x82\x01\x00\x37\x78\x52\x9e\xfb\xcc\x39\x78\x25\x3c" + "\x62\xba\xe7\x81\x03\xdb\x17\xdb\xd5\x98\xe6\xf3\x84\xdd\x57" + "\xc5\x3f\x8f\x8b\x98\x1d\xba\x37\xca\x1b\xbe\x11\xf8\x71\x21" + "\xee\xb8\x0b\xe8\xd6\x4b\x78\x7b\x35\x38\xa6\x5a\xcd\xc5\x07" + "\x7b\x31\x03\x4d\x46\x79\x23\x2a\x16\xf5\x1e\xe4\x1f\x79\x81" + "\x44\xb3\x7d\x33\x55\x06\xae\xce\x01\x21\x5e\x26\x05\x90\x64" + "\x22\x14\xf3\xc2\x7c\xed\xf2\xb9\x54\x8c\x6d\x28\xd6\xbc\x40" + "\xd0\x27\x64\xe2\x22\xba\xd4\xf0\x18\x59\xc8\x56\x61\x89\x76" + "\xf4\xbb\x4d\x1a\x5c\xa6\x1e\x8c\x89\xa1\x18\x59\x22\xe1\x1c" + "\x37\x2e\xe4\xce\x63\x25\xd1\x64\x47\x23\xda\x24\xa7\xe0\xbe" + "\x06\x4f\xa8\x2a\x6b\xd0\xda\xcf\x45\x29\x08\x13\x61\x32\xe0" + "\x13\x07\xde\x32\xea\x5e\x8d\x72\xd3\x20\x19\x21\x3a\xf0\x9b" + "\x5e\x4a\x59\x50\x3c\xa8\x89\x3d\x18\x49\xc2\x4f\x0d\xfb\x9d" + "\xb9\xbf\x97\xde\x9f\xb9\x99\xc7\x84\x75\x52\xf3\xcc\x21\x7a" + "\x10\xbe\xbb\xb6\xe5\xc5\xc4\xba\x52\x53\xba\xc8\x0e\x89\x87" + "\x2c\x98\x24\x57\xb8\xaf\xd7\x95\x5b\xe2\x10\x37\xaa\x39\x02" + "\xa9\x03\xd4\x6b\x0d\x9d\xa1\x77\x82\x94\xe8\x61\x57\x77\xf0" + "\x5d\x35\x89\x6a\xb6\xf1\xa4\x64\x80\x20\x58\xcf\x4b\xc5\x59" + "\xdb\xba\x62\x25\x14\x3a\xc0\xad\xab\x5e\x35\xa1\xb4\x0e\xc1" + "\xaf\x3c\xa8\x2f\x69\x2c\xb6\x25\xd7\xea\x15\xb3\x81\x40\xd0" + "\xd1\x17\xe2\xb5\x40\x14\x81\x0b\x12\xd8\xbe\x1d\x1c\xb0\x88" + "\x27\xaf\x6e\xc3\x13\x71\xea\xac\xf3\xd8\x6f\x38\x21\xe2\x6d" + "\x77\xe9\xa6\xba\x03\x2a\xe3\x50\xcb\x38\xbe\x36\xba\x62\x6e" + "\x37\x5c\x8d\x69\x9f\xf0\x43\x64\x83\x82\x8e\xbe\xf5\xa6\x96" + "\x35\xb7\x03\xa1\x81\xd2\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa1\x2a\x80\x20\x40\x12\xc5\x21\x95\x7f\x57\xf7\xca\xb8\xed" + "\xc5\x36\xac\x18\x13\x75\xd6\xf5\x68\xef\x8b\x57\xed\x06\xc0" + "\x37\x94\x3d\xe6\x6e\x21\x81\x02\x0c\x48\x82\x02\x07\x80\xa2" + "\x2b\x80\x20\xd1\x6d\xda\x96\x60\x90\x20\x59\x46\x02\x38\x55" + "\x20\xf4\x49\xcb\x2d\x28\x4a\x11\x09\x6d\xe2\xbe\xd0\x67\x23" + "\x7d\xeb\xb4\xf3\xc8\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88" + "\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb" + "\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00" + "\x8b\xe6\x62\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16" + "\xda\x09\xbe\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62" + "\xfa\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x65\xe0\x41\xaf\x80\x12\x71\xd2\x32\x0b\x48" + "\x3f\xf2\xe2\x54\x1d\xb4\x3d\x2c\x58\x92\xae\x04\xaf\x0f\x41" + "\x63\x84\x80\x06\x98\x2e\x81\x03\x07\x34\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x7e\x80\x01\x04\xa1\x82\x01\x77\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2a\x80\x20\x40\x12\xc5\x21\x95\x7f\x57\xf7\xca\xb8\xed\xc5" + "\x36\xac\x18\x13\x75\xd6\xf5\x68\xef\x8b\x57\xed\x06\xc0\x37" + "\x94\x3d\xe6\x6e\x21\x81\x02\x0c\x48\x82\x02\x07\x80\xa1\x2a" + "\x80\x20\xda\xb4\x67\x2a\xc7\xfd\xd3\x62\x60\x13\x5a\xd4\x95" + "\xda\xf4\xa1\xe4\xdc\xf9\x4b\x44\x3d\xf1\x65\xf5\x6a\xbd\xe0" + "\x5e\xcf\x5f\x01\x81\x02\x0c\x63\x82\x02\x07\x80\xa2\x2b\x80" + "\x20\xd1\x6d\xda\x96\x60\x90\x20\x59\x46\x02\x38\x55\x20\xf4" + "\x49\xcb\x2d\x28\x4a\x11\x09\x6d\xe2\xbe\xd0\x67\x23\x7d\xeb" + "\xb4\xf3\xc8\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80" + "\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70" + "\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f" + "\xc7\xe4\x52\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xee\x75\xbe" + "\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c\x70\x85" + "\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2\xa0\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4\x30\x65" + "\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79\x5f\x41" + "\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02\x00\x00" + "\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0" + "\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0\x1a\xd4" + "\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh8() + { + testcase("Thresh8"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim19Cond + // ** Rsa20Cond + // ** Ed21Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** preim4 + // ** prefix5 + // *** prefix6 + // **** thresh7 + // ***** preim8 + // ** thresh9 + // *** Preim16Cond + // *** Rsa17Cond + // *** Ed18Cond + // *** preim10 + // *** thresh11 + // **** Preim13Cond + // **** Rsa14Cond + // **** Ed15Cond + // **** preim12 + + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim8Preimage = "I am root"s; + auto const preim8Msg = "P6P5abcdefghijklmnopqrstuvwxyz"s; + auto const thresh7Msg = "P6P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6Prefix = "P6"s; + auto const prefix6Msg = "P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6MaxMsgLength = 28; + auto const prefix5Prefix = "P5"s; + auto const prefix5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix5MaxMsgLength = 26; + auto const preim10Preimage = "I am root"s; + auto const preim10Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim12Preimage = "I am root"s; + auto const preim12Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh11Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim13CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim13Cond{Type::preimageSha256, + 9, + Preim13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa14CondConditionFingerprint = { + {0x32, 0xec, 0xaa, 0x5e, 0xa6, 0x88, 0xdc, 0xe4, 0x81, 0x0f, 0x93, + 0x0f, 0x65, 0xde, 0x87, 0xfd, 0x54, 0x8c, 0x79, 0x04, 0x81, 0xe3, + 0x63, 0x3f, 0x3d, 0x08, 0xa1, 0xba, 0x0a, 0x24, 0x2b, 0x46}}; + Condition const Rsa14Cond{Type::rsaSha256, + 65536, + Rsa14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed15CondConditionFingerprint = { + {0x40, 0xd1, 0x9a, 0x63, 0x62, 0x9b, 0xc0, 0x76, 0xab, 0x11, 0x73, + 0x42, 0x86, 0xb3, 0x20, 0x9d, 0x23, 0xe8, 0x5e, 0xee, 0xb9, 0x82, + 0x5d, 0x93, 0xe3, 0xac, 0xad, 0xa0, 0x40, 0x41, 0x51, 0x1b}}; + Condition const Ed15Cond{Type::ed25519Sha256, + 131072, + Ed15CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim16CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim16Cond{Type::preimageSha256, + 9, + Preim16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa17CondConditionFingerprint = { + {0x78, 0xe3, 0x04, 0xf4, 0xa6, 0x16, 0x68, 0x4c, 0x1b, 0xcf, 0x3a, + 0x32, 0xff, 0xbc, 0x75, 0x1a, 0xe6, 0x08, 0x9b, 0xff, 0xba, 0x79, + 0xf4, 0x39, 0x7a, 0xfc, 0xe1, 0x6f, 0xff, 0x3e, 0xb3, 0x75}}; + Condition const Rsa17Cond{Type::rsaSha256, + 65536, + Rsa17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed18CondConditionFingerprint = { + {0x0d, 0xea, 0xc5, 0x16, 0x5c, 0x62, 0xb8, 0xd1, 0xa4, 0xe7, 0x5a, + 0x07, 0x58, 0x00, 0x79, 0x51, 0x88, 0x21, 0xe9, 0x4d, 0xba, 0x73, + 0x7b, 0xad, 0x60, 0x9c, 0x5c, 0x26, 0x00, 0x2e, 0xd1, 0x51}}; + Condition const Ed18Cond{Type::ed25519Sha256, + 131072, + Ed18CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + std::vector thresh3Subconditions{}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim8 = + std::make_unique(makeSlice(preim8Preimage)); + std::vector> thresh7Subfulfillments; + thresh7Subfulfillments.emplace_back(std::move(preim8)); + std::vector thresh7Subconditions{}; + auto thresh7 = std::make_unique( + std::move(thresh7Subfulfillments), std::move(thresh7Subconditions)); + auto prefix6 = std::make_unique( + makeSlice(prefix6Prefix), prefix6MaxMsgLength, std::move(thresh7)); + auto prefix5 = std::make_unique( + makeSlice(prefix5Prefix), prefix5MaxMsgLength, std::move(prefix6)); + auto preim10 = + std::make_unique(makeSlice(preim10Preimage)); + auto preim12 = + std::make_unique(makeSlice(preim12Preimage)); + std::vector> thresh11Subfulfillments; + thresh11Subfulfillments.emplace_back(std::move(preim12)); + std::vector thresh11Subconditions{ + {Preim13Cond, Rsa14Cond, Ed15Cond}}; + auto thresh11 = std::make_unique( + std::move(thresh11Subfulfillments), + std::move(thresh11Subconditions)); + std::vector> thresh9Subfulfillments; + thresh9Subfulfillments.emplace_back(std::move(preim10)); + thresh9Subfulfillments.emplace_back(std::move(thresh11)); + std::vector thresh9Subconditions{ + {Preim16Cond, Rsa17Cond, Ed18Cond}}; + auto thresh9 = std::make_unique( + std::move(thresh9Subfulfillments), std::move(thresh9Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix5)); + thresh0Subfulfillments.emplace_back(std::move(thresh9)); + std::vector thresh0Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\xed\xa0\x82\x01\x6e\xa1\x27\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x1e\xa1\x1c\x80\x02\x50\x32\x81\x01\x1c\xa2\x13" + "\xa2\x11\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f" + "\x6f\x74\xa1\x00\xa1\x27\x80\x02\x50\x35\x81\x01\x1a\xa2\x1e" + "\xa1\x1c\x80\x02\x50\x36\x81\x01\x1c\xa2\x13\xa2\x11\xa0\x0d" + "\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x00" + "\xa2\x82\x01\x18\xa0\x81\x9a\xa0\x0b\x80\x09\x49\x20\x61\x6d" + "\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49" + "\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\x32\xec\xaa\x5e\xa6\x88\xdc" + "\xe4\x81\x0f\x93\x0f\x65\xde\x87\xfd\x54\x8c\x79\x04\x81\xe3" + "\x63\x3f\x3d\x08\xa1\xba\x0a\x24\x2b\x46\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x40\xd1\x9a\x63\x62\x9b\xc0\x76\xab\x11\x73" + "\x42\x86\xb3\x20\x9d\x23\xe8\x5e\xee\xb9\x82\x5d\x93\xe3\xac" + "\xad\xa0\x40\x41\x51\x1b\x81\x03\x02\x00\x00\xa1\x79\xa0\x25" + "\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54" + "\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee" + "\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x78\xe3\x04\xf4" + "\xa6\x16\x68\x4c\x1b\xcf\x3a\x32\xff\xbc\x75\x1a\xe6\x08\x9b" + "\xff\xba\x79\xf4\x39\x7a\xfc\xe1\x6f\xff\x3e\xb3\x75\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c\x62\xb8\xd1" + "\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d\xba\x73\x7b" + "\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02\x00\x00\xa1" + "\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x8d" + "\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57\xca\xf4\x9d\x63" + "\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9\xc6\xa3\xf1\x33" + "\xfd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x95\x3c\x86\x65\x91" + "\x76\x69\x6b\x72\x61\xaa\x76\x15\x2a\xd7\x25\x4f\x32\xb7\x73" + "\x7a\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81\x03\x02" + "\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x3e\x3a\x1b\x9b\x7c\x93\xbd\xe8\xbb\xf6\xb8" + "\xc6\xff\x5b\xc8\xab\xf0\xe6\xec\x96\x04\x19\x9e\x3a\x3a\x43" + "\xba\x2a\xc1\x35\x8a\x3f\x81\x03\x07\x3c\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x04\x80\x01\x03\xa1\x81\xfe\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2a\x80\x20\x8e\x06\xb8\x28\x91\x04\x58" + "\xa3\x4a\xff\xae\x32\xd8\xc4\x38\x55\x4f\x5b\x62\x95\x7c\x46" + "\x2f\x61\xb6\x38\x32\x1e\xc0\x99\x9a\x60\x81\x02\x0c\x43\x82" + "\x02\x05\xa0\xa1\x2a\x80\x20\xd4\xd4\x02\x10\xa1\xc2\xb4\x42" + "\x60\xf3\xc3\x0b\x05\x74\xef\xc3\x06\xf6\x78\xf2\x9d\x1d\x9c" + "\xff\xbf\xdf\x52\xa3\x5a\x57\xac\xd0\x81\x02\x0c\x43\x82\x02" + "\x05\xa0\xa2\x2b\x80\x20\xff\xf0\xa1\xa3\xc8\x5e\x3f\x37\x30" + "\xe5\x02\x04\xfa\xa3\x6a\x6f\xf0\x9a\xc8\xc5\x4c\xb5\x17\xb0" + "\x72\xa2\x59\xe5\xb7\x3a\xee\xc8\x81\x03\x04\x24\x00\x82\x02" + "\x03\x98\xa3\x27\x80\x20\x8d\xb0\x2c\xb1\x28\xc3\xf4\x97\x50" + "\x84\x64\x57\xca\xf4\x9d\x63\x08\x73\xfc\xde\x2f\x90\xf0\xf2" + "\xec\x79\xa9\xc6\xa3\xf1\x33\xfd\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x95\x3c\x86\x65\x91\x76\x69\x6b\x72\x61\xaa\x76\x15" + "\x2a\xd7\x25\x4f\x32\xb7\x73\x7a\xb2\x49\x0c\x0b\xdf\xb5\x4e" + "\x4a\x8b\xf7\x65\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh9() + { + testcase("Thresh9"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim8Cond + // ** Rsa9Cond + // ** Ed10Cond + // ** Prefix11Cond + // ** Thresh15Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** preim4 + // ** preim5 + // ** rsa6 + // ** ed7 + + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim5Preimage = "I am root"s; + auto const preim5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 0x40, 0xe4, 0x52, 0x30, + 0x42, 0x74, 0xfd, 0x35, 0x04, 0xde, 0x45, 0x68, 0xb3, 0x22, 0xdd, + 0xff, 0x41, 0x43, 0x69, 0x33, 0xc0, 0xff, 0x35, 0xb6, 0x6d, 0x15, + 0xe9, 0x54, 0x15, 0xeb, 0x1d, 0x07, 0xe2, 0x25, 0x2b, 0xdb, 0xaa, + 0x16, 0x8d, 0x0d, 0x7f, 0x05, 0xf0, 0xd2, 0x7d, 0xb4, 0x9b, 0x51, + 0x19, 0x20, 0x1e, 0x3d, 0xba, 0x50, 0x9e, 0x51, 0x13, 0x81, 0x43, + 0x55, 0x96, 0xca, 0xdb, 0x88, 0x1f, 0xef, 0x2d, 0x38, 0x3f, 0xae, + 0x8d, 0xac, 0xc8, 0x6f, 0x2b, 0xd5, 0xf0, 0x34, 0x1a, 0x99, 0x00, + 0x7c, 0x6d, 0xb3, 0x1b, 0x1d, 0x68, 0xdb, 0xf8, 0x1c, 0x59, 0x3a, + 0x63, 0x38, 0x7c, 0x1c, 0x14, 0xbc, 0x22, 0xcf, 0xc8, 0x9a, 0xc6, + 0x96, 0x6f, 0x3d, 0x03, 0x0b, 0x61, 0x6b, 0x7d, 0x75, 0x97, 0xe8, + 0x25, 0xb8, 0x2f, 0xfa, 0xf4, 0x07, 0x44, 0xdf, 0x00, 0x3d, 0xff, + 0x0d, 0xd5, 0x7f, 0x7f, 0xf3, 0x0c, 0x13, 0xac, 0x8d, 0xf8, 0x8c, + 0x79, 0xc5, 0xf3, 0x29, 0xdc, 0x23, 0x65, 0xd3, 0xd1, 0x1c, 0xa6, + 0x14, 0x78, 0x6a, 0x1a, 0xe3, 0x15, 0x8d, 0x8b, 0xdc, 0xa0, 0x5a, + 0xc7, 0x82, 0xb0, 0x03, 0x6c, 0x71, 0x43, 0x59, 0x24, 0xc7, 0x50, + 0x64, 0xb2, 0xa7, 0x69, 0xf5, 0xbd, 0xe6, 0x5e, 0xaa, 0x77, 0x59, + 0x60, 0x36, 0xc0, 0xe3, 0x42, 0x7f, 0x05, 0x3b, 0x4c, 0x02, 0x0e, + 0x70, 0x5a, 0x70, 0xc5, 0x2a, 0xeb, 0x94, 0x4d, 0x15, 0x09, 0xef, + 0xbb, 0x58, 0x42, 0x68, 0x05, 0x59, 0x70, 0xa0, 0x17, 0xb2, 0x8e, + 0xdf, 0x7b, 0x40, 0x5d, 0x21, 0x1e, 0xfe, 0x62, 0x58, 0xde, 0xfb, + 0x14, 0x91, 0x18, 0xf3, 0x4f, 0x9b, 0x36, 0x55, 0xcf, 0xb3, 0x5e, + 0xec, 0x4f, 0xcc, 0x6d, 0x13, 0x58, 0xc8, 0xa3, 0xa3, 0xee, 0x23, + 0x8a, 0xc2, 0xbf}}; + std::array const rsa6Sig{ + {0x06, 0x55, 0x74, 0x66, 0x60, 0x8c, 0xc6, 0xcb, 0x41, 0x11, 0x5e, + 0xb0, 0x76, 0x98, 0x69, 0xaf, 0xe6, 0x40, 0x5f, 0x4c, 0x9c, 0xd3, + 0x74, 0xd3, 0x79, 0x0f, 0x23, 0x7a, 0x9c, 0xfc, 0x3f, 0x6f, 0x5d, + 0x19, 0xbd, 0xde, 0x7a, 0x01, 0xff, 0x49, 0xef, 0x60, 0x7d, 0x58, + 0x5e, 0x57, 0x44, 0x27, 0x99, 0x4e, 0xef, 0x9c, 0xec, 0x95, 0xd7, + 0x6d, 0x1b, 0x1e, 0x5f, 0xbb, 0x78, 0xe3, 0xf3, 0xb6, 0xe9, 0xd6, + 0xe1, 0x51, 0x11, 0xa8, 0x9c, 0xb5, 0x6e, 0x4f, 0x6b, 0x95, 0xde, + 0xd1, 0x7e, 0xd4, 0xcc, 0x8e, 0x91, 0xc8, 0xe5, 0xe4, 0xb9, 0x0e, + 0x41, 0x3d, 0x69, 0xc5, 0xc3, 0x15, 0x77, 0x16, 0xdf, 0x16, 0x83, + 0x7b, 0x53, 0xcb, 0xbf, 0x57, 0x4a, 0x57, 0xfc, 0xde, 0x97, 0xd5, + 0x58, 0x7c, 0x9f, 0xeb, 0xf2, 0xcb, 0x73, 0xa7, 0x85, 0x00, 0x3b, + 0xc5, 0x5d, 0x4f, 0x3e, 0x1e, 0x7e, 0xf4, 0x29, 0xbf, 0xda, 0x15, + 0x90, 0x80, 0x1d, 0x1b, 0x22, 0x25, 0x4e, 0x93, 0xc2, 0x22, 0xd6, + 0xa5, 0x75, 0xd6, 0x90, 0x6d, 0x88, 0x47, 0x99, 0x64, 0xe7, 0x93, + 0x25, 0xd7, 0xab, 0xab, 0xbb, 0x93, 0x1b, 0xa6, 0x72, 0x7e, 0x87, + 0xe0, 0x41, 0x20, 0x36, 0x36, 0x83, 0x4c, 0x31, 0xfb, 0xff, 0xb2, + 0x78, 0x5d, 0xfb, 0xff, 0xc2, 0x0d, 0x59, 0xbe, 0x50, 0x94, 0x55, + 0x25, 0x2b, 0x3f, 0x2e, 0x87, 0x4b, 0x77, 0x88, 0xd6, 0xf1, 0x1b, + 0x6a, 0x7b, 0x1d, 0x22, 0x1a, 0x8e, 0xc4, 0x29, 0x8e, 0xbe, 0xdc, + 0x6a, 0x00, 0x76, 0x1c, 0x0c, 0x0b, 0xa7, 0xbf, 0x9a, 0xf4, 0x97, + 0x06, 0x3b, 0x89, 0xd7, 0xd9, 0x01, 0x02, 0xb6, 0x82, 0x63, 0x1e, + 0xa9, 0x44, 0xc1, 0xd3, 0xcb, 0x05, 0xcb, 0xde, 0x97, 0xa2, 0xd3, + 0x76, 0x88, 0xd9, 0xae, 0x45, 0x5a, 0xf6, 0xd4, 0x76, 0xfb, 0x98, + 0x88, 0xeb, 0x8c}}; + auto const ed7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed7PublicKey{ + {0x58, 0xcf, 0x4b, 0xc5, 0x59, 0xdb, 0xba, 0x62, 0x25, 0x14, 0x3a, + 0xc0, 0xad, 0xab, 0x5e, 0x35, 0xa1, 0xb4, 0x0e, 0xc1, 0xaf, 0x3c, + 0xa8, 0x2f, 0x69, 0x2c, 0xb6, 0x25, 0xd7, 0xea, 0x15, 0xb3}}; + std::array const ed7Sig{ + {0xd0, 0xd1, 0x17, 0xe2, 0xb5, 0x40, 0x14, 0x81, 0x0b, 0x12, 0xd8, + 0xbe, 0x1d, 0x1c, 0xb0, 0x88, 0x27, 0xaf, 0x6e, 0xc3, 0x13, 0x71, + 0xea, 0xac, 0xf3, 0xd8, 0x6f, 0x38, 0x21, 0xe2, 0x6d, 0x77, 0xe9, + 0xa6, 0xba, 0x03, 0x2a, 0xe3, 0x50, 0xcb, 0x38, 0xbe, 0x36, 0xba, + 0x62, 0x6e, 0x37, 0x5c, 0x8d, 0x69, 0x9f, 0xf0, 0x43, 0x64, 0x83, + 0x82, 0x8e, 0xbe, 0xf5, 0xa6, 0x96, 0x35, 0xb7, 0x03}}; + std::array const ed7SigningKey{ + {0x9c, 0x02, 0x4b, 0x5e, 0x6a, 0x83, 0x35, 0x8a, 0x2a, 0x71, 0x70, + 0x4e, 0xab, 0x74, 0x72, 0x22, 0x33, 0x5a, 0x82, 0xd9, 0x8e, 0x9c, + 0x8c, 0x41, 0x62, 0x6b, 0x02, 0x62, 0xbd, 0x59, 0x31, 0xcb}}; + (void)ed7SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix11CondConditionFingerprint = { + {0x9e, 0x6e, 0xab, 0xa1, 0x2f, 0xa0, 0x27, 0xf8, 0x19, 0xa9, 0xf3, + 0x0a, 0x12, 0xef, 0x47, 0xce, 0x16, 0xd7, 0xd3, 0x05, 0x02, 0x92, + 0x99, 0x9d, 0xdd, 0x70, 0x09, 0x3c, 0xaa, 0x45, 0x85, 0xda}}; + Condition const Prefix11Cond{Type::prefixSha256, + 3116, + Prefix11CondConditionFingerprint, + std::bitset<5>{5}}; + std::array const Thresh15CondConditionFingerprint = { + {0x38, 0xa3, 0x03, 0x53, 0x35, 0x19, 0x29, 0x19, 0xc3, 0x92, 0xbb, + 0x76, 0xbe, 0xde, 0x2c, 0x5d, 0xb4, 0x33, 0xe9, 0x8b, 0xcd, 0xf1, + 0x80, 0xf9, 0xd6, 0x84, 0x2a, 0xcc, 0x45, 0x7e, 0x74, 0x99}}; + Condition const Thresh15Cond{Type::thresholdSha256, + 271360, + Thresh15CondConditionFingerprint, + std::bitset<5>{25}}; + + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + std::vector thresh3Subconditions{}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim5 = + std::make_unique(makeSlice(preim5Preimage)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + auto ed7 = std::make_unique(ed7PublicKey, ed7Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim5)); + thresh0Subfulfillments.emplace_back(std::move(rsa6)); + thresh0Subfulfillments.emplace_back(std::move(ed7)); + std::vector thresh0Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Prefix11Cond, Thresh15Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\x81\xa0\x82\x02\xa8\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x27\x80\x02\x50\x31\x81\x01\x1a" + "\xa2\x1e\xa1\x1c\x80\x02\x50\x32\x81\x01\x1c\xa2\x13\xa2\x11" + "\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74" + "\xa1\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xd0\x07\xfc\x9d\xb0" + "\xa1\xa6\x40\xe4\x52\x30\x42\x74\xfd\x35\x04\xde\x45\x68\xb3" + "\x22\xdd\xff\x41\x43\x69\x33\xc0\xff\x35\xb6\x6d\x15\xe9\x54" + "\x15\xeb\x1d\x07\xe2\x25\x2b\xdb\xaa\x16\x8d\x0d\x7f\x05\xf0" + "\xd2\x7d\xb4\x9b\x51\x19\x20\x1e\x3d\xba\x50\x9e\x51\x13\x81" + "\x43\x55\x96\xca\xdb\x88\x1f\xef\x2d\x38\x3f\xae\x8d\xac\xc8" + "\x6f\x2b\xd5\xf0\x34\x1a\x99\x00\x7c\x6d\xb3\x1b\x1d\x68\xdb" + "\xf8\x1c\x59\x3a\x63\x38\x7c\x1c\x14\xbc\x22\xcf\xc8\x9a\xc6" + "\x96\x6f\x3d\x03\x0b\x61\x6b\x7d\x75\x97\xe8\x25\xb8\x2f\xfa" + "\xf4\x07\x44\xdf\x00\x3d\xff\x0d\xd5\x7f\x7f\xf3\x0c\x13\xac" + "\x8d\xf8\x8c\x79\xc5\xf3\x29\xdc\x23\x65\xd3\xd1\x1c\xa6\x14" + "\x78\x6a\x1a\xe3\x15\x8d\x8b\xdc\xa0\x5a\xc7\x82\xb0\x03\x6c" + "\x71\x43\x59\x24\xc7\x50\x64\xb2\xa7\x69\xf5\xbd\xe6\x5e\xaa" + "\x77\x59\x60\x36\xc0\xe3\x42\x7f\x05\x3b\x4c\x02\x0e\x70\x5a" + "\x70\xc5\x2a\xeb\x94\x4d\x15\x09\xef\xbb\x58\x42\x68\x05\x59" + "\x70\xa0\x17\xb2\x8e\xdf\x7b\x40\x5d\x21\x1e\xfe\x62\x58\xde" + "\xfb\x14\x91\x18\xf3\x4f\x9b\x36\x55\xcf\xb3\x5e\xec\x4f\xcc" + "\x6d\x13\x58\xc8\xa3\xa3\xee\x23\x8a\xc2\xbf\x81\x82\x01\x00" + "\x06\x55\x74\x66\x60\x8c\xc6\xcb\x41\x11\x5e\xb0\x76\x98\x69" + "\xaf\xe6\x40\x5f\x4c\x9c\xd3\x74\xd3\x79\x0f\x23\x7a\x9c\xfc" + "\x3f\x6f\x5d\x19\xbd\xde\x7a\x01\xff\x49\xef\x60\x7d\x58\x5e" + "\x57\x44\x27\x99\x4e\xef\x9c\xec\x95\xd7\x6d\x1b\x1e\x5f\xbb" + "\x78\xe3\xf3\xb6\xe9\xd6\xe1\x51\x11\xa8\x9c\xb5\x6e\x4f\x6b" + "\x95\xde\xd1\x7e\xd4\xcc\x8e\x91\xc8\xe5\xe4\xb9\x0e\x41\x3d" + "\x69\xc5\xc3\x15\x77\x16\xdf\x16\x83\x7b\x53\xcb\xbf\x57\x4a" + "\x57\xfc\xde\x97\xd5\x58\x7c\x9f\xeb\xf2\xcb\x73\xa7\x85\x00" + "\x3b\xc5\x5d\x4f\x3e\x1e\x7e\xf4\x29\xbf\xda\x15\x90\x80\x1d" + "\x1b\x22\x25\x4e\x93\xc2\x22\xd6\xa5\x75\xd6\x90\x6d\x88\x47" + "\x99\x64\xe7\x93\x25\xd7\xab\xab\xbb\x93\x1b\xa6\x72\x7e\x87" + "\xe0\x41\x20\x36\x36\x83\x4c\x31\xfb\xff\xb2\x78\x5d\xfb\xff" + "\xc2\x0d\x59\xbe\x50\x94\x55\x25\x2b\x3f\x2e\x87\x4b\x77\x88" + "\xd6\xf1\x1b\x6a\x7b\x1d\x22\x1a\x8e\xc4\x29\x8e\xbe\xdc\x6a" + "\x00\x76\x1c\x0c\x0b\xa7\xbf\x9a\xf4\x97\x06\x3b\x89\xd7\xd9" + "\x01\x02\xb6\x82\x63\x1e\xa9\x44\xc1\xd3\xcb\x05\xcb\xde\x97" + "\xa2\xd3\x76\x88\xd9\xae\x45\x5a\xf6\xd4\x76\xfb\x98\x88\xeb" + "\x8c\xa4\x64\x80\x20\x58\xcf\x4b\xc5\x59\xdb\xba\x62\x25\x14" + "\x3a\xc0\xad\xab\x5e\x35\xa1\xb4\x0e\xc1\xaf\x3c\xa8\x2f\x69" + "\x2c\xb6\x25\xd7\xea\x15\xb3\x81\x40\xd0\xd1\x17\xe2\xb5\x40" + "\x14\x81\x0b\x12\xd8\xbe\x1d\x1c\xb0\x88\x27\xaf\x6e\xc3\x13" + "\x71\xea\xac\xf3\xd8\x6f\x38\x21\xe2\x6d\x77\xe9\xa6\xba\x03" + "\x2a\xe3\x50\xcb\x38\xbe\x36\xba\x62\x6e\x37\x5c\x8d\x69\x9f" + "\xf0\x43\x64\x83\x82\x8e\xbe\xf5\xa6\x96\x35\xb7\x03\xa1\x81" + "\xd2\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2a\x80\x20\x9e" + "\x6e\xab\xa1\x2f\xa0\x27\xf8\x19\xa9\xf3\x0a\x12\xef\x47\xce" + "\x16\xd7\xd3\x05\x02\x92\x99\x9d\xdd\x70\x09\x3c\xaa\x45\x85" + "\xda\x81\x02\x0c\x2c\x82\x02\x05\xa0\xa2\x2b\x80\x20\x38\xa3" + "\x03\x53\x35\x19\x29\x19\xc3\x92\xbb\x76\xbe\xde\x2c\x5d\xb4" + "\x33\xe9\x8b\xcd\xf1\x80\xf9\xd6\x84\x2a\xcc\x45\x7e\x74\x99" + "\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xe5\x15" + "\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70\x64\x51\xeb" + "\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7\xe4\x52" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4\x30" + "\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79\x5f" + "\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02\x00" + "\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x17\x6b\xa2\x0a\x39\x89\xd9\xf6\x21\x3d\x11" + "\xf8\xe0\x8c\x85\x29\x69\x75\x96\xae\x95\x74\x3a\xef\xc3\xae" + "\xd7\x60\x82\x22\xe6\x28\x81\x03\x09\x48\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x7e\x80\x01\x04\xa1\x82\x01\x77\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2a\x80\x20\x8e\x06\xb8\x28\x91\x04\x58\xa3\x4a\xff\xae\x32" + "\xd8\xc4\x38\x55\x4f\x5b\x62\x95\x7c\x46\x2f\x61\xb6\x38\x32" + "\x1e\xc0\x99\x9a\x60\x81\x02\x0c\x43\x82\x02\x05\xa0\xa1\x2a" + "\x80\x20\x9e\x6e\xab\xa1\x2f\xa0\x27\xf8\x19\xa9\xf3\x0a\x12" + "\xef\x47\xce\x16\xd7\xd3\x05\x02\x92\x99\x9d\xdd\x70\x09\x3c" + "\xaa\x45\x85\xda\x81\x02\x0c\x2c\x82\x02\x05\xa0\xa2\x2b\x80" + "\x20\x38\xa3\x03\x53\x35\x19\x29\x19\xc3\x92\xbb\x76\xbe\xde" + "\x2c\x5d\xb4\x33\xe9\x8b\xcd\xf1\x80\xf9\xd6\x84\x2a\xcc\x45" + "\x7e\x74\x99\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3\x27\x80" + "\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70" + "\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f" + "\xc7\xe4\x52\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xee\x75\xbe" + "\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c\x70\x85" + "\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2\xa0\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4\x30\x65" + "\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79\x5f\x41" + "\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02\x00\x00" + "\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0" + "\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0\x1a\xd4" + "\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh10() + { + testcase("Thresh10"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim30Cond + // ** Rsa31Cond + // ** Ed32Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim5Cond + // ***** Rsa6Cond + // ***** Ed7Cond + // ***** preim4 + // ** prefix8 + // *** prefix9 + // **** thresh10 + // ***** Preim12Cond + // ***** Rsa13Cond + // ***** Ed14Cond + // ***** preim11 + // ** thresh15 + // *** Preim22Cond + // *** Rsa23Cond + // *** Ed24Cond + // *** Thresh25Cond + // *** preim16 + // *** thresh17 + // **** Preim19Cond + // **** Rsa20Cond + // **** Ed21Cond + // **** preim18 + + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim11Preimage = "I am root"s; + auto const preim11Msg = "P9P8abcdefghijklmnopqrstuvwxyz"s; + auto const thresh10Msg = "P9P8abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim12CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim12Cond{Type::preimageSha256, + 9, + Preim12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa13CondConditionFingerprint = { + {0x65, 0x58, 0x3c, 0x41, 0x23, 0xcb, 0x17, 0xee, 0x38, 0xf7, 0x10, + 0x74, 0xdb, 0xa3, 0x24, 0xb4, 0x5b, 0x39, 0x35, 0xc1, 0x1a, 0xa6, + 0xbd, 0xbc, 0xc8, 0xea, 0x71, 0x39, 0x33, 0xe5, 0xd5, 0x1a}}; + Condition const Rsa13Cond{Type::rsaSha256, + 65536, + Rsa13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed14CondConditionFingerprint = { + {0xde, 0x4c, 0x08, 0x88, 0x5c, 0xfe, 0x31, 0x01, 0xbe, 0xe9, 0xe4, + 0x12, 0xce, 0x03, 0x59, 0x75, 0xb3, 0x7b, 0xac, 0x62, 0x26, 0xfa, + 0x78, 0x07, 0x59, 0x64, 0x4e, 0x5e, 0x89, 0x64, 0x17, 0x04}}; + Condition const Ed14Cond{Type::ed25519Sha256, + 131072, + Ed14CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix9Prefix = "P9"s; + auto const prefix9Msg = "P8abcdefghijklmnopqrstuvwxyz"s; + auto const prefix9MaxMsgLength = 28; + auto const prefix8Prefix = "P8"s; + auto const prefix8Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix8MaxMsgLength = 26; + auto const preim16Preimage = "I am root"s; + auto const preim16Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim18Preimage = "I am root"s; + auto const preim18Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh17Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh15Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim22CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim22Cond{Type::preimageSha256, + 9, + Preim22CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa23CondConditionFingerprint = { + {0x4a, 0x64, 0xbf, 0x23, 0xa9, 0x2b, 0xec, 0x55, 0x00, 0x3d, 0x55, + 0xf5, 0xbf, 0x3f, 0x26, 0x49, 0x18, 0xbb, 0xe0, 0xda, 0xf8, 0x0c, + 0xf4, 0x5c, 0x8a, 0x33, 0x74, 0xb6, 0x58, 0xa4, 0x38, 0x30}}; + Condition const Rsa23Cond{Type::rsaSha256, + 65536, + Rsa23CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed24CondConditionFingerprint = { + {0x6b, 0xf3, 0xe3, 0x0f, 0x92, 0x6d, 0x45, 0x8d, 0xae, 0xd2, 0x8a, + 0x2a, 0x3e, 0x53, 0x37, 0x1f, 0x57, 0x82, 0x21, 0x60, 0xe4, 0x5b, + 0x88, 0x9a, 0x9d, 0x13, 0xa2, 0x56, 0x13, 0x88, 0x9e, 0x21}}; + Condition const Ed24Cond{Type::ed25519Sha256, + 131072, + Ed24CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh25CondConditionFingerprint = { + {0x97, 0x57, 0x7e, 0xfd, 0x8a, 0x6c, 0x0e, 0xb0, 0x84, 0xe0, 0x63, + 0x04, 0x2a, 0x01, 0x2e, 0x09, 0xd4, 0xc7, 0x67, 0x3d, 0x89, 0xf0, + 0x63, 0x26, 0xd0, 0x69, 0xe0, 0xcb, 0x7a, 0x81, 0xbf, 0x97}}; + Condition const Thresh25Cond{Type::thresholdSha256, + 135168, + Thresh25CondConditionFingerprint, + std::bitset<5>{25}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim30CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim30Cond{Type::preimageSha256, + 9, + Preim30CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa31CondConditionFingerprint = { + {0x34, 0x77, 0x63, 0xd7, 0x27, 0x76, 0x4d, 0x3a, 0x9b, 0x6c, 0xdb, + 0x09, 0xed, 0xd8, 0x5f, 0xc2, 0x12, 0x9e, 0x9c, 0xc4, 0xc8, 0xa6, + 0x62, 0xcf, 0x14, 0xde, 0x09, 0x30, 0x64, 0x8e, 0xf4, 0x84}}; + Condition const Rsa31Cond{Type::rsaSha256, + 65536, + Rsa31CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed32CondConditionFingerprint = { + {0xe9, 0x54, 0x85, 0xb7, 0x7d, 0xa1, 0x1f, 0x2f, 0xaa, 0x84, 0x72, + 0x3f, 0x4e, 0x3f, 0x09, 0xa7, 0x49, 0xf2, 0x15, 0x2a, 0xe6, 0x13, + 0x5b, 0x68, 0xb6, 0xe1, 0x98, 0xa6, 0x89, 0x76, 0x08, 0x05}}; + Condition const Ed32Cond{Type::ed25519Sha256, + 131072, + Ed32CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim11 = + std::make_unique(makeSlice(preim11Preimage)); + std::vector> thresh10Subfulfillments; + thresh10Subfulfillments.emplace_back(std::move(preim11)); + std::vector thresh10Subconditions{ + {Preim12Cond, Rsa13Cond, Ed14Cond}}; + auto thresh10 = std::make_unique( + std::move(thresh10Subfulfillments), + std::move(thresh10Subconditions)); + auto prefix9 = std::make_unique( + makeSlice(prefix9Prefix), prefix9MaxMsgLength, std::move(thresh10)); + auto prefix8 = std::make_unique( + makeSlice(prefix8Prefix), prefix8MaxMsgLength, std::move(prefix9)); + auto preim16 = + std::make_unique(makeSlice(preim16Preimage)); + auto preim18 = + std::make_unique(makeSlice(preim18Preimage)); + std::vector> thresh17Subfulfillments; + thresh17Subfulfillments.emplace_back(std::move(preim18)); + std::vector thresh17Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond}}; + auto thresh17 = std::make_unique( + std::move(thresh17Subfulfillments), + std::move(thresh17Subconditions)); + std::vector> thresh15Subfulfillments; + thresh15Subfulfillments.emplace_back(std::move(preim16)); + thresh15Subfulfillments.emplace_back(std::move(thresh17)); + std::vector thresh15Subconditions{ + {Preim22Cond, Rsa23Cond, Ed24Cond, Thresh25Cond}}; + auto thresh15 = std::make_unique( + std::move(thresh15Subfulfillments), + std::move(thresh15Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix8)); + thresh0Subfulfillments.emplace_back(std::move(thresh15)); + std::vector thresh0Subconditions{ + {Preim30Cond, Rsa31Cond, Ed32Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\x17\xa0\x82\x02\x98\xa1\x81\xa4\x80\x02\x50\x31" + "\x81\x01\x1a\xa2\x81\x9a\xa1\x81\x97\x80\x02\x50\x32\x81\x01" + "\x1c\xa2\x81\x8d\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49\x20" + "\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa3\x27\x80\x20\xee\x75\xbe\xb3\x52\x54\xbd\x24" + "\x06\x3f\xd9\x32\x48\x19\xe1\x5c\x70\x85\x92\x11\x6c\x3a\xc1" + "\x4c\x9b\x83\xeb\x05\xa7\x59\xe2\xa0\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1" + "\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0\x1a\xd4\x23" + "\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00\x00\xa1\x81\xa4\x80\x02" + "\x50\x38\x81\x01\x1a\xa2\x81\x9a\xa1\x81\x97\x80\x02\x50\x39" + "\x81\x01\x1c\xa2\x81\x8d\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09" + "\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x65\x58\x3c\x41\x23\xcb" + "\x17\xee\x38\xf7\x10\x74\xdb\xa3\x24\xb4\x5b\x39\x35\xc1\x1a" + "\xa6\xbd\xbc\xc8\xea\x71\x39\x33\xe5\xd5\x1a\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xde\x4c\x08\x88\x5c\xfe\x31\x01\xbe\xe9" + "\xe4\x12\xce\x03\x59\x75\xb3\x7b\xac\x62\x26\xfa\x78\x07\x59" + "\x64\x4e\x5e\x89\x64\x17\x04\x81\x03\x02\x00\x00\xa2\x82\x01" + "\x46\xa0\x81\x9a\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f" + "\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d" + "\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef" + "\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9" + "\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01" + "\x09\xa3\x27\x80\x20\x8d\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84" + "\x64\x57\xca\xf4\x9d\x63\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec" + "\x79\xa9\xc6\xa3\xf1\x33\xfd\x81\x03\x01\x00\x00\xa4\x27\x80" + "\x20\x95\x3c\x86\x65\x91\x76\x69\x6b\x72\x61\xaa\x76\x15\x2a" + "\xd7\x25\x4f\x32\xb7\x73\x7a\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a" + "\x8b\xf7\x65\x81\x03\x02\x00\x00\xa1\x81\xa6\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\x97\x57\x7e\xfd\x8a\x6c" + "\x0e\xb0\x84\xe0\x63\x04\x2a\x01\x2e\x09\xd4\xc7\x67\x3d\x89" + "\xf0\x63\x26\xd0\x69\xe0\xcb\x7a\x81\xbf\x97\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x4a\x64\xbf\x23\xa9\x2b" + "\xec\x55\x00\x3d\x55\xf5\xbf\x3f\x26\x49\x18\xbb\xe0\xda\xf8" + "\x0c\xf4\x5c\x8a\x33\x74\xb6\x58\xa4\x38\x30\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x6b\xf3\xe3\x0f\x92\x6d\x45\x8d\xae\xd2" + "\x8a\x2a\x3e\x53\x37\x1f\x57\x82\x21\x60\xe4\x5b\x88\x9a\x9d" + "\x13\xa2\x56\x13\x88\x9e\x21\x81\x03\x02\x00\x00\xa1\x79\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x34\x77\x63" + "\xd7\x27\x76\x4d\x3a\x9b\x6c\xdb\x09\xed\xd8\x5f\xc2\x12\x9e" + "\x9c\xc4\xc8\xa6\x62\xcf\x14\xde\x09\x30\x64\x8e\xf4\x84\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\xe9\x54\x85\xb7\x7d\xa1\x1f" + "\x2f\xaa\x84\x72\x3f\x4e\x3f\x09\xa7\x49\xf2\x15\x2a\xe6\x13" + "\x5b\x68\xb6\xe1\x98\xa6\x89\x76\x08\x05\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x10\xcf\x17\x92\x13\xe8\x25\xec\xe3\xe7\x5a" + "\x7c\xef\xff\x97\xbb\x1a\xea\x1f\x63\x36\xfc\x8e\x35\x32\x5f" + "\x33\xf0\x22\x6a\x96\x5e\x81\x03\x08\x80\x74\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x1f\x00\x2e\xd7\xa5\x0f" + "\x27\x26\x46\x63\x2e\xd3\x60\x75\x03\xbd\x59\xa3\x7f\xc2\x71" + "\x41\x4c\x68\x5d\x80\x77\x7f\xe4\xa8\x5a\x2e\x81\x03\x02\x18" + "\x3a\x82\x02\x03\xb8\xa1\x2b\x80\x20\x94\x9c\x68\x45\x4d\xe8" + "\x1f\x57\x4d\x02\x5c\xe8\xd4\x8d\x2e\x83\xe7\x8b\x00\x6c\xa0" + "\xdd\xc0\x7d\x1e\x69\x2b\x4d\x86\xe1\xc9\x38\x81\x03\x02\x18" + "\x3a\x82\x02\x03\xb8\xa2\x2b\x80\x20\x79\x93\x46\xe5\x6c\x0e" + "\xce\xa6\x9c\x0e\x67\xea\x57\x74\xda\x8b\xd6\x9d\x84\x9c\x87" + "\xee\x37\x70\x3e\xe9\x9f\x9d\x66\x26\x6a\xd9\x81\x03\x04\x38" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x34\x77\x63\xd7\x27\x76" + "\x4d\x3a\x9b\x6c\xdb\x09\xed\xd8\x5f\xc2\x12\x9e\x9c\xc4\xc8" + "\xa6\x62\xcf\x14\xde\x09\x30\x64\x8e\xf4\x84\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe9\x54\x85\xb7\x7d\xa1\x1f\x2f\xaa\x84" + "\x72\x3f\x4e\x3f\x09\xa7\x49\xf2\x15\x2a\xe6\x13\x5b\x68\xb6" + "\xe1\x98\xa6\x89\x76\x08\x05\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh11() + { + testcase("Thresh11"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim11Cond + // ** Rsa12Cond + // ** Ed13Cond + // ** Prefix14Cond + // ** Thresh21Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim5Cond + // ***** Rsa6Cond + // ***** Ed7Cond + // ***** preim4 + // ** preim8 + // ** rsa9 + // ** ed10 + + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim8Preimage = "I am root"s; + auto const preim8Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa9PublicKey{ + {0xb6, 0x7b, 0xe2, 0x98, 0x9f, 0xff, 0x6c, 0x37, 0xd0, 0xb6, 0x64, + 0x19, 0xfb, 0xa0, 0x21, 0x18, 0xe2, 0xc0, 0xd1, 0x92, 0xbd, 0x04, + 0xa6, 0xd2, 0xb4, 0x7e, 0xc6, 0x6a, 0x1a, 0x34, 0x20, 0x7b, 0xfe, + 0x84, 0xeb, 0xe8, 0xc1, 0x6f, 0xfd, 0xdc, 0x0a, 0xfe, 0x60, 0x55, + 0xb6, 0xfc, 0x86, 0x5a, 0x21, 0xbf, 0xf1, 0x39, 0xfa, 0xec, 0x42, + 0xca, 0x57, 0xb3, 0x3e, 0x3f, 0xe6, 0x26, 0x5a, 0xb7, 0x4a, 0x5f, + 0xbb, 0xb1, 0xf5, 0x91, 0x85, 0x92, 0x3e, 0x6a, 0x18, 0x48, 0x4d, + 0x9e, 0xdd, 0x08, 0x25, 0xa3, 0x3b, 0x3d, 0x75, 0x9a, 0xbe, 0xee, + 0x0d, 0x6e, 0xd2, 0x5d, 0xe2, 0xbd, 0xed, 0x45, 0x60, 0xef, 0xa0, + 0x37, 0xfd, 0xbb, 0xcf, 0x30, 0x97, 0xf1, 0x5b, 0xc8, 0x9c, 0x29, + 0x33, 0x67, 0x3e, 0x23, 0x33, 0x7f, 0x36, 0xd4, 0x75, 0x8b, 0xa1, + 0xcf, 0x9e, 0xe6, 0xc5, 0x63, 0x63, 0xb0, 0x3f, 0xa0, 0xc2, 0xa2, + 0x10, 0xc9, 0xb2, 0x6b, 0xaa, 0x67, 0xc9, 0xf5, 0xb8, 0xbf, 0x5b, + 0x97, 0xe5, 0x29, 0xf2, 0xbb, 0xc7, 0x22, 0x0f, 0x1f, 0xc1, 0xf6, + 0xca, 0x4a, 0x8a, 0x46, 0x89, 0xa0, 0xca, 0x4e, 0x49, 0x9d, 0xfc, + 0x23, 0xd3, 0xb4, 0xdb, 0xc6, 0x84, 0x45, 0xbd, 0x9f, 0x10, 0x86, + 0xe2, 0xf0, 0x47, 0x7b, 0x75, 0xbf, 0x25, 0x99, 0x02, 0x2c, 0xdb, + 0x6b, 0xd6, 0x2b, 0x67, 0x0d, 0xcd, 0x46, 0x63, 0xbd, 0xce, 0x1c, + 0xc5, 0x56, 0x63, 0x58, 0x5b, 0xc8, 0xb2, 0x58, 0x42, 0xf6, 0xaf, + 0xce, 0x47, 0xb2, 0xa9, 0x2a, 0x71, 0x8b, 0x82, 0xf4, 0x72, 0xff, + 0xef, 0xe7, 0xc1, 0x70, 0x12, 0xfa, 0xb8, 0xad, 0xb2, 0xfe, 0xa9, + 0x14, 0xe7, 0xc2, 0xec, 0x12, 0xbf, 0x29, 0x5a, 0x65, 0x91, 0x74, + 0x82, 0xd3, 0x77, 0x1f, 0x14, 0xbf, 0x5f, 0x41, 0x11, 0x6c, 0x7c, + 0x22, 0x70, 0x65}}; + std::array const rsa9Sig{ + {0x20, 0xdd, 0x33, 0x79, 0x2c, 0x83, 0x40, 0x6d, 0xdc, 0x50, 0xe9, + 0xe6, 0x5a, 0x78, 0x91, 0x42, 0x19, 0x59, 0x5a, 0x7c, 0x99, 0xce, + 0xd9, 0x18, 0x61, 0x35, 0xb9, 0xab, 0x82, 0xef, 0xe4, 0xfd, 0xdd, + 0x3a, 0xd5, 0xad, 0x60, 0xe5, 0x1c, 0x9d, 0x4d, 0xe7, 0x3c, 0x5c, + 0x0d, 0xaa, 0x3a, 0x85, 0x9b, 0xc2, 0x4b, 0x9a, 0x13, 0x5d, 0xce, + 0xe7, 0x26, 0xa5, 0x46, 0x67, 0x17, 0x3d, 0x22, 0xc5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xa5, 0x3c, 0xc1, 0x38, 0x1b, 0x25, 0xf0, 0x68, 0x31, + 0x38, 0xb1, 0x2a}}; + auto const ed10Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed10PublicKey{ + {0x7a, 0xdc, 0x65, 0x52, 0x0f, 0xca, 0x06, 0x72, 0x5c, 0xe4, 0x65, + 0x57, 0x82, 0x6d, 0x3f, 0x57, 0x1f, 0xc6, 0xc6, 0xe4, 0x5d, 0xaf, + 0x08, 0xda, 0xe2, 0x07, 0x02, 0xcb, 0x42, 0x3d, 0x2a, 0xd0}}; + std::array const ed10Sig{ + {0xf2, 0x7c, 0x5f, 0x61, 0xec, 0xbc, 0xc2, 0x8c, 0xad, 0xd0, 0xd3, + 0xcb, 0x89, 0xab, 0xac, 0xe4, 0x01, 0x6f, 0x90, 0x60, 0x6f, 0x89, + 0xc0, 0xd9, 0xca, 0x2b, 0x4b, 0xfd, 0x78, 0x80, 0xae, 0xf9, 0xd0, + 0x3f, 0x45, 0x7a, 0xb2, 0x26, 0x0c, 0xee, 0xc5, 0x06, 0x0e, 0x94, + 0x6b, 0xf8, 0xfe, 0x96, 0x4f, 0x0d, 0xa0, 0x2c, 0x66, 0x78, 0xa5, + 0x60, 0xfe, 0x47, 0x1e, 0xa9, 0x88, 0x76, 0x55, 0x03}}; + std::array const ed10SigningKey{ + {0x84, 0x04, 0xdd, 0x34, 0x6a, 0x4d, 0x40, 0xef, 0x70, 0xf7, 0xef, + 0x7f, 0x25, 0xf4, 0xd0, 0xa0, 0xa8, 0xad, 0xc1, 0x51, 0x1c, 0x16, + 0x57, 0x9d, 0x5e, 0xd9, 0xa6, 0x45, 0xda, 0xff, 0x5e, 0x1e}}; + (void)ed10SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim11CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim11Cond{Type::preimageSha256, + 9, + Preim11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa12CondConditionFingerprint = { + {0x38, 0xb9, 0xf0, 0xeb, 0x68, 0x8b, 0x9f, 0x55, 0x37, 0x9a, 0xec, + 0x07, 0xd4, 0xa2, 0x13, 0xac, 0x34, 0xa1, 0x67, 0x31, 0x34, 0xea, + 0xc2, 0x2f, 0xef, 0x13, 0xe3, 0x5c, 0xcf, 0x8f, 0x90, 0x1e}}; + Condition const Rsa12Cond{Type::rsaSha256, + 65536, + Rsa12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed13CondConditionFingerprint = { + {0x7c, 0x54, 0x6a, 0x6d, 0x7f, 0x00, 0x52, 0x31, 0x03, 0xe7, 0xb4, + 0x5b, 0x1c, 0x9f, 0x72, 0xeb, 0x3c, 0x18, 0x08, 0xa3, 0x24, 0xb2, + 0x63, 0x5f, 0x77, 0x55, 0x4a, 0x42, 0xdb, 0x1e, 0xff, 0x1e}}; + Condition const Ed13Cond{Type::ed25519Sha256, + 131072, + Ed13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix14CondConditionFingerprint = { + {0x8a, 0x19, 0xbe, 0x6b, 0x4b, 0xad, 0x3f, 0xab, 0x85, 0x13, 0xce, + 0xb4, 0xec, 0x4b, 0x8c, 0x5d, 0x9c, 0xd9, 0x1e, 0xb4, 0x0c, 0x08, + 0x03, 0x54, 0xd3, 0xa5, 0xa5, 0xbe, 0x6d, 0xdb, 0x94, 0xf3}}; + Condition const Prefix14Cond{Type::prefixSha256, + 137251, + Prefix14CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh21CondConditionFingerprint = { + {0x6f, 0x57, 0x52, 0x73, 0x7f, 0x22, 0x19, 0xb7, 0xd0, 0xc9, 0xa9, + 0xa5, 0x15, 0xc8, 0x99, 0x72, 0xd3, 0xe9, 0x2a, 0x2f, 0xae, 0x19, + 0x55, 0x83, 0x27, 0x52, 0xfd, 0x07, 0x03, 0x5d, 0xc0, 0xd3}}; + Condition const Thresh21Cond{Type::thresholdSha256, + 276480, + Thresh21CondConditionFingerprint, + std::bitset<5>{25}}; + + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim8 = + std::make_unique(makeSlice(preim8Preimage)); + auto rsa9 = std::make_unique( + makeSlice(rsa9PublicKey), makeSlice(rsa9Sig)); + auto ed10 = std::make_unique(ed10PublicKey, ed10Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim8)); + thresh0Subfulfillments.emplace_back(std::move(rsa9)); + thresh0Subfulfillments.emplace_back(std::move(ed10)); + std::vector thresh0Subconditions{ + {Preim11Cond, Rsa12Cond, Ed13Cond, Prefix14Cond, Thresh21Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x04\x00\xa0\x82\x03\x26\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x81\xa4\x80\x02\x50\x31\x81\x01" + "\x1a\xa2\x81\x9a\xa1\x81\x97\x80\x02\x50\x32\x81\x01\x1c\xa2" + "\x81\x8d\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d" + "\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef" + "\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9" + "\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01" + "\x09\xa3\x27\x80\x20\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f" + "\xd9\x32\x48\x19\xe1\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b" + "\x83\xeb\x05\xa7\x59\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27\x80" + "\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35" + "\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0\x21" + "\x8d\x42\xc0\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01" + "\x00\xb6\x7b\xe2\x98\x9f\xff\x6c\x37\xd0\xb6\x64\x19\xfb\xa0" + "\x21\x18\xe2\xc0\xd1\x92\xbd\x04\xa6\xd2\xb4\x7e\xc6\x6a\x1a" + "\x34\x20\x7b\xfe\x84\xeb\xe8\xc1\x6f\xfd\xdc\x0a\xfe\x60\x55" + "\xb6\xfc\x86\x5a\x21\xbf\xf1\x39\xfa\xec\x42\xca\x57\xb3\x3e" + "\x3f\xe6\x26\x5a\xb7\x4a\x5f\xbb\xb1\xf5\x91\x85\x92\x3e\x6a" + "\x18\x48\x4d\x9e\xdd\x08\x25\xa3\x3b\x3d\x75\x9a\xbe\xee\x0d" + "\x6e\xd2\x5d\xe2\xbd\xed\x45\x60\xef\xa0\x37\xfd\xbb\xcf\x30" + "\x97\xf1\x5b\xc8\x9c\x29\x33\x67\x3e\x23\x33\x7f\x36\xd4\x75" + "\x8b\xa1\xcf\x9e\xe6\xc5\x63\x63\xb0\x3f\xa0\xc2\xa2\x10\xc9" + "\xb2\x6b\xaa\x67\xc9\xf5\xb8\xbf\x5b\x97\xe5\x29\xf2\xbb\xc7" + "\x22\x0f\x1f\xc1\xf6\xca\x4a\x8a\x46\x89\xa0\xca\x4e\x49\x9d" + "\xfc\x23\xd3\xb4\xdb\xc6\x84\x45\xbd\x9f\x10\x86\xe2\xf0\x47" + "\x7b\x75\xbf\x25\x99\x02\x2c\xdb\x6b\xd6\x2b\x67\x0d\xcd\x46" + "\x63\xbd\xce\x1c\xc5\x56\x63\x58\x5b\xc8\xb2\x58\x42\xf6\xaf" + "\xce\x47\xb2\xa9\x2a\x71\x8b\x82\xf4\x72\xff\xef\xe7\xc1\x70" + "\x12\xfa\xb8\xad\xb2\xfe\xa9\x14\xe7\xc2\xec\x12\xbf\x29\x5a" + "\x65\x91\x74\x82\xd3\x77\x1f\x14\xbf\x5f\x41\x11\x6c\x7c\x22" + "\x70\x65\x81\x82\x01\x00\x20\xdd\x33\x79\x2c\x83\x40\x6d\xdc" + "\x50\xe9\xe6\x5a\x78\x91\x42\x19\x59\x5a\x7c\x99\xce\xd9\x18" + "\x61\x35\xb9\xab\x82\xef\xe4\xfd\xdd\x3a\xd5\xad\x60\xe5\x1c" + "\x9d\x4d\xe7\x3c\x5c\x0d\xaa\x3a\x85\x9b\xc2\x4b\x9a\x13\x5d" + "\xce\xe7\x26\xa5\x46\x67\x17\x3d\x22\xc5\x2f\x50\xe6\x53\x50" + "\x0a\x33\xc3\x97\x91\xed\x58\x32\x51\x29\xe5\xa2\xd5\x5c\x05" + "\x1c\xf1\x93\xdf\x15\xf4\x75\x16\x98\xd0\xd6\x14\x45\x5e\x7b" + "\x4c\x28\x07\x11\x2a\x0d\x4b\x90\x97\xda\xa7\x43\x83\xe7\x40" + "\xf3\xc9\xbd\x7d\xef\x8c\x7c\x32\xdd\xea\x38\x89\x48\x49\x6a" + "\xe2\x71\xe1\x5e\x32\x4c\x9c\x84\x01\x76\x10\x7c\xb1\xc8\x18" + "\xb6\xdf\x6c\xd3\xb8\x34\x27\xe7\x8a\x5d\xcc\x50\xbe\x0d\x87" + "\x02\x30\x39\xf7\x36\xc6\x51\x45\x18\xb5\xcc\xeb\x83\xc3\xfe" + "\x99\xd1\xd1\x7f\xe5\x89\x39\xc9\xaf\x4a\x0c\xdd\xd1\x8a\x47" + "\xd5\x5f\xdf\x8e\x19\xef\x70\xf4\x09\xad\xb2\x6d\xaf\xc1\x24" + "\x0b\x59\x5a\x2a\xd1\x7a\x52\xf1\xd1\x7b\x5b\x9f\x8a\xe8\x45" + "\xe1\xab\x93\xdf\x93\x5e\xbc\xa3\x5c\x5b\x5b\xe2\xdb\x8f\x58" + "\x6a\x7f\xcf\x08\x0f\x3f\x68\x97\x85\x48\xa5\x3c\xc1\x38\x1b" + "\x25\xf0\x68\x31\x38\xb1\x2a\xa4\x64\x80\x20\x7a\xdc\x65\x52" + "\x0f\xca\x06\x72\x5c\xe4\x65\x57\x82\x6d\x3f\x57\x1f\xc6\xc6" + "\xe4\x5d\xaf\x08\xda\xe2\x07\x02\xcb\x42\x3d\x2a\xd0\x81\x40" + "\xf2\x7c\x5f\x61\xec\xbc\xc2\x8c\xad\xd0\xd3\xcb\x89\xab\xac" + "\xe4\x01\x6f\x90\x60\x6f\x89\xc0\xd9\xca\x2b\x4b\xfd\x78\x80" + "\xae\xf9\xd0\x3f\x45\x7a\xb2\x26\x0c\xee\xc5\x06\x0e\x94\x6b" + "\xf8\xfe\x96\x4f\x0d\xa0\x2c\x66\x78\xa5\x60\xfe\x47\x1e\xa9" + "\x88\x76\x55\x03\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef" + "\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9" + "\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01" + "\x09\xa1\x2b\x80\x20\x8a\x19\xbe\x6b\x4b\xad\x3f\xab\x85\x13" + "\xce\xb4\xec\x4b\x8c\x5d\x9c\xd9\x1e\xb4\x0c\x08\x03\x54\xd3" + "\xa5\xa5\xbe\x6d\xdb\x94\xf3\x81\x03\x02\x18\x23\x82\x02\x03" + "\xb8\xa2\x2b\x80\x20\x6f\x57\x52\x73\x7f\x22\x19\xb7\xd0\xc9" + "\xa9\xa5\x15\xc8\x99\x72\xd3\xe9\x2a\x2f\xae\x19\x55\x83\x27" + "\x52\xfd\x07\x03\x5d\xc0\xd3\x81\x03\x04\x38\x00\x82\x02\x03" + "\x98\xa3\x27\x80\x20\x38\xb9\xf0\xeb\x68\x8b\x9f\x55\x37\x9a" + "\xec\x07\xd4\xa2\x13\xac\x34\xa1\x67\x31\x34\xea\xc2\x2f\xef" + "\x13\xe3\x5c\xcf\x8f\x90\x1e\x81\x03\x01\x00\x00\xa4\x27\x80" + "\x20\x7c\x54\x6a\x6d\x7f\x00\x52\x31\x03\xe7\xb4\x5b\x1c\x9f" + "\x72\xeb\x3c\x18\x08\xa3\x24\xb2\x63\x5f\x77\x55\x4a\x42\xdb" + "\x1e\xff\x1e\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x9c\xd0\xa6\xcd\xd3\xef\x1e\x99\x24\x4b\x04" + "\xc3\xb0\xb1\xfc\x57\xdc\xe1\x14\x92\x2b\x6e\xfa\xe7\xdd\x57" + "\xe4\x94\xbf\xb4\x74\xc9\x81\x03\x0a\x8c\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x1f\x00\x2e\xd7\xa5\x0f\x27\x26\x46\x63\x2e\xd3" + "\x60\x75\x03\xbd\x59\xa3\x7f\xc2\x71\x41\x4c\x68\x5d\x80\x77" + "\x7f\xe4\xa8\x5a\x2e\x81\x03\x02\x18\x3a\x82\x02\x03\xb8\xa1" + "\x2b\x80\x20\x8a\x19\xbe\x6b\x4b\xad\x3f\xab\x85\x13\xce\xb4" + "\xec\x4b\x8c\x5d\x9c\xd9\x1e\xb4\x0c\x08\x03\x54\xd3\xa5\xa5" + "\xbe\x6d\xdb\x94\xf3\x81\x03\x02\x18\x23\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\x6f\x57\x52\x73\x7f\x22\x19\xb7\xd0\xc9\xa9\xa5" + "\x15\xc8\x99\x72\xd3\xe9\x2a\x2f\xae\x19\x55\x83\x27\x52\xfd" + "\x07\x03\x5d\xc0\xd3\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x38\xb9\xf0\xeb\x68\x8b\x9f\x55\x37\x9a\xec\x07" + "\xd4\xa2\x13\xac\x34\xa1\x67\x31\x34\xea\xc2\x2f\xef\x13\xe3" + "\x5c\xcf\x8f\x90\x1e\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xe5" + "\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70\x64\x51" + "\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7\xe4" + "\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4" + "\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79" + "\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x7c\x54\x6a\x6d\x7f\x00\x52\x31\x03" + "\xe7\xb4\x5b\x1c\x9f\x72\xeb\x3c\x18\x08\xa3\x24\xb2\x63\x5f" + "\x77\x55\x4a\x42\xdb\x1e\xff\x1e\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh12() + { + testcase("Thresh12"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim27Cond + // ** Rsa28Cond + // ** Ed29Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** preim4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** preim6 + // ** prefix13 + // *** prefix14 + // **** thresh15 + // ***** Preim22Cond + // ***** Rsa23Cond + // ***** Ed24Cond + // ***** preim16 + // ***** thresh17 + // ****** Preim19Cond + // ****** Rsa20Cond + // ****** Ed21Cond + // ****** preim18 + // ** thresh25 + // *** preim26 + + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const preim6Preimage = "I am root"s; + auto const preim6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim16Preimage = "I am root"s; + auto const preim16Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + auto const preim18Preimage = "I am root"s; + auto const preim18Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + auto const thresh17Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh15Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim22CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim22Cond{Type::preimageSha256, + 9, + Preim22CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa23CondConditionFingerprint = { + {0x4a, 0x64, 0xbf, 0x23, 0xa9, 0x2b, 0xec, 0x55, 0x00, 0x3d, 0x55, + 0xf5, 0xbf, 0x3f, 0x26, 0x49, 0x18, 0xbb, 0xe0, 0xda, 0xf8, 0x0c, + 0xf4, 0x5c, 0x8a, 0x33, 0x74, 0xb6, 0x58, 0xa4, 0x38, 0x30}}; + Condition const Rsa23Cond{Type::rsaSha256, + 65536, + Rsa23CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed24CondConditionFingerprint = { + {0x6b, 0xf3, 0xe3, 0x0f, 0x92, 0x6d, 0x45, 0x8d, 0xae, 0xd2, 0x8a, + 0x2a, 0x3e, 0x53, 0x37, 0x1f, 0x57, 0x82, 0x21, 0x60, 0xe4, 0x5b, + 0x88, 0x9a, 0x9d, 0x13, 0xa2, 0x56, 0x13, 0x88, 0x9e, 0x21}}; + Condition const Ed24Cond{Type::ed25519Sha256, + 131072, + Ed24CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix14Prefix = "P14"s; + auto const prefix14Msg = "P13abcdefghijklmnopqrstuvwxyz"s; + auto const prefix14MaxMsgLength = 29; + auto const prefix13Prefix = "P13"s; + auto const prefix13Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix13MaxMsgLength = 26; + auto const preim26Preimage = "I am root"s; + auto const preim26Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh25Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim27CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim27Cond{Type::preimageSha256, + 9, + Preim27CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa28CondConditionFingerprint = { + {0x58, 0xac, 0x94, 0x55, 0x27, 0x79, 0x7a, 0x0c, 0xac, 0x84, 0x2d, + 0x5c, 0x13, 0x32, 0xee, 0x84, 0x25, 0xb8, 0xb8, 0xec, 0x25, 0x0d, + 0x40, 0xee, 0xc0, 0xd4, 0x79, 0x18, 0x3f, 0xc6, 0xbc, 0xd7}}; + Condition const Rsa28Cond{Type::rsaSha256, + 65536, + Rsa28CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed29CondConditionFingerprint = { + {0xc5, 0x39, 0xb2, 0xc7, 0xc4, 0x92, 0x8a, 0x29, 0xf3, 0x72, 0xb4, + 0x6c, 0xa5, 0x0d, 0x8c, 0xbe, 0x43, 0xda, 0xc9, 0xac, 0x6c, 0x26, + 0x7c, 0x44, 0xb9, 0x3f, 0xee, 0x40, 0xcc, 0x8e, 0x41, 0x3c}}; + Condition const Ed29Cond{Type::ed25519Sha256, + 131072, + Ed29CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + auto preim6 = + std::make_unique(makeSlice(preim6Preimage)); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(preim6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim16 = + std::make_unique(makeSlice(preim16Preimage)); + auto preim18 = + std::make_unique(makeSlice(preim18Preimage)); + std::vector> thresh17Subfulfillments; + thresh17Subfulfillments.emplace_back(std::move(preim18)); + std::vector thresh17Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond}}; + auto thresh17 = std::make_unique( + std::move(thresh17Subfulfillments), + std::move(thresh17Subconditions)); + std::vector> thresh15Subfulfillments; + thresh15Subfulfillments.emplace_back(std::move(preim16)); + thresh15Subfulfillments.emplace_back(std::move(thresh17)); + std::vector thresh15Subconditions{ + {Preim22Cond, Rsa23Cond, Ed24Cond}}; + auto thresh15 = std::make_unique( + std::move(thresh15Subfulfillments), + std::move(thresh15Subconditions)); + auto prefix14 = std::make_unique( + makeSlice(prefix14Prefix), + prefix14MaxMsgLength, + std::move(thresh15)); + auto prefix13 = std::make_unique( + makeSlice(prefix13Prefix), + prefix13MaxMsgLength, + std::move(prefix14)); + auto preim26 = + std::make_unique(makeSlice(preim26Preimage)); + std::vector> thresh25Subfulfillments; + thresh25Subfulfillments.emplace_back(std::move(preim26)); + std::vector thresh25Subconditions{}; + auto thresh25 = std::make_unique( + std::move(thresh25Subfulfillments), + std::move(thresh25Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix13)); + thresh0Subfulfillments.emplace_back(std::move(thresh25)); + std::vector thresh0Subconditions{ + {Preim27Cond, Rsa28Cond, Ed29Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\x08\xa0\x82\x02\x89\xa1\x82\x01\x36\x80\x02\x50" + "\x31\x81\x01\x1a\xa2\x82\x01\x2b\xa1\x82\x01\x27\x80\x02\x50" + "\x32\x81\x01\x1c\xa2\x82\x01\x1c\xa2\x82\x01\x18\xa0\x81\x9a" + "\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x81" + "\x8a\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f" + "\x74\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9" + "\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2" + "\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc" + "\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36" + "\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81" + "\x03\x02\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa3\x27\x80\x20\xaf\x93\xfd\x22\x45\xc2\x08\xab\x43\xf7\x45" + "\x56\x63\xec\xaf\x15\x33\xa0\x2a\xb4\x9e\x15\xb4\x6e\xda\x87" + "\x35\xde\x09\x4b\x06\x31\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\x55\xcc\xd1\xa2\x2c\x90\x8d\xe3\x2e\x42\xd4\xe0\x65\xb2\xf7" + "\xda\xc0\x07\x1e\xd3\x23\x0f\xfe\x78\x13\xa2\x86\x61\xc4\x34" + "\x28\x50\x81\x03\x02\x00\x00\xa1\x82\x01\x38\x80\x03\x50\x31" + "\x33\x81\x01\x1a\xa2\x82\x01\x2c\xa1\x82\x01\x28\x80\x03\x50" + "\x31\x34\x81\x01\x1d\xa2\x82\x01\x1c\xa2\x82\x01\x18\xa0\x81" + "\x9a\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2" + "\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f" + "\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27" + "\x80\x20\x8d\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57\xca" + "\xf4\x9d\x63\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9\xc6" + "\xa3\xf1\x33\xfd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x95\x3c" + "\x86\x65\x91\x76\x69\x6b\x72\x61\xaa\x76\x15\x2a\xd7\x25\x4f" + "\x32\xb7\x73\x7a\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a\x8b\xf7\x65" + "\x81\x03\x02\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef" + "\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9" + "\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01" + "\x09\xa3\x27\x80\x20\x4a\x64\xbf\x23\xa9\x2b\xec\x55\x00\x3d" + "\x55\xf5\xbf\x3f\x26\x49\x18\xbb\xe0\xda\xf8\x0c\xf4\x5c\x8a" + "\x33\x74\xb6\x58\xa4\x38\x30\x81\x03\x01\x00\x00\xa4\x27\x80" + "\x20\x6b\xf3\xe3\x0f\x92\x6d\x45\x8d\xae\xd2\x8a\x2a\x3e\x53" + "\x37\x1f\x57\x82\x21\x60\xe4\x5b\x88\x9a\x9d\x13\xa2\x56\x13" + "\x88\x9e\x21\x81\x03\x02\x00\x00\xa2\x11\xa0\x0d\xa0\x0b\x80" + "\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x00\xa1\x79\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x58\xac\x94" + "\x55\x27\x79\x7a\x0c\xac\x84\x2d\x5c\x13\x32\xee\x84\x25\xb8" + "\xb8\xec\x25\x0d\x40\xee\xc0\xd4\x79\x18\x3f\xc6\xbc\xd7\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\xc5\x39\xb2\xc7\xc4\x92\x8a" + "\x29\xf3\x72\xb4\x6c\xa5\x0d\x8c\xbe\x43\xda\xc9\xac\x6c\x26" + "\x7c\x44\xb9\x3f\xee\x40\xcc\x8e\x41\x3c\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x18\x65\x7d\x10\xf6\x3d\x3d\x9c\xc0\x3e\x34" + "\xec\x79\xd2\xb0\x73\x42\xbd\xea\x99\x5a\x37\x2a\x5f\xaf\x57" + "\x72\xb6\xdc\xf1\x83\x09\x81\x03\x0a\x70\x77\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x05\x80\x01\x03\xa1\x81\xff\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2b\x80\x20\x05\x81\x7d\x47\xe8\xc3\xa8" + "\x51\x34\x38\xb6\x00\x2a\x31\xf1\xb5\x5c\xa1\xbb\x01\xc4\x10" + "\x03\x82\x24\x2a\xea\x12\x5e\x40\x1f\xec\x81\x03\x04\x2c\x3a" + "\x82\x02\x03\xb8\xa1\x2b\x80\x20\x85\x6a\xf1\xc7\x64\x14\xf2" + "\x91\x70\x3a\x43\xcd\x31\xb6\x41\xf1\x55\xb2\x30\xee\x7d\x7d" + "\xbc\x90\xcf\x23\x54\x4f\xf4\x51\x62\xc0\x81\x03\x04\x2c\x3d" + "\x82\x02\x03\xb8\xa2\x2a\x80\x20\x57\xb7\x93\x0b\xb8\xe2\x21" + "\xe9\x42\x8c\x85\x8f\x27\x2d\x4c\xa0\x85\xa0\x40\x6c\x4c\xed" + "\x25\x22\x0d\xef\x3f\x73\xd9\xcf\x02\xc9\x81\x02\x04\x09\x82" + "\x02\x07\x80\xa3\x27\x80\x20\x58\xac\x94\x55\x27\x79\x7a\x0c" + "\xac\x84\x2d\x5c\x13\x32\xee\x84\x25\xb8\xb8\xec\x25\x0d\x40" + "\xee\xc0\xd4\x79\x18\x3f\xc6\xbc\xd7\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\xc5\x39\xb2\xc7\xc4\x92\x8a\x29\xf3\x72\xb4\x6c" + "\xa5\x0d\x8c\xbe\x43\xda\xc9\xac\x6c\x26\x7c\x44\xb9\x3f\xee" + "\x40\xcc\x8e\x41\x3c\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh13() + { + testcase("Thresh13"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim16Cond + // ** Rsa17Cond + // ** Ed18Cond + // ** Prefix19Cond + // ** Thresh31Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** preim4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** preim6 + // ** preim13 + // ** rsa14 + // ** ed15 + + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const preim6Preimage = "I am root"s; + auto const preim6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim13Preimage = "I am root"s; + auto const preim13Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa14Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa14PublicKey{ + {0xbd, 0x63, 0x74, 0xd9, 0xc0, 0x3e, 0x0c, 0x57, 0x55, 0x99, 0x00, + 0xf3, 0xa8, 0x03, 0xdc, 0x9a, 0x6c, 0x14, 0xfc, 0x83, 0x33, 0x63, + 0x87, 0x35, 0x9c, 0xfe, 0xc3, 0x00, 0xb4, 0x8b, 0x03, 0xc7, 0x5f, + 0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xe4, 0x34, 0x42, 0x13, 0x44, 0x1d, 0xe6, + 0xf9, 0x27, 0x21, 0xa7, 0x03, 0x74, 0x64, 0x18, 0xfa, 0xd0, 0x68, + 0x28, 0x73, 0x37, 0x3c, 0xf6, 0x63, 0x10, 0x56, 0xcc, 0x25, 0x08, + 0xb9, 0xad, 0xc8, 0x25, 0x64, 0xd1, 0x9c, 0x7c, 0xe7, 0x6c, 0xa6, + 0x12, 0x2c, 0x7d}}; + std::array const rsa14Sig{ + {0xb2, 0x02, 0x99, 0x4f, 0x5e, 0x41, 0xd9, 0x5f, 0x0e, 0x82, 0x86, + 0x93, 0x49, 0x20, 0x55, 0x96, 0x5a, 0xe2, 0xa3, 0xbb, 0x32, 0x37, + 0xe4, 0x57, 0x9a, 0x35, 0xa5, 0x74, 0xc0, 0x33, 0x94, 0x73, 0x1c, + 0xf7, 0xf9, 0x52, 0x4c, 0x9b, 0xed, 0x35, 0x20, 0xda, 0x3f, 0x21, + 0x1f, 0xdd, 0x1c, 0xb2, 0x3a, 0xd0, 0x2a, 0xdf, 0x0c, 0x35, 0x1c, + 0xba, 0x5b, 0x2d, 0x58, 0xf6, 0xcf, 0xe7, 0x85, 0x22, 0x36, 0xa0, + 0xd2, 0x90, 0xf2, 0xc0, 0xbb, 0x86, 0x4c, 0x27, 0x45, 0x25, 0x58, + 0xd8, 0x83, 0x9b, 0x16, 0xa5, 0xb5, 0xff, 0x87, 0xe9, 0xb6, 0x06, + 0xd3, 0xcb, 0x33, 0xc6, 0xa7, 0xa0, 0x62, 0xa9, 0xb4, 0x80, 0x9b, + 0xfe, 0x96, 0x5a, 0xec, 0x6d, 0x76, 0x6d, 0xfa, 0xa1, 0x51, 0x83, + 0x7e, 0x47, 0xc7, 0xea, 0x6e, 0xc1, 0xb9, 0x12, 0x44, 0x6e, 0x27, + 0x99, 0x97, 0x1c, 0xfd, 0x53, 0x62, 0x13, 0xa3, 0x96, 0x91, 0xc8, + 0xd7, 0x1e, 0x09, 0x4e, 0x40, 0x86, 0x72, 0x76, 0x90, 0xb1, 0x5b, + 0xc5, 0xac, 0x47, 0x97, 0x03, 0x4b, 0x5a, 0x8a, 0x1d, 0xc7, 0x86, + 0x1b, 0x00, 0xac, 0x8c, 0xcd, 0x8d, 0x01, 0x2f, 0x50, 0x67, 0x7e, + 0xe6, 0x4e, 0xcb, 0xc1, 0x13, 0xf3, 0x40, 0x00, 0x23, 0x35, 0x9e, + 0xaf, 0x59, 0x0a, 0xf0, 0x7a, 0x84, 0xe2, 0x0c, 0x5c, 0xbd, 0xbf, + 0x27, 0x33, 0xa8, 0x87, 0x8a, 0x59, 0x79, 0x6e, 0xb5, 0x87, 0x8c, + 0x4e, 0xc9, 0x62, 0x3e, 0xf0, 0x25, 0x31, 0x5f, 0xc2, 0x6e, 0x4b, + 0x0d, 0xb8, 0x97, 0x28, 0xc3, 0xd8, 0x80, 0xd3, 0x01, 0x4c, 0x90, + 0xcb, 0xda, 0x46, 0xf5, 0xb6, 0x79, 0x73, 0x08, 0x2b, 0xe1, 0x9c, + 0x81, 0x40, 0x39, 0x67, 0xa1, 0x26, 0x76, 0x1f, 0x2a, 0x98, 0x9a, + 0x62, 0xce, 0xb1, 0xcd, 0xf3, 0x3d, 0xa8, 0x36, 0x60, 0x82, 0x9f, + 0x23, 0x04, 0x11}}; + auto const ed15Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed15PublicKey{ + {0x37, 0x86, 0xc1, 0x8d, 0x06, 0xf2, 0xe9, 0x58, 0x82, 0x95, 0xcd, + 0xb6, 0x5d, 0x37, 0x28, 0xc9, 0x72, 0xa9, 0x41, 0x20, 0xdc, 0x78, + 0x3d, 0xac, 0x24, 0x8c, 0xb0, 0x6f, 0x1e, 0x44, 0x22, 0xc3}}; + std::array const ed15Sig{ + {0xd8, 0x59, 0x56, 0xbd, 0x99, 0x5c, 0xdd, 0xcd, 0x82, 0x9b, 0xea, + 0x14, 0x18, 0x09, 0x9a, 0x8c, 0x54, 0xff, 0xb3, 0xd4, 0xf3, 0xbf, + 0xc1, 0x4b, 0x70, 0x2a, 0xc9, 0x69, 0x5d, 0x42, 0x8a, 0x34, 0x08, + 0x74, 0x3a, 0xef, 0x8b, 0xd9, 0x2e, 0x7a, 0x0d, 0xb7, 0xdb, 0x68, + 0xb3, 0xa8, 0xb8, 0x12, 0x3a, 0x11, 0x60, 0x20, 0xee, 0xd9, 0x1e, + 0x4a, 0xb6, 0x33, 0x94, 0x27, 0x4e, 0x83, 0xf0, 0x0e}}; + std::array const ed15SigningKey{ + {0x0e, 0x2d, 0x40, 0x72, 0x23, 0x7c, 0x11, 0x66, 0xdb, 0xe2, 0xa2, + 0x6e, 0x4a, 0x4e, 0x95, 0x3a, 0x03, 0x78, 0x62, 0x84, 0x2b, 0x40, + 0x3e, 0xc5, 0xa8, 0x93, 0x4d, 0xb5, 0xe0, 0xe4, 0xc5, 0xdd}}; + (void)ed15SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim16CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim16Cond{Type::preimageSha256, + 9, + Preim16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa17CondConditionFingerprint = { + {0x78, 0xe3, 0x04, 0xf4, 0xa6, 0x16, 0x68, 0x4c, 0x1b, 0xcf, 0x3a, + 0x32, 0xff, 0xbc, 0x75, 0x1a, 0xe6, 0x08, 0x9b, 0xff, 0xba, 0x79, + 0xf4, 0x39, 0x7a, 0xfc, 0xe1, 0x6f, 0xff, 0x3e, 0xb3, 0x75}}; + Condition const Rsa17Cond{Type::rsaSha256, + 65536, + Rsa17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed18CondConditionFingerprint = { + {0x0d, 0xea, 0xc5, 0x16, 0x5c, 0x62, 0xb8, 0xd1, 0xa4, 0xe7, 0x5a, + 0x07, 0x58, 0x00, 0x79, 0x51, 0x88, 0x21, 0xe9, 0x4d, 0xba, 0x73, + 0x7b, 0xad, 0x60, 0x9c, 0x5c, 0x26, 0x00, 0x2e, 0xd1, 0x51}}; + Condition const Ed18Cond{Type::ed25519Sha256, + 131072, + Ed18CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix19CondConditionFingerprint = { + {0x26, 0x1c, 0x49, 0x5b, 0x3a, 0xe9, 0x33, 0x8b, 0xa2, 0x9d, 0x09, + 0x07, 0x6c, 0x5d, 0x3e, 0x3a, 0x9f, 0x4e, 0xaa, 0x1d, 0x07, 0x6d, + 0xee, 0x70, 0xe7, 0x6f, 0xd6, 0x5d, 0xeb, 0x90, 0x83, 0x12}}; + Condition const Prefix19Cond{Type::prefixSha256, + 273443, + Prefix19CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh31CondConditionFingerprint = { + {0x57, 0xb7, 0x93, 0x0b, 0xb8, 0xe2, 0x21, 0xe9, 0x42, 0x8c, 0x85, + 0x8f, 0x27, 0x2d, 0x4c, 0xa0, 0x85, 0xa0, 0x40, 0x6c, 0x4c, 0xed, + 0x25, 0x22, 0x0d, 0xef, 0x3f, 0x73, 0xd9, 0xcf, 0x02, 0xc9}}; + Condition const Thresh31Cond{Type::thresholdSha256, + 1033, + Thresh31CondConditionFingerprint, + std::bitset<5>{1}}; + + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + auto preim6 = + std::make_unique(makeSlice(preim6Preimage)); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(preim6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim13 = + std::make_unique(makeSlice(preim13Preimage)); + auto rsa14 = std::make_unique( + makeSlice(rsa14PublicKey), makeSlice(rsa14Sig)); + auto ed15 = std::make_unique(ed15PublicKey, ed15Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim13)); + thresh0Subfulfillments.emplace_back(std::move(rsa14)); + thresh0Subfulfillments.emplace_back(std::move(ed15)); + std::vector thresh0Subconditions{ + {Preim16Cond, Rsa17Cond, Ed18Cond, Prefix19Cond, Thresh31Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x04\x92\xa0\x82\x03\xb9\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x82\x01\x36\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x82\x01\x2b\xa1\x82\x01\x27\x80\x02\x50\x32\x81" + "\x01\x1c\xa2\x82\x01\x1c\xa2\x82\x01\x18\xa0\x81\x9a\xa0\x0b" + "\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0" + "\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1" + "\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xd1" + "\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20" + "\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91" + "\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc\xc6\x2f" + "\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36\xbe\x1d" + "\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81\x03\x02" + "\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27" + "\x80\x20\xaf\x93\xfd\x22\x45\xc2\x08\xab\x43\xf7\x45\x56\x63" + "\xec\xaf\x15\x33\xa0\x2a\xb4\x9e\x15\xb4\x6e\xda\x87\x35\xde" + "\x09\x4b\x06\x31\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x55\xcc" + "\xd1\xa2\x2c\x90\x8d\xe3\x2e\x42\xd4\xe0\x65\xb2\xf7\xda\xc0" + "\x07\x1e\xd3\x23\x0f\xfe\x78\x13\xa2\x86\x61\xc4\x34\x28\x50" + "\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xbd\x63" + "\x74\xd9\xc0\x3e\x0c\x57\x55\x99\x00\xf3\xa8\x03\xdc\x9a\x6c" + "\x14\xfc\x83\x33\x63\x87\x35\x9c\xfe\xc3\x00\xb4\x8b\x03\xc7" + "\x5f\x0a\xe2\x94\xaa\x3f\x76\x15\xb1\xb9\xf6\x5f\x0a\x87\x0c" + "\x5c\x35\xbc\x2f\x0f\x04\xdd\x9d\x12\x8d\x94\xeb\x8b\x93\xb4" + "\x4e\x96\x20\xb7\x17\xa0\x8e\xff\x9e\x1f\x43\xbf\xd6\x6a\x1e" + "\xb6\x0d\x7f\x2c\x08\x67\xa5\xe7\xa3\xb6\xd2\x63\x6a\xf2\xeb" + "\xd1\x21\x83\x8f\xa0\x25\x4a\xc6\xcb\x4e\x66\xc3\x5f\x37\xdf" + "\x5c\x12\xb7\xb8\xfa\x7a\x57\x91\x9d\x55\xa6\x96\x91\xee\x94" + "\xb0\xcc\x45\xd3\x76\x70\x6f\x12\xbd\x81\x9d\x08\x1b\x6d\x55" + "\x3c\x19\x56\x9c\xcf\xc4\xb4\x63\x8a\x87\x35\x2b\x4c\xc6\xe1" + "\x0d\x74\x31\xaa\xc6\x25\x0d\x90\x55\x14\xf1\x73\x09\x93\xba" + "\xc6\xda\x52\x7f\xc2\xdd\x9d\xb2\x4f\x92\x43\xa6\xc9\x2c\x22" + "\xc4\x5a\x22\xc2\x56\xac\xfa\x6a\x37\x6a\x0c\x22\x72\x5d\x30" + "\x50\x4a\x6b\x93\xab\xcf\x69\x5a\x09\xd2\x5a\x87\x31\x80\xa7" + "\x5b\xe4\x34\x42\x13\x44\x1d\xe6\xf9\x27\x21\xa7\x03\x74\x64" + "\x18\xfa\xd0\x68\x28\x73\x37\x3c\xf6\x63\x10\x56\xcc\x25\x08" + "\xb9\xad\xc8\x25\x64\xd1\x9c\x7c\xe7\x6c\xa6\x12\x2c\x7d\x81" + "\x82\x01\x00\xb2\x02\x99\x4f\x5e\x41\xd9\x5f\x0e\x82\x86\x93" + "\x49\x20\x55\x96\x5a\xe2\xa3\xbb\x32\x37\xe4\x57\x9a\x35\xa5" + "\x74\xc0\x33\x94\x73\x1c\xf7\xf9\x52\x4c\x9b\xed\x35\x20\xda" + "\x3f\x21\x1f\xdd\x1c\xb2\x3a\xd0\x2a\xdf\x0c\x35\x1c\xba\x5b" + "\x2d\x58\xf6\xcf\xe7\x85\x22\x36\xa0\xd2\x90\xf2\xc0\xbb\x86" + "\x4c\x27\x45\x25\x58\xd8\x83\x9b\x16\xa5\xb5\xff\x87\xe9\xb6" + "\x06\xd3\xcb\x33\xc6\xa7\xa0\x62\xa9\xb4\x80\x9b\xfe\x96\x5a" + "\xec\x6d\x76\x6d\xfa\xa1\x51\x83\x7e\x47\xc7\xea\x6e\xc1\xb9" + "\x12\x44\x6e\x27\x99\x97\x1c\xfd\x53\x62\x13\xa3\x96\x91\xc8" + "\xd7\x1e\x09\x4e\x40\x86\x72\x76\x90\xb1\x5b\xc5\xac\x47\x97" + "\x03\x4b\x5a\x8a\x1d\xc7\x86\x1b\x00\xac\x8c\xcd\x8d\x01\x2f" + "\x50\x67\x7e\xe6\x4e\xcb\xc1\x13\xf3\x40\x00\x23\x35\x9e\xaf" + "\x59\x0a\xf0\x7a\x84\xe2\x0c\x5c\xbd\xbf\x27\x33\xa8\x87\x8a" + "\x59\x79\x6e\xb5\x87\x8c\x4e\xc9\x62\x3e\xf0\x25\x31\x5f\xc2" + "\x6e\x4b\x0d\xb8\x97\x28\xc3\xd8\x80\xd3\x01\x4c\x90\xcb\xda" + "\x46\xf5\xb6\x79\x73\x08\x2b\xe1\x9c\x81\x40\x39\x67\xa1\x26" + "\x76\x1f\x2a\x98\x9a\x62\xce\xb1\xcd\xf3\x3d\xa8\x36\x60\x82" + "\x9f\x23\x04\x11\xa4\x64\x80\x20\x37\x86\xc1\x8d\x06\xf2\xe9" + "\x58\x82\x95\xcd\xb6\x5d\x37\x28\xc9\x72\xa9\x41\x20\xdc\x78" + "\x3d\xac\x24\x8c\xb0\x6f\x1e\x44\x22\xc3\x81\x40\xd8\x59\x56" + "\xbd\x99\x5c\xdd\xcd\x82\x9b\xea\x14\x18\x09\x9a\x8c\x54\xff" + "\xb3\xd4\xf3\xbf\xc1\x4b\x70\x2a\xc9\x69\x5d\x42\x8a\x34\x08" + "\x74\x3a\xef\x8b\xd9\x2e\x7a\x0d\xb7\xdb\x68\xb3\xa8\xb8\x12" + "\x3a\x11\x60\x20\xee\xd9\x1e\x4a\xb6\x33\x94\x27\x4e\x83\xf0" + "\x0e\xa1\x81\xd2\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b" + "\x80\x20\x26\x1c\x49\x5b\x3a\xe9\x33\x8b\xa2\x9d\x09\x07\x6c" + "\x5d\x3e\x3a\x9f\x4e\xaa\x1d\x07\x6d\xee\x70\xe7\x6f\xd6\x5d" + "\xeb\x90\x83\x12\x81\x03\x04\x2c\x23\x82\x02\x03\xb8\xa2\x2a" + "\x80\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9\x42\x8c\x85\x8f\x27" + "\x2d\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25\x22\x0d\xef\x3f\x73" + "\xd9\xcf\x02\xc9\x81\x02\x04\x09\x82\x02\x07\x80\xa3\x27\x80" + "\x20\x78\xe3\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32\xff\xbc" + "\x75\x1a\xe6\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1\x6f\xff" + "\x3e\xb3\x75\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5" + "\x16\x5c\x62\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21" + "\xe9\x4d\xba\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81" + "\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xed\x35\x35\x44\x12\xa9\x8d\x8b\x06\x29\x46" + "\x40\x3f\x25\xe2\xd6\xf8\xc0\x2b\x18\x32\x48\x38\x0e\x6e\x72" + "\xd6\xd6\x31\x44\x3f\xc5\x81\x03\x0c\x7c\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x7f\x80\x01\x04\xa1\x82\x01\x78\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x05\x81\x7d\x47\xe8\xc3\xa8\x51\x34\x38\xb6\x00" + "\x2a\x31\xf1\xb5\x5c\xa1\xbb\x01\xc4\x10\x03\x82\x24\x2a\xea" + "\x12\x5e\x40\x1f\xec\x81\x03\x04\x2c\x3a\x82\x02\x03\xb8\xa1" + "\x2b\x80\x20\x26\x1c\x49\x5b\x3a\xe9\x33\x8b\xa2\x9d\x09\x07" + "\x6c\x5d\x3e\x3a\x9f\x4e\xaa\x1d\x07\x6d\xee\x70\xe7\x6f\xd6" + "\x5d\xeb\x90\x83\x12\x81\x03\x04\x2c\x23\x82\x02\x03\xb8\xa2" + "\x2a\x80\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9\x42\x8c\x85\x8f" + "\x27\x2d\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25\x22\x0d\xef\x3f" + "\x73\xd9\xcf\x02\xc9\x81\x02\x04\x09\x82\x02\x07\x80\xa3\x27" + "\x80\x20\x32\xec\xaa\x5e\xa6\x88\xdc\xe4\x81\x0f\x93\x0f\x65" + "\xde\x87\xfd\x54\x8c\x79\x04\x81\xe3\x63\x3f\x3d\x08\xa1\xba" + "\x0a\x24\x2b\x46\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x78\xe3" + "\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32\xff\xbc\x75\x1a\xe6" + "\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1\x6f\xff\x3e\xb3\x75" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c\x62" + "\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d\xba" + "\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02\x00" + "\x00\xa4\x27\x80\x20\x40\xd1\x9a\x63\x62\x9b\xc0\x76\xab\x11" + "\x73\x42\x86\xb3\x20\x9d\x23\xe8\x5e\xee\xb9\x82\x5d\x93\xe3" + "\xac\xad\xa0\x40\x41\x51\x1b\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh14() + { + testcase("Thresh14"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim40Cond + // ** Rsa41Cond + // ** Ed42Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** Thresh13Cond + // ***** preim4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** preim6 + // ** prefix18 + // *** prefix19 + // **** thresh20 + // ***** Preim27Cond + // ***** Rsa28Cond + // ***** Ed29Cond + // ***** Thresh30Cond + // ***** preim21 + // ***** thresh22 + // ****** Preim24Cond + // ****** Rsa25Cond + // ****** Ed26Cond + // ****** preim23 + // ** thresh35 + // *** Preim37Cond + // *** Rsa38Cond + // *** Ed39Cond + // *** preim36 + + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const preim6Preimage = "I am root"s; + auto const preim6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh13CondConditionFingerprint = { + {0xec, 0x3a, 0xe5, 0x7c, 0x51, 0x58, 0x3c, 0xcd, 0x1d, 0x5b, 0x3c, + 0xcf, 0xda, 0x64, 0xb0, 0x06, 0x2a, 0x81, 0xf9, 0xcf, 0x46, 0x7d, + 0x7b, 0x48, 0x5e, 0xa9, 0x27, 0x61, 0x86, 0x59, 0x79, 0x44}}; + Condition const Thresh13Cond{Type::thresholdSha256, + 135168, + Thresh13CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim21Preimage = "I am root"s; + auto const preim21Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + auto const preim23Preimage = "I am root"s; + auto const preim23Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + auto const thresh22Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim24CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim24Cond{Type::preimageSha256, + 9, + Preim24CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa25CondConditionFingerprint = { + {0xb2, 0x7f, 0x94, 0xe3, 0xdf, 0x0c, 0x9a, 0x71, 0x3a, 0xd2, 0xeb, + 0x71, 0x91, 0x72, 0x40, 0xb9, 0xcb, 0xb7, 0xac, 0xbc, 0x77, 0x0a, + 0x08, 0x85, 0x07, 0xa3, 0x85, 0x4e, 0x7e, 0xc9, 0x50, 0x96}}; + Condition const Rsa25Cond{Type::rsaSha256, + 65536, + Rsa25CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed26CondConditionFingerprint = { + {0xd6, 0x2f, 0x07, 0xbd, 0x56, 0xfe, 0x9a, 0x02, 0x8c, 0x98, 0x1a, + 0x72, 0x17, 0xb6, 0x26, 0x90, 0x51, 0xaf, 0xe4, 0xea, 0x51, 0x64, + 0xe0, 0x58, 0x3e, 0x85, 0xc9, 0x29, 0x22, 0x94, 0xa1, 0xbf}}; + Condition const Ed26Cond{Type::ed25519Sha256, + 131072, + Ed26CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh20Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim27CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim27Cond{Type::preimageSha256, + 9, + Preim27CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa28CondConditionFingerprint = { + {0x58, 0xac, 0x94, 0x55, 0x27, 0x79, 0x7a, 0x0c, 0xac, 0x84, 0x2d, + 0x5c, 0x13, 0x32, 0xee, 0x84, 0x25, 0xb8, 0xb8, 0xec, 0x25, 0x0d, + 0x40, 0xee, 0xc0, 0xd4, 0x79, 0x18, 0x3f, 0xc6, 0xbc, 0xd7}}; + Condition const Rsa28Cond{Type::rsaSha256, + 65536, + Rsa28CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed29CondConditionFingerprint = { + {0xc5, 0x39, 0xb2, 0xc7, 0xc4, 0x92, 0x8a, 0x29, 0xf3, 0x72, 0xb4, + 0x6c, 0xa5, 0x0d, 0x8c, 0xbe, 0x43, 0xda, 0xc9, 0xac, 0x6c, 0x26, + 0x7c, 0x44, 0xb9, 0x3f, 0xee, 0x40, 0xcc, 0x8e, 0x41, 0x3c}}; + Condition const Ed29Cond{Type::ed25519Sha256, + 131072, + Ed29CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh30CondConditionFingerprint = { + {0x9c, 0x63, 0x06, 0xe7, 0x17, 0xa0, 0x5e, 0xbd, 0xd1, 0x8e, 0x64, + 0xf5, 0xd5, 0xe7, 0x4e, 0x11, 0x4e, 0xe4, 0x25, 0x56, 0xae, 0xdc, + 0x59, 0x76, 0xd1, 0x1e, 0x33, 0x6d, 0x2a, 0xa9, 0x63, 0xdf}}; + Condition const Thresh30Cond{Type::thresholdSha256, + 135168, + Thresh30CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix19Prefix = "P19"s; + auto const prefix19Msg = "P18abcdefghijklmnopqrstuvwxyz"s; + auto const prefix19MaxMsgLength = 29; + auto const prefix18Prefix = "P18"s; + auto const prefix18Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix18MaxMsgLength = 26; + auto const preim36Preimage = "I am root"s; + auto const preim36Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh35Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim37CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim37Cond{Type::preimageSha256, + 9, + Preim37CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa38CondConditionFingerprint = { + {0x13, 0xb3, 0xe0, 0x2d, 0xea, 0x58, 0x68, 0x9a, 0xa7, 0x10, 0x7e, + 0xb2, 0x1a, 0x12, 0x55, 0x79, 0xd6, 0xfe, 0xde, 0x57, 0x0f, 0x6c, + 0x6b, 0xde, 0xd7, 0xfd, 0x12, 0xeb, 0xa6, 0x1d, 0xad, 0x43}}; + Condition const Rsa38Cond{Type::rsaSha256, + 65536, + Rsa38CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed39CondConditionFingerprint = { + {0xbe, 0x9b, 0x3b, 0xe3, 0x70, 0xfc, 0xc2, 0x29, 0xaa, 0xe9, 0x72, + 0x91, 0x42, 0x6b, 0xd7, 0x1f, 0x1a, 0x25, 0x7d, 0xde, 0xa8, 0x39, + 0xfb, 0xce, 0x5c, 0xaa, 0x63, 0xde, 0xfd, 0x1d, 0x23, 0xcf}}; + Condition const Ed39Cond{Type::ed25519Sha256, + 131072, + Ed39CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim40CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim40Cond{Type::preimageSha256, + 9, + Preim40CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa41CondConditionFingerprint = { + {0xf3, 0xe3, 0x0d, 0x35, 0x45, 0x3f, 0x9f, 0x57, 0x07, 0x0b, 0x13, + 0x04, 0x4d, 0x62, 0x56, 0x30, 0x18, 0x34, 0x88, 0x02, 0x22, 0xa6, + 0x94, 0x6e, 0xba, 0x97, 0xa4, 0x4a, 0x64, 0x5d, 0x05, 0xd1}}; + Condition const Rsa41Cond{Type::rsaSha256, + 65536, + Rsa41CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed42CondConditionFingerprint = { + {0xe3, 0x9a, 0x66, 0x70, 0xcd, 0x9b, 0x26, 0x4a, 0x79, 0xac, 0x64, + 0xbe, 0x92, 0xbb, 0xfb, 0x70, 0x0b, 0xdc, 0x9c, 0xbd, 0x13, 0x61, + 0xb7, 0x00, 0x22, 0xaa, 0x2f, 0xdc, 0x96, 0xc9, 0x45, 0x44}}; + Condition const Ed42Cond{Type::ed25519Sha256, + 131072, + Ed42CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + auto preim6 = + std::make_unique(makeSlice(preim6Preimage)); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(preim6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond, Thresh13Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim21 = + std::make_unique(makeSlice(preim21Preimage)); + auto preim23 = + std::make_unique(makeSlice(preim23Preimage)); + std::vector> thresh22Subfulfillments; + thresh22Subfulfillments.emplace_back(std::move(preim23)); + std::vector thresh22Subconditions{ + {Preim24Cond, Rsa25Cond, Ed26Cond}}; + auto thresh22 = std::make_unique( + std::move(thresh22Subfulfillments), + std::move(thresh22Subconditions)); + std::vector> thresh20Subfulfillments; + thresh20Subfulfillments.emplace_back(std::move(preim21)); + thresh20Subfulfillments.emplace_back(std::move(thresh22)); + std::vector thresh20Subconditions{ + {Preim27Cond, Rsa28Cond, Ed29Cond, Thresh30Cond}}; + auto thresh20 = std::make_unique( + std::move(thresh20Subfulfillments), + std::move(thresh20Subconditions)); + auto prefix19 = std::make_unique( + makeSlice(prefix19Prefix), + prefix19MaxMsgLength, + std::move(thresh20)); + auto prefix18 = std::make_unique( + makeSlice(prefix18Prefix), + prefix18MaxMsgLength, + std::move(prefix19)); + auto preim36 = + std::make_unique(makeSlice(preim36Preimage)); + std::vector> thresh35Subfulfillments; + thresh35Subfulfillments.emplace_back(std::move(preim36)); + std::vector thresh35Subconditions{ + {Preim37Cond, Rsa38Cond, Ed39Cond}}; + auto thresh35 = std::make_unique( + std::move(thresh35Subfulfillments), + std::move(thresh35Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix18)); + thresh0Subfulfillments.emplace_back(std::move(thresh35)); + std::vector thresh0Subconditions{ + {Preim40Cond, Rsa41Cond, Ed42Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\xde\xa0\x82\x03\x5f\xa1\x82\x01\x64\x80\x02\x50" + "\x31\x81\x01\x1a\xa2\x82\x01\x59\xa1\x82\x01\x55\x80\x02\x50" + "\x32\x81\x01\x1c\xa2\x82\x01\x4a\xa2\x82\x01\x46\xa0\x81\x9a" + "\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x81" + "\x8a\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f" + "\x74\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9" + "\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2" + "\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc" + "\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36" + "\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81" + "\x03\x02\x00\x00\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef" + "\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9" + "\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01" + "\x09\xa2\x2b\x80\x20\xec\x3a\xe5\x7c\x51\x58\x3c\xcd\x1d\x5b" + "\x3c\xcf\xda\x64\xb0\x06\x2a\x81\xf9\xcf\x46\x7d\x7b\x48\x5e" + "\xa9\x27\x61\x86\x59\x79\x44\x81\x03\x02\x10\x00\x82\x02\x03" + "\x98\xa3\x27\x80\x20\xaf\x93\xfd\x22\x45\xc2\x08\xab\x43\xf7" + "\x45\x56\x63\xec\xaf\x15\x33\xa0\x2a\xb4\x9e\x15\xb4\x6e\xda" + "\x87\x35\xde\x09\x4b\x06\x31\x81\x03\x01\x00\x00\xa4\x27\x80" + "\x20\x55\xcc\xd1\xa2\x2c\x90\x8d\xe3\x2e\x42\xd4\xe0\x65\xb2" + "\xf7\xda\xc0\x07\x1e\xd3\x23\x0f\xfe\x78\x13\xa2\x86\x61\xc4" + "\x34\x28\x50\x81\x03\x02\x00\x00\xa1\x82\x01\x66\x80\x03\x50" + "\x31\x38\x81\x01\x1a\xa2\x82\x01\x5a\xa1\x82\x01\x56\x80\x03" + "\x50\x31\x39\x81\x01\x1d\xa2\x82\x01\x4a\xa2\x82\x01\x46\xa0" + "\x81\x9a\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74" + "\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72" + "\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\xb2\x7f\x94\xe3\xdf\x0c\x9a\x71\x3a\xd2\xeb\x71" + "\x91\x72\x40\xb9\xcb\xb7\xac\xbc\x77\x0a\x08\x85\x07\xa3\x85" + "\x4e\x7e\xc9\x50\x96\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xd6" + "\x2f\x07\xbd\x56\xfe\x9a\x02\x8c\x98\x1a\x72\x17\xb6\x26\x90" + "\x51\xaf\xe4\xea\x51\x64\xe0\x58\x3e\x85\xc9\x29\x22\x94\xa1" + "\xbf\x81\x03\x02\x00\x00\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa2\x2b\x80\x20\x9c\x63\x06\xe7\x17\xa0\x5e\xbd" + "\xd1\x8e\x64\xf5\xd5\xe7\x4e\x11\x4e\xe4\x25\x56\xae\xdc\x59" + "\x76\xd1\x1e\x33\x6d\x2a\xa9\x63\xdf\x81\x03\x02\x10\x00\x82" + "\x02\x03\x98\xa3\x27\x80\x20\x58\xac\x94\x55\x27\x79\x7a\x0c" + "\xac\x84\x2d\x5c\x13\x32\xee\x84\x25\xb8\xb8\xec\x25\x0d\x40" + "\xee\xc0\xd4\x79\x18\x3f\xc6\xbc\xd7\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\xc5\x39\xb2\xc7\xc4\x92\x8a\x29\xf3\x72\xb4\x6c" + "\xa5\x0d\x8c\xbe\x43\xda\xc9\xac\x6c\x26\x7c\x44\xb9\x3f\xee" + "\x40\xcc\x8e\x41\x3c\x81\x03\x02\x00\x00\xa2\x81\x8a\xa0\x0d" + "\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x13\xb3" + "\xe0\x2d\xea\x58\x68\x9a\xa7\x10\x7e\xb2\x1a\x12\x55\x79\xd6" + "\xfe\xde\x57\x0f\x6c\x6b\xde\xd7\xfd\x12\xeb\xa6\x1d\xad\x43" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xbe\x9b\x3b\xe3\x70\xfc" + "\xc2\x29\xaa\xe9\x72\x91\x42\x6b\xd7\x1f\x1a\x25\x7d\xde\xa8" + "\x39\xfb\xce\x5c\xaa\x63\xde\xfd\x1d\x23\xcf\x81\x03\x02\x00" + "\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xf3\xe3\x0d\x35\x45\x3f\x9f\x57\x07\x0b\x13\x04\x4d\x62" + "\x56\x30\x18\x34\x88\x02\x22\xa6\x94\x6e\xba\x97\xa4\x4a\x64" + "\x5d\x05\xd1\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xe3\x9a\x66" + "\x70\xcd\x9b\x26\x4a\x79\xac\x64\xbe\x92\xbb\xfb\x70\x0b\xdc" + "\x9c\xbd\x13\x61\xb7\x00\x22\xaa\x2f\xdc\x96\xc9\x45\x44\x81" + "\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xa3\x87\x17\x38\x0c\x70\x1c\x71\x1c\x8a\x63" + "\x1c\xa6\x1f\x22\x29\x02\x77\xae\xa5\x68\x83\xc8\x35\x9e\x5b" + "\x77\x05\x93\x09\xe9\x62\x81\x03\x0a\xa8\x77\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x59\x07\xdd\x25\xab\xb6" + "\x0b\x25\x84\x7d\x74\x9c\x8b\x71\xa8\x55\xe6\x24\x4e\x17\xdd" + "\xff\xfe\xa4\x79\xb0\x9a\x32\xa3\xff\x45\x9b\x81\x03\x04\x40" + "\x3d\x82\x02\x03\xb8\xa1\x2b\x80\x20\x6c\xae\x9a\x25\x1a\x55" + "\x81\x14\x61\x28\x94\xb6\x4d\xf7\x25\xa6\x0e\xa7\xc6\x70\x7f" + "\xf5\x9b\x31\xa9\xfa\x5b\x09\xf0\x17\x4c\x9d\x81\x03\x04\x40" + "\x3a\x82\x02\x03\xb8\xa2\x2b\x80\x20\x55\xdc\x4e\xc4\xec\xa1" + "\x66\x88\x2d\x34\x87\xd0\x6a\xd0\xd8\x92\xc4\x9d\x8c\x5d\xd4" + "\xef\x54\x33\x28\x14\x0d\x73\x71\x7f\x6b\x1f\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xf3\xe3\x0d\x35\x45\x3f" + "\x9f\x57\x07\x0b\x13\x04\x4d\x62\x56\x30\x18\x34\x88\x02\x22" + "\xa6\x94\x6e\xba\x97\xa4\x4a\x64\x5d\x05\xd1\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe3\x9a\x66\x70\xcd\x9b\x26\x4a\x79\xac" + "\x64\xbe\x92\xbb\xfb\x70\x0b\xdc\x9c\xbd\x13\x61\xb7\x00\x22" + "\xaa\x2f\xdc\x96\xc9\x45\x44\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh15() + { + testcase("Thresh15"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim21Cond + // ** Rsa22Cond + // ** Ed23Cond + // ** Prefix24Cond + // ** Thresh41Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** Thresh13Cond + // ***** preim4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** preim6 + // ** preim18 + // ** rsa19 + // ** ed20 + + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const preim6Preimage = "I am root"s; + auto const preim6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh13CondConditionFingerprint = { + {0xec, 0x3a, 0xe5, 0x7c, 0x51, 0x58, 0x3c, 0xcd, 0x1d, 0x5b, 0x3c, + 0xcf, 0xda, 0x64, 0xb0, 0x06, 0x2a, 0x81, 0xf9, 0xcf, 0x46, 0x7d, + 0x7b, 0x48, 0x5e, 0xa9, 0x27, 0x61, 0x86, 0x59, 0x79, 0x44}}; + Condition const Thresh13Cond{Type::thresholdSha256, + 135168, + Thresh13CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim18Preimage = "I am root"s; + auto const preim18Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa19Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa19PublicKey{ + {0xc0, 0x81, 0x79, 0x3f, 0x26, 0x8f, 0xe8, 0x48, 0xf1, 0x9c, 0xd2, + 0x09, 0x7c, 0x96, 0x0d, 0x3c, 0xbb, 0x85, 0xdb, 0x1f, 0xab, 0xbe, + 0x97, 0x7d, 0xc0, 0x31, 0x07, 0xb0, 0x2e, 0xb9, 0x5c, 0x2c, 0xae, + 0x82, 0xf5, 0x3e, 0xb6, 0x91, 0xb8, 0x88, 0x2a, 0xa4, 0xa7, 0x81, + 0x97, 0xa5, 0x71, 0xad, 0x09, 0x4d, 0xfc, 0x25, 0x41, 0x3e, 0xe0, + 0xa3, 0xa6, 0x19, 0xba, 0x8f, 0x02, 0x41, 0x8d, 0x05, 0x51, 0xcd, + 0xf8, 0x22, 0xb3, 0x7a, 0x6e, 0x94, 0x7e, 0xaa, 0x58, 0xda, 0x02, + 0xae, 0x73, 0x00, 0x94, 0x1c, 0xb5, 0xb5, 0x26, 0x9f, 0xc5, 0x8b, + 0x04, 0xe0, 0xe0, 0x73, 0x96, 0x4b, 0xaf, 0x6d, 0x0a, 0xe4, 0x25, + 0x90, 0x2d, 0x13, 0x3c, 0xbe, 0x0e, 0x68, 0x7d, 0xfe, 0xa6, 0x12, + 0x6b, 0xb6, 0xec, 0xa0, 0xda, 0x2b, 0x22, 0x31, 0xe6, 0x05, 0x76, + 0xf5, 0x98, 0x8e, 0x76, 0x86, 0xbe, 0xc6, 0x07, 0x73, 0x52, 0x20, + 0x13, 0x8f, 0x93, 0x1f, 0xd9, 0x73, 0xfa, 0xb3, 0xed, 0x50, 0x1b, + 0xf7, 0x68, 0xf6, 0x60, 0xa3, 0x12, 0x73, 0x10, 0xda, 0x06, 0x70, + 0x69, 0xcb, 0xb5, 0x6c, 0x85, 0x29, 0xe8, 0x9e, 0x29, 0xb1, 0x4d, + 0x7e, 0x7e, 0xce, 0x15, 0xf5, 0x25, 0x55, 0xc5, 0x89, 0x7e, 0x34, + 0x48, 0x34, 0x43, 0x30, 0x2b, 0x6a, 0x8a, 0x6d, 0x1b, 0x55, 0x2a, + 0x2c, 0xf4, 0xcd, 0xc1, 0x72, 0x78, 0xda, 0x0d, 0x54, 0x32, 0x46, + 0x93, 0xd7, 0x96, 0xce, 0x33, 0x06, 0xe9, 0x7a, 0x7b, 0x6d, 0xe9, + 0x54, 0xe4, 0xbe, 0x56, 0x37, 0xa7, 0x7c, 0xc8, 0xba, 0x17, 0xb1, + 0xba, 0x76, 0xd7, 0x7f, 0xca, 0x7f, 0xfe, 0x60, 0x7d, 0x60, 0x27, + 0xd0, 0x80, 0x65, 0x74, 0xdc, 0xd6, 0xc8, 0x58, 0x4d, 0xcd, 0x8e, + 0xc9, 0x4e, 0xb2, 0x3e, 0x6e, 0x4f, 0xfa, 0x22, 0xfa, 0x9f, 0x3a, + 0x9f, 0x14, 0xeb}}; + std::array const rsa19Sig{ + {0xbc, 0x33, 0xbb, 0xac, 0x3b, 0x40, 0x5d, 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, 0x2c, 0x26, 0x54, 0xc9, 0x24, 0x6b, 0x6f, 0x35, 0x5f, 0xbb, + 0xa9, 0x9e, 0xc2, 0x8a, 0x33, 0xee, 0xf1, 0x96, 0xb9, 0xf0, 0x4d, + 0xa8, 0xaa, 0xf3, 0x81, 0x7e, 0x6d, 0x4e, 0xdc, 0x2c, 0x93, 0x9a, + 0xc5, 0x37, 0x93, 0x26, 0x0b, 0xf6, 0xc1, 0x56, 0x32, 0xea, 0x2f, + 0x16, 0x79, 0x21, 0x68, 0xcf, 0xbe, 0x68, 0xdd, 0xb9, 0x01, 0xdc, + 0x16, 0x82, 0xab, 0xba, 0x6c, 0x4e, 0xab, 0xdc, 0x0f, 0xf2, 0xdb, + 0x94, 0x84, 0x36}}; + auto const ed20Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed20PublicKey{ + {0x63, 0x87, 0xe7, 0xfd, 0x5e, 0x93, 0x76, 0x3e, 0x74, 0x42, 0x8e, + 0xd5, 0xc9, 0x79, 0xa6, 0xa9, 0xc4, 0x3d, 0x61, 0x14, 0x7b, 0x49, + 0xf3, 0xda, 0x52, 0xc2, 0x74, 0x9b, 0x62, 0xae, 0x8c, 0x90}}; + std::array const ed20Sig{ + {0x4f, 0x9d, 0xaf, 0x7e, 0x00, 0x50, 0x3d, 0xdc, 0xb2, 0xd9, 0x56, + 0x79, 0x61, 0xb7, 0xcb, 0xe6, 0x2d, 0xf3, 0xc8, 0xce, 0x6f, 0x7a, + 0xde, 0x9a, 0x85, 0xf8, 0xc5, 0xc7, 0x93, 0x7d, 0xf8, 0xdc, 0xdb, + 0xbc, 0x12, 0x87, 0x0d, 0x42, 0x62, 0xc8, 0xc8, 0xd0, 0xbd, 0xb7, + 0xa9, 0x05, 0x0c, 0x57, 0x2a, 0xf5, 0x59, 0x83, 0x81, 0x69, 0xc8, + 0xbc, 0xec, 0x4b, 0xf8, 0xf6, 0xbd, 0xc7, 0x70, 0x0f}}; + std::array const ed20SigningKey{ + {0x15, 0xe5, 0xd2, 0xb8, 0x15, 0x1f, 0xe1, 0x89, 0x7e, 0x3f, 0x33, + 0x3b, 0x27, 0xed, 0x94, 0xb6, 0xe4, 0x47, 0x82, 0xa0, 0xa8, 0x40, + 0xb9, 0x4d, 0xa8, 0x65, 0xb8, 0x79, 0x2b, 0x0f, 0x1b, 0x4c}}; + (void)ed20SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim21CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim21Cond{Type::preimageSha256, + 9, + Preim21CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa22CondConditionFingerprint = { + {0x1a, 0x59, 0xf0, 0xd9, 0x99, 0xe2, 0xac, 0x9a, 0xc7, 0x84, 0xc3, + 0xe7, 0x21, 0x3d, 0x86, 0x3b, 0x18, 0xfd, 0x67, 0xc1, 0x70, 0x5f, + 0x36, 0x60, 0xc3, 0x4d, 0xb6, 0x1c, 0x84, 0x53, 0x7e, 0xda}}; + Condition const Rsa22Cond{Type::rsaSha256, + 65536, + Rsa22CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed23CondConditionFingerprint = { + {0x1a, 0x18, 0x47, 0x1f, 0xd0, 0x23, 0xc4, 0x4d, 0x07, 0x5b, 0x1e, + 0x43, 0xa6, 0x28, 0x54, 0xce, 0xec, 0x02, 0x4d, 0xc1, 0x00, 0x3c, + 0x0c, 0x55, 0x02, 0xa3, 0xa3, 0x28, 0x38, 0x88, 0x5c, 0x84}}; + Condition const Ed23Cond{Type::ed25519Sha256, + 131072, + Ed23CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix24CondConditionFingerprint = { + {0x8e, 0xbb, 0x0e, 0x97, 0x95, 0xc9, 0x59, 0x89, 0x9d, 0x4a, 0x68, + 0x99, 0x53, 0x94, 0x62, 0x21, 0x6c, 0xb8, 0x22, 0xae, 0x25, 0xb1, + 0xf9, 0x14, 0x12, 0xbf, 0x9c, 0xc9, 0x3f, 0xe3, 0xa2, 0x95}}; + Condition const Prefix24Cond{Type::prefixSha256, + 278563, + Prefix24CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh41CondConditionFingerprint = { + {0xce, 0xc3, 0xf7, 0x49, 0x6e, 0x0c, 0xa4, 0xf0, 0xc7, 0x5a, 0x8f, + 0xd7, 0x84, 0xd2, 0x0d, 0x3d, 0x5a, 0xb7, 0xd3, 0x36, 0x36, 0x49, + 0x21, 0x75, 0xc7, 0x3e, 0x99, 0x9c, 0x82, 0xa4, 0x49, 0x8a}}; + Condition const Thresh41Cond{Type::thresholdSha256, + 135168, + Thresh41CondConditionFingerprint, + std::bitset<5>{25}}; + + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + auto preim6 = + std::make_unique(makeSlice(preim6Preimage)); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(preim6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond, Thresh13Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim18 = + std::make_unique(makeSlice(preim18Preimage)); + auto rsa19 = std::make_unique( + makeSlice(rsa19PublicKey), makeSlice(rsa19Sig)); + auto ed20 = std::make_unique(ed20PublicKey, ed20Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim18)); + thresh0Subfulfillments.emplace_back(std::move(rsa19)); + thresh0Subfulfillments.emplace_back(std::move(ed20)); + std::vector thresh0Subconditions{ + {Preim21Cond, Rsa22Cond, Ed23Cond, Prefix24Cond, Thresh41Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x04\xc1\xa0\x82\x03\xe7\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x82\x01\x64\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x82\x01\x59\xa1\x82\x01\x55\x80\x02\x50\x32\x81" + "\x01\x1c\xa2\x82\x01\x4a\xa2\x82\x01\x46\xa0\x81\x9a\xa0\x0b" + "\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0" + "\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1" + "\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xd1" + "\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20" + "\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91" + "\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc\xc6\x2f" + "\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36\xbe\x1d" + "\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81\x03\x02" + "\x00\x00\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2" + "\x2b\x80\x20\xec\x3a\xe5\x7c\x51\x58\x3c\xcd\x1d\x5b\x3c\xcf" + "\xda\x64\xb0\x06\x2a\x81\xf9\xcf\x46\x7d\x7b\x48\x5e\xa9\x27" + "\x61\x86\x59\x79\x44\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\xaf\x93\xfd\x22\x45\xc2\x08\xab\x43\xf7\x45\x56" + "\x63\xec\xaf\x15\x33\xa0\x2a\xb4\x9e\x15\xb4\x6e\xda\x87\x35" + "\xde\x09\x4b\x06\x31\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x55" + "\xcc\xd1\xa2\x2c\x90\x8d\xe3\x2e\x42\xd4\xe0\x65\xb2\xf7\xda" + "\xc0\x07\x1e\xd3\x23\x0f\xfe\x78\x13\xa2\x86\x61\xc4\x34\x28" + "\x50\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xc0" + "\x81\x79\x3f\x26\x8f\xe8\x48\xf1\x9c\xd2\x09\x7c\x96\x0d\x3c" + "\xbb\x85\xdb\x1f\xab\xbe\x97\x7d\xc0\x31\x07\xb0\x2e\xb9\x5c" + "\x2c\xae\x82\xf5\x3e\xb6\x91\xb8\x88\x2a\xa4\xa7\x81\x97\xa5" + "\x71\xad\x09\x4d\xfc\x25\x41\x3e\xe0\xa3\xa6\x19\xba\x8f\x02" + "\x41\x8d\x05\x51\xcd\xf8\x22\xb3\x7a\x6e\x94\x7e\xaa\x58\xda" + "\x02\xae\x73\x00\x94\x1c\xb5\xb5\x26\x9f\xc5\x8b\x04\xe0\xe0" + "\x73\x96\x4b\xaf\x6d\x0a\xe4\x25\x90\x2d\x13\x3c\xbe\x0e\x68" + "\x7d\xfe\xa6\x12\x6b\xb6\xec\xa0\xda\x2b\x22\x31\xe6\x05\x76" + "\xf5\x98\x8e\x76\x86\xbe\xc6\x07\x73\x52\x20\x13\x8f\x93\x1f" + "\xd9\x73\xfa\xb3\xed\x50\x1b\xf7\x68\xf6\x60\xa3\x12\x73\x10" + "\xda\x06\x70\x69\xcb\xb5\x6c\x85\x29\xe8\x9e\x29\xb1\x4d\x7e" + "\x7e\xce\x15\xf5\x25\x55\xc5\x89\x7e\x34\x48\x34\x43\x30\x2b" + "\x6a\x8a\x6d\x1b\x55\x2a\x2c\xf4\xcd\xc1\x72\x78\xda\x0d\x54" + "\x32\x46\x93\xd7\x96\xce\x33\x06\xe9\x7a\x7b\x6d\xe9\x54\xe4" + "\xbe\x56\x37\xa7\x7c\xc8\xba\x17\xb1\xba\x76\xd7\x7f\xca\x7f" + "\xfe\x60\x7d\x60\x27\xd0\x80\x65\x74\xdc\xd6\xc8\x58\x4d\xcd" + "\x8e\xc9\x4e\xb2\x3e\x6e\x4f\xfa\x22\xfa\x9f\x3a\x9f\x14\xeb" + "\x81\x82\x01\x00\xbc\x33\xbb\xac\x3b\x40\x5d\x97\x4f\x74\xa2" + "\x54\x5b\xf4\xb3\x1e\xb2\x05\x1b\xe0\xd8\x51\x31\x3e\x78\x05" + "\xeb\xe5\x3d\x67\x22\x9e\x99\x51\x1a\xd7\x6c\xce\x2d\xb5\x08" + "\x7c\x4c\x1a\x17\x47\x6c\x15\x1b\xf6\x89\xc1\x24\x2f\x58\x6b" + "\xd6\x50\x6c\xa7\xd7\x94\xf6\xe1\x7c\x9e\x3b\xea\xc2\x6d\xc2" + "\xb4\x14\x0c\x55\x78\x34\xb2\x18\x83\xc1\x86\x9b\x15\x74\xd2" + "\xce\x71\xac\x29\x95\x67\x57\x12\x7e\x72\x55\x61\x83\xc3\x00" + "\xf4\xbb\x9b\x45\xa2\x00\x5c\x7c\xb5\x74\x99\xb1\xe1\xbb\xab" + "\x88\x8d\xfe\x7b\x1f\x13\xd8\xc2\x49\x58\xc2\x41\xdf\xc9\xb9" + "\xeb\x8d\x06\x01\x94\x36\xfb\xdd\x84\x05\x79\xd8\xb2\x23\xba" + "\x2b\xfd\x30\x76\x04\xc4\xba\x08\xf2\x7a\x3a\x49\x40\xbd\xcb" + "\x77\x5a\x1a\x6e\x8d\xb2\x00\x2e\xbf\x5f\xfc\xd8\x2a\xd5\xc3" + "\xd1\x65\x9e\x40\x15\x4b\x5b\x53\x9e\xcc\xaf\xaf\x2c\x26\x54" + "\xc9\x24\x6b\x6f\x35\x5f\xbb\xa9\x9e\xc2\x8a\x33\xee\xf1\x96" + "\xb9\xf0\x4d\xa8\xaa\xf3\x81\x7e\x6d\x4e\xdc\x2c\x93\x9a\xc5" + "\x37\x93\x26\x0b\xf6\xc1\x56\x32\xea\x2f\x16\x79\x21\x68\xcf" + "\xbe\x68\xdd\xb9\x01\xdc\x16\x82\xab\xba\x6c\x4e\xab\xdc\x0f" + "\xf2\xdb\x94\x84\x36\xa4\x64\x80\x20\x63\x87\xe7\xfd\x5e\x93" + "\x76\x3e\x74\x42\x8e\xd5\xc9\x79\xa6\xa9\xc4\x3d\x61\x14\x7b" + "\x49\xf3\xda\x52\xc2\x74\x9b\x62\xae\x8c\x90\x81\x40\x4f\x9d" + "\xaf\x7e\x00\x50\x3d\xdc\xb2\xd9\x56\x79\x61\xb7\xcb\xe6\x2d" + "\xf3\xc8\xce\x6f\x7a\xde\x9a\x85\xf8\xc5\xc7\x93\x7d\xf8\xdc" + "\xdb\xbc\x12\x87\x0d\x42\x62\xc8\xc8\xd0\xbd\xb7\xa9\x05\x0c" + "\x57\x2a\xf5\x59\x83\x81\x69\xc8\xbc\xec\x4b\xf8\xf6\xbd\xc7" + "\x70\x0f\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x8e\xbb\x0e\x97\x95\xc9\x59\x89\x9d\x4a\x68\x99" + "\x53\x94\x62\x21\x6c\xb8\x22\xae\x25\xb1\xf9\x14\x12\xbf\x9c" + "\xc9\x3f\xe3\xa2\x95\x81\x03\x04\x40\x23\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\xce\xc3\xf7\x49\x6e\x0c\xa4\xf0\xc7\x5a\x8f\xd7" + "\x84\xd2\x0d\x3d\x5a\xb7\xd3\x36\x36\x49\x21\x75\xc7\x3e\x99" + "\x9c\x82\xa4\x49\x8a\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x1a\x59\xf0\xd9\x99\xe2\xac\x9a\xc7\x84\xc3\xe7" + "\x21\x3d\x86\x3b\x18\xfd\x67\xc1\x70\x5f\x36\x60\xc3\x4d\xb6" + "\x1c\x84\x53\x7e\xda\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1a" + "\x18\x47\x1f\xd0\x23\xc4\x4d\x07\x5b\x1e\x43\xa6\x28\x54\xce" + "\xec\x02\x4d\xc1\x00\x3c\x0c\x55\x02\xa3\xa3\x28\x38\x88\x5c" + "\x84\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x25\x5f\xef\xe9\x74\x93\xbc\x33\x08\xe5\x6d" + "\xfd\x54\x3a\xd3\x3b\xd9\x73\x88\x36\x84\x17\xd4\x97\x2f\x80" + "\x13\xb9\x64\x86\x07\x56\x81\x03\x0c\xb4\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x6c\xae\x9a\x25\x1a\x55\x81\x14\x61\x28\x94\xb6" + "\x4d\xf7\x25\xa6\x0e\xa7\xc6\x70\x7f\xf5\x9b\x31\xa9\xfa\x5b" + "\x09\xf0\x17\x4c\x9d\x81\x03\x04\x40\x3a\x82\x02\x03\xb8\xa1" + "\x2b\x80\x20\x8e\xbb\x0e\x97\x95\xc9\x59\x89\x9d\x4a\x68\x99" + "\x53\x94\x62\x21\x6c\xb8\x22\xae\x25\xb1\xf9\x14\x12\xbf\x9c" + "\xc9\x3f\xe3\xa2\x95\x81\x03\x04\x40\x23\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\xce\xc3\xf7\x49\x6e\x0c\xa4\xf0\xc7\x5a\x8f\xd7" + "\x84\xd2\x0d\x3d\x5a\xb7\xd3\x36\x36\x49\x21\x75\xc7\x3e\x99" + "\x9c\x82\xa4\x49\x8a\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x19\x8c\xcc\x4c\x02\x17\xf3\xb7\xc0\x65\x68\xae" + "\xf6\xd8\x1a\x44\xd5\x39\x52\x93\x1c\xb2\x4f\x8f\xb3\x6f\x21" + "\xfc\x18\x2c\x58\x10\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x1a" + "\x59\xf0\xd9\x99\xe2\xac\x9a\xc7\x84\xc3\xe7\x21\x3d\x86\x3b" + "\x18\xfd\x67\xc1\x70\x5f\x36\x60\xc3\x4d\xb6\x1c\x84\x53\x7e" + "\xda\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1a\x18\x47\x1f\xd0" + "\x23\xc4\x4d\x07\x5b\x1e\x43\xa6\x28\x54\xce\xec\x02\x4d\xc1" + "\x00\x3c\x0c\x55\x02\xa3\xa3\x28\x38\x88\x5c\x84\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\xa1\xa0\xd1\xf4\xea\x8d\x9a\x14\x25" + "\xca\x52\x3a\x77\x7e\xf4\x0d\x86\x56\xc7\x22\x12\xd3\xa3\xc2" + "\x32\xa3\x2b\x80\x96\xf3\xd4\x23\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh16() + { + testcase("Thresh16"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim16Cond + // ** Rsa17Cond + // ** Ed18Cond + // ** thresh1 + // *** preim2 + // ** prefix3 + // *** prefix4 + // **** preim5 + // ** thresh6 + // *** Preim13Cond + // *** Rsa14Cond + // *** Ed15Cond + // *** preim7 + // *** thresh8 + // **** Preim10Cond + // **** Rsa11Cond + // **** Ed12Cond + // **** preim9 + + auto const preim2Preimage = "I am root"s; + auto const preim2Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim5Preimage = "I am root"s; + auto const preim5Msg = "P4P3abcdefghijklmnopqrstuvwxyz"s; + auto const prefix4Prefix = "P4"s; + auto const prefix4Msg = "P3abcdefghijklmnopqrstuvwxyz"s; + auto const prefix4MaxMsgLength = 28; + auto const prefix3Prefix = "P3"s; + auto const prefix3Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3MaxMsgLength = 26; + auto const preim7Preimage = "I am root"s; + auto const preim7Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim9Preimage = "I am root"s; + auto const preim9Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh8Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim13CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim13Cond{Type::preimageSha256, + 9, + Preim13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa14CondConditionFingerprint = { + {0x32, 0xec, 0xaa, 0x5e, 0xa6, 0x88, 0xdc, 0xe4, 0x81, 0x0f, 0x93, + 0x0f, 0x65, 0xde, 0x87, 0xfd, 0x54, 0x8c, 0x79, 0x04, 0x81, 0xe3, + 0x63, 0x3f, 0x3d, 0x08, 0xa1, 0xba, 0x0a, 0x24, 0x2b, 0x46}}; + Condition const Rsa14Cond{Type::rsaSha256, + 65536, + Rsa14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed15CondConditionFingerprint = { + {0x40, 0xd1, 0x9a, 0x63, 0x62, 0x9b, 0xc0, 0x76, 0xab, 0x11, 0x73, + 0x42, 0x86, 0xb3, 0x20, 0x9d, 0x23, 0xe8, 0x5e, 0xee, 0xb9, 0x82, + 0x5d, 0x93, 0xe3, 0xac, 0xad, 0xa0, 0x40, 0x41, 0x51, 0x1b}}; + Condition const Ed15Cond{Type::ed25519Sha256, + 131072, + Ed15CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim16CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim16Cond{Type::preimageSha256, + 9, + Preim16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa17CondConditionFingerprint = { + {0x78, 0xe3, 0x04, 0xf4, 0xa6, 0x16, 0x68, 0x4c, 0x1b, 0xcf, 0x3a, + 0x32, 0xff, 0xbc, 0x75, 0x1a, 0xe6, 0x08, 0x9b, 0xff, 0xba, 0x79, + 0xf4, 0x39, 0x7a, 0xfc, 0xe1, 0x6f, 0xff, 0x3e, 0xb3, 0x75}}; + Condition const Rsa17Cond{Type::rsaSha256, + 65536, + Rsa17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed18CondConditionFingerprint = { + {0x0d, 0xea, 0xc5, 0x16, 0x5c, 0x62, 0xb8, 0xd1, 0xa4, 0xe7, 0x5a, + 0x07, 0x58, 0x00, 0x79, 0x51, 0x88, 0x21, 0xe9, 0x4d, 0xba, 0x73, + 0x7b, 0xad, 0x60, 0x9c, 0x5c, 0x26, 0x00, 0x2e, 0xd1, 0x51}}; + Condition const Ed18Cond{Type::ed25519Sha256, + 131072, + Ed18CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim2 = + std::make_unique(makeSlice(preim2Preimage)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(preim2)); + std::vector thresh1Subconditions{}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim5 = + std::make_unique(makeSlice(preim5Preimage)); + auto prefix4 = std::make_unique( + makeSlice(prefix4Prefix), prefix4MaxMsgLength, std::move(preim5)); + auto prefix3 = std::make_unique( + makeSlice(prefix3Prefix), prefix3MaxMsgLength, std::move(prefix4)); + auto preim7 = + std::make_unique(makeSlice(preim7Preimage)); + auto preim9 = + std::make_unique(makeSlice(preim9Preimage)); + std::vector> thresh8Subfulfillments; + thresh8Subfulfillments.emplace_back(std::move(preim9)); + std::vector thresh8Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond}}; + auto thresh8 = std::make_unique( + std::move(thresh8Subfulfillments), std::move(thresh8Subconditions)); + std::vector> thresh6Subfulfillments; + thresh6Subfulfillments.emplace_back(std::move(preim7)); + thresh6Subfulfillments.emplace_back(std::move(thresh8)); + std::vector thresh6Subconditions{ + {Preim13Cond, Rsa14Cond, Ed15Cond}}; + auto thresh6 = std::make_unique( + std::move(thresh6Subfulfillments), std::move(thresh6Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix3)); + thresh0Subfulfillments.emplace_back(std::move(thresh6)); + std::vector thresh0Subconditions{ + {Preim16Cond, Rsa17Cond, Ed18Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\xd1\xa0\x82\x01\x52\xa1\x21\x80\x02\x50\x33\x81" + "\x01\x1a\xa2\x18\xa1\x16\x80\x02\x50\x34\x81\x01\x1c\xa2\x0d" + "\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x11" + "\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74" + "\xa1\x00\xa2\x82\x01\x18\xa0\x81\x9a\xa0\x0b\x80\x09\x49\x20" + "\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80" + "\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xaf\x93\xfd\x22\x45" + "\xc2\x08\xab\x43\xf7\x45\x56\x63\xec\xaf\x15\x33\xa0\x2a\xb4" + "\x9e\x15\xb4\x6e\xda\x87\x35\xde\x09\x4b\x06\x31\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\x55\xcc\xd1\xa2\x2c\x90\x8d\xe3\x2e" + "\x42\xd4\xe0\x65\xb2\xf7\xda\xc0\x07\x1e\xd3\x23\x0f\xfe\x78" + "\x13\xa2\x86\x61\xc4\x34\x28\x50\x81\x03\x02\x00\x00\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x32\xec" + "\xaa\x5e\xa6\x88\xdc\xe4\x81\x0f\x93\x0f\x65\xde\x87\xfd\x54" + "\x8c\x79\x04\x81\xe3\x63\x3f\x3d\x08\xa1\xba\x0a\x24\x2b\x46" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x40\xd1\x9a\x63\x62\x9b" + "\xc0\x76\xab\x11\x73\x42\x86\xb3\x20\x9d\x23\xe8\x5e\xee\xb9" + "\x82\x5d\x93\xe3\xac\xad\xa0\x40\x41\x51\x1b\x81\x03\x02\x00" + "\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\x78\xe3\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32\xff\xbc" + "\x75\x1a\xe6\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1\x6f\xff" + "\x3e\xb3\x75\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5" + "\x16\x5c\x62\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21" + "\xe9\x4d\xba\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81" + "\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xd1\xd5\x70\x92\x4d\x4d\xf1\xe5\xc4\xf1\xf5" + "\xf9\x9c\x13\x8a\xf8\x97\x15\x73\x87\x19\x43\x95\xd8\x75\x8e" + "\x5f\xcb\x27\x7a\xe0\x16\x81\x03\x07\x3c\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x04\x80\x01\x03\xa1\x81\xfe\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2a\x80\x20\x91\x68\x6a\x05\xa2\x96\xc0" + "\xdd\x58\xd3\xdd\x84\x6b\x1f\x89\xd6\xa7\xad\xcd\x72\xbd\x31" + "\x00\x48\xaa\x52\x37\x39\x46\xe0\x64\x94\x81\x02\x08\x43\x82" + "\x02\x07\x80\xa2\x2a\x80\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9" + "\x42\x8c\x85\x8f\x27\x2d\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25" + "\x22\x0d\xef\x3f\x73\xd9\xcf\x02\xc9\x81\x02\x04\x09\x82\x02" + "\x07\x80\xa2\x2b\x80\x20\x1d\x3f\x66\x5c\x23\xce\x99\x6b\x18" + "\xad\x65\xad\x33\xed\x6d\x1d\x1c\xde\x0d\x07\xae\x19\x3e\x63" + "\x29\x78\x4e\x1f\x21\x64\x8f\x11\x81\x03\x04\x24\x00\x82\x02" + "\x03\x98\xa3\x27\x80\x20\x78\xe3\x04\xf4\xa6\x16\x68\x4c\x1b" + "\xcf\x3a\x32\xff\xbc\x75\x1a\xe6\x08\x9b\xff\xba\x79\xf4\x39" + "\x7a\xfc\xe1\x6f\xff\x3e\xb3\x75\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x0d\xea\xc5\x16\x5c\x62\xb8\xd1\xa4\xe7\x5a\x07\x58" + "\x00\x79\x51\x88\x21\xe9\x4d\xba\x73\x7b\xad\x60\x9c\x5c\x26" + "\x00\x2e\xd1\x51\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh17() + { + testcase("Thresh17"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim6Cond + // ** Rsa7Cond + // ** Ed8Cond + // ** Prefix9Cond + // ** Thresh12Cond + // ** thresh1 + // *** preim2 + // ** preim3 + // ** rsa4 + // ** ed5 + + auto const preim2Preimage = "I am root"s; + auto const preim2Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0xb9, 0x84, 0xf8, 0xbf, 0xb6, 0x59, 0xa3, 0x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7, 0x98, 0x6a, 0xae, 0x81, 0xf3, 0x79, 0xe0, 0x99, 0xd3, + 0x34, 0xcf, 0xe0, 0xbe, 0x1d, 0xa4, 0x72, 0x93, 0x22, 0xe8, 0x66, + 0xff, 0x35, 0x2c, 0xb7, 0xb8, 0x54, 0x29, 0xea, 0xfe, 0x68, 0x42, + 0xec, 0x98, 0x8c, 0x89, 0x3d, 0x61, 0x1f, 0x0e, 0xa3, 0x59, 0x86, + 0x2f, 0xbe, 0xd7, 0xf0, 0x7b, 0x77, 0xca, 0xf6, 0xdf, 0xb1, 0x35, + 0xc1, 0xbb, 0xcd, 0xad, 0xcd, 0x8c, 0xb8, 0x72, 0xb3, 0x98, 0x5a, + 0x8a, 0x23, 0xd6}}; + auto const ed5Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed5PublicKey{ + {0xae, 0xbc, 0xe5, 0x4b, 0x88, 0x09, 0x8d, 0x4f, 0xc4, 0xe1, 0x22, + 0xa0, 0x7c, 0x41, 0x05, 0xd7, 0x9f, 0xbe, 0xc8, 0x3d, 0x1d, 0x7e, + 0xd6, 0x55, 0xf4, 0x01, 0x67, 0x68, 0x93, 0x55, 0x85, 0xdf}}; + std::array const ed5Sig{ + {0x30, 0xe8, 0x22, 0x9b, 0x51, 0x8c, 0xaa, 0x86, 0x9b, 0xd0, 0xb2, + 0x06, 0xe0, 0xf0, 0xf2, 0xc0, 0x87, 0x43, 0x0f, 0xb0, 0xbd, 0xe1, + 0xeb, 0x17, 0x7f, 0x85, 0xe8, 0x79, 0xc6, 0xa2, 0x9d, 0x19, 0x17, + 0x07, 0x7e, 0x56, 0x06, 0xcb, 0x5a, 0xe1, 0xca, 0x36, 0x5c, 0x0a, + 0xb5, 0x81, 0x2a, 0x42, 0xf6, 0xcc, 0x6e, 0x04, 0xe2, 0x61, 0x8b, + 0x12, 0x16, 0xc2, 0x36, 0xfc, 0xd5, 0xd8, 0xfc, 0x0c}}; + std::array const ed5SigningKey{ + {0x42, 0x67, 0x67, 0xc0, 0xba, 0xdf, 0xb4, 0xd3, 0xf5, 0xc5, 0x1f, + 0x71, 0x97, 0x8a, 0xb4, 0x8e, 0x9a, 0xea, 0x3e, 0xec, 0xaf, 0xdc, + 0xc7, 0x2b, 0x01, 0x1b, 0x06, 0x8f, 0x05, 0x56, 0x63, 0xbc}}; + (void)ed5SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim6CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim6Cond{Type::preimageSha256, + 9, + Preim6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa7CondConditionFingerprint = { + {0x6c, 0x7b, 0xea, 0x83, 0xa1, 0xf4, 0x82, 0x3d, 0x36, 0xe7, 0x6e, + 0xae, 0x1a, 0xbc, 0xa0, 0xba, 0x90, 0x3d, 0x96, 0xc1, 0xe6, 0xad, + 0x3a, 0x47, 0xa5, 0xcb, 0x88, 0xab, 0x3c, 0x5f, 0xcc, 0xd5}}; + Condition const Rsa7Cond{Type::rsaSha256, + 65536, + Rsa7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed8CondConditionFingerprint = { + {0xf1, 0x68, 0x96, 0xa6, 0x2e, 0xef, 0x7f, 0x47, 0x06, 0x51, 0x4c, + 0xc6, 0x7e, 0x24, 0xf7, 0x29, 0x84, 0x9c, 0xd6, 0xb0, 0xd9, 0x4b, + 0xd9, 0x0f, 0xc9, 0x34, 0x01, 0x9d, 0x92, 0xeb, 0xbc, 0x0a}}; + Condition const Ed8Cond{Type::ed25519Sha256, + 131072, + Ed8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix9CondConditionFingerprint = { + {0x61, 0x08, 0x88, 0x30, 0x87, 0xa7, 0x2c, 0x00, 0xe9, 0x98, 0x24, + 0x53, 0x38, 0x61, 0x82, 0xb3, 0x35, 0x81, 0xed, 0x80, 0x33, 0xe7, + 0x68, 0x5b, 0x65, 0xff, 0x56, 0x67, 0x43, 0x7e, 0x53, 0x0b}}; + Condition const Prefix9Cond{Type::prefixSha256, + 2092, + Prefix9CondConditionFingerprint, + std::bitset<5>{1}}; + std::array const Thresh12CondConditionFingerprint = { + {0x1b, 0x04, 0x83, 0x7b, 0xb2, 0x64, 0x8e, 0x23, 0xdf, 0x14, 0x27, + 0x2f, 0x3d, 0xab, 0x92, 0x23, 0x79, 0x01, 0xaa, 0x5e, 0x59, 0x9e, + 0xea, 0x30, 0x82, 0xc0, 0x0d, 0x27, 0x0c, 0xb7, 0x4a, 0x97}}; + Condition const Thresh12Cond{Type::thresholdSha256, + 271360, + Thresh12CondConditionFingerprint, + std::bitset<5>{25}}; + + auto preim2 = + std::make_unique(makeSlice(preim2Preimage)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(preim2)); + std::vector thresh1Subconditions{}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + auto ed5 = std::make_unique(ed5PublicKey, ed5Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim3)); + thresh0Subfulfillments.emplace_back(std::move(rsa4)); + thresh0Subfulfillments.emplace_back(std::move(ed5)); + std::vector thresh0Subconditions{ + {Preim6Cond, Rsa7Cond, Ed8Cond, Prefix9Cond, Thresh12Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\x6b\xa0\x82\x02\x92\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x11\xa0\x0d\xa0\x0b\x80\x09\x49" + "\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x00\xa3\x82\x02\x08\x80" + "\x82\x01\x00\xbe\x09\xc5\xa4\x27\x29\xdf\xd4\x67\x76\xbe\xbf" + "\x2c\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67\x20\xfb\x7a\x27\x93" + "\xc0\x78\x47\x78\xd7\x15\x32\xee\x38\x81\x0d\x36\xa2\xc4\x65" + "\x44\xe6\x62\x26\xb9\x58\x13\xa4\x15\x82\xab\xb1\x16\x61\xfc" + "\x01\x98\xc6\x1a\x69\xc6\xba\x39\x3f\x01\x55\x3d\xd7\x8e\x14" + "\x42\x6d\x78\x74\x9b\x28\xcb\x31\x39\x98\x5a\x11\xdc\xc1\x18" + "\x9d\x8d\xb0\xcd\x1b\x4c\x10\xab\x14\x64\x19\xf1\x33\x15\x45" + "\xc8\x92\x82\x03\x82\x8a\xaa\xad\x94\xfc\x24\x11\x96\x99\x7e" + "\x94\x5a\x82\x57\x68\x61\x9f\x7b\x45\xe0\x99\x9e\x4f\x32\x50" + "\x5f\x05\xc8\x11\xae\xc4\x0c\x63\x18\x0e\x02\x59\x36\x25\x92" + "\x06\x32\xc7\x71\x47\x99\xcc\x0a\x6e\x0a\x58\x71\x3f\x5e\xb7" + "\x78\xf7\x98\x79\xdf\x74\xa4\xeb\xa9\x00\xfd\x81\xb3\xcf\x04" + "\x8c\x5d\x7d\xe7\xb2\x82\x90\x49\xbd\x69\xf3\x08\xe9\x92\xc6" + "\x9e\x41\xba\x74\xd8\x8d\x81\x97\x6f\x86\xab\xc9\xf1\x02\x31" + "\xb4\xce\x47\xb0\x39\xc8\xba\x51\xa7\x39\xf3\x71\xa2\x25\x27" + "\x37\x6e\x09\x6f\x19\x59\xbc\x65\xd9\xcd\x12\xd3\x2c\xa2\x78" + "\xfa\x23\x15\x1a\x82\x41\x91\x1b\xbe\x8a\xe7\xfe\x3c\x3c\x30" + "\x32\xaa\xe9\xf3\x81\x82\x01\x00\xb9\x84\xf8\xbf\xb6\x59\xa3" + "\xda\xd6\xbc\xc4\x90\x78\x9c\xda\x9f\x5d\xf3\xe2\x7c\xd1\x26" + "\xa4\x2e\x03\x37\x51\xbc\x46\xf7\xf9\x84\xe1\xff\xb1\x82\x4a" + "\x7b\xdf\x23\xe6\x47\x2e\x25\xef\x3f\xe2\x47\x37\xec\x55\x24" + "\x1c\x87\xb0\xdb\x66\x8b\xa5\x9b\x71\x94\xc9\x4f\x60\x34\x87" + "\x82\x83\x93\xb6\x0e\x17\x27\xb9\x15\x42\x8f\x4d\x75\x5d\xa8" + "\x0d\x5b\x43\xbf\x58\xe8\x83\x48\xc4\x25\x41\x82\x89\x63\xd6" + "\xf2\x94\x1e\xbc\x55\x3a\xdf\xc5\x0e\x6f\x64\xa1\xc6\x02\x6d" + "\x01\xc0\x12\x76\xdf\xb2\x13\xc4\x17\x73\xd5\xf7\x0e\x1e\x1e" + "\xc3\x7e\x82\x8e\x1d\x17\x50\x4c\xa5\xc3\xf2\xc9\x87\x92\x97" + "\x25\xd5\x66\xd0\x7f\xbf\x0d\x20\x58\xdd\xad\x7c\xd6\x8e\xd2" + "\xea\xe7\xc2\x22\xa8\x1c\xcf\x74\xed\x03\x68\x81\x2b\xfa\xcb" + "\x70\x61\x9e\x4c\x27\xb6\xc0\xa3\x4e\x5a\xa9\x29\x44\x87\x19" + "\xc5\xd7\x98\x6a\xae\x81\xf3\x79\xe0\x99\xd3\x34\xcf\xe0\xbe" + "\x1d\xa4\x72\x93\x22\xe8\x66\xff\x35\x2c\xb7\xb8\x54\x29\xea" + "\xfe\x68\x42\xec\x98\x8c\x89\x3d\x61\x1f\x0e\xa3\x59\x86\x2f" + "\xbe\xd7\xf0\x7b\x77\xca\xf6\xdf\xb1\x35\xc1\xbb\xcd\xad\xcd" + "\x8c\xb8\x72\xb3\x98\x5a\x8a\x23\xd6\xa4\x64\x80\x20\xae\xbc" + "\xe5\x4b\x88\x09\x8d\x4f\xc4\xe1\x22\xa0\x7c\x41\x05\xd7\x9f" + "\xbe\xc8\x3d\x1d\x7e\xd6\x55\xf4\x01\x67\x68\x93\x55\x85\xdf" + "\x81\x40\x30\xe8\x22\x9b\x51\x8c\xaa\x86\x9b\xd0\xb2\x06\xe0" + "\xf0\xf2\xc0\x87\x43\x0f\xb0\xbd\xe1\xeb\x17\x7f\x85\xe8\x79" + "\xc6\xa2\x9d\x19\x17\x07\x7e\x56\x06\xcb\x5a\xe1\xca\x36\x5c" + "\x0a\xb5\x81\x2a\x42\xf6\xcc\x6e\x04\xe2\x61\x8b\x12\x16\xc2" + "\x36\xfc\xd5\xd8\xfc\x0c\xa1\x81\xd2\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa1\x2a\x80\x20\x61\x08\x88\x30\x87\xa7\x2c\x00" + "\xe9\x98\x24\x53\x38\x61\x82\xb3\x35\x81\xed\x80\x33\xe7\x68" + "\x5b\x65\xff\x56\x67\x43\x7e\x53\x0b\x81\x02\x08\x2c\x82\x02" + "\x07\x80\xa2\x2b\x80\x20\x1b\x04\x83\x7b\xb2\x64\x8e\x23\xdf" + "\x14\x27\x2f\x3d\xab\x92\x23\x79\x01\xaa\x5e\x59\x9e\xea\x30" + "\x82\xc0\x0d\x27\x0c\xb7\x4a\x97\x81\x03\x04\x24\x00\x82\x02" + "\x03\x98\xa3\x27\x80\x20\x6c\x7b\xea\x83\xa1\xf4\x82\x3d\x36" + "\xe7\x6e\xae\x1a\xbc\xa0\xba\x90\x3d\x96\xc1\xe6\xad\x3a\x47" + "\xa5\xcb\x88\xab\x3c\x5f\xcc\xd5\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06\x51\x4c\xc6\x7e" + "\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f\xc9\x34\x01\x9d" + "\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xb7\xb7\xa4\x5e\xb0\x43\xaf\xc2\xda\xbb\x7c" + "\xb0\x8b\xf2\x3c\xb5\x1d\x99\xfe\xc4\xc2\x2b\x4d\xca\x96\xe2" + "\x1a\x5d\x16\xdb\x61\xb1\x81\x03\x09\x48\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x7e\x80\x01\x04\xa1\x82\x01\x77\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2a\x80\x20\x61\x08\x88\x30\x87\xa7\x2c\x00\xe9\x98\x24\x53" + "\x38\x61\x82\xb3\x35\x81\xed\x80\x33\xe7\x68\x5b\x65\xff\x56" + "\x67\x43\x7e\x53\x0b\x81\x02\x08\x2c\x82\x02\x07\x80\xa2\x2a" + "\x80\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9\x42\x8c\x85\x8f\x27" + "\x2d\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25\x22\x0d\xef\x3f\x73" + "\xd9\xcf\x02\xc9\x81\x02\x04\x09\x82\x02\x07\x80\xa2\x2b\x80" + "\x20\x1b\x04\x83\x7b\xb2\x64\x8e\x23\xdf\x14\x27\x2f\x3d\xab" + "\x92\x23\x79\x01\xaa\x5e\x59\x9e\xea\x30\x82\xc0\x0d\x27\x0c" + "\xb7\x4a\x97\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3\x27\x80" + "\x20\x3a\x82\x3b\x32\x38\xb1\x3c\x17\x87\x60\x62\xec\xcf\x91" + "\xb0\xaf\xaa\xe5\x11\xe6\xfb\xe2\xb0\x3d\x70\x4d\x1d\xad\xd6" + "\x7c\xee\xa6\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x6c\x7b\xea" + "\x83\xa1\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba\x90\x3d" + "\x96\xc1\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc\xd5\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x90\xce\xed\x45\x98\x68\xff" + "\x19\x2b\x27\xc1\x2a\xa2\x6e\x2e\x82\xf3\xbd\x71\x13\x61\xb0" + "\x76\x40\x4d\x48\xea\x16\xfb\x27\x57\xdc\x81\x03\x02\x00\x00" + "\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06\x51\x4c" + "\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f\xc9\x34" + "\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh18() + { + testcase("Thresh18"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim25Cond + // ** Rsa26Cond + // ** Ed27Cond + // ** thresh1 + // *** Preim3Cond + // *** Rsa4Cond + // *** Ed5Cond + // *** preim2 + // ** prefix6 + // *** prefix7 + // **** prefix8 + // ***** preim9 + // ** thresh10 + // *** Preim17Cond + // *** Rsa18Cond + // *** Ed19Cond + // *** Thresh20Cond + // *** preim11 + // *** thresh12 + // **** Preim14Cond + // **** Rsa15Cond + // **** Ed16Cond + // **** preim13 + + auto const preim2Preimage = "I am root"s; + auto const preim2Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim3CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim3Cond{Type::preimageSha256, + 9, + Preim3CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa4CondConditionFingerprint = { + {0x3a, 0x82, 0x3b, 0x32, 0x38, 0xb1, 0x3c, 0x17, 0x87, 0x60, 0x62, + 0xec, 0xcf, 0x91, 0xb0, 0xaf, 0xaa, 0xe5, 0x11, 0xe6, 0xfb, 0xe2, + 0xb0, 0x3d, 0x70, 0x4d, 0x1d, 0xad, 0xd6, 0x7c, 0xee, 0xa6}}; + Condition const Rsa4Cond{Type::rsaSha256, + 65536, + Rsa4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed5CondConditionFingerprint = { + {0x90, 0xce, 0xed, 0x45, 0x98, 0x68, 0xff, 0x19, 0x2b, 0x27, 0xc1, + 0x2a, 0xa2, 0x6e, 0x2e, 0x82, 0xf3, 0xbd, 0x71, 0x13, 0x61, 0xb0, + 0x76, 0x40, 0x4d, 0x48, 0xea, 0x16, 0xfb, 0x27, 0x57, 0xdc}}; + Condition const Ed5Cond{Type::ed25519Sha256, + 131072, + Ed5CondConditionFingerprint, + std::bitset<5>{0}}; + auto const preim9Preimage = "I am root"s; + auto const preim9Msg = "P8P7P6abcdefghijklmnopqrstuvwxyz"s; + auto const prefix8Prefix = "P8"s; + auto const prefix8Msg = "P7P6abcdefghijklmnopqrstuvwxyz"s; + auto const prefix8MaxMsgLength = 30; + auto const prefix7Prefix = "P7"s; + auto const prefix7Msg = "P6abcdefghijklmnopqrstuvwxyz"s; + auto const prefix7MaxMsgLength = 28; + auto const prefix6Prefix = "P6"s; + auto const prefix6Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6MaxMsgLength = 26; + auto const preim11Preimage = "I am root"s; + auto const preim11Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim13Preimage = "I am root"s; + auto const preim13Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh12Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim14CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim14Cond{Type::preimageSha256, + 9, + Preim14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa15CondConditionFingerprint = { + {0x55, 0x6b, 0x6d, 0xe3, 0x00, 0xd4, 0xf3, 0x7e, 0x75, 0x3a, 0x68, + 0xfc, 0x25, 0xdf, 0xf2, 0xf7, 0x18, 0x54, 0xa5, 0x55, 0x0c, 0xa5, + 0xa9, 0x65, 0xbf, 0x66, 0x9e, 0x4e, 0x49, 0x56, 0x1e, 0xf1}}; + Condition const Rsa15Cond{Type::rsaSha256, + 65536, + Rsa15CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed16CondConditionFingerprint = { + {0xe4, 0x66, 0x69, 0x86, 0x87, 0x57, 0x0e, 0xac, 0xf1, 0xfd, 0x06, + 0x81, 0x48, 0x90, 0x82, 0x42, 0x48, 0x50, 0x75, 0x8e, 0xd4, 0x2d, + 0xf3, 0x02, 0x37, 0x89, 0x28, 0xc5, 0x68, 0xd7, 0xa0, 0x11}}; + Condition const Ed16Cond{Type::ed25519Sha256, + 131072, + Ed16CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh10Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim17CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim17Cond{Type::preimageSha256, + 9, + Preim17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa18CondConditionFingerprint = { + {0x9d, 0xbe, 0x65, 0xf4, 0xae, 0x81, 0x90, 0x79, 0x09, 0x18, 0xa2, + 0x66, 0x12, 0x9c, 0x10, 0x94, 0x66, 0x21, 0x94, 0x70, 0x60, 0x20, + 0x4a, 0x3d, 0x5f, 0xb3, 0x62, 0xb6, 0x06, 0x46, 0x37, 0xfe}}; + Condition const Rsa18Cond{Type::rsaSha256, + 65536, + Rsa18CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed19CondConditionFingerprint = { + {0xe5, 0x88, 0xb7, 0x6e, 0xec, 0x2d, 0xaf, 0x47, 0xc7, 0xa2, 0xf4, + 0x6e, 0xbf, 0x7f, 0x5e, 0x46, 0xd7, 0xfa, 0x33, 0x2c, 0x0a, 0x7e, + 0x86, 0x1d, 0x8c, 0x38, 0xa8, 0x93, 0x52, 0xe8, 0x97, 0xe9}}; + Condition const Ed19Cond{Type::ed25519Sha256, + 131072, + Ed19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh20CondConditionFingerprint = { + {0xb1, 0xc3, 0xf1, 0x72, 0xcd, 0xb5, 0x21, 0xc0, 0x9b, 0xcf, 0xd9, + 0xdf, 0x3a, 0x31, 0x32, 0xe0, 0xc0, 0x2e, 0xde, 0x61, 0xec, 0xb3, + 0xf5, 0x86, 0x46, 0x9a, 0xeb, 0x73, 0x5a, 0xc0, 0x2d, 0x7d}}; + Condition const Thresh20Cond{Type::thresholdSha256, + 135168, + Thresh20CondConditionFingerprint, + std::bitset<5>{25}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim25CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim25Cond{Type::preimageSha256, + 9, + Preim25CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa26CondConditionFingerprint = { + {0xd6, 0x40, 0x0d, 0x21, 0x44, 0x8a, 0xd4, 0x5a, 0xe6, 0x10, 0x3f, + 0xd4, 0x3a, 0x14, 0x5a, 0x5b, 0x87, 0x86, 0x20, 0x3c, 0x43, 0x20, + 0x9d, 0x9d, 0x0c, 0x75, 0x57, 0x80, 0x7d, 0xda, 0x9d, 0x06}}; + Condition const Rsa26Cond{Type::rsaSha256, + 65536, + Rsa26CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed27CondConditionFingerprint = { + {0x6a, 0x26, 0x73, 0x6f, 0xc3, 0xbf, 0x25, 0x73, 0x8e, 0x3b, 0x27, + 0x79, 0x47, 0xa5, 0x37, 0x7c, 0x78, 0xa0, 0x72, 0xd8, 0x77, 0x91, + 0xfc, 0x45, 0x87, 0x7f, 0x11, 0x57, 0xfe, 0x94, 0x57, 0x45}}; + Condition const Ed27Cond{Type::ed25519Sha256, + 131072, + Ed27CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim2 = + std::make_unique(makeSlice(preim2Preimage)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(preim2)); + std::vector thresh1Subconditions{ + {Preim3Cond, Rsa4Cond, Ed5Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim9 = + std::make_unique(makeSlice(preim9Preimage)); + auto prefix8 = std::make_unique( + makeSlice(prefix8Prefix), prefix8MaxMsgLength, std::move(preim9)); + auto prefix7 = std::make_unique( + makeSlice(prefix7Prefix), prefix7MaxMsgLength, std::move(prefix8)); + auto prefix6 = std::make_unique( + makeSlice(prefix6Prefix), prefix6MaxMsgLength, std::move(prefix7)); + auto preim11 = + std::make_unique(makeSlice(preim11Preimage)); + auto preim13 = + std::make_unique(makeSlice(preim13Preimage)); + std::vector> thresh12Subfulfillments; + thresh12Subfulfillments.emplace_back(std::move(preim13)); + std::vector thresh12Subconditions{ + {Preim14Cond, Rsa15Cond, Ed16Cond}}; + auto thresh12 = std::make_unique( + std::move(thresh12Subfulfillments), + std::move(thresh12Subconditions)); + std::vector> thresh10Subfulfillments; + thresh10Subfulfillments.emplace_back(std::move(preim11)); + thresh10Subfulfillments.emplace_back(std::move(thresh12)); + std::vector thresh10Subconditions{ + {Preim17Cond, Rsa18Cond, Ed19Cond, Thresh20Cond}}; + auto thresh10 = std::make_unique( + std::move(thresh10Subfulfillments), + std::move(thresh10Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix6)); + thresh0Subfulfillments.emplace_back(std::move(thresh10)); + std::vector thresh0Subconditions{ + {Preim25Cond, Rsa26Cond, Ed27Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x02\x84\xa0\x82\x02\x05\xa1\x2c\x80\x02\x50\x36\x81" + "\x01\x1a\xa2\x23\xa1\x21\x80\x02\x50\x37\x81\x01\x1c\xa2\x18" + "\xa1\x16\x80\x02\x50\x38\x81\x01\x1e\xa2\x0d\xa0\x0b\x80\x09" + "\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0" + "\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x3a\x82\x3b" + "\x32\x38\xb1\x3c\x17\x87\x60\x62\xec\xcf\x91\xb0\xaf\xaa\xe5" + "\x11\xe6\xfb\xe2\xb0\x3d\x70\x4d\x1d\xad\xd6\x7c\xee\xa6\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x90\xce\xed\x45\x98\x68\xff" + "\x19\x2b\x27\xc1\x2a\xa2\x6e\x2e\x82\xf3\xbd\x71\x13\x61\xb0" + "\x76\x40\x4d\x48\xea\x16\xfb\x27\x57\xdc\x81\x03\x02\x00\x00" + "\xa2\x82\x01\x46\xa0\x81\x9a\xa0\x0b\x80\x09\x49\x20\x61\x6d" + "\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49" + "\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\x55\x6b\x6d\xe3\x00\xd4\xf3" + "\x7e\x75\x3a\x68\xfc\x25\xdf\xf2\xf7\x18\x54\xa5\x55\x0c\xa5" + "\xa9\x65\xbf\x66\x9e\x4e\x49\x56\x1e\xf1\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\xe4\x66\x69\x86\x87\x57\x0e\xac\xf1\xfd\x06" + "\x81\x48\x90\x82\x42\x48\x50\x75\x8e\xd4\x2d\xf3\x02\x37\x89" + "\x28\xc5\x68\xd7\xa0\x11\x81\x03\x02\x00\x00\xa1\x81\xa6\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\xb1\xc3\xf1" + "\x72\xcd\xb5\x21\xc0\x9b\xcf\xd9\xdf\x3a\x31\x32\xe0\xc0\x2e" + "\xde\x61\xec\xb3\xf5\x86\x46\x9a\xeb\x73\x5a\xc0\x2d\x7d\x81" + "\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x9d\xbe\x65" + "\xf4\xae\x81\x90\x79\x09\x18\xa2\x66\x12\x9c\x10\x94\x66\x21" + "\x94\x70\x60\x20\x4a\x3d\x5f\xb3\x62\xb6\x06\x46\x37\xfe\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\xe5\x88\xb7\x6e\xec\x2d\xaf" + "\x47\xc7\xa2\xf4\x6e\xbf\x7f\x5e\x46\xd7\xfa\x33\x2c\x0a\x7e" + "\x86\x1d\x8c\x38\xa8\x93\x52\xe8\x97\xe9\x81\x03\x02\x00\x00" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\xd6\x40\x0d\x21\x44\x8a\xd4\x5a\xe6\x10\x3f\xd4\x3a\x14\x5a" + "\x5b\x87\x86\x20\x3c\x43\x20\x9d\x9d\x0c\x75\x57\x80\x7d\xda" + "\x9d\x06\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x6a\x26\x73\x6f" + "\xc3\xbf\x25\x73\x8e\x3b\x27\x79\x47\xa5\x37\x7c\x78\xa0\x72" + "\xd8\x77\x91\xfc\x45\x87\x7f\x11\x57\xfe\x94\x57\x45\x81\x03" + "\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x03\xd9\x35\x80\x8f\x1a\x34\x46\x09\x02\xcd" + "\xef\x5f\xa2\x13\xb0\xa4\x92\xfc\xef\x00\xd0\x0e\xde\xe4\xcb" + "\xb0\x51\xef\xe0\xff\x24\x81\x03\x08\x60\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x05\x80\x01\x03\xa1\x81\xff\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2a\x80\x20\x7e\x01\xde\x42\xb7\xa1\xa9" + "\x00\x1b\xe6\x63\xb3\x7f\x11\xf4\x2b\x64\x6c\xb7\x9c\xb6\x91" + "\x21\xd6\x27\xbe\xe0\x23\xb4\x73\x06\x61\x81\x02\x0c\x63\x82" + "\x02\x07\x80\xa2\x2b\x80\x20\x13\xeb\x94\x11\x11\xbd\x3a\x86" + "\x32\x53\x0b\x1a\x15\x8e\x6a\x39\xe7\x73\x1f\x22\xa9\xcb\xc1" + "\x8e\x94\xa6\xdf\xfb\x31\x4d\x25\x75\x81\x03\x04\x38\x00\x82" + "\x02\x03\x98\xa2\x2b\x80\x20\x46\x88\xe3\xe8\x80\xca\xd5\x79" + "\x36\xe0\x73\xb0\xf6\xd8\xab\xdd\xf6\x17\xe4\x83\x5f\xc7\xdb" + "\xe4\x55\x54\x89\x84\x92\xef\x96\x28\x81\x03\x02\x10\x00\x82" + "\x02\x03\x98\xa3\x27\x80\x20\xd6\x40\x0d\x21\x44\x8a\xd4\x5a" + "\xe6\x10\x3f\xd4\x3a\x14\x5a\x5b\x87\x86\x20\x3c\x43\x20\x9d" + "\x9d\x0c\x75\x57\x80\x7d\xda\x9d\x06\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\x6a\x26\x73\x6f\xc3\xbf\x25\x73\x8e\x3b\x27\x79" + "\x47\xa5\x37\x7c\x78\xa0\x72\xd8\x77\x91\xfc\x45\x87\x7f\x11" + "\x57\xfe\x94\x57\x45\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh19() + { + testcase("Thresh19"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim9Cond + // ** Rsa10Cond + // ** Ed11Cond + // ** Prefix12Cond + // ** Thresh16Cond + // ** thresh1 + // *** Preim3Cond + // *** Rsa4Cond + // *** Ed5Cond + // *** preim2 + // ** preim6 + // ** rsa7 + // ** ed8 + + auto const preim2Preimage = "I am root"s; + auto const preim2Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim3CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim3Cond{Type::preimageSha256, + 9, + Preim3CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa4CondConditionFingerprint = { + {0x3a, 0x82, 0x3b, 0x32, 0x38, 0xb1, 0x3c, 0x17, 0x87, 0x60, 0x62, + 0xec, 0xcf, 0x91, 0xb0, 0xaf, 0xaa, 0xe5, 0x11, 0xe6, 0xfb, 0xe2, + 0xb0, 0x3d, 0x70, 0x4d, 0x1d, 0xad, 0xd6, 0x7c, 0xee, 0xa6}}; + Condition const Rsa4Cond{Type::rsaSha256, + 65536, + Rsa4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed5CondConditionFingerprint = { + {0x90, 0xce, 0xed, 0x45, 0x98, 0x68, 0xff, 0x19, 0x2b, 0x27, 0xc1, + 0x2a, 0xa2, 0x6e, 0x2e, 0x82, 0xf3, 0xbd, 0x71, 0x13, 0x61, 0xb0, + 0x76, 0x40, 0x4d, 0x48, 0xea, 0x16, 0xfb, 0x27, 0x57, 0xdc}}; + Condition const Ed5Cond{Type::ed25519Sha256, + 131072, + Ed5CondConditionFingerprint, + std::bitset<5>{0}}; + auto const preim6Preimage = "I am root"s; + auto const preim6Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa7PublicKey{ + {0xb5, 0x8b, 0xa2, 0xa1, 0xc0, 0x5b, 0xc3, 0xa3, 0x64, 0xe9, 0x88, + 0xe3, 0x25, 0x89, 0xa0, 0x6d, 0x73, 0x8a, 0x46, 0x09, 0x58, 0xb4, + 0x85, 0x66, 0x87, 0x56, 0x85, 0x39, 0xee, 0x6d, 0x77, 0xbb, 0x99, + 0x57, 0x90, 0x0e, 0x9c, 0x9c, 0xd5, 0x40, 0xc4, 0x8b, 0x37, 0xb1, + 0xfe, 0x78, 0xb7, 0xe1, 0xe8, 0xb7, 0x74, 0xee, 0x74, 0x9c, 0xe5, + 0xa3, 0xdd, 0xb7, 0x87, 0x77, 0xb7, 0x14, 0x08, 0x71, 0xc4, 0xec, + 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b3, 0xa5, 0x06, 0x14, 0x7c, 0xc4, 0xce, 0xc0, 0x6b, 0x27, + 0x46, 0x36, 0x2c, 0x2a, 0x72, 0xb1, 0xe8, 0xd5, 0x5f, 0xcb, 0xca, + 0xf3, 0x6a, 0x47, 0x67, 0x72, 0xf5, 0x87, 0xe2, 0xba, 0x68, 0x88, + 0xac, 0x54, 0x15, 0x3c, 0x00, 0x4d, 0xa7, 0x24, 0x30, 0x5b, 0x90, + 0xe0, 0xdc, 0x53, 0xf9, 0x0a, 0x92, 0x99, 0xbb, 0xfb, 0x62, 0x42, + 0xcf, 0xa3, 0x23, 0x47, 0x56, 0x2b, 0x6a, 0x7d, 0x10, 0x35, 0x2f, + 0xbd, 0x3f, 0x51, 0xf9, 0x76, 0x00, 0x98, 0xa7, 0x71, 0x44, 0x83, + 0x7b, 0xc3, 0x1b, 0xbf, 0xef, 0xe3, 0x2e, 0x95, 0xc7, 0xb6, 0xaf, + 0xf7, 0xca, 0x70}}; + auto const ed8Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed8PublicKey{ + {0xb6, 0x55, 0xc8, 0xa4, 0x14, 0x20, 0x73, 0x44, 0x12, 0x06, 0xf6, + 0xf7, 0xd0, 0x03, 0x74, 0x53, 0xaa, 0x74, 0x6c, 0xf1, 0x84, 0x0e, + 0x86, 0x1d, 0xb1, 0x97, 0x1a, 0x04, 0x91, 0x83, 0x3b, 0x49}}; + std::array const ed8Sig{ + {0x4d, 0xf6, 0x5a, 0x0e, 0xa4, 0x6f, 0x3d, 0xa0, 0x76, 0xe4, 0x3a, + 0xea, 0x69, 0x1e, 0x3f, 0xe4, 0x45, 0x51, 0x97, 0xc8, 0x7e, 0x3c, + 0xd6, 0x34, 0xc8, 0x7f, 0xa3, 0xf9, 0xd7, 0xfe, 0x0a, 0xf4, 0x86, + 0x18, 0xc5, 0xfa, 0x1c, 0x73, 0x88, 0x37, 0x33, 0x3d, 0xd4, 0x8c, + 0x08, 0xf9, 0xa5, 0xf0, 0x83, 0x37, 0x06, 0x5b, 0xd3, 0xfc, 0x20, + 0x12, 0x42, 0x7a, 0x7a, 0xd7, 0x60, 0xc5, 0xd1, 0x0b}}; + std::array const ed8SigningKey{ + {0xc2, 0x00, 0xc6, 0x2e, 0x45, 0xde, 0xf2, 0x39, 0x81, 0x0a, 0xf8, + 0x6d, 0x53, 0x29, 0xe3, 0x1b, 0x8e, 0x57, 0xad, 0xfa, 0x29, 0x1b, + 0x07, 0x1a, 0xee, 0x34, 0xe6, 0x57, 0x5a, 0xeb, 0xf2, 0x1c}}; + (void)ed8SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix12CondConditionFingerprint = { + {0x40, 0x12, 0xc5, 0x21, 0x95, 0x7f, 0x57, 0xf7, 0xca, 0xb8, 0xed, + 0xc5, 0x36, 0xac, 0x18, 0x13, 0x75, 0xd6, 0xf5, 0x68, 0xef, 0x8b, + 0x57, 0xed, 0x06, 0xc0, 0x37, 0x94, 0x3d, 0xe6, 0x6e, 0x21}}; + Condition const Prefix12Cond{Type::prefixSha256, + 3144, + Prefix12CondConditionFingerprint, + std::bitset<5>{1}}; + std::array const Thresh16CondConditionFingerprint = { + {0x42, 0xac, 0xb3, 0xc9, 0x1b, 0xc3, 0xeb, 0x65, 0x74, 0x9a, 0xf5, + 0xb7, 0x1f, 0x46, 0x4a, 0x98, 0xf2, 0xf9, 0x77, 0x7e, 0x5c, 0xac, + 0x9a, 0xa8, 0x2d, 0x1c, 0xaa, 0x60, 0x31, 0xdd, 0x5d, 0x57}}; + Condition const Thresh16Cond{Type::thresholdSha256, + 276480, + Thresh16CondConditionFingerprint, + std::bitset<5>{25}}; + + auto preim2 = + std::make_unique(makeSlice(preim2Preimage)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(preim2)); + std::vector thresh1Subconditions{ + {Preim3Cond, Rsa4Cond, Ed5Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim6 = + std::make_unique(makeSlice(preim6Preimage)); + auto rsa7 = std::make_unique( + makeSlice(rsa7PublicKey), makeSlice(rsa7Sig)); + auto ed8 = std::make_unique(ed8PublicKey, ed8Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim6)); + thresh0Subfulfillments.emplace_back(std::move(rsa7)); + thresh0Subfulfillments.emplace_back(std::move(ed8)); + std::vector thresh0Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond, Prefix12Cond, Thresh16Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\xe5\xa0\x82\x03\x0c\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09" + "\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x3a\x82\x3b\x32\x38\xb1" + "\x3c\x17\x87\x60\x62\xec\xcf\x91\xb0\xaf\xaa\xe5\x11\xe6\xfb" + "\xe2\xb0\x3d\x70\x4d\x1d\xad\xd6\x7c\xee\xa6\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x90\xce\xed\x45\x98\x68\xff\x19\x2b\x27" + "\xc1\x2a\xa2\x6e\x2e\x82\xf3\xbd\x71\x13\x61\xb0\x76\x40\x4d" + "\x48\xea\x16\xfb\x27\x57\xdc\x81\x03\x02\x00\x00\xa3\x82\x02" + "\x08\x80\x82\x01\x00\xb5\x8b\xa2\xa1\xc0\x5b\xc3\xa3\x64\xe9" + "\x88\xe3\x25\x89\xa0\x6d\x73\x8a\x46\x09\x58\xb4\x85\x66\x87" + "\x56\x85\x39\xee\x6d\x77\xbb\x99\x57\x90\x0e\x9c\x9c\xd5\x40" + "\xc4\x8b\x37\xb1\xfe\x78\xb7\xe1\xe8\xb7\x74\xee\x74\x9c\xe5" + "\xa3\xdd\xb7\x87\x77\xb7\x14\x08\x71\xc4\xec\x85\xe2\xe3\xc1" + "\x1e\x34\x14\x21\xe1\xac\xd3\x20\x0f\xb8\x11\x24\x69\xa3\x7d" + "\x98\x35\x2a\xdf\x56\x7d\x30\xf7\x31\x64\x73\xcf\x0c\x9e\xa6" + "\x3b\x7d\x93\xb1\xc4\xb6\x78\x39\x52\x3b\x4d\xb6\xb2\x55\x17" + "\x95\x27\xbd\xd6\xc1\x28\x7b\x82\xbb\xeb\xea\xec\x7e\x48\x35" + "\xb3\x4b\x78\x30\xc4\x66\x32\x39\x2d\xd6\x5f\x59\xeb\x81\x64" + "\x68\xdb\x94\xf4\x8e\x5f\x34\x4f\x3b\x03\xe5\xa6\x1b\x30\x6c" + "\xea\xe8\xc6\x36\xf8\xee\x0b\x0f\xb5\xd2\xe7\xa4\x0a\xbc\xef" + "\x80\x7e\xb1\x9b\xda\xe6\x40\x4a\x3f\x6f\xd1\x5a\x64\x84\xb2" + "\x5c\xd2\xf0\x38\x7c\xcb\xd1\xcd\xdd\x37\x3f\x76\xe7\x08\x25" + "\xe5\xd3\xd9\xe3\x21\x1b\x88\x41\x3d\x2d\x32\xff\xd3\xfe\x4d" + "\x40\x85\x1b\x0f\xd6\xab\x4e\xb7\x38\x68\xe9\x67\xc7\xb5\xd1" + "\x38\xdb\x85\x2e\x2f\x76\xea\x4a\xce\xff\x08\x5e\x93\x87\x98" + "\xf7\x95\xeb\x49\xf6\x8d\x81\x82\x01\x00\x32\x46\x7c\x93\x2a" + "\x43\x4b\xcd\xc1\x40\x8b\xc4\x1e\x1b\x40\xd8\xc2\xa5\x36\x35" + "\xd5\x4b\x39\x98\x16\x31\x9d\x6e\xf4\x09\x84\xd5\xe0\x6c\x26" + "\x8d\x61\x1a\xb6\xac\x1e\x45\xb4\x5f\xb7\x1e\x93\xad\xea\xa6" + "\x05\x69\x7a\xaa\xd2\x38\x7a\x04\x3b\xbe\xc8\x68\xdf\xe6\xc1" + "\x4e\x24\xd1\x0b\xd7\xe0\x7b\x1e\xab\xed\xe5\xa8\xa9\x28\x5e" + "\x4f\x4e\x0b\xbe\x9c\x7f\x9a\xde\x80\x12\x5a\xc1\x9d\xad\x2d" + "\x80\xda\xc2\xd0\xd3\x66\xf6\x8d\x4e\x1d\xf7\x73\xc6\xdc\xee" + "\x5c\x08\x8d\x76\xe7\xb8\xbe\x8e\x85\xe4\x0c\x12\xdc\xe2\x8e" + "\xa0\xc0\x61\xb4\x1b\xbb\x83\x39\xc4\x8b\xeb\xbe\x0c\xa0\xdb" + "\xdc\x08\x03\x70\x05\x23\x61\x32\x24\xe6\x94\x2b\x1e\xd5\xdb" + "\xcb\xee\x83\x3b\xa9\xbc\x7a\xdc\xc5\x53\x43\xb3\xa5\x06\x14" + "\x7c\xc4\xce\xc0\x6b\x27\x46\x36\x2c\x2a\x72\xb1\xe8\xd5\x5f" + "\xcb\xca\xf3\x6a\x47\x67\x72\xf5\x87\xe2\xba\x68\x88\xac\x54" + "\x15\x3c\x00\x4d\xa7\x24\x30\x5b\x90\xe0\xdc\x53\xf9\x0a\x92" + "\x99\xbb\xfb\x62\x42\xcf\xa3\x23\x47\x56\x2b\x6a\x7d\x10\x35" + "\x2f\xbd\x3f\x51\xf9\x76\x00\x98\xa7\x71\x44\x83\x7b\xc3\x1b" + "\xbf\xef\xe3\x2e\x95\xc7\xb6\xaf\xf7\xca\x70\xa4\x64\x80\x20" + "\xb6\x55\xc8\xa4\x14\x20\x73\x44\x12\x06\xf6\xf7\xd0\x03\x74" + "\x53\xaa\x74\x6c\xf1\x84\x0e\x86\x1d\xb1\x97\x1a\x04\x91\x83" + "\x3b\x49\x81\x40\x4d\xf6\x5a\x0e\xa4\x6f\x3d\xa0\x76\xe4\x3a" + "\xea\x69\x1e\x3f\xe4\x45\x51\x97\xc8\x7e\x3c\xd6\x34\xc8\x7f" + "\xa3\xf9\xd7\xfe\x0a\xf4\x86\x18\xc5\xfa\x1c\x73\x88\x37\x33" + "\x3d\xd4\x8c\x08\xf9\xa5\xf0\x83\x37\x06\x5b\xd3\xfc\x20\x12" + "\x42\x7a\x7a\xd7\x60\xc5\xd1\x0b\xa1\x81\xd2\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2a\x80\x20\x40\x12\xc5\x21\x95\x7f" + "\x57\xf7\xca\xb8\xed\xc5\x36\xac\x18\x13\x75\xd6\xf5\x68\xef" + "\x8b\x57\xed\x06\xc0\x37\x94\x3d\xe6\x6e\x21\x81\x02\x0c\x48" + "\x82\x02\x07\x80\xa2\x2b\x80\x20\x42\xac\xb3\xc9\x1b\xc3\xeb" + "\x65\x74\x9a\xf5\xb7\x1f\x46\x4a\x98\xf2\xf9\x77\x7e\x5c\xac" + "\x9a\xa8\x2d\x1c\xaa\x60\x31\xdd\x5d\x57\x81\x03\x04\x38\x00" + "\x82\x02\x03\x98\xa3\x27\x80\x20\x3c\x73\x38\xcf\x23\xc6\x31" + "\x53\x28\xc4\x27\xf8\x95\x87\x99\x83\x2d\x35\x3c\x03\x9b\xd1" + "\xff\xff\x2e\x53\x20\xe9\x5e\x62\xb9\xb7\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x41\x80\x08\xb2\x60\x74\x57\x6d\xac\xed\x74" + "\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95\xa1\x49\x17\xc7\x65\xe3" + "\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x31\xde\x69\x11\x33\x4a\x3b\x83\xbd\x17\xad" + "\x37\xd9\x78\x3e\x93\xb1\x1a\x20\x81\x49\xb9\x6f\x12\x86\x8c" + "\x0d\xaa\xc6\x2d\x4b\x3c\x81\x03\x0a\x6c\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x7f\x80\x01\x04\xa1\x82\x01\x78\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2a\x80\x20\x40\x12\xc5\x21\x95\x7f\x57\xf7\xca\xb8\xed\xc5" + "\x36\xac\x18\x13\x75\xd6\xf5\x68\xef\x8b\x57\xed\x06\xc0\x37" + "\x94\x3d\xe6\x6e\x21\x81\x02\x0c\x48\x82\x02\x07\x80\xa2\x2b" + "\x80\x20\x42\xac\xb3\xc9\x1b\xc3\xeb\x65\x74\x9a\xf5\xb7\x1f" + "\x46\x4a\x98\xf2\xf9\x77\x7e\x5c\xac\x9a\xa8\x2d\x1c\xaa\x60" + "\x31\xdd\x5d\x57\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa2\x2b" + "\x80\x20\x46\x88\xe3\xe8\x80\xca\xd5\x79\x36\xe0\x73\xb0\xf6" + "\xd8\xab\xdd\xf6\x17\xe4\x83\x5f\xc7\xdb\xe4\x55\x54\x89\x84" + "\x92\xef\x96\x28\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27" + "\x80\x20\x3c\x73\x38\xcf\x23\xc6\x31\x53\x28\xc4\x27\xf8\x95" + "\x87\x99\x83\x2d\x35\x3c\x03\x9b\xd1\xff\xff\x2e\x53\x20\xe9" + "\x5e\x62\xb9\xb7\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x6c\x7b" + "\xea\x83\xa1\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba\x90" + "\x3d\x96\xc1\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc\xd5" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x41\x80\x08\xb2\x60\x74" + "\x57\x6d\xac\xed\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95\xa1" + "\x49\x17\xc7\x65\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02\x00" + "\x00\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06\x51" + "\x4c\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f\xc9" + "\x34\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh20() + { + testcase("Thresh20"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim17Cond + // ** Rsa18Cond + // ** Ed19Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** preim2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** preim4 + // ** prefix11 + // *** prefix12 + // **** thresh13 + // ***** preim14 + // ** thresh15 + // *** preim16 + + auto const preim2Preimage = "I am root"s; + auto const preim2Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + auto const preim14Preimage = "I am root"s; + auto const preim14Msg = "P12P11abcdefghijklmnopqrstuvwxyz"s; + auto const thresh13Msg = "P12P11abcdefghijklmnopqrstuvwxyz"s; + auto const prefix12Prefix = "P12"s; + auto const prefix12Msg = "P11abcdefghijklmnopqrstuvwxyz"s; + auto const prefix12MaxMsgLength = 29; + auto const prefix11Prefix = "P11"s; + auto const prefix11Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix11MaxMsgLength = 26; + auto const preim16Preimage = "I am root"s; + auto const preim16Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh15Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim17CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim17Cond{Type::preimageSha256, + 9, + Preim17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa18CondConditionFingerprint = { + {0x9d, 0xbe, 0x65, 0xf4, 0xae, 0x81, 0x90, 0x79, 0x09, 0x18, 0xa2, + 0x66, 0x12, 0x9c, 0x10, 0x94, 0x66, 0x21, 0x94, 0x70, 0x60, 0x20, + 0x4a, 0x3d, 0x5f, 0xb3, 0x62, 0xb6, 0x06, 0x46, 0x37, 0xfe}}; + Condition const Rsa18Cond{Type::rsaSha256, + 65536, + Rsa18CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed19CondConditionFingerprint = { + {0xe5, 0x88, 0xb7, 0x6e, 0xec, 0x2d, 0xaf, 0x47, 0xc7, 0xa2, 0xf4, + 0x6e, 0xbf, 0x7f, 0x5e, 0x46, 0xd7, 0xfa, 0x33, 0x2c, 0x0a, 0x7e, + 0x86, 0x1d, 0x8c, 0x38, 0xa8, 0x93, 0x52, 0xe8, 0x97, 0xe9}}; + Condition const Ed19Cond{Type::ed25519Sha256, + 131072, + Ed19CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim2 = + std::make_unique(makeSlice(preim2Preimage)); + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(preim2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim14 = + std::make_unique(makeSlice(preim14Preimage)); + std::vector> thresh13Subfulfillments; + thresh13Subfulfillments.emplace_back(std::move(preim14)); + std::vector thresh13Subconditions{}; + auto thresh13 = std::make_unique( + std::move(thresh13Subfulfillments), + std::move(thresh13Subconditions)); + auto prefix12 = std::make_unique( + makeSlice(prefix12Prefix), + prefix12MaxMsgLength, + std::move(thresh13)); + auto prefix11 = std::make_unique( + makeSlice(prefix11Prefix), + prefix11MaxMsgLength, + std::move(prefix12)); + auto preim16 = + std::make_unique(makeSlice(preim16Preimage)); + std::vector> thresh15Subfulfillments; + thresh15Subfulfillments.emplace_back(std::move(preim16)); + std::vector thresh15Subconditions{}; + auto thresh15 = std::make_unique( + std::move(thresh15Subfulfillments), + std::move(thresh15Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix11)); + thresh0Subfulfillments.emplace_back(std::move(thresh15)); + std::vector thresh0Subconditions{ + {Preim17Cond, Rsa18Cond, Ed19Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\xd9\xa0\x82\x01\x5a\xa1\x29\x80\x03\x50\x31\x31" + "\x81\x01\x1a\xa2\x1f\xa1\x1d\x80\x03\x50\x31\x32\x81\x01\x1d" + "\xa2\x13\xa2\x11\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20" + "\x72\x6f\x6f\x74\xa1\x00\xa2\x11\xa0\x0d\xa0\x0b\x80\x09\x49" + "\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x00\xa2\x82\x01\x18\xa0" + "\x81\x9a\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74" + "\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72" + "\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32" + "\x48\x19\xe1\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb" + "\x05\xa7\x59\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1e" + "\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0" + "\x8b\x86\x91\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d\x42" + "\xc0\x81\x03\x02\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30" + "\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c" + "\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81" + "\x01\x09\xa3\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c" + "\x81\xf1\x88\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20" + "\x53\xf7\xcb\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x00\x8b\xe6\x62\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52" + "\x3a\xf3\x16\xda\x09\xbe\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c" + "\x24\x87\x62\xfa\x81\x03\x02\x00\x00\xa1\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x9d\xbe\x65\xf4\xae\x81" + "\x90\x79\x09\x18\xa2\x66\x12\x9c\x10\x94\x66\x21\x94\x70\x60" + "\x20\x4a\x3d\x5f\xb3\x62\xb6\x06\x46\x37\xfe\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe5\x88\xb7\x6e\xec\x2d\xaf\x47\xc7\xa2" + "\xf4\x6e\xbf\x7f\x5e\x46\xd7\xfa\x33\x2c\x0a\x7e\x86\x1d\x8c" + "\x38\xa8\x93\x52\xe8\x97\xe9\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x83\xdb\x2d\x5a\xd2\x60\xf2\xf2\x5d\x4b\xea" + "\x77\x91\xa3\x25\x86\x08\x95\xf1\x80\x7e\x11\x92\x28\xce\x87" + "\x49\x63\x33\xb4\x09\x00\x81\x03\x07\x3c\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x04\x80\x01\x03\xa1\x81\xfe\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2a\x80\x20\xa5\x4e\x2b\xc7\xb9\x11\xd2" + "\x66\x1f\x2c\x49\xf6\x1d\xdc\x8a\xaa\xc3\xde\xd6\x2f\xd5\xc8" + "\x13\x22\x0b\x0e\xee\x7d\xf5\xa4\x14\x9b\x81\x02\x0c\x46\x82" + "\x02\x05\xa0\xa2\x2a\x80\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9" + "\x42\x8c\x85\x8f\x27\x2d\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25" + "\x22\x0d\xef\x3f\x73\xd9\xcf\x02\xc9\x81\x02\x04\x09\x82\x02" + "\x07\x80\xa2\x2b\x80\x20\x9c\x76\x66\xc0\x4b\x86\x50\x6c\x38" + "\x0d\xe9\xd8\x43\xac\x79\xfe\x4a\x1f\x31\x6e\x2b\x7c\x23\x3e" + "\xef\x6c\x5b\xc8\xef\x9a\x5e\x58\x81\x03\x04\x24\x00\x82\x02" + "\x03\x98\xa3\x27\x80\x20\x9d\xbe\x65\xf4\xae\x81\x90\x79\x09" + "\x18\xa2\x66\x12\x9c\x10\x94\x66\x21\x94\x70\x60\x20\x4a\x3d" + "\x5f\xb3\x62\xb6\x06\x46\x37\xfe\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\xe5\x88\xb7\x6e\xec\x2d\xaf\x47\xc7\xa2\xf4\x6e\xbf" + "\x7f\x5e\x46\xd7\xfa\x33\x2c\x0a\x7e\x86\x1d\x8c\x38\xa8\x93" + "\x52\xe8\x97\xe9\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh21() + { + testcase("Thresh21"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim14Cond + // ** Rsa15Cond + // ** Ed16Cond + // ** Prefix17Cond + // ** Thresh21Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** preim2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** preim4 + // ** preim11 + // ** rsa12 + // ** ed13 + + auto const preim2Preimage = "I am root"s; + auto const preim2Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + auto const preim11Preimage = "I am root"s; + auto const preim11Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa12Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa12PublicKey{ + {0xd9, 0x25, 0xc3, 0xba, 0x0a, 0x46, 0x6e, 0xa9, 0x1d, 0x05, 0xd7, + 0x54, 0xf1, 0xff, 0xf4, 0xaf, 0xe5, 0x13, 0xcf, 0xd6, 0x74, 0xb0, + 0xcf, 0xc2, 0x8c, 0x68, 0x5c, 0xa9, 0xf3, 0x44, 0x4b, 0xfd, 0x4a, + 0x4d, 0x29, 0x64, 0xbc, 0xa8, 0x98, 0xf5, 0x35, 0x0a, 0x65, 0xe5, + 0xcd, 0x5d, 0x08, 0x9f, 0x58, 0x22, 0xed, 0x21, 0x78, 0x04, 0x4d, + 0x2a, 0xce, 0x80, 0x33, 0x19, 0x5b, 0x7a, 0xbd, 0xa6, 0x89, 0xfa, + 0x80, 0xa4, 0xf5, 0x32, 0xa6, 0xb1, 0x34, 0x61, 0x55, 0x5a, 0xbd, + 0x05, 0xaf, 0x4b, 0x4b, 0xdf, 0xe0, 0xa9, 0x3e, 0x1d, 0x2f, 0x3e, + 0xaf, 0x0c, 0x65, 0x32, 0xc6, 0xf2, 0xe0, 0x5c, 0x09, 0xc0, 0xa2, + 0x41, 0xe6, 0xc9, 0x96, 0x5e, 0x88, 0x62, 0x4a, 0x28, 0x4b, 0x23, + 0x2f, 0xcf, 0xb3, 0xb7, 0x1e, 0x11, 0x7f, 0xc4, 0x63, 0x1a, 0xe4, + 0x24, 0x29, 0x46, 0xf4, 0x48, 0xde, 0x30, 0x45, 0x97, 0xf8, 0x6c, + 0x8d, 0x4e, 0x4a, 0xce, 0x5e, 0x41, 0xb2, 0xb7, 0x5a, 0xd5, 0x94, + 0x42, 0x5a, 0x14, 0xd1, 0x11, 0x99, 0xc5, 0xeb, 0x66, 0xbe, 0xb1, + 0xc6, 0xc3, 0xdb, 0x2f, 0x8f, 0xa0, 0x6c, 0xa9, 0x27, 0x0f, 0xc0, + 0x92, 0x77, 0x0b, 0x8d, 0x66, 0xb8, 0x93, 0x0b, 0xc0, 0x5c, 0xcb, + 0x51, 0x4e, 0xa3, 0x83, 0xd2, 0xbd, 0x04, 0xd8, 0xc0, 0x0c, 0xb2, + 0xf7, 0x38, 0x4e, 0x6a, 0xec, 0xfe, 0x76, 0xd9, 0x71, 0x0b, 0x90, + 0x21, 0x7c, 0xbf, 0x07, 0xc4, 0xd8, 0x4c, 0x6d, 0xb9, 0x35, 0x48, + 0x5d, 0x82, 0xea, 0x61, 0xc5, 0x14, 0xff, 0x25, 0x50, 0x47, 0xaf, + 0x06, 0x58, 0xa9, 0x95, 0x2c, 0xdd, 0xe5, 0xbd, 0x95, 0x4a, 0x7b, + 0x27, 0xa1, 0x46, 0xe3, 0xf0, 0x16, 0xe8, 0xf9, 0xba, 0x43, 0xb8, + 0x77, 0xdc, 0x87, 0x81, 0x3a, 0xc0, 0xf2, 0xed, 0x3b, 0x03, 0x5e, + 0xe6, 0x89, 0x71}}; + std::array const rsa12Sig{ + {0x9f, 0x25, 0x73, 0x8a, 0x4d, 0x3d, 0x96, 0x08, 0xd2, 0x2e, 0x4d, + 0x60, 0xfa, 0xe4, 0x66,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, 0x6b, 0x8a, + 0x25, 0x8c, 0xc0, 0x43, 0xe0, 0x56, 0x50, 0x67, 0x56, 0xd6, 0xaf, + 0x9e, 0x81, 0xaf, 0x82, 0x80, 0xa3, 0xfe, 0x0d, 0xbe, 0xb6, 0xa4, + 0x41, 0x56, 0x96, 0x76, 0x09, 0x31, 0x7e, 0x79, 0xbf, 0x69, 0xb1, + 0x4e, 0x6d, 0x81, 0xab, 0xbb, 0xd3, 0x6a, 0xf0, 0x7b, 0x1f, 0x59, + 0x4a, 0x71, 0x81, 0x73, 0x1c, 0x21, 0x72, 0x24, 0xcf, 0xc2, 0x98, + 0x71, 0x89, 0x72}}; + auto const ed13Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed13PublicKey{ + {0xe8, 0xb1, 0xe9, 0x04, 0xef, 0x8f, 0x78, 0x4c, 0x54, 0xf2, 0x45, + 0x60, 0x93, 0xb4, 0xc6, 0xa4, 0xc2, 0x9a, 0xa9, 0xb7, 0x5a, 0x0b, + 0x06, 0xf1, 0x78, 0xdc, 0xa9, 0x08, 0x12, 0xb2, 0x2f, 0xf4}}; + std::array const ed13Sig{ + {0x03, 0x17, 0xa0, 0x49, 0x7b, 0xee, 0x0d, 0x84, 0x64, 0xee, 0xa8, + 0xc1, 0xe6, 0x3e, 0xc6, 0xed, 0xd6, 0x25, 0x7e, 0x7d, 0xad, 0x96, + 0xf3, 0x82, 0x4a, 0xa6, 0xb1, 0x38, 0xf1, 0x2f, 0x54, 0x6a, 0x52, + 0x39, 0x26, 0x08, 0x2d, 0xe6, 0xfd, 0xb2, 0xfa, 0x23, 0xb3, 0x91, + 0x30, 0x07, 0x9a, 0x4b, 0x63, 0xbb, 0x6f, 0x55, 0xcb, 0x0a, 0xe9, + 0xb1, 0xfb, 0x40, 0x9e, 0x1f, 0x87, 0x70, 0x5a, 0x07}}; + std::array const ed13SigningKey{ + {0x0c, 0x45, 0x3e, 0x20, 0xe2, 0x12, 0x63, 0x6a, 0x7c, 0x36, 0x75, + 0xad, 0x2e, 0xd7, 0xc0, 0x39, 0x27, 0x7e, 0x38, 0x9a, 0xa2, 0xd3, + 0x3b, 0x24, 0x18, 0xf8, 0x68, 0x4e, 0x7f, 0xfa, 0x5d, 0xf3}}; + (void)ed13SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim14CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim14Cond{Type::preimageSha256, + 9, + Preim14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa15CondConditionFingerprint = { + {0x55, 0x6b, 0x6d, 0xe3, 0x00, 0xd4, 0xf3, 0x7e, 0x75, 0x3a, 0x68, + 0xfc, 0x25, 0xdf, 0xf2, 0xf7, 0x18, 0x54, 0xa5, 0x55, 0x0c, 0xa5, + 0xa9, 0x65, 0xbf, 0x66, 0x9e, 0x4e, 0x49, 0x56, 0x1e, 0xf1}}; + Condition const Rsa15Cond{Type::rsaSha256, + 65536, + Rsa15CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed16CondConditionFingerprint = { + {0xe4, 0x66, 0x69, 0x86, 0x87, 0x57, 0x0e, 0xac, 0xf1, 0xfd, 0x06, + 0x81, 0x48, 0x90, 0x82, 0x42, 0x48, 0x50, 0x75, 0x8e, 0xd4, 0x2d, + 0xf3, 0x02, 0x37, 0x89, 0x28, 0xc5, 0x68, 0xd7, 0xa0, 0x11}}; + Condition const Ed16Cond{Type::ed25519Sha256, + 131072, + Ed16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix17CondConditionFingerprint = { + {0x9e, 0x6e, 0xab, 0xa1, 0x2f, 0xa0, 0x27, 0xf8, 0x19, 0xa9, 0xf3, + 0x0a, 0x12, 0xef, 0x47, 0xce, 0x16, 0xd7, 0xd3, 0x05, 0x02, 0x92, + 0x99, 0x9d, 0xdd, 0x70, 0x09, 0x3c, 0xaa, 0x45, 0x85, 0xda}}; + Condition const Prefix17Cond{Type::prefixSha256, + 3116, + Prefix17CondConditionFingerprint, + std::bitset<5>{5}}; + std::array const Thresh21CondConditionFingerprint = { + {0x57, 0xb7, 0x93, 0x0b, 0xb8, 0xe2, 0x21, 0xe9, 0x42, 0x8c, 0x85, + 0x8f, 0x27, 0x2d, 0x4c, 0xa0, 0x85, 0xa0, 0x40, 0x6c, 0x4c, 0xed, + 0x25, 0x22, 0x0d, 0xef, 0x3f, 0x73, 0xd9, 0xcf, 0x02, 0xc9}}; + Condition const Thresh21Cond{Type::thresholdSha256, + 1033, + Thresh21CondConditionFingerprint, + std::bitset<5>{1}}; + + auto preim2 = + std::make_unique(makeSlice(preim2Preimage)); + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(preim2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim11 = + std::make_unique(makeSlice(preim11Preimage)); + auto rsa12 = std::make_unique( + makeSlice(rsa12PublicKey), makeSlice(rsa12Sig)); + auto ed13 = std::make_unique(ed13PublicKey, ed13Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim11)); + thresh0Subfulfillments.emplace_back(std::move(rsa12)); + thresh0Subfulfillments.emplace_back(std::move(ed13)); + std::vector thresh0Subconditions{ + {Preim14Cond, Rsa15Cond, Ed16Cond, Prefix17Cond, Thresh21Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x04\x73\xa0\x82\x03\x9b\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x82\x01\x18\xa0\x81\x9a\xa0\x0b" + "\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0" + "\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1" + "\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xee" + "\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c" + "\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2" + "\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46" + "\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac" + "\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02" + "\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27" + "\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e" + "\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f" + "\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b" + "\xe6\x62\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda" + "\x09\xbe\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa" + "\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xd9\x25" + "\xc3\xba\x0a\x46\x6e\xa9\x1d\x05\xd7\x54\xf1\xff\xf4\xaf\xe5" + "\x13\xcf\xd6\x74\xb0\xcf\xc2\x8c\x68\x5c\xa9\xf3\x44\x4b\xfd" + "\x4a\x4d\x29\x64\xbc\xa8\x98\xf5\x35\x0a\x65\xe5\xcd\x5d\x08" + "\x9f\x58\x22\xed\x21\x78\x04\x4d\x2a\xce\x80\x33\x19\x5b\x7a" + "\xbd\xa6\x89\xfa\x80\xa4\xf5\x32\xa6\xb1\x34\x61\x55\x5a\xbd" + "\x05\xaf\x4b\x4b\xdf\xe0\xa9\x3e\x1d\x2f\x3e\xaf\x0c\x65\x32" + "\xc6\xf2\xe0\x5c\x09\xc0\xa2\x41\xe6\xc9\x96\x5e\x88\x62\x4a" + "\x28\x4b\x23\x2f\xcf\xb3\xb7\x1e\x11\x7f\xc4\x63\x1a\xe4\x24" + "\x29\x46\xf4\x48\xde\x30\x45\x97\xf8\x6c\x8d\x4e\x4a\xce\x5e" + "\x41\xb2\xb7\x5a\xd5\x94\x42\x5a\x14\xd1\x11\x99\xc5\xeb\x66" + "\xbe\xb1\xc6\xc3\xdb\x2f\x8f\xa0\x6c\xa9\x27\x0f\xc0\x92\x77" + "\x0b\x8d\x66\xb8\x93\x0b\xc0\x5c\xcb\x51\x4e\xa3\x83\xd2\xbd" + "\x04\xd8\xc0\x0c\xb2\xf7\x38\x4e\x6a\xec\xfe\x76\xd9\x71\x0b" + "\x90\x21\x7c\xbf\x07\xc4\xd8\x4c\x6d\xb9\x35\x48\x5d\x82\xea" + "\x61\xc5\x14\xff\x25\x50\x47\xaf\x06\x58\xa9\x95\x2c\xdd\xe5" + "\xbd\x95\x4a\x7b\x27\xa1\x46\xe3\xf0\x16\xe8\xf9\xba\x43\xb8" + "\x77\xdc\x87\x81\x3a\xc0\xf2\xed\x3b\x03\x5e\xe6\x89\x71\x81" + "\x82\x01\x00\x9f\x25\x73\x8a\x4d\x3d\x96\x08\xd2\x2e\x4d\x60" + "\xfa\xe4\x66\x77\xa2\x5b\xa3\xdc\x7e\x2e\xea\x97\x5c\x1b\x83" + "\xbb\xf8\xa7\xe1\xe4\x69\xd1\x9f\x82\xee\xa5\x73\xa9\xd3\x9f" + "\xa4\x0a\xd8\x25\xb1\xcb\xeb\x34\x3f\x76\x1c\xe2\xe8\x31\xdc" + "\x95\xbd\xdc\x44\x48\xd6\x8f\x77\x9d\x1e\xfe\xc2\xeb\x84\xc2" + "\xb8\x3b\x54\x08\x3b\x8a\x02\xda\xa4\x43\xe3\x0a\x36\xbe\x70" + "\x3c\x1f\x19\x1e\x18\x8f\x9f\x2a\x61\x2b\x70\x12\x9b\x8f\x3b" + "\xe8\x43\xe6\x31\x50\xb0\xe4\xc3\x5d\x63\xe4\xbf\x3d\x24\x4a" + "\x71\x70\x1c\x57\x24\x28\x63\x20\x88\x68\xa3\x23\xb1\xdd\xee" + "\x8b\xa9\xce\x87\x85\xba\xf1\x3a\x6e\x78\x34\x93\x55\x28\x1d" + "\x8c\x92\x9d\x4d\x0d\x6d\x16\xa6\xfb\x3a\xea\xf8\x90\xd7\xed" + "\xb9\xe4\xd8\x49\x8f\x40\x77\x52\x31\x15\x5f\x49\xee\xbb\xdc" + "\x31\x2a\x63\xdf\xcb\x41\x80\x19\x5b\xd6\x4b\x52\xe3\x31\x61" + "\x1f\xff\x93\xa7\x6b\x8a\x25\x8c\xc0\x43\xe0\x56\x50\x67\x56" + "\xd6\xaf\x9e\x81\xaf\x82\x80\xa3\xfe\x0d\xbe\xb6\xa4\x41\x56" + "\x96\x76\x09\x31\x7e\x79\xbf\x69\xb1\x4e\x6d\x81\xab\xbb\xd3" + "\x6a\xf0\x7b\x1f\x59\x4a\x71\x81\x73\x1c\x21\x72\x24\xcf\xc2" + "\x98\x71\x89\x72\xa4\x64\x80\x20\xe8\xb1\xe9\x04\xef\x8f\x78" + "\x4c\x54\xf2\x45\x60\x93\xb4\xc6\xa4\xc2\x9a\xa9\xb7\x5a\x0b" + "\x06\xf1\x78\xdc\xa9\x08\x12\xb2\x2f\xf4\x81\x40\x03\x17\xa0" + "\x49\x7b\xee\x0d\x84\x64\xee\xa8\xc1\xe6\x3e\xc6\xed\xd6\x25" + "\x7e\x7d\xad\x96\xf3\x82\x4a\xa6\xb1\x38\xf1\x2f\x54\x6a\x52" + "\x39\x26\x08\x2d\xe6\xfd\xb2\xfa\x23\xb3\x91\x30\x07\x9a\x4b" + "\x63\xbb\x6f\x55\xcb\x0a\xe9\xb1\xfb\x40\x9e\x1f\x87\x70\x5a" + "\x07\xa1\x81\xd1\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2a" + "\x80\x20\x9e\x6e\xab\xa1\x2f\xa0\x27\xf8\x19\xa9\xf3\x0a\x12" + "\xef\x47\xce\x16\xd7\xd3\x05\x02\x92\x99\x9d\xdd\x70\x09\x3c" + "\xaa\x45\x85\xda\x81\x02\x0c\x2c\x82\x02\x05\xa0\xa2\x2a\x80" + "\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9\x42\x8c\x85\x8f\x27\x2d" + "\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25\x22\x0d\xef\x3f\x73\xd9" + "\xcf\x02\xc9\x81\x02\x04\x09\x82\x02\x07\x80\xa3\x27\x80\x20" + "\x55\x6b\x6d\xe3\x00\xd4\xf3\x7e\x75\x3a\x68\xfc\x25\xdf\xf2" + "\xf7\x18\x54\xa5\x55\x0c\xa5\xa9\x65\xbf\x66\x9e\x4e\x49\x56" + "\x1e\xf1\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xe4\x66\x69\x86" + "\x87\x57\x0e\xac\xf1\xfd\x06\x81\x48\x90\x82\x42\x48\x50\x75" + "\x8e\xd4\x2d\xf3\x02\x37\x89\x28\xc5\x68\xd7\xa0\x11\x81\x03" + "\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x5f\xc8\xe8\x8f\x8e\xd9\x8e\x38\x95\x4d\xaf" + "\xe9\x0e\x06\xa3\x89\x4d\xa6\x32\x31\x98\x4d\x35\xbd\x29\xdc" + "\x7e\x86\xf8\x58\x34\x11\x81\x03\x09\x48\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x7e\x80\x01\x04\xa1\x82\x01\x77\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2a\x80\x20\x9e\x6e\xab\xa1\x2f\xa0\x27\xf8\x19\xa9\xf3\x0a" + "\x12\xef\x47\xce\x16\xd7\xd3\x05\x02\x92\x99\x9d\xdd\x70\x09" + "\x3c\xaa\x45\x85\xda\x81\x02\x0c\x2c\x82\x02\x05\xa0\xa2\x2a" + "\x80\x20\x57\xb7\x93\x0b\xb8\xe2\x21\xe9\x42\x8c\x85\x8f\x27" + "\x2d\x4c\xa0\x85\xa0\x40\x6c\x4c\xed\x25\x22\x0d\xef\x3f\x73" + "\xd9\xcf\x02\xc9\x81\x02\x04\x09\x82\x02\x07\x80\xa2\x2b\x80" + "\x20\x9c\x76\x66\xc0\x4b\x86\x50\x6c\x38\x0d\xe9\xd8\x43\xac" + "\x79\xfe\x4a\x1f\x31\x6e\x2b\x7c\x23\x3e\xef\x6c\x5b\xc8\xef" + "\x9a\x5e\x58\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3\x27\x80" + "\x20\x38\xb9\xf0\xeb\x68\x8b\x9f\x55\x37\x9a\xec\x07\xd4\xa2" + "\x13\xac\x34\xa1\x67\x31\x34\xea\xc2\x2f\xef\x13\xe3\x5c\xcf" + "\x8f\x90\x1e\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x55\x6b\x6d" + "\xe3\x00\xd4\xf3\x7e\x75\x3a\x68\xfc\x25\xdf\xf2\xf7\x18\x54" + "\xa5\x55\x0c\xa5\xa9\x65\xbf\x66\x9e\x4e\x49\x56\x1e\xf1\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x7c\x54\x6a\x6d\x7f\x00\x52" + "\x31\x03\xe7\xb4\x5b\x1c\x9f\x72\xeb\x3c\x18\x08\xa3\x24\xb2" + "\x63\x5f\x77\x55\x4a\x42\xdb\x1e\xff\x1e\x81\x03\x02\x00\x00" + "\xa4\x27\x80\x20\xe4\x66\x69\x86\x87\x57\x0e\xac\xf1\xfd\x06" + "\x81\x48\x90\x82\x42\x48\x50\x75\x8e\xd4\x2d\xf3\x02\x37\x89" + "\x28\xc5\x68\xd7\xa0\x11\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh22() + { + testcase("Thresh22"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim28Cond + // ** Rsa29Cond + // ** Ed30Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** Thresh11Cond + // *** preim2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** preim4 + // ** prefix16 + // *** prefix17 + // **** thresh18 + // ***** Preim20Cond + // ***** Rsa21Cond + // ***** Ed22Cond + // ***** preim19 + // ** thresh23 + // *** Preim25Cond + // *** Rsa26Cond + // *** Ed27Cond + // *** preim24 + + auto const preim2Preimage = "I am root"s; + auto const preim2Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh11CondConditionFingerprint = { + {0xe9, 0x51, 0x21, 0xbb, 0xea, 0xcc, 0x1a, 0x1a, 0xd1, 0xb1, 0x53, + 0xfd, 0x74, 0x81, 0x54, 0xad, 0xb9, 0x95, 0x4b, 0xa7, 0x40, 0x7f, + 0x11, 0xe9, 0xdc, 0xaf, 0x92, 0xf4, 0xea, 0xf4, 0xb6, 0x29}}; + Condition const Thresh11Cond{Type::thresholdSha256, + 135168, + Thresh11CondConditionFingerprint, + std::bitset<5>{25}}; + auto const preim19Preimage = "I am root"s; + auto const preim19Msg = "P17P16abcdefghijklmnopqrstuvwxyz"s; + auto const thresh18Msg = "P17P16abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim20CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim20Cond{Type::preimageSha256, + 9, + Preim20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa21CondConditionFingerprint = { + {0x18, 0x13, 0xb3, 0x53, 0x3a, 0x10, 0x06, 0xee, 0xf9, 0x67, 0xa2, + 0xcb, 0x27, 0x5e, 0xb8, 0x79, 0x5c, 0x09, 0xd1, 0x8f, 0xa0, 0xc7, + 0xb3, 0x95, 0x59, 0x14, 0xf6, 0x24, 0x99, 0x6b, 0x1a, 0xdd}}; + Condition const Rsa21Cond{Type::rsaSha256, + 65536, + Rsa21CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed22CondConditionFingerprint = { + {0xce, 0xba, 0x65, 0x8f, 0x48, 0xe3, 0x35, 0x4b, 0x51, 0xb6, 0xfd, + 0xe9, 0x57, 0xd7, 0xb9, 0xf0, 0x9b, 0x80, 0xb3, 0x6e, 0xdf, 0x73, + 0x20, 0x22, 0x5c, 0x0a, 0xda, 0x13, 0xf8, 0xc0, 0xa7, 0x5d}}; + Condition const Ed22Cond{Type::ed25519Sha256, + 131072, + Ed22CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix17Prefix = "P17"s; + auto const prefix17Msg = "P16abcdefghijklmnopqrstuvwxyz"s; + auto const prefix17MaxMsgLength = 29; + auto const prefix16Prefix = "P16"s; + auto const prefix16Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix16MaxMsgLength = 26; + auto const preim24Preimage = "I am root"s; + auto const preim24Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh23Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim25CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim25Cond{Type::preimageSha256, + 9, + Preim25CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa26CondConditionFingerprint = { + {0xd6, 0x40, 0x0d, 0x21, 0x44, 0x8a, 0xd4, 0x5a, 0xe6, 0x10, 0x3f, + 0xd4, 0x3a, 0x14, 0x5a, 0x5b, 0x87, 0x86, 0x20, 0x3c, 0x43, 0x20, + 0x9d, 0x9d, 0x0c, 0x75, 0x57, 0x80, 0x7d, 0xda, 0x9d, 0x06}}; + Condition const Rsa26Cond{Type::rsaSha256, + 65536, + Rsa26CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed27CondConditionFingerprint = { + {0x6a, 0x26, 0x73, 0x6f, 0xc3, 0xbf, 0x25, 0x73, 0x8e, 0x3b, 0x27, + 0x79, 0x47, 0xa5, 0x37, 0x7c, 0x78, 0xa0, 0x72, 0xd8, 0x77, 0x91, + 0xfc, 0x45, 0x87, 0x7f, 0x11, 0x57, 0xfe, 0x94, 0x57, 0x45}}; + Condition const Ed27Cond{Type::ed25519Sha256, + 131072, + Ed27CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim28CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim28Cond{Type::preimageSha256, + 9, + Preim28CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa29CondConditionFingerprint = { + {0x5c, 0xe1, 0xef, 0x71, 0xf6, 0x96, 0x65, 0x37, 0x01, 0x15, 0x1a, + 0xdd, 0xfe, 0x28, 0x5d, 0xef, 0x33, 0x99, 0x1f, 0xe9, 0x6a, 0x51, + 0x2d, 0x22, 0x62, 0x2c, 0x2e, 0x26, 0xb8, 0xda, 0x1e, 0xfa}}; + Condition const Rsa29Cond{Type::rsaSha256, + 65536, + Rsa29CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed30CondConditionFingerprint = { + {0xcc, 0x8a, 0x65, 0x38, 0xf7, 0x7c, 0xf9, 0x28, 0xc9, 0xdd, 0xf3, + 0x0c, 0x26, 0x64, 0x02, 0xde, 0x89, 0xd0, 0x71, 0xde, 0x61, 0x3e, + 0x31, 0x4d, 0x9b, 0x4e, 0x91, 0x6f, 0xcc, 0x36, 0x5c, 0xa3}}; + Condition const Ed30Cond{Type::ed25519Sha256, + 131072, + Ed30CondConditionFingerprint, + std::bitset<5>{0}}; + + auto preim2 = + std::make_unique(makeSlice(preim2Preimage)); + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(preim2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Thresh11Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim19 = + std::make_unique(makeSlice(preim19Preimage)); + std::vector> thresh18Subfulfillments; + thresh18Subfulfillments.emplace_back(std::move(preim19)); + std::vector thresh18Subconditions{ + {Preim20Cond, Rsa21Cond, Ed22Cond}}; + auto thresh18 = std::make_unique( + std::move(thresh18Subfulfillments), + std::move(thresh18Subconditions)); + auto prefix17 = std::make_unique( + makeSlice(prefix17Prefix), + prefix17MaxMsgLength, + std::move(thresh18)); + auto prefix16 = std::make_unique( + makeSlice(prefix16Prefix), + prefix16MaxMsgLength, + std::move(prefix17)); + auto preim24 = + std::make_unique(makeSlice(preim24Preimage)); + std::vector> thresh23Subfulfillments; + thresh23Subfulfillments.emplace_back(std::move(preim24)); + std::vector thresh23Subconditions{ + {Preim25Cond, Rsa26Cond, Ed27Cond}}; + auto thresh23 = std::make_unique( + std::move(thresh23Subfulfillments), + std::move(thresh23Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix16)); + thresh0Subfulfillments.emplace_back(std::move(thresh23)); + std::vector thresh0Subconditions{ + {Preim28Cond, Rsa29Cond, Ed30Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x02\xff\xa0\x82\x02\x80\xa1\x81\xa6\x80\x03\x50\x31" + "\x36\x81\x01\x1a\xa2\x81\x9b\xa1\x81\x98\x80\x03\x50\x31\x37" + "\x81\x01\x1d\xa2\x81\x8d\xa2\x81\x8a\xa0\x0d\xa0\x0b\x80\x09" + "\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x18\x13\xb3\x53\x3a\x10" + "\x06\xee\xf9\x67\xa2\xcb\x27\x5e\xb8\x79\x5c\x09\xd1\x8f\xa0" + "\xc7\xb3\x95\x59\x14\xf6\x24\x99\x6b\x1a\xdd\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xce\xba\x65\x8f\x48\xe3\x35\x4b\x51\xb6" + "\xfd\xe9\x57\xd7\xb9\xf0\x9b\x80\xb3\x6e\xdf\x73\x20\x22\x5c" + "\x0a\xda\x13\xf8\xc0\xa7\x5d\x81\x03\x02\x00\x00\xa2\x81\x8a" + "\xa0\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\xd6\x40\x0d\x21\x44\x8a\xd4\x5a\xe6\x10\x3f\xd4\x3a\x14\x5a" + "\x5b\x87\x86\x20\x3c\x43\x20\x9d\x9d\x0c\x75\x57\x80\x7d\xda" + "\x9d\x06\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x6a\x26\x73\x6f" + "\xc3\xbf\x25\x73\x8e\x3b\x27\x79\x47\xa5\x37\x7c\x78\xa0\x72" + "\xd8\x77\x91\xfc\x45\x87\x7f\x11\x57\xfe\x94\x57\x45\x81\x03" + "\x02\x00\x00\xa2\x82\x01\x46\xa0\x81\x9a\xa0\x0b\x80\x09\x49" + "\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0\x0d\xa0\x0b" + "\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1\x79\xa0\x25" + "\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54" + "\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee" + "\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xee\x75\xbe\xb3" + "\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c\x70\x85\x92" + "\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2\xa0\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf" + "\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24" + "\xf0\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00\x00\xa1" + "\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20" + "\xe9\x51\x21\xbb\xea\xcc\x1a\x1a\xd1\xb1\x53\xfd\x74\x81\x54" + "\xad\xb9\x95\x4b\xa7\x40\x7f\x11\xe9\xdc\xaf\x92\xf4\xea\xf4" + "\xb6\x29\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80\x20" + "\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70\x64" + "\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7" + "\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62" + "\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe" + "\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03" + "\x02\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\x5c\xe1\xef\x71\xf6\x96\x65\x37\x01\x15\x1a\xdd" + "\xfe\x28\x5d\xef\x33\x99\x1f\xe9\x6a\x51\x2d\x22\x62\x2c\x2e" + "\x26\xb8\xda\x1e\xfa\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xcc" + "\x8a\x65\x38\xf7\x7c\xf9\x28\xc9\xdd\xf3\x0c\x26\x64\x02\xde" + "\x89\xd0\x71\xde\x61\x3e\x31\x4d\x9b\x4e\x91\x6f\xcc\x36\x5c" + "\xa3\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x52\xe9\xfd\x08\x0f\x32\x16\x47\xa0\x53\x04" + "\xdf\x8d\x72\xf4\x0c\x13\x17\xf3\xb0\x8e\x93\x83\xbf\x7d\x70" + "\xf9\x77\xa0\xe3\x7b\xde\x81\x03\x08\x78\x3d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\xe3\x8e\x59\xf7\x47\x6f" + "\x61\xbe\xaa\x80\x28\xfe\x42\x8a\x90\x0a\x4a\x15\xc9\x0e\xca" + "\x9a\xa1\x45\xf7\xc9\xe9\x22\x46\x83\x4f\xee\x81\x03\x02\x18" + "\x3d\x82\x02\x03\xb8\xa2\x2b\x80\x20\x4c\xea\x4f\xb1\xec\x74" + "\xd7\x9e\x52\x7e\x26\xcb\x42\x73\x31\x52\x01\x5c\x18\xef\x19" + "\xfe\x64\x81\xd8\xb8\xba\xe1\xf4\x83\x0e\x0f\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa2\x2b\x80\x20\x8a\x60\x28\x1e\x98\x5f" + "\x3d\xda\xde\xaa\xa9\xe1\x8c\x39\x05\x89\xc4\x05\x23\x5b\xef" + "\xd6\xec\xbc\xa7\x5d\x27\x7c\x38\x9c\x94\x18\x81\x03\x04\x38" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x5c\xe1\xef\x71\xf6\x96" + "\x65\x37\x01\x15\x1a\xdd\xfe\x28\x5d\xef\x33\x99\x1f\xe9\x6a" + "\x51\x2d\x22\x62\x2c\x2e\x26\xb8\xda\x1e\xfa\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xcc\x8a\x65\x38\xf7\x7c\xf9\x28\xc9\xdd" + "\xf3\x0c\x26\x64\x02\xde\x89\xd0\x71\xde\x61\x3e\x31\x4d\x9b" + "\x4e\x91\x6f\xcc\x36\x5c\xa3\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh23() + { + testcase("Thresh23"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim19Cond + // ** Rsa20Cond + // ** Ed21Cond + // ** Prefix22Cond + // ** Thresh29Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** Thresh11Cond + // *** preim2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** preim4 + // ** preim16 + // ** rsa17 + // ** ed18 + + auto const preim2Preimage = "I am root"s; + auto const preim2Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh11CondConditionFingerprint = { + {0xe9, 0x51, 0x21, 0xbb, 0xea, 0xcc, 0x1a, 0x1a, 0xd1, 0xb1, 0x53, + 0xfd, 0x74, 0x81, 0x54, 0xad, 0xb9, 0x95, 0x4b, 0xa7, 0x40, 0x7f, + 0x11, 0xe9, 0xdc, 0xaf, 0x92, 0xf4, 0xea, 0xf4, 0xb6, 0x29}}; + Condition const Thresh11Cond{Type::thresholdSha256, + 135168, + Thresh11CondConditionFingerprint, + std::bitset<5>{25}}; + auto const preim16Preimage = "I am root"s; + auto const preim16Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa17Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa17PublicKey{ + {0xb0, 0x41, 0xe9, 0x6e, 0xfe, 0x3b, 0xde, 0x46, 0x52, 0x56, 0x34, + 0x2a, 0x92, 0x83, 0x4d, 0x3a, 0x7b, 0x94, 0xe7, 0xc2, 0x06, 0x5b, + 0x8c, 0xf4, 0x9d, 0x71, 0x9d, 0x00, 0x73, 0xd9, 0x15, 0x81, 0x12, + 0x1a, 0x0c, 0x9e, 0xd8, 0xa6, 0xa6, 0xd8, 0x62, 0xbe, 0xfe, 0xa3, + 0x7c, 0xc5, 0xd0, 0x71, 0xdd, 0x83, 0xed, 0xcf, 0x71, 0xd8, 0xe5, + 0x72, 0x27, 0xcb, 0xce, 0xd7, 0x06, 0xda, 0xe8, 0x4b, 0xb8, 0x8d, + 0x45, 0xc0, 0x9c, 0xe3, 0x13, 0x27, 0xbf, 0x60, 0x50, 0x85, 0xbf, + 0xd1, 0xfc, 0x8c, 0x41, 0x75, 0x2d, 0x51, 0x83, 0x24, 0x06, 0xcb, + 0xe6, 0x98, 0x8e, 0x0d, 0x35, 0xfa, 0x58, 0x34, 0x43, 0x90, 0x55, + 0x6a, 0x40, 0xc9, 0x78, 0x31, 0xfb, 0x28, 0x8b, 0x10, 0x78, 0x46, + 0x59, 0x49, 0xf5, 0x89, 0x1c, 0x66, 0xc0, 0x6e, 0x6b, 0x73, 0x05, + 0x75, 0x83, 0x2b, 0x86, 0x78, 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3, 0xdc, 0x31, 0x2f, 0x20, 0xcf, 0xaf, 0xf9, 0x51, + 0x33, 0xc8, 0x60, 0x19, 0x6f, 0x28, 0x83, 0x7d, 0x1d, 0x41, 0x5c, + 0xac, 0x2b, 0x70, 0x5e, 0xae, 0x76, 0xec, 0x54, 0xb9, 0x63, 0x7d, + 0xb6, 0x40, 0x53, 0x05, 0x9e, 0x31, 0x89, 0x2c, 0xae, 0x8e, 0x58, + 0x61, 0x6c, 0x9e, 0x14, 0x40, 0x6c, 0x4b, 0xb4, 0x89, 0x33, 0x2c, + 0x8a, 0xb7, 0x62, 0x60, 0x0c, 0x69, 0x23, 0x5b, 0xd0, 0x1f, 0x36, + 0xb5, 0xcc, 0xff, 0xa9, 0xa4, 0xd7, 0xbd, 0x97, 0xec, 0x64, 0x1b, + 0xc0, 0x38, 0xfb, 0xae, 0x3e, 0x97, 0xcf, 0x38, 0xc6, 0x85, 0xe5, + 0xc9, 0x2f, 0x0f, 0x99, 0x56, 0x83, 0x1b, 0xff, 0x5a, 0x18, 0xec, + 0xd3, 0x4e, 0x3d, 0x5e, 0xf0, 0xe4, 0x43, 0xb5, 0xcf, 0xf6, 0xff, + 0x5f, 0x4a, 0x47, 0x96, 0x0e, 0x3d, 0x51, 0xef, 0x70, 0xa4, 0x2d, + 0xf8, 0x58, 0x61, 0x6b, 0x54, 0x64, 0x6e, 0x93, 0xcd, 0xb9, 0xc0, + 0xa3, 0xd9, 0x84, 0x0b, 0xea, 0x79, 0xed, 0x75, 0xce, 0x56, 0xf3, + 0xfd, 0xff, 0xe2, 0x8a, 0xd8, 0x07, 0xcf, 0x94, 0xda, 0x91, 0xda, + 0xa7, 0xa3, 0x94, 0xc8, 0xb6, 0x63, 0x33, 0x37, 0xdd, 0xa3, 0x79, + 0x6b, 0xf3, 0x96, 0x45, 0x06, 0x06, 0x48, 0x8b, 0xff, 0xb3, 0x0e, + 0x6e, 0x78, 0x80, 0x05, 0xfc, 0xad, 0x6d, 0xc5, 0xf5, 0x13, 0xc7, + 0x8c, 0x5a, 0x6e, 0x6a, 0x06, 0x18, 0x96, 0x71, 0x77, 0xae, 0xda, + 0x9d, 0x07, 0xce, 0xf0, 0xa2, 0x94, 0x27, 0x3f, 0x85, 0x10, 0xfa, + 0xf6, 0x95, 0x79}}; + auto const ed18Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed18PublicKey{ + {0x3b, 0x07, 0x0f, 0xe5, 0x29, 0x34, 0xd9, 0x17, 0xf5, 0x06, 0x00, + 0xb8, 0x87, 0x2f, 0xcf, 0x89, 0x52, 0x70, 0xcc, 0x04, 0x92, 0xe1, + 0x67, 0xcb, 0xba, 0xbb, 0x10, 0xa6, 0x2d, 0x06, 0xa4, 0x6b}}; + std::array const ed18Sig{ + {0x09, 0xc4, 0x1d, 0xc3, 0x8e, 0x6c, 0xd6, 0x04, 0xb7, 0x9e, 0x8c, + 0x8b, 0x30, 0x65, 0x88, 0x43, 0xc7, 0xc6, 0xe5, 0xa0, 0xb0, 0x4c, + 0x60, 0xee, 0xb7, 0x1d, 0x69, 0x2a, 0xb7, 0x5d, 0x5f, 0x16, 0x53, + 0xd1, 0xe6, 0x6a, 0x74, 0x5d, 0x63, 0xc0, 0x41, 0x30, 0x6a, 0x58, + 0xce, 0x52, 0xf2, 0xdb, 0x41, 0x03, 0x78, 0xfd, 0x7f, 0x0e, 0xa5, + 0xc1, 0xe4, 0xd2, 0x50, 0x8d, 0x97, 0x1d, 0xf9, 0x06}}; + std::array const ed18SigningKey{ + {0x59, 0x73, 0xbb, 0x41, 0xb0, 0xe0, 0xce, 0xc2, 0xa9, 0x85, 0xaa, + 0x05, 0xa4, 0x7e, 0x3b, 0x51, 0x09, 0x8d, 0x3e, 0x47, 0xb7, 0x75, + 0xda, 0x81, 0x39, 0xa0, 0xe1, 0xd5, 0x9f, 0xb0, 0x9c, 0x5a}}; + (void)ed18SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix22CondConditionFingerprint = { + {0x46, 0x85, 0xf8, 0x94, 0x01, 0xca, 0x4a, 0xef, 0x2c, 0xdb, 0xb1, + 0x18, 0xf0, 0xf4, 0xa3, 0x0f, 0x9d, 0x5b, 0x05, 0xc3, 0xd4, 0x26, + 0x49, 0x4d, 0xe6, 0xa6, 0xf7, 0x2a, 0xe5, 0xf1, 0xf7, 0xf2}}; + Condition const Prefix22Cond{Type::prefixSha256, + 137251, + Prefix22CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh29CondConditionFingerprint = { + {0x78, 0xe2, 0x68, 0xfe, 0xbe, 0xe5, 0x81, 0xd5, 0x98, 0x62, 0x9a, + 0x0c, 0x8e, 0x66, 0xba, 0xea, 0x74, 0x70, 0xb2, 0x5d, 0xd2, 0xd4, + 0x0b, 0xf2, 0xbc, 0xd1, 0x9f, 0xea, 0x3e, 0x1d, 0x19, 0x84}}; + Condition const Thresh29Cond{Type::thresholdSha256, + 135168, + Thresh29CondConditionFingerprint, + std::bitset<5>{25}}; + + auto preim2 = + std::make_unique(makeSlice(preim2Preimage)); + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(preim4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(preim2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Thresh11Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim16 = + std::make_unique(makeSlice(preim16Preimage)); + auto rsa17 = std::make_unique( + makeSlice(rsa17PublicKey), makeSlice(rsa17Sig)); + auto ed18 = std::make_unique(ed18PublicKey, ed18Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim16)); + thresh0Subfulfillments.emplace_back(std::move(rsa17)); + thresh0Subfulfillments.emplace_back(std::move(ed18)); + std::vector thresh0Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond, Prefix22Cond, Thresh29Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x04\xa3\xa0\x82\x03\xc9\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x82\x01\x46\xa0\x81\x9a\xa0\x0b" + "\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa2\x81\x8a\xa0" + "\x0d\xa0\x0b\x80\x09\x49\x20\x61\x6d\x20\x72\x6f\x6f\x74\xa1" + "\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xee" + "\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c" + "\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2" + "\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46" + "\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac" + "\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02" + "\x00\x00\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2" + "\x2b\x80\x20\xe9\x51\x21\xbb\xea\xcc\x1a\x1a\xd1\xb1\x53\xfd" + "\x74\x81\x54\xad\xb9\x95\x4b\xa7\x40\x7f\x11\xe9\xdc\xaf\x92" + "\xf4\xea\xf4\xb6\x29\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88" + "\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb" + "\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00" + "\x8b\xe6\x62\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16" + "\xda\x09\xbe\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62" + "\xfa\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xb0" + "\x41\xe9\x6e\xfe\x3b\xde\x46\x52\x56\x34\x2a\x92\x83\x4d\x3a" + "\x7b\x94\xe7\xc2\x06\x5b\x8c\xf4\x9d\x71\x9d\x00\x73\xd9\x15" + "\x81\x12\x1a\x0c\x9e\xd8\xa6\xa6\xd8\x62\xbe\xfe\xa3\x7c\xc5" + "\xd0\x71\xdd\x83\xed\xcf\x71\xd8\xe5\x72\x27\xcb\xce\xd7\x06" + "\xda\xe8\x4b\xb8\x8d\x45\xc0\x9c\xe3\x13\x27\xbf\x60\x50\x85" + "\xbf\xd1\xfc\x8c\x41\x75\x2d\x51\x83\x24\x06\xcb\xe6\x98\x8e" + "\x0d\x35\xfa\x58\x34\x43\x90\x55\x6a\x40\xc9\x78\x31\xfb\x28" + "\x8b\x10\x78\x46\x59\x49\xf5\x89\x1c\x66\xc0\x6e\x6b\x73\x05" + "\x75\x83\x2b\x86\x78\x02\xc1\xb0\xf1\x2a\x6e\x7e\xf6\x65\x8f" + "\xe3\xc2\x02\x6d\xae\x03\xc5\xef\x41\x03\x3a\x6b\xeb\xb0\xab" + "\x6a\x27\x2e\xcb\x13\xf5\xd3\xae\x11\x18\x33\x6a\xc3\x08\x7a" + "\xf8\xb9\xd7\xf3\x37\xee\x05\x32\xd9\xb5\xa4\xb9\xeb\x67\xa8" + "\x84\xeb\xb2\xc3\x2f\x8a\x8f\xa7\x24\xac\x9a\x24\x91\x11\x70" + "\xab\xc5\x05\x25\xa9\xd3\x93\x17\x6d\x70\xb1\x67\x60\x6b\x50" + "\x69\xdd\x22\x8b\x6a\xa9\x11\x7e\x5e\x09\xa8\xaa\xdc\x4a\xc8" + "\x09\x4c\x1a\xe7\x4c\x1e\x42\xb2\x27\x9d\xa9\x1b\xa3\x59\x14" + "\xcb\x0b\xca\xff\x6e\x8d\x8e\x38\xf6\x19\xb1\x81\x5f\xf4\x7d" + "\x81\x82\x01\x00\x83\x9f\x5e\xdf\x34\xe1\x8d\xfe\xd8\xa7\x1a" + "\xd6\x2a\xd5\xc4\x98\x6f\xe7\x92\x52\x09\xd3\x4f\xed\x5f\x41" + "\x1d\xca\x0c\x1d\x7d\x08\x8f\x62\x09\xd3\x53\x37\x5d\x5c\x69" + "\xe0\xb7\x58\x84\xcd\xd3\xdc\x31\x2f\x20\xcf\xaf\xf9\x51\x33" + "\xc8\x60\x19\x6f\x28\x83\x7d\x1d\x41\x5c\xac\x2b\x70\x5e\xae" + "\x76\xec\x54\xb9\x63\x7d\xb6\x40\x53\x05\x9e\x31\x89\x2c\xae" + "\x8e\x58\x61\x6c\x9e\x14\x40\x6c\x4b\xb4\x89\x33\x2c\x8a\xb7" + "\x62\x60\x0c\x69\x23\x5b\xd0\x1f\x36\xb5\xcc\xff\xa9\xa4\xd7" + "\xbd\x97\xec\x64\x1b\xc0\x38\xfb\xae\x3e\x97\xcf\x38\xc6\x85" + "\xe5\xc9\x2f\x0f\x99\x56\x83\x1b\xff\x5a\x18\xec\xd3\x4e\x3d" + "\x5e\xf0\xe4\x43\xb5\xcf\xf6\xff\x5f\x4a\x47\x96\x0e\x3d\x51" + "\xef\x70\xa4\x2d\xf8\x58\x61\x6b\x54\x64\x6e\x93\xcd\xb9\xc0" + "\xa3\xd9\x84\x0b\xea\x79\xed\x75\xce\x56\xf3\xfd\xff\xe2\x8a" + "\xd8\x07\xcf\x94\xda\x91\xda\xa7\xa3\x94\xc8\xb6\x63\x33\x37" + "\xdd\xa3\x79\x6b\xf3\x96\x45\x06\x06\x48\x8b\xff\xb3\x0e\x6e" + "\x78\x80\x05\xfc\xad\x6d\xc5\xf5\x13\xc7\x8c\x5a\x6e\x6a\x06" + "\x18\x96\x71\x77\xae\xda\x9d\x07\xce\xf0\xa2\x94\x27\x3f\x85" + "\x10\xfa\xf6\x95\x79\xa4\x64\x80\x20\x3b\x07\x0f\xe5\x29\x34" + "\xd9\x17\xf5\x06\x00\xb8\x87\x2f\xcf\x89\x52\x70\xcc\x04\x92" + "\xe1\x67\xcb\xba\xbb\x10\xa6\x2d\x06\xa4\x6b\x81\x40\x09\xc4" + "\x1d\xc3\x8e\x6c\xd6\x04\xb7\x9e\x8c\x8b\x30\x65\x88\x43\xc7" + "\xc6\xe5\xa0\xb0\x4c\x60\xee\xb7\x1d\x69\x2a\xb7\x5d\x5f\x16" + "\x53\xd1\xe6\x6a\x74\x5d\x63\xc0\x41\x30\x6a\x58\xce\x52\xf2" + "\xdb\x41\x03\x78\xfd\x7f\x0e\xa5\xc1\xe4\xd2\x50\x8d\x97\x1d" + "\xf9\x06\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x46\x85\xf8\x94\x01\xca\x4a\xef\x2c\xdb\xb1\x18" + "\xf0\xf4\xa3\x0f\x9d\x5b\x05\xc3\xd4\x26\x49\x4d\xe6\xa6\xf7" + "\x2a\xe5\xf1\xf7\xf2\x81\x03\x02\x18\x23\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\x78\xe2\x68\xfe\xbe\xe5\x81\xd5\x98\x62\x9a\x0c" + "\x8e\x66\xba\xea\x74\x70\xb2\x5d\xd2\xd4\x0b\xf2\xbc\xd1\x9f" + "\xea\x3e\x1d\x19\x84\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x8d\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57" + "\xca\xf4\x9d\x63\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9" + "\xc6\xa3\xf1\x33\xfd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x95" + "\x3c\x86\x65\x91\x76\x69\x6b\x72\x61\xaa\x76\x15\x2a\xd7\x25" + "\x4f\x32\xb7\x73\x7a\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a\x8b\xf7" + "\x65\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xe0\xdc\x81\x91\x44\xfc\x07\xbc\x96\xc4\x78" + "\x9b\x9b\xab\x8c\xd7\x06\x48\x0c\xee\x2a\x25\xbd\x25\x19\x21" + "\xf4\x8f\xc6\xbf\x0c\xb3\x81\x03\x0a\x84\x23\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x46\x85\xf8\x94\x01\xca\x4a\xef\x2c\xdb\xb1\x18" + "\xf0\xf4\xa3\x0f\x9d\x5b\x05\xc3\xd4\x26\x49\x4d\xe6\xa6\xf7" + "\x2a\xe5\xf1\xf7\xf2\x81\x03\x02\x18\x23\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\x78\xe2\x68\xfe\xbe\xe5\x81\xd5\x98\x62\x9a\x0c" + "\x8e\x66\xba\xea\x74\x70\xb2\x5d\xd2\xd4\x0b\xf2\xbc\xd1\x9f" + "\xea\x3e\x1d\x19\x84\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa2" + "\x2b\x80\x20\x8a\x60\x28\x1e\x98\x5f\x3d\xda\xde\xaa\xa9\xe1" + "\x8c\x39\x05\x89\xc4\x05\x23\x5b\xef\xd6\xec\xbc\xa7\x5d\x27" + "\x7c\x38\x9c\x94\x18\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x78\xe3\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32" + "\xff\xbc\x75\x1a\xe6\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1" + "\x6f\xff\x3e\xb3\x75\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x8d" + "\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57\xca\xf4\x9d\x63" + "\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9\xc6\xa3\xf1\x33" + "\xfd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c" + "\x62\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d" + "\xba\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x95\x3c\x86\x65\x91\x76\x69\x6b\x72" + "\x61\xaa\x76\x15\x2a\xd7\x25\x4f\x32\xb7\x73\x7a\xb2\x49\x0c" + "\x0b\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh24() + { + testcase("Thresh24"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** rsa1 + + auto const rsa1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa1PublicKey{ + {0xc4, 0x1b, 0xc9, 0x7a, 0x96, 0x81, 0xce, 0x2e, 0xf2, 0x53, 0xc0, + 0xd4, 0xa8, 0xb9, 0xa8, 0x12, 0x92, 0x45, 0x06, 0xf1, 0xf4, 0xcd, + 0x27, 0x7d, 0xff, 0xc1, 0x65, 0x75, 0xae, 0xb7, 0xc4, 0x98, 0x53, + 0xd8, 0xfa, 0x6d, 0x86, 0x63, 0xd8, 0x4e, 0xf5, 0x20, 0xe2, 0x9e, + 0x96, 0x04, 0x36, 0x0c, 0x3f, 0xac, 0x7d, 0x09, 0x42, 0x11, 0x13, + 0x30, 0x2d, 0x7f, 0x60, 0x2c, 0xec, 0x2a, 0x34, 0xc3, 0xd8, 0xba, + 0x6d, 0x14, 0x75, 0x28, 0x56, 0xdc, 0x73, 0x6c, 0xb7, 0xd6, 0xba, + 0x8a, 0xa3, 0x9e, 0x09, 0x0e, 0xa4, 0xf3, 0x6b, 0x5d, 0x12, 0xc6, + 0xe4, 0xdd, 0x8c, 0xb1, 0x98, 0xcd, 0xde, 0xca, 0xad, 0xff, 0x86, + 0xb6, 0x06, 0x25, 0x9b, 0x71, 0x84, 0xa0, 0x9b, 0x19, 0x14, 0x88, + 0xd0, 0xc7, 0x55, 0x99, 0xe0, 0x1e, 0x0e, 0x39, 0x67, 0x74, 0xdf, + 0xf6, 0x29, 0xfa, 0x92, 0xb6, 0xbb, 0xe6, 0xe1, 0x1c, 0xd9, 0xee, + 0x65, 0xda, 0x13, 0xec, 0x50, 0x6a, 0x11, 0x7e, 0xae, 0xb4, 0xac, + 0x85, 0xa5, 0xc7, 0xcb, 0x43, 0x42, 0x36, 0x73, 0x34, 0x31, 0xb6, + 0x0b, 0x5e, 0xf0, 0x9e, 0x80, 0x49, 0xab, 0xc7, 0x79, 0xc5, 0xa7, + 0xe3, 0x16, 0x35, 0x3a, 0x48, 0xe6, 0xc0, 0x69, 0xe2, 0x70, 0x30, + 0x20, 0x74, 0x47, 0x3e, 0x3a, 0x51, 0x01, 0x21, 0x60, 0x15, 0x53, + 0x40, 0x68, 0x6e, 0xe7, 0x9f, 0x73, 0xb6, 0x98, 0x3b, 0x6e, 0x50, + 0xb8, 0xb2, 0xe7, 0x42, 0x90, 0x77, 0x61, 0xd4, 0x22, 0x6c, 0x0b, + 0x3d, 0x66, 0xe0, 0x1b, 0x7d, 0xb0, 0xa1, 0xa9, 0xa9, 0xea, 0x0e, + 0xf2, 0xab, 0xe0, 0x32, 0xf4, 0x49, 0x44, 0xcb, 0xae, 0x60, 0x1d, + 0xe1, 0xac, 0xd3, 0x34, 0x2b, 0x03, 0x97, 0x98, 0x2d, 0xda, 0xf8, + 0xe8, 0x0b, 0x81, 0x94, 0x98, 0x3a, 0xbd, 0x6d, 0x17, 0x18, 0x42, + 0x58, 0x0c, 0xa3}}; + std::array const rsa1Sig{ + {0x6b, 0x3a, 0xec, 0x49, 0x4e, 0xc1, 0x98, 0x89, 0x9d, 0x96, 0x0d, + 0xae, 0x94, 0x8f, 0x0c, 0x75, 0x8d, 0x4e, 0xaf, 0x14, 0x4c, 0xad, + 0x25, 0xfd, 0xc2, 0xc6, 0x0e, 0xfc, 0x49, 0x4c, 0x5e, 0x14, 0xb2, + 0x17, 0x4c, 0xbf, 0x76, 0xe5, 0xf6, 0xa2, 0xa3, 0x70, 0x04, 0x0c, + 0x8f, 0x5e, 0x8e, 0xc0, 0x45, 0xe5, 0xa0, 0x0a, 0xdc, 0x2c, 0xf3, + 0x1e, 0xd0, 0x44, 0x71, 0xc9, 0xf6, 0x63, 0x1b, 0x81, 0x98, 0x5f, + 0x2a, 0x09, 0x72, 0x67, 0xdb, 0x96, 0xc1, 0xc7, 0x21, 0x37, 0x1b, + 0x6a, 0x8d, 0x37, 0x77, 0xe6, 0x1c, 0x64, 0x68, 0x05, 0xac, 0xe2, + 0x6e, 0x47, 0xa8, 0x2c, 0xff, 0x65, 0x08, 0xd0, 0xde, 0xde, 0xb3, + 0xc5, 0xae, 0x9d, 0x56, 0x0e, 0xfd, 0x0b, 0xfe, 0xd0, 0x75, 0x4b, + 0xdc, 0xab, 0x1a, 0x1f, 0x31, 0x93, 0x10, 0x08, 0xa2, 0x41, 0xbd, + 0x80, 0xb8, 0xa7, 0x7e, 0xa7, 0x62, 0x93, 0x3f, 0xfc, 0x7f, 0x89, + 0xa6, 0x10, 0xf6, 0x3a, 0x1f, 0xfc, 0x1e, 0x7b, 0xd9, 0xd6, 0x84, + 0x06, 0x39, 0x30, 0xef, 0x1d, 0x14, 0x99, 0x24, 0x9f, 0xa4, 0xc6, + 0xf3, 0x90, 0xbf, 0x11, 0xd0, 0xdf, 0x39, 0x37, 0xa2, 0x39, 0x45, + 0xd4, 0x5f, 0xbc, 0x4d, 0xa0, 0xba, 0xdc, 0xea, 0x69, 0x48, 0xf6, + 0xeb, 0xb3, 0xb3, 0x10, 0x65, 0x62, 0xfa, 0x89, 0xeb, 0xaf, 0xf2, + 0x13, 0xc2, 0x10, 0x64, 0x4b, 0x85, 0x4a, 0xf0, 0xb7, 0xc4, 0x28, + 0xd9, 0x65, 0x21, 0x57, 0x27, 0xaf, 0xb5, 0x30, 0x05, 0x82, 0x12, + 0x9e, 0xf4, 0xd5, 0xf5, 0x8e, 0x8b, 0xea, 0x89, 0xac, 0x78, 0x16, + 0xba, 0x6c, 0x37, 0x2e, 0x8e, 0xf7, 0x24, 0x44, 0xa3, 0x0a, 0x6a, + 0x6b, 0x5f, 0xb8, 0xfe, 0x42, 0x38, 0xa8, 0x8c, 0x55, 0x6b, 0xf4, + 0x62, 0x48, 0x6a, 0xef, 0x7b, 0xcb, 0x2e, 0x9c, 0x2f, 0xd3, 0x18, + 0x9b, 0x13, 0x01}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + + auto rsa1 = std::make_unique( + makeSlice(rsa1PublicKey), makeSlice(rsa1Sig)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(rsa1)); + std::vector thresh0Subconditions{}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x02\x12\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01" + "\x00\xc4\x1b\xc9\x7a\x96\x81\xce\x2e\xf2\x53\xc0\xd4\xa8\xb9" + "\xa8\x12\x92\x45\x06\xf1\xf4\xcd\x27\x7d\xff\xc1\x65\x75\xae" + "\xb7\xc4\x98\x53\xd8\xfa\x6d\x86\x63\xd8\x4e\xf5\x20\xe2\x9e" + "\x96\x04\x36\x0c\x3f\xac\x7d\x09\x42\x11\x13\x30\x2d\x7f\x60" + "\x2c\xec\x2a\x34\xc3\xd8\xba\x6d\x14\x75\x28\x56\xdc\x73\x6c" + "\xb7\xd6\xba\x8a\xa3\x9e\x09\x0e\xa4\xf3\x6b\x5d\x12\xc6\xe4" + "\xdd\x8c\xb1\x98\xcd\xde\xca\xad\xff\x86\xb6\x06\x25\x9b\x71" + "\x84\xa0\x9b\x19\x14\x88\xd0\xc7\x55\x99\xe0\x1e\x0e\x39\x67" + "\x74\xdf\xf6\x29\xfa\x92\xb6\xbb\xe6\xe1\x1c\xd9\xee\x65\xda" + "\x13\xec\x50\x6a\x11\x7e\xae\xb4\xac\x85\xa5\xc7\xcb\x43\x42" + "\x36\x73\x34\x31\xb6\x0b\x5e\xf0\x9e\x80\x49\xab\xc7\x79\xc5" + "\xa7\xe3\x16\x35\x3a\x48\xe6\xc0\x69\xe2\x70\x30\x20\x74\x47" + "\x3e\x3a\x51\x01\x21\x60\x15\x53\x40\x68\x6e\xe7\x9f\x73\xb6" + "\x98\x3b\x6e\x50\xb8\xb2\xe7\x42\x90\x77\x61\xd4\x22\x6c\x0b" + "\x3d\x66\xe0\x1b\x7d\xb0\xa1\xa9\xa9\xea\x0e\xf2\xab\xe0\x32" + "\xf4\x49\x44\xcb\xae\x60\x1d\xe1\xac\xd3\x34\x2b\x03\x97\x98" + "\x2d\xda\xf8\xe8\x0b\x81\x94\x98\x3a\xbd\x6d\x17\x18\x42\x58" + "\x0c\xa3\x81\x82\x01\x00\x6b\x3a\xec\x49\x4e\xc1\x98\x89\x9d" + "\x96\x0d\xae\x94\x8f\x0c\x75\x8d\x4e\xaf\x14\x4c\xad\x25\xfd" + "\xc2\xc6\x0e\xfc\x49\x4c\x5e\x14\xb2\x17\x4c\xbf\x76\xe5\xf6" + "\xa2\xa3\x70\x04\x0c\x8f\x5e\x8e\xc0\x45\xe5\xa0\x0a\xdc\x2c" + "\xf3\x1e\xd0\x44\x71\xc9\xf6\x63\x1b\x81\x98\x5f\x2a\x09\x72" + "\x67\xdb\x96\xc1\xc7\x21\x37\x1b\x6a\x8d\x37\x77\xe6\x1c\x64" + "\x68\x05\xac\xe2\x6e\x47\xa8\x2c\xff\x65\x08\xd0\xde\xde\xb3" + "\xc5\xae\x9d\x56\x0e\xfd\x0b\xfe\xd0\x75\x4b\xdc\xab\x1a\x1f" + "\x31\x93\x10\x08\xa2\x41\xbd\x80\xb8\xa7\x7e\xa7\x62\x93\x3f" + "\xfc\x7f\x89\xa6\x10\xf6\x3a\x1f\xfc\x1e\x7b\xd9\xd6\x84\x06" + "\x39\x30\xef\x1d\x14\x99\x24\x9f\xa4\xc6\xf3\x90\xbf\x11\xd0" + "\xdf\x39\x37\xa2\x39\x45\xd4\x5f\xbc\x4d\xa0\xba\xdc\xea\x69" + "\x48\xf6\xeb\xb3\xb3\x10\x65\x62\xfa\x89\xeb\xaf\xf2\x13\xc2" + "\x10\x64\x4b\x85\x4a\xf0\xb7\xc4\x28\xd9\x65\x21\x57\x27\xaf" + "\xb5\x30\x05\x82\x12\x9e\xf4\xd5\xf5\x8e\x8b\xea\x89\xac\x78" + "\x16\xba\x6c\x37\x2e\x8e\xf7\x24\x44\xa3\x0a\x6a\x6b\x5f\xb8" + "\xfe\x42\x38\xa8\x8c\x55\x6b\xf4\x62\x48\x6a\xef\x7b\xcb\x2e" + "\x9c\x2f\xd3\x18\x9b\x13\x01\xa1\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xb5\x0e\x55\xf3\xb5\xb2\x5f\xea\xa9\x99\x79" + "\x50\x68\xaa\x99\x8f\x3b\x20\xaa\x20\xa3\x95\x27\x07\xfd\x64" + "\xeb\xa6\xcb\x76\x2b\x8e\x81\x03\x01\x04\x00\x82\x02\x04\x10"s; + auto const thresh0EncodedFingerprint = + "\x30\x2e\x80\x01\x01\xa1\x29\xa3\x27\x80\x20\x23\xc9\xfd\x99" + "\xdc\xf3\x74\x06\xe3\x11\x57\x5e\x7a\x90\x4b\x0d\x0c\x36\xa7" + "\x8d\x25\xbc\xd5\x5f\x0d\x1f\x25\x08\x2e\x4f\xca\x1a\x81\x03" + "\x01\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh25() + { + testcase("Thresh25"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim2Cond + // ** Rsa3Cond + // ** Ed4Cond + // ** rsa1 + + auto const rsa1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa1PublicKey{ + {0xc4, 0x1b, 0xc9, 0x7a, 0x96, 0x81, 0xce, 0x2e, 0xf2, 0x53, 0xc0, + 0xd4, 0xa8, 0xb9, 0xa8, 0x12, 0x92, 0x45, 0x06, 0xf1, 0xf4, 0xcd, + 0x27, 0x7d, 0xff, 0xc1, 0x65, 0x75, 0xae, 0xb7, 0xc4, 0x98, 0x53, + 0xd8, 0xfa, 0x6d, 0x86, 0x63, 0xd8, 0x4e, 0xf5, 0x20, 0xe2, 0x9e, + 0x96, 0x04, 0x36, 0x0c, 0x3f, 0xac, 0x7d, 0x09, 0x42, 0x11, 0x13, + 0x30, 0x2d, 0x7f, 0x60, 0x2c, 0xec, 0x2a, 0x34, 0xc3, 0xd8, 0xba, + 0x6d, 0x14, 0x75, 0x28, 0x56, 0xdc, 0x73, 0x6c, 0xb7, 0xd6, 0xba, + 0x8a, 0xa3, 0x9e, 0x09, 0x0e, 0xa4, 0xf3, 0x6b, 0x5d, 0x12, 0xc6, + 0xe4, 0xdd, 0x8c, 0xb1, 0x98, 0xcd, 0xde, 0xca, 0xad, 0xff, 0x86, + 0xb6, 0x06, 0x25, 0x9b, 0x71, 0x84, 0xa0, 0x9b, 0x19, 0x14, 0x88, + 0xd0, 0xc7, 0x55, 0x99, 0xe0, 0x1e, 0x0e, 0x39, 0x67, 0x74, 0xdf, + 0xf6, 0x29, 0xfa, 0x92, 0xb6, 0xbb, 0xe6, 0xe1, 0x1c, 0xd9, 0xee, + 0x65, 0xda, 0x13, 0xec, 0x50, 0x6a, 0x11, 0x7e, 0xae, 0xb4, 0xac, + 0x85, 0xa5, 0xc7, 0xcb, 0x43, 0x42, 0x36, 0x73, 0x34, 0x31, 0xb6, + 0x0b, 0x5e, 0xf0, 0x9e, 0x80, 0x49, 0xab, 0xc7, 0x79, 0xc5, 0xa7, + 0xe3, 0x16, 0x35, 0x3a, 0x48, 0xe6, 0xc0, 0x69, 0xe2, 0x70, 0x30, + 0x20, 0x74, 0x47, 0x3e, 0x3a, 0x51, 0x01, 0x21, 0x60, 0x15, 0x53, + 0x40, 0x68, 0x6e, 0xe7, 0x9f, 0x73, 0xb6, 0x98, 0x3b, 0x6e, 0x50, + 0xb8, 0xb2, 0xe7, 0x42, 0x90, 0x77, 0x61, 0xd4, 0x22, 0x6c, 0x0b, + 0x3d, 0x66, 0xe0, 0x1b, 0x7d, 0xb0, 0xa1, 0xa9, 0xa9, 0xea, 0x0e, + 0xf2, 0xab, 0xe0, 0x32, 0xf4, 0x49, 0x44, 0xcb, 0xae, 0x60, 0x1d, + 0xe1, 0xac, 0xd3, 0x34, 0x2b, 0x03, 0x97, 0x98, 0x2d, 0xda, 0xf8, + 0xe8, 0x0b, 0x81, 0x94, 0x98, 0x3a, 0xbd, 0x6d, 0x17, 0x18, 0x42, + 0x58, 0x0c, 0xa3}}; + std::array const rsa1Sig{ + {0x51, 0x8e, 0xf4, 0x67, 0xe8, 0xd7, 0xec, 0x18, 0x92, 0xfc, 0x1c, + 0x03, 0xbc, 0xa8, 0xf8, 0x16, 0xc7, 0xca, 0xf0, 0xa8, 0x69, 0x02, + 0xc2, 0x7f, 0x85, 0x80, 0xa3, 0xa8, 0x00, 0x97, 0x63, 0x35, 0x39, + 0x8e, 0x42, 0xa4, 0x5d, 0x44, 0x7d, 0x0f, 0x67, 0x15, 0x63, 0x48, + 0x88, 0xf2, 0xa6, 0xe4, 0x21, 0xfe, 0x14, 0x53, 0x33, 0xa1, 0x2f, + 0x6e, 0x27, 0xfb, 0xe2, 0xf8, 0x77, 0xe8, 0xd6, 0xad, 0x11, 0x46, + 0x39, 0xb5, 0xb9, 0x8d, 0x63, 0xce, 0xfe, 0x15, 0xe8, 0x07, 0xbc, + 0x94, 0xf3, 0xcc, 0xf0, 0x6d, 0xed, 0x0d, 0x8b, 0xa2, 0xb5, 0x23, + 0x33, 0xcc, 0x8f, 0xe9, 0xbf, 0x12, 0x30, 0xa0, 0x67, 0x33, 0x6c, + 0x0a, 0x1a, 0x17, 0x9e, 0xdf, 0xae, 0x86, 0x82, 0xe2, 0xd1, 0x30, + 0x99, 0x5a, 0x2b, 0x96, 0x3e, 0xf3, 0x11, 0x8f, 0x78, 0xc7, 0x2b, + 0x16, 0xd3, 0xf9, 0x11, 0x74, 0xdb, 0x19, 0x3f, 0xfb, 0xe2, 0xda, + 0x81, 0x2e, 0xd3, 0x9a, 0x25, 0x60, 0x31, 0x6a, 0x97, 0x5b, 0xd1, + 0x1b, 0x57, 0xa3, 0x6e, 0xc8, 0x61, 0x18, 0x02, 0xca, 0x78, 0x59, + 0xaf, 0x76, 0x9f, 0x0c, 0x10, 0x53, 0x11, 0x38, 0x74, 0x3a, 0xb1, + 0xe8, 0xa8, 0x86, 0xb8, 0xd7, 0xef, 0x3f, 0x02, 0x13, 0x74, 0x89, + 0x8f, 0x26, 0xcf, 0xa6, 0x7b, 0x8b, 0x71, 0x12, 0x4b, 0xfe, 0x0b, + 0xd5, 0x67, 0x36, 0x83, 0xa8, 0x8d, 0xc1, 0x1c, 0x8c, 0x67, 0xbd, + 0x47, 0x0d, 0xfe, 0x1c, 0xb2, 0x44, 0x0f, 0x05, 0x5b, 0x1b, 0xd0, + 0x30, 0x3d, 0xeb, 0x1f, 0x10, 0x31, 0xf2, 0x2f, 0x4d, 0xe8, 0xe5, + 0x75, 0x76, 0x6b, 0x5c, 0xd5, 0x70, 0xd6, 0x9d, 0x9f, 0x58, 0x46, + 0x7f, 0xfb, 0x75, 0xe0, 0x70, 0x5a, 0xe4, 0xc4, 0x4f, 0xb4, 0x97, + 0x60, 0x65, 0x4f, 0x15, 0x71, 0x6e, 0x1d, 0x48, 0xab, 0xb4, 0x2e, + 0x0d, 0xc4, 0x8f}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim2CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim2Cond{Type::preimageSha256, + 9, + Preim2CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa3CondConditionFingerprint = { + {0xc2, 0x20, 0xd2, 0xd9, 0x00, 0x97, 0x9f, 0xb2, 0x4d, 0x72, 0x2b, + 0x28, 0x34, 0x99, 0xf6, 0xb5, 0x51, 0xee, 0x40, 0x07, 0x1b, 0x8d, + 0x96, 0x78, 0x14, 0xe2, 0x64, 0x1e, 0xea, 0x05, 0x71, 0xfb}}; + Condition const Rsa3Cond{Type::rsaSha256, + 65536, + Rsa3CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed4CondConditionFingerprint = { + {0xfa, 0xa5, 0xd8, 0x25, 0xe0, 0xb2, 0x1e, 0x1b, 0x7f, 0x79, 0xa8, + 0xfe, 0x46, 0x2d, 0xb1, 0xc0, 0x14, 0x91, 0xcb, 0x33, 0x9e, 0x03, + 0xe7, 0x48, 0x13, 0x41, 0xa9, 0xe3, 0x58, 0x0e, 0x5d, 0xdd}}; + Condition const Ed4Cond{Type::ed25519Sha256, + 131072, + Ed4CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa1 = std::make_unique( + makeSlice(rsa1PublicKey), makeSlice(rsa1Sig)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(rsa1)); + std::vector thresh0Subconditions{ + {Preim2Cond, Rsa3Cond, Ed4Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01" + "\x00\xc4\x1b\xc9\x7a\x96\x81\xce\x2e\xf2\x53\xc0\xd4\xa8\xb9" + "\xa8\x12\x92\x45\x06\xf1\xf4\xcd\x27\x7d\xff\xc1\x65\x75\xae" + "\xb7\xc4\x98\x53\xd8\xfa\x6d\x86\x63\xd8\x4e\xf5\x20\xe2\x9e" + "\x96\x04\x36\x0c\x3f\xac\x7d\x09\x42\x11\x13\x30\x2d\x7f\x60" + "\x2c\xec\x2a\x34\xc3\xd8\xba\x6d\x14\x75\x28\x56\xdc\x73\x6c" + "\xb7\xd6\xba\x8a\xa3\x9e\x09\x0e\xa4\xf3\x6b\x5d\x12\xc6\xe4" + "\xdd\x8c\xb1\x98\xcd\xde\xca\xad\xff\x86\xb6\x06\x25\x9b\x71" + "\x84\xa0\x9b\x19\x14\x88\xd0\xc7\x55\x99\xe0\x1e\x0e\x39\x67" + "\x74\xdf\xf6\x29\xfa\x92\xb6\xbb\xe6\xe1\x1c\xd9\xee\x65\xda" + "\x13\xec\x50\x6a\x11\x7e\xae\xb4\xac\x85\xa5\xc7\xcb\x43\x42" + "\x36\x73\x34\x31\xb6\x0b\x5e\xf0\x9e\x80\x49\xab\xc7\x79\xc5" + "\xa7\xe3\x16\x35\x3a\x48\xe6\xc0\x69\xe2\x70\x30\x20\x74\x47" + "\x3e\x3a\x51\x01\x21\x60\x15\x53\x40\x68\x6e\xe7\x9f\x73\xb6" + "\x98\x3b\x6e\x50\xb8\xb2\xe7\x42\x90\x77\x61\xd4\x22\x6c\x0b" + "\x3d\x66\xe0\x1b\x7d\xb0\xa1\xa9\xa9\xea\x0e\xf2\xab\xe0\x32" + "\xf4\x49\x44\xcb\xae\x60\x1d\xe1\xac\xd3\x34\x2b\x03\x97\x98" + "\x2d\xda\xf8\xe8\x0b\x81\x94\x98\x3a\xbd\x6d\x17\x18\x42\x58" + "\x0c\xa3\x81\x82\x01\x00\x51\x8e\xf4\x67\xe8\xd7\xec\x18\x92" + "\xfc\x1c\x03\xbc\xa8\xf8\x16\xc7\xca\xf0\xa8\x69\x02\xc2\x7f" + "\x85\x80\xa3\xa8\x00\x97\x63\x35\x39\x8e\x42\xa4\x5d\x44\x7d" + "\x0f\x67\x15\x63\x48\x88\xf2\xa6\xe4\x21\xfe\x14\x53\x33\xa1" + "\x2f\x6e\x27\xfb\xe2\xf8\x77\xe8\xd6\xad\x11\x46\x39\xb5\xb9" + "\x8d\x63\xce\xfe\x15\xe8\x07\xbc\x94\xf3\xcc\xf0\x6d\xed\x0d" + "\x8b\xa2\xb5\x23\x33\xcc\x8f\xe9\xbf\x12\x30\xa0\x67\x33\x6c" + "\x0a\x1a\x17\x9e\xdf\xae\x86\x82\xe2\xd1\x30\x99\x5a\x2b\x96" + "\x3e\xf3\x11\x8f\x78\xc7\x2b\x16\xd3\xf9\x11\x74\xdb\x19\x3f" + "\xfb\xe2\xda\x81\x2e\xd3\x9a\x25\x60\x31\x6a\x97\x5b\xd1\x1b" + "\x57\xa3\x6e\xc8\x61\x18\x02\xca\x78\x59\xaf\x76\x9f\x0c\x10" + "\x53\x11\x38\x74\x3a\xb1\xe8\xa8\x86\xb8\xd7\xef\x3f\x02\x13" + "\x74\x89\x8f\x26\xcf\xa6\x7b\x8b\x71\x12\x4b\xfe\x0b\xd5\x67" + "\x36\x83\xa8\x8d\xc1\x1c\x8c\x67\xbd\x47\x0d\xfe\x1c\xb2\x44" + "\x0f\x05\x5b\x1b\xd0\x30\x3d\xeb\x1f\x10\x31\xf2\x2f\x4d\xe8" + "\xe5\x75\x76\x6b\x5c\xd5\x70\xd6\x9d\x9f\x58\x46\x7f\xfb\x75" + "\xe0\x70\x5a\xe4\xc4\x4f\xb4\x97\x60\x65\x4f\x15\x71\x6e\x1d" + "\x48\xab\xb4\x2e\x0d\xc4\x8f\xa1\x79\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa3\x27\x80\x20\xc2\x20\xd2\xd9\x00\x97\x9f\xb2" + "\x4d\x72\x2b\x28\x34\x99\xf6\xb5\x51\xee\x40\x07\x1b\x8d\x96" + "\x78\x14\xe2\x64\x1e\xea\x05\x71\xfb\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\xfa\xa5\xd8\x25\xe0\xb2\x1e\x1b\x7f\x79\xa8\xfe" + "\x46\x2d\xb1\xc0\x14\x91\xcb\x33\x9e\x03\xe7\x48\x13\x41\xa9" + "\xe3\x58\x0e\x5d\xdd\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xfc\x2c\xde\x5b\xcd\xa1\xb1\xcd\xac\x6a\x7b" + "\xd9\xd4\x93\x8b\xa3\x94\x97\x9e\x0c\x80\x6d\x8d\x47\xec\x03" + "\x4a\x32\x6c\xfe\x15\x9c\x81\x03\x02\x10\x00\x82\x02\x03\x98"s; + auto const thresh0EncodedFingerprint = + "\x30\x81\xa8\x80\x01\x01\xa1\x81\xa2\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa3\x27\x80\x20\x23\xc9\xfd\x99\xdc\xf3\x74\x06" + "\xe3\x11\x57\x5e\x7a\x90\x4b\x0d\x0c\x36\xa7\x8d\x25\xbc\xd5" + "\x5f\x0d\x1f\x25\x08\x2e\x4f\xca\x1a\x81\x03\x01\x00\x00\xa3" + "\x27\x80\x20\xc2\x20\xd2\xd9\x00\x97\x9f\xb2\x4d\x72\x2b\x28" + "\x34\x99\xf6\xb5\x51\xee\x40\x07\x1b\x8d\x96\x78\x14\xe2\x64" + "\x1e\xea\x05\x71\xfb\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xfa" + "\xa5\xd8\x25\xe0\xb2\x1e\x1b\x7f\x79\xa8\xfe\x46\x2d\xb1\xc0" + "\x14\x91\xcb\x33\x9e\x03\xe7\x48\x13\x41\xa9\xe3\x58\x0e\x5d" + "\xdd\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh26() + { + testcase("Thresh26"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim7Cond + // ** Rsa8Cond + // ** Ed9Cond + // ** rsa1 + // ** thresh2 + // *** Preim4Cond + // *** Rsa5Cond + // *** Ed6Cond + // *** rsa3 + + auto const rsa1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa1PublicKey{ + {0xc4, 0x1b, 0xc9, 0x7a, 0x96, 0x81, 0xce, 0x2e, 0xf2, 0x53, 0xc0, + 0xd4, 0xa8, 0xb9, 0xa8, 0x12, 0x92, 0x45, 0x06, 0xf1, 0xf4, 0xcd, + 0x27, 0x7d, 0xff, 0xc1, 0x65, 0x75, 0xae, 0xb7, 0xc4, 0x98, 0x53, + 0xd8, 0xfa, 0x6d, 0x86, 0x63, 0xd8, 0x4e, 0xf5, 0x20, 0xe2, 0x9e, + 0x96, 0x04, 0x36, 0x0c, 0x3f, 0xac, 0x7d, 0x09, 0x42, 0x11, 0x13, + 0x30, 0x2d, 0x7f, 0x60, 0x2c, 0xec, 0x2a, 0x34, 0xc3, 0xd8, 0xba, + 0x6d, 0x14, 0x75, 0x28, 0x56, 0xdc, 0x73, 0x6c, 0xb7, 0xd6, 0xba, + 0x8a, 0xa3, 0x9e, 0x09, 0x0e, 0xa4, 0xf3, 0x6b, 0x5d, 0x12, 0xc6, + 0xe4, 0xdd, 0x8c, 0xb1, 0x98, 0xcd, 0xde, 0xca, 0xad, 0xff, 0x86, + 0xb6, 0x06, 0x25, 0x9b, 0x71, 0x84, 0xa0, 0x9b, 0x19, 0x14, 0x88, + 0xd0, 0xc7, 0x55, 0x99, 0xe0, 0x1e, 0x0e, 0x39, 0x67, 0x74, 0xdf, + 0xf6, 0x29, 0xfa, 0x92, 0xb6, 0xbb, 0xe6, 0xe1, 0x1c, 0xd9, 0xee, + 0x65, 0xda, 0x13, 0xec, 0x50, 0x6a, 0x11, 0x7e, 0xae, 0xb4, 0xac, + 0x85, 0xa5, 0xc7, 0xcb, 0x43, 0x42, 0x36, 0x73, 0x34, 0x31, 0xb6, + 0x0b, 0x5e, 0xf0, 0x9e, 0x80, 0x49, 0xab, 0xc7, 0x79, 0xc5, 0xa7, + 0xe3, 0x16, 0x35, 0x3a, 0x48, 0xe6, 0xc0, 0x69, 0xe2, 0x70, 0x30, + 0x20, 0x74, 0x47, 0x3e, 0x3a, 0x51, 0x01, 0x21, 0x60, 0x15, 0x53, + 0x40, 0x68, 0x6e, 0xe7, 0x9f, 0x73, 0xb6, 0x98, 0x3b, 0x6e, 0x50, + 0xb8, 0xb2, 0xe7, 0x42, 0x90, 0x77, 0x61, 0xd4, 0x22, 0x6c, 0x0b, + 0x3d, 0x66, 0xe0, 0x1b, 0x7d, 0xb0, 0xa1, 0xa9, 0xa9, 0xea, 0x0e, + 0xf2, 0xab, 0xe0, 0x32, 0xf4, 0x49, 0x44, 0xcb, 0xae, 0x60, 0x1d, + 0xe1, 0xac, 0xd3, 0x34, 0x2b, 0x03, 0x97, 0x98, 0x2d, 0xda, 0xf8, + 0xe8, 0x0b, 0x81, 0x94, 0x98, 0x3a, 0xbd, 0x6d, 0x17, 0x18, 0x42, + 0x58, 0x0c, 0xa3}}; + std::array const rsa1Sig{ + {0x35, 0x02, 0x0c, 0x86, 0x41, 0xb4, 0x14, 0xb0, 0x94, 0x0a, 0xa4, + 0xb8, 0xb7, 0xa1, 0x6d, 0x2f, 0x4c, 0x6d, 0x82, 0xae, 0x9b, 0x3b, + 0x73, 0xae, 0xa1, 0xb4, 0xb7, 0x54, 0xda, 0x6f, 0x64, 0x2d, 0x87, + 0x5e, 0xfc, 0xaf, 0x9e, 0x0c, 0x82, 0x8a, 0x9b, 0xf4, 0xbb, 0x32, + 0x1c, 0x3d, 0x22, 0xb3, 0x3e, 0xae, 0x1e, 0x9e, 0xd7, 0xde, 0xe0, + 0x94, 0x30, 0xef, 0x6d, 0x9e, 0xf4, 0x19, 0x2c, 0x90, 0xe8, 0x91, + 0x85, 0xb9, 0x1b, 0x71, 0xa6, 0xa1, 0x4f, 0x43, 0x75, 0xae, 0xfc, + 0xae, 0x19, 0xfb, 0xea, 0xab, 0x34, 0x4e, 0x3d, 0x77, 0x92, 0x81, + 0xa5, 0xe5, 0x23, 0xa5, 0x51, 0xf8, 0x5a, 0x3e, 0x47, 0xeb, 0xf7, + 0x90, 0xa6, 0x3c, 0x00, 0x1b, 0xd6, 0xdc, 0x3e, 0x0e, 0xc0, 0xef, + 0x6b, 0xc1, 0x78, 0x5c, 0xff, 0x9e, 0x8c, 0xe4, 0x15, 0x3c, 0x5d, + 0x3f, 0x18, 0xeb, 0xe5, 0xf9, 0xac, 0x19, 0xc9, 0xae, 0x34, 0xef, + 0x08, 0x30, 0xce, 0xc3, 0x13, 0x39, 0x51, 0x7e, 0xdd, 0xb7, 0xb2, + 0x5c, 0x2c, 0x0e, 0x3c, 0x8d, 0x97, 0xaf, 0xc6, 0x4e, 0x1c, 0x2d, + 0x1d, 0xe1, 0x65, 0x7c, 0xcc, 0x64, 0x94, 0xeb, 0x18, 0xa6, 0x9f, + 0x39, 0xde, 0x72, 0xfc, 0x60, 0xfd, 0x49, 0xa5, 0xd0, 0xfa, 0xab, + 0x12, 0x7f, 0x02, 0x3d, 0x9b, 0x0d, 0x61, 0x0e, 0xb8, 0xca, 0x86, + 0xaf, 0x84, 0x79, 0xb9, 0x74, 0x02, 0x3e, 0x70, 0x4a, 0xe8, 0x15, + 0x01, 0xef, 0x23, 0xd3, 0x2a, 0x9a, 0x05, 0x51, 0xb6, 0xa2, 0xca, + 0x14, 0xa1, 0x53, 0x23, 0xa2, 0x69, 0x66, 0x18, 0xa7, 0xf2, 0x74, + 0x51, 0x90, 0xea, 0xbb, 0x3c, 0xf8, 0x11, 0xac, 0xc1, 0xdd, 0xa0, + 0xf0, 0x01, 0x82, 0xb3, 0x72, 0xf4, 0xce, 0x3a, 0xb6, 0x43, 0xef, + 0x82, 0x3c, 0xcd, 0x84, 0x4e, 0xac, 0x6f, 0x91, 0xfe, 0x32, 0x8f, + 0x12, 0x3d, 0xe8}}; + auto const rsa3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa3PublicKey{ + {0xbd, 0xd1, 0xc7, 0xf0, 0xb0, 0x3a, 0xa5, 0x5b, 0x3e, 0x49, 0x8d, + 0x4e, 0x00, 0x54, 0x89, 0xb9, 0x89, 0xcd, 0x4b, 0x43, 0xde, 0x59, + 0xf6, 0x7a, 0x67, 0x5c, 0x3a, 0xc6, 0xcf, 0x82, 0x3f, 0x35, 0x9c, + 0xcc, 0xda, 0xcd, 0xd3, 0x97, 0x86, 0x5b, 0xe9, 0xf6, 0x05, 0x55, + 0x0b, 0x26, 0xef, 0x1e, 0x88, 0xd5, 0xb6, 0xba, 0x14, 0x0a, 0xb2, + 0x76, 0xb9, 0xb3, 0x46, 0x0c, 0xc0, 0x80, 0x17, 0x13, 0x68, 0x23, + 0xdc, 0xec, 0x10, 0x18, 0xfc, 0xaa, 0xbe, 0xb3, 0xc4, 0xc7, 0xa9, + 0x84, 0xa6, 0x4e, 0x5c, 0x08, 0x6b, 0x7b, 0x4c, 0x81, 0x91, 0x79, + 0x5d, 0x90, 0x06, 0x15, 0xbb, 0x76, 0x2f, 0x5c, 0x53, 0x60, 0x0f, + 0xac, 0xf3, 0x7c, 0x49, 0xc5, 0x47, 0xec, 0xb3, 0xda, 0x93, 0x87, + 0xc1, 0xb9, 0xcf, 0x2c, 0xb5, 0xf0, 0x85, 0xad, 0xb4, 0x38, 0x67, + 0x88, 0xda, 0x3d, 0xfa, 0x01, 0xb7, 0x54, 0xd9, 0x41, 0x0b, 0x7b, + 0x8a, 0x09, 0xe0, 0x84, 0x7d, 0xbb, 0x89, 0xb2, 0xfc, 0x0b, 0x70, + 0x36, 0x93, 0x56, 0x62, 0xcc, 0xb4, 0xfc, 0xf9, 0x1f, 0x37, 0x92, + 0x9b, 0x3a, 0x4e, 0x7c, 0xad, 0x4b, 0xa6, 0x76, 0x6f, 0xda, 0xc4, + 0x2f, 0x83, 0x53, 0xbd, 0x93, 0xa9, 0x76, 0x89, 0x53, 0xe1, 0x4d, + 0xee, 0x27, 0x11, 0x6f, 0xbc, 0x21, 0xad, 0x42, 0x9f, 0x29, 0xf6, + 0x03, 0xdd, 0xec, 0xfa, 0xa1, 0x78, 0xd2, 0xde,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, 0x5d, 0xc1, 0x2f, 0x8f, 0x9f, + 0xe2, 0x43, 0xb2, 0xda, 0xd4, 0xdc, 0x0b, 0x6d, 0xb8, 0x79, 0x18, + 0x1f, 0x75, 0x02, 0xfa, 0x11, 0x65, 0x4a, 0x6b, 0x75, 0xb1, 0x04, + 0x2d, 0x12, 0x0e, 0xfc, 0xf0, 0x55, 0xdc, 0xd9, 0x8e, 0x37, 0xc9, + 0xeb, 0x72, 0xcb, 0xb4, 0xb1, 0xd9, 0x99, 0x3b, 0x7f, 0xe0, 0xad, + 0x64, 0x20, 0x19, 0x5d, 0x2b, 0x40, 0xf1, 0x2b, 0x9e, 0x8d, 0x18, + 0xbb, 0x8d, 0xf7, 0x7c, 0x7e, 0x3d, 0x70, 0x2b, 0xd4, 0x51, 0x49, + 0xbd, 0x9d, 0xbb, 0x0c, 0x43, 0x52, 0x7f, 0xb3, 0x41, 0x00, 0x9f, + 0x01, 0x1e, 0x79, 0xf1, 0x1d, 0x9f, 0x3e, 0x95, 0x03, 0x63, 0x4e, + 0x5a, 0x8d, 0x58, 0xa2, 0x0c, 0xdb, 0xd3, 0x4b, 0x21, 0x29, 0xa6, + 0xc1, 0xfd, 0x3b, 0x62, 0x39, 0x35, 0x9d, 0x24, 0x90, 0x6f, 0x3d, + 0x90, 0x29, 0xc6, 0xba, 0x1c, 0x15, 0xaf, 0x56, 0xb1, 0xe2, 0x16, + 0x22, 0x39, 0x63, 0x36, 0x88, 0xdb, 0x34, 0x5f, 0x6d, 0xb6, 0xb8, + 0xce, 0x2f, 0x1a}}; + auto const thresh2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim4CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim4Cond{Type::preimageSha256, + 9, + Preim4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa5CondConditionFingerprint = { + {0x99, 0xfb, 0x0b, 0x38, 0x94, 0x4d, 0x20, 0x85, 0xc8, 0xda, 0x3a, + 0x64, 0x31, 0x44, 0x6f, 0x6c, 0x3b, 0x46, 0x25, 0x50, 0xd7, 0x7f, + 0xdf, 0xee, 0x75, 0x72, 0x71, 0xf9, 0x61, 0x40, 0x63, 0xfa}}; + Condition const Rsa5Cond{Type::rsaSha256, + 65536, + Rsa5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed6CondConditionFingerprint = { + {0x00, 0xd3, 0xc9, 0x24, 0x3f, 0x2d, 0x2e, 0x64, 0x93, 0xa8, 0x49, + 0x29, 0x82, 0x75, 0xea, 0xbf, 0xe3, 0x53, 0x7f, 0x8e, 0x45, 0x16, + 0xdb, 0x5e, 0xc6, 0xdf, 0x39, 0xd2, 0xcb, 0xea, 0x62, 0xfb}}; + Condition const Ed6Cond{Type::ed25519Sha256, + 131072, + Ed6CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa1 = std::make_unique( + makeSlice(rsa1PublicKey), makeSlice(rsa1Sig)); + auto rsa3 = std::make_unique( + makeSlice(rsa3PublicKey), makeSlice(rsa3Sig)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(rsa3)); + std::vector thresh2Subconditions{ + {Preim4Cond, Rsa5Cond, Ed6Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(rsa1)); + thresh0Subfulfillments.emplace_back(std::move(thresh2)); + std::vector thresh0Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x1a\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82\x02" + "\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xbd\xd1\xc7\xf0\xb0\x3a" + "\xa5\x5b\x3e\x49\x8d\x4e\x00\x54\x89\xb9\x89\xcd\x4b\x43\xde" + "\x59\xf6\x7a\x67\x5c\x3a\xc6\xcf\x82\x3f\x35\x9c\xcc\xda\xcd" + "\xd3\x97\x86\x5b\xe9\xf6\x05\x55\x0b\x26\xef\x1e\x88\xd5\xb6" + "\xba\x14\x0a\xb2\x76\xb9\xb3\x46\x0c\xc0\x80\x17\x13\x68\x23" + "\xdc\xec\x10\x18\xfc\xaa\xbe\xb3\xc4\xc7\xa9\x84\xa6\x4e\x5c" + "\x08\x6b\x7b\x4c\x81\x91\x79\x5d\x90\x06\x15\xbb\x76\x2f\x5c" + "\x53\x60\x0f\xac\xf3\x7c\x49\xc5\x47\xec\xb3\xda\x93\x87\xc1" + "\xb9\xcf\x2c\xb5\xf0\x85\xad\xb4\x38\x67\x88\xda\x3d\xfa\x01" + "\xb7\x54\xd9\x41\x0b\x7b\x8a\x09\xe0\x84\x7d\xbb\x89\xb2\xfc" + "\x0b\x70\x36\x93\x56\x62\xcc\xb4\xfc\xf9\x1f\x37\x92\x9b\x3a" + "\x4e\x7c\xad\x4b\xa6\x76\x6f\xda\xc4\x2f\x83\x53\xbd\x93\xa9" + "\x76\x89\x53\xe1\x4d\xee\x27\x11\x6f\xbc\x21\xad\x42\x9f\x29" + "\xf6\x03\xdd\xec\xfa\xa1\x78\xd2\xde\x29\x2e\xd8\x3a\x7f\xe9" + "\x9b\x5d\xeb\x37\xb8\xb0\xa0\x66\x3f\x02\xcd\x2a\x6e\xd3\x1c" + "\xa5\x65\xdc\x73\xbe\x93\x54\x9a\x2b\xf8\x32\x8b\xe8\xce\x9a" + "\x59\xd0\x05\xeb\xbb\xac\xfc\x4c\x4b\x2e\xac\x2a\xc3\x0f\x0a" + "\xd7\x46\xaf\xfd\x22\x0d\x0d\x54\xcc\x2f\x81\x82\x01\x00\x0e" + "\xc0\xe5\x76\x08\x2a\xf6\x16\x3a\x39\x67\xae\x8a\x99\x2e\x33" + "\x95\x55\x49\x3f\xea\x5e\xc9\x6a\x7e\x78\x52\x1e\x3b\x88\x83" + "\xb7\x8f\x19\x4d\xc8\x5f\x7f\xef\xdd\x79\x25\x76\xb6\xd7\x2e" + "\x51\x20\xb5\xc2\x63\x07\x46\x2a\x4a\x95\xf8\x89\x59\x5a\x4e" + "\xae\xba\x80\xb3\xb6\x3f\xd1\x13\x9d\x91\x46\xdb\xdc\x2c\x4a" + "\x27\x2a\x46\x67\x6a\x9d\x73\x39\x7c\x1d\x7a\x47\xdc\x10\x89" + "\xd2\x0b\xfd\x6b\x80\xaa\x76\xe4\x58\x40\x53\x1f\xd2\xe1\x08" + "\x7b\xc5\x46\xaf\xfd\x72\x9a\x72\xe0\x79\x5d\xc1\x2f\x8f\x9f" + "\xe2\x43\xb2\xda\xd4\xdc\x0b\x6d\xb8\x79\x18\x1f\x75\x02\xfa" + "\x11\x65\x4a\x6b\x75\xb1\x04\x2d\x12\x0e\xfc\xf0\x55\xdc\xd9" + "\x8e\x37\xc9\xeb\x72\xcb\xb4\xb1\xd9\x99\x3b\x7f\xe0\xad\x64" + "\x20\x19\x5d\x2b\x40\xf1\x2b\x9e\x8d\x18\xbb\x8d\xf7\x7c\x7e" + "\x3d\x70\x2b\xd4\x51\x49\xbd\x9d\xbb\x0c\x43\x52\x7f\xb3\x41" + "\x00\x9f\x01\x1e\x79\xf1\x1d\x9f\x3e\x95\x03\x63\x4e\x5a\x8d" + "\x58\xa2\x0c\xdb\xd3\x4b\x21\x29\xa6\xc1\xfd\x3b\x62\x39\x35" + "\x9d\x24\x90\x6f\x3d\x90\x29\xc6\xba\x1c\x15\xaf\x56\xb1\xe2" + "\x16\x22\x39\x63\x36\x88\xdb\x34\x5f\x6d\xb6\xb8\xce\x2f\x1a" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\x99\xfb\x0b\x38\x94\x4d\x20\x85\xc8\xda\x3a\x64\x31\x44\x6f" + "\x6c\x3b\x46\x25\x50\xd7\x7f\xdf\xee\x75\x72\x71\xf9\x61\x40" + "\x63\xfa\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\xd3\xc9\x24" + "\x3f\x2d\x2e\x64\x93\xa8\x49\x29\x82\x75\xea\xbf\xe3\x53\x7f" + "\x8e\x45\x16\xdb\x5e\xc6\xdf\x39\xd2\xcb\xea\x62\xfb\x81\x03" + "\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xc4\x1b\xc9\x7a" + "\x96\x81\xce\x2e\xf2\x53\xc0\xd4\xa8\xb9\xa8\x12\x92\x45\x06" + "\xf1\xf4\xcd\x27\x7d\xff\xc1\x65\x75\xae\xb7\xc4\x98\x53\xd8" + "\xfa\x6d\x86\x63\xd8\x4e\xf5\x20\xe2\x9e\x96\x04\x36\x0c\x3f" + "\xac\x7d\x09\x42\x11\x13\x30\x2d\x7f\x60\x2c\xec\x2a\x34\xc3" + "\xd8\xba\x6d\x14\x75\x28\x56\xdc\x73\x6c\xb7\xd6\xba\x8a\xa3" + "\x9e\x09\x0e\xa4\xf3\x6b\x5d\x12\xc6\xe4\xdd\x8c\xb1\x98\xcd" + "\xde\xca\xad\xff\x86\xb6\x06\x25\x9b\x71\x84\xa0\x9b\x19\x14" + "\x88\xd0\xc7\x55\x99\xe0\x1e\x0e\x39\x67\x74\xdf\xf6\x29\xfa" + "\x92\xb6\xbb\xe6\xe1\x1c\xd9\xee\x65\xda\x13\xec\x50\x6a\x11" + "\x7e\xae\xb4\xac\x85\xa5\xc7\xcb\x43\x42\x36\x73\x34\x31\xb6" + "\x0b\x5e\xf0\x9e\x80\x49\xab\xc7\x79\xc5\xa7\xe3\x16\x35\x3a" + "\x48\xe6\xc0\x69\xe2\x70\x30\x20\x74\x47\x3e\x3a\x51\x01\x21" + "\x60\x15\x53\x40\x68\x6e\xe7\x9f\x73\xb6\x98\x3b\x6e\x50\xb8" + "\xb2\xe7\x42\x90\x77\x61\xd4\x22\x6c\x0b\x3d\x66\xe0\x1b\x7d" + "\xb0\xa1\xa9\xa9\xea\x0e\xf2\xab\xe0\x32\xf4\x49\x44\xcb\xae" + "\x60\x1d\xe1\xac\xd3\x34\x2b\x03\x97\x98\x2d\xda\xf8\xe8\x0b" + "\x81\x94\x98\x3a\xbd\x6d\x17\x18\x42\x58\x0c\xa3\x81\x82\x01" + "\x00\x35\x02\x0c\x86\x41\xb4\x14\xb0\x94\x0a\xa4\xb8\xb7\xa1" + "\x6d\x2f\x4c\x6d\x82\xae\x9b\x3b\x73\xae\xa1\xb4\xb7\x54\xda" + "\x6f\x64\x2d\x87\x5e\xfc\xaf\x9e\x0c\x82\x8a\x9b\xf4\xbb\x32" + "\x1c\x3d\x22\xb3\x3e\xae\x1e\x9e\xd7\xde\xe0\x94\x30\xef\x6d" + "\x9e\xf4\x19\x2c\x90\xe8\x91\x85\xb9\x1b\x71\xa6\xa1\x4f\x43" + "\x75\xae\xfc\xae\x19\xfb\xea\xab\x34\x4e\x3d\x77\x92\x81\xa5" + "\xe5\x23\xa5\x51\xf8\x5a\x3e\x47\xeb\xf7\x90\xa6\x3c\x00\x1b" + "\xd6\xdc\x3e\x0e\xc0\xef\x6b\xc1\x78\x5c\xff\x9e\x8c\xe4\x15" + "\x3c\x5d\x3f\x18\xeb\xe5\xf9\xac\x19\xc9\xae\x34\xef\x08\x30" + "\xce\xc3\x13\x39\x51\x7e\xdd\xb7\xb2\x5c\x2c\x0e\x3c\x8d\x97" + "\xaf\xc6\x4e\x1c\x2d\x1d\xe1\x65\x7c\xcc\x64\x94\xeb\x18\xa6" + "\x9f\x39\xde\x72\xfc\x60\xfd\x49\xa5\xd0\xfa\xab\x12\x7f\x02" + "\x3d\x9b\x0d\x61\x0e\xb8\xca\x86\xaf\x84\x79\xb9\x74\x02\x3e" + "\x70\x4a\xe8\x15\x01\xef\x23\xd3\x2a\x9a\x05\x51\xb6\xa2\xca" + "\x14\xa1\x53\x23\xa2\x69\x66\x18\xa7\xf2\x74\x51\x90\xea\xbb" + "\x3c\xf8\x11\xac\xc1\xdd\xa0\xf0\x01\x82\xb3\x72\xf4\xce\x3a" + "\xb6\x43\xef\x82\x3c\xcd\x84\x4e\xac\x6f\x91\xfe\x32\x8f\x12" + "\x3d\xe8\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27" + "\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e" + "\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e" + "\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa" + "\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f" + "\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9" + "\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x03\xdb\x6c\x3b\x95\xb7\x3d\x38\x34\x95\x9e" + "\x8b\xad\xc6\xbb\xb9\x54\xe0\xdb\x29\x13\xa0\xa8\x82\x89\x11" + "\xe6\xa5\xf2\xf2\xcf\x51\x81\x03\x04\x24\x00\x82\x02\x03\x98"s; + auto const thresh0EncodedFingerprint = + "\x30\x81\xd5\x80\x01\x02\xa1\x81\xcf\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa2\x2b\x80\x20\xd4\x46\x35\xa3\xe4\x89\x30\xbe" + "\xab\xa5\xb3\xb6\x82\xb6\xa2\xb4\xc8\x19\x3f\xf9\xf4\xb4\xf8" + "\x6f\x3c\xd9\x80\x19\xd7\x1a\x0f\xad\x81\x03\x02\x10\x00\x82" + "\x02\x03\x98\xa3\x27\x80\x20\x23\xc9\xfd\x99\xdc\xf3\x74\x06" + "\xe3\x11\x57\x5e\x7a\x90\x4b\x0d\x0c\x36\xa7\x8d\x25\xbc\xd5" + "\x5f\x0d\x1f\x25\x08\x2e\x4f\xca\x1a\x81\x03\x01\x00\x00\xa3" + "\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7" + "\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c" + "\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92" + "\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0" + "\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6" + "\xc9\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh27() + { + testcase("Thresh27"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim7Cond + // ** Rsa8Cond + // ** Ed9Cond + // ** Thresh10Cond + // ** rsa1 + // ** thresh2 + // *** Preim4Cond + // *** Rsa5Cond + // *** Ed6Cond + // *** rsa3 + + auto const rsa1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa1PublicKey{ + {0xc4, 0x1b, 0xc9, 0x7a, 0x96, 0x81, 0xce, 0x2e, 0xf2, 0x53, 0xc0, + 0xd4, 0xa8, 0xb9, 0xa8, 0x12, 0x92, 0x45, 0x06, 0xf1, 0xf4, 0xcd, + 0x27, 0x7d, 0xff, 0xc1, 0x65, 0x75, 0xae, 0xb7, 0xc4, 0x98, 0x53, + 0xd8, 0xfa, 0x6d, 0x86, 0x63, 0xd8, 0x4e, 0xf5, 0x20, 0xe2, 0x9e, + 0x96, 0x04, 0x36, 0x0c, 0x3f, 0xac, 0x7d, 0x09, 0x42, 0x11, 0x13, + 0x30, 0x2d, 0x7f, 0x60, 0x2c, 0xec, 0x2a, 0x34, 0xc3, 0xd8, 0xba, + 0x6d, 0x14, 0x75, 0x28, 0x56, 0xdc, 0x73, 0x6c, 0xb7, 0xd6, 0xba, + 0x8a, 0xa3, 0x9e, 0x09, 0x0e, 0xa4, 0xf3, 0x6b, 0x5d, 0x12, 0xc6, + 0xe4, 0xdd, 0x8c, 0xb1, 0x98, 0xcd, 0xde, 0xca, 0xad, 0xff, 0x86, + 0xb6, 0x06, 0x25, 0x9b, 0x71, 0x84, 0xa0, 0x9b, 0x19, 0x14, 0x88, + 0xd0, 0xc7, 0x55, 0x99, 0xe0, 0x1e, 0x0e, 0x39, 0x67, 0x74, 0xdf, + 0xf6, 0x29, 0xfa, 0x92, 0xb6, 0xbb, 0xe6, 0xe1, 0x1c, 0xd9, 0xee, + 0x65, 0xda, 0x13, 0xec, 0x50, 0x6a, 0x11, 0x7e, 0xae, 0xb4, 0xac, + 0x85, 0xa5, 0xc7, 0xcb, 0x43, 0x42, 0x36, 0x73, 0x34, 0x31, 0xb6, + 0x0b, 0x5e, 0xf0, 0x9e, 0x80, 0x49, 0xab, 0xc7, 0x79, 0xc5, 0xa7, + 0xe3, 0x16, 0x35, 0x3a, 0x48, 0xe6, 0xc0, 0x69, 0xe2, 0x70, 0x30, + 0x20, 0x74, 0x47, 0x3e, 0x3a, 0x51, 0x01, 0x21, 0x60, 0x15, 0x53, + 0x40, 0x68, 0x6e, 0xe7, 0x9f, 0x73, 0xb6, 0x98, 0x3b, 0x6e, 0x50, + 0xb8, 0xb2, 0xe7, 0x42, 0x90, 0x77, 0x61, 0xd4, 0x22, 0x6c, 0x0b, + 0x3d, 0x66, 0xe0, 0x1b, 0x7d, 0xb0, 0xa1, 0xa9, 0xa9, 0xea, 0x0e, + 0xf2, 0xab, 0xe0, 0x32, 0xf4, 0x49, 0x44, 0xcb, 0xae, 0x60, 0x1d, + 0xe1, 0xac, 0xd3, 0x34, 0x2b, 0x03, 0x97, 0x98, 0x2d, 0xda, 0xf8, + 0xe8, 0x0b, 0x81, 0x94, 0x98, 0x3a, 0xbd, 0x6d, 0x17, 0x18, 0x42, + 0x58, 0x0c, 0xa3}}; + std::array const rsa1Sig{ + {0x0a, 0xa6, 0x89, 0xd6, 0xfa, 0xc5, 0x0b, 0xaa, 0x48, 0x12, 0x72, + 0xf8, 0x30, 0x7a, 0x2a, 0x34, 0x3a, 0x99, 0x3f, 0x50, 0xb6, 0x13, + 0x5b, 0xc1, 0xa9, 0x0d, 0x6c, 0x99, 0x18, 0x20, 0x2d, 0xe1, 0xe4, + 0x3e, 0x31, 0x01, 0x8c, 0x50, 0x90, 0x97, 0xf6, 0x91, 0xf8, 0xb3, + 0x59, 0x0a, 0x2c, 0x05, 0x1d, 0x1f, 0x73, 0x71, 0x98, 0xc6, 0x57, + 0xb9, 0xc1, 0x07, 0x53, 0xc7, 0xe8, 0xa0, 0xe4, 0x2d, 0x0f, 0x44, + 0x30, 0xa1, 0xcd, 0xa6, 0x79, 0x12, 0x50, 0x31, 0xf5, 0x92, 0x2b, + 0xfe, 0xdc, 0xee, 0x7c, 0x2a, 0xbc, 0xdd, 0x35, 0x53, 0xa5, 0x92, + 0x08, 0x51, 0xeb, 0xe7, 0x84, 0x9a, 0xf1, 0x2d, 0x4b, 0xfd, 0x00, + 0xa5, 0x61, 0xde, 0x32, 0x28, 0x5e, 0x41, 0x7f, 0x24, 0x40, 0xaa, + 0x1b, 0x19, 0x40, 0x3d, 0x00, 0xec, 0x40, 0x14, 0xf0, 0x3d, 0x75, + 0x4f, 0x21, 0x8c, 0x2b, 0xfc, 0x84, 0x91, 0x81, 0x8c, 0x8b, 0xfb, + 0xdb, 0xd6, 0xd9, 0x48, 0x0f, 0x30, 0x9e, 0xc4, 0x1e, 0xf3, 0xcf, + 0x2e, 0x36, 0x7b, 0x8e, 0x10, 0x80, 0xf9, 0xe5, 0x8e, 0xba, 0x96, + 0x07, 0x5e, 0x21, 0xa7, 0x0d, 0x37, 0x7b, 0xea, 0x7d, 0x23, 0xa4, + 0x67, 0x95, 0xa4, 0xb9, 0x5c, 0xdd, 0x17, 0x60, 0x22, 0xf9, 0xb2, + 0x80, 0x0f, 0x06, 0xd9, 0xb6, 0x4c, 0x81, 0x8d, 0xb9, 0xc2, 0xbc, + 0x32, 0x4a, 0x87, 0xa2, 0x31, 0x5e, 0x34, 0x58, 0xa3, 0xaa, 0xcb, + 0x78, 0x99, 0x06, 0x33, 0xa0, 0x1f, 0xde, 0xdd, 0x30, 0xb8, 0x0a, + 0x34, 0xce, 0xb7, 0x45, 0xff, 0xde, 0xa8, 0x30, 0x36, 0x16, 0xda, + 0xfa, 0x28, 0x83, 0x21, 0x5c, 0x4f, 0x20, 0x53, 0x89, 0xc4, 0x84, + 0x81, 0xad, 0x7a, 0x46, 0xa6, 0xc0, 0x5a, 0xbb, 0xa8, 0x01, 0x3b, + 0x00, 0x56, 0x9e, 0xf5, 0x50, 0x38, 0x9b, 0x0f, 0x52, 0x2b, 0xa1, + 0x4c, 0x80, 0x70}}; + auto const rsa3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa3PublicKey{ + {0xbd, 0xd1, 0xc7, 0xf0, 0xb0, 0x3a, 0xa5, 0x5b, 0x3e, 0x49, 0x8d, + 0x4e, 0x00, 0x54, 0x89, 0xb9, 0x89, 0xcd, 0x4b, 0x43, 0xde, 0x59, + 0xf6, 0x7a, 0x67, 0x5c, 0x3a, 0xc6, 0xcf, 0x82, 0x3f, 0x35, 0x9c, + 0xcc, 0xda, 0xcd, 0xd3, 0x97, 0x86, 0x5b, 0xe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0x04, 0x20, + 0x7b, 0xd0, 0x73, 0xab, 0xeb, 0xcf, 0x5e, 0x97, 0x85, 0xa1, 0xf2, + 0x69, 0x9e, 0x53, 0x66, 0xd8, 0x27, 0x9e, 0x15, 0x1f, 0x54, 0xc3, + 0x61, 0x1d, 0x0a, 0xfc, 0x9e, 0xb8, 0xc7, 0x15, 0x6f, 0xae, 0xf0, + 0x31, 0x93, 0x90, 0x07, 0x1b, 0xf1, 0x3d, 0x7e, 0xf7, 0x1d, 0xc5, + 0xb1, 0xcf, 0x34, 0x30, 0xbf, 0xef, 0x7f, 0x65, 0x95, 0x6a, 0x49, + 0xbe, 0xea, 0x60, 0xe0, 0xfb, 0x55, 0x74, 0xaa, 0x67, 0x65, 0xe3, + 0xbb, 0x7b, 0xd8, 0x91, 0x92, 0x56, 0x2a, 0x77, 0xe6, 0x82, 0x54, + 0x8c, 0x3d, 0x28, 0x13, 0xe8, 0x03, 0xe8, 0x9f, 0xb6, 0xa7, 0x0d, + 0xbf, 0xc1, 0x00, 0x68, 0x22, 0x9a, 0xf0, 0xcc, 0xb1, 0xaa, 0x16, + 0x84, 0x8e, 0x24, 0x6b, 0x88, 0x69, 0x6d, 0xd6, 0x52, 0x63, 0xb2, + 0x7f, 0x65, 0xa3}}; + auto const thresh2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim4CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim4Cond{Type::preimageSha256, + 9, + Preim4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa5CondConditionFingerprint = { + {0x99, 0xfb, 0x0b, 0x38, 0x94, 0x4d, 0x20, 0x85, 0xc8, 0xda, 0x3a, + 0x64, 0x31, 0x44, 0x6f, 0x6c, 0x3b, 0x46, 0x25, 0x50, 0xd7, 0x7f, + 0xdf, 0xee, 0x75, 0x72, 0x71, 0xf9, 0x61, 0x40, 0x63, 0xfa}}; + Condition const Rsa5Cond{Type::rsaSha256, + 65536, + Rsa5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed6CondConditionFingerprint = { + {0x00, 0xd3, 0xc9, 0x24, 0x3f, 0x2d, 0x2e, 0x64, 0x93, 0xa8, 0x49, + 0x29, 0x82, 0x75, 0xea, 0xbf, 0xe3, 0x53, 0x7f, 0x8e, 0x45, 0x16, + 0xdb, 0x5e, 0xc6, 0xdf, 0x39, 0xd2, 0xcb, 0xea, 0x62, 0xfb}}; + Condition const Ed6Cond{Type::ed25519Sha256, + 131072, + Ed6CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh10CondConditionFingerprint = { + {0x10, 0xb9, 0xab, 0xba, 0x33, 0x4f, 0x94, 0xea, 0xb3, 0x05, 0x2b, + 0x43, 0x30, 0x38, 0x4d, 0x9b, 0x28, 0x34, 0x90, 0x9f, 0xa4, 0x3b, + 0x33, 0x96, 0xf3, 0x3c, 0x5c, 0x0d, 0x3b, 0x10, 0xf8, 0x22}}; + Condition const Thresh10Cond{Type::thresholdSha256, + 135168, + Thresh10CondConditionFingerprint, + std::bitset<5>{25}}; + + auto rsa1 = std::make_unique( + makeSlice(rsa1PublicKey), makeSlice(rsa1Sig)); + auto rsa3 = std::make_unique( + makeSlice(rsa3PublicKey), makeSlice(rsa3Sig)); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(rsa3)); + std::vector thresh2Subconditions{ + {Preim4Cond, Rsa5Cond, Ed6Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(rsa1)); + thresh0Subfulfillments.emplace_back(std::move(thresh2)); + std::vector thresh0Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond, Thresh10Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x48\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82\x02" + "\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xbd\xd1\xc7\xf0\xb0\x3a" + "\xa5\x5b\x3e\x49\x8d\x4e\x00\x54\x89\xb9\x89\xcd\x4b\x43\xde" + "\x59\xf6\x7a\x67\x5c\x3a\xc6\xcf\x82\x3f\x35\x9c\xcc\xda\xcd" + "\xd3\x97\x86\x5b\xe9\xf6\x05\x55\x0b\x26\xef\x1e\x88\xd5\xb6" + "\xba\x14\x0a\xb2\x76\xb9\xb3\x46\x0c\xc0\x80\x17\x13\x68\x23" + "\xdc\xec\x10\x18\xfc\xaa\xbe\xb3\xc4\xc7\xa9\x84\xa6\x4e\x5c" + "\x08\x6b\x7b\x4c\x81\x91\x79\x5d\x90\x06\x15\xbb\x76\x2f\x5c" + "\x53\x60\x0f\xac\xf3\x7c\x49\xc5\x47\xec\xb3\xda\x93\x87\xc1" + "\xb9\xcf\x2c\xb5\xf0\x85\xad\xb4\x38\x67\x88\xda\x3d\xfa\x01" + "\xb7\x54\xd9\x41\x0b\x7b\x8a\x09\xe0\x84\x7d\xbb\x89\xb2\xfc" + "\x0b\x70\x36\x93\x56\x62\xcc\xb4\xfc\xf9\x1f\x37\x92\x9b\x3a" + "\x4e\x7c\xad\x4b\xa6\x76\x6f\xda\xc4\x2f\x83\x53\xbd\x93\xa9" + "\x76\x89\x53\xe1\x4d\xee\x27\x11\x6f\xbc\x21\xad\x42\x9f\x29" + "\xf6\x03\xdd\xec\xfa\xa1\x78\xd2\xde\x29\x2e\xd8\x3a\x7f\xe9" + "\x9b\x5d\xeb\x37\xb8\xb0\xa0\x66\x3f\x02\xcd\x2a\x6e\xd3\x1c" + "\xa5\x65\xdc\x73\xbe\x93\x54\x9a\x2b\xf8\x32\x8b\xe8\xce\x9a" + "\x59\xd0\x05\xeb\xbb\xac\xfc\x4c\x4b\x2e\xac\x2a\xc3\x0f\x0a" + "\xd7\x46\xaf\xfd\x22\x0d\x0d\x54\xcc\x2f\x81\x82\x01\x00\x7e" + "\x87\x15\x01\xd0\x86\x57\xda\xb0\xa9\xc6\xd8\x50\xd4\x9a\x19" + "\x1e\x1b\xb3\x68\x70\x63\x9e\xb4\xcc\x2c\x65\x1d\x66\x15\xcd" + "\xcf\xec\xeb\xef\xdb\x75\x7a\x2a\x63\x06\xe5\xb8\xf5\xaa\xa9" + "\x3b\xdf\xf2\x26\xbf\xae\xbe\xa8\x9e\xd8\xb8\xf9\x39\xfe\x84" + "\x9d\x3c\xa0\x5d\x7c\x0b\x03\xac\x2f\x45\x8b\x6f\xbb\x48\x4f" + "\xfd\x9f\x08\x3d\xb6\xb5\x6a\xd8\x87\xab\x0f\xc1\x4a\x70\x64" + "\x1d\xd1\xc3\xe4\xb8\x5f\x33\x2b\x97\xe2\x46\xc3\xf9\x74\x77" + "\x66\x74\xb9\xaa\x00\x64\xa2\x5b\x3a\x52\xc6\xe3\x5b\xc0\x6c" + "\x44\x80\x67\xcd\x6c\x2b\x13\xb5\x2a\xa6\x8f\x8e\xe4\x2c\x23" + "\xd7\xbf\x72\x95\x9f\x04\x20\x7b\xd0\x73\xab\xeb\xcf\x5e\x97" + "\x85\xa1\xf2\x69\x9e\x53\x66\xd8\x27\x9e\x15\x1f\x54\xc3\x61" + "\x1d\x0a\xfc\x9e\xb8\xc7\x15\x6f\xae\xf0\x31\x93\x90\x07\x1b" + "\xf1\x3d\x7e\xf7\x1d\xc5\xb1\xcf\x34\x30\xbf\xef\x7f\x65\x95" + "\x6a\x49\xbe\xea\x60\xe0\xfb\x55\x74\xaa\x67\x65\xe3\xbb\x7b" + "\xd8\x91\x92\x56\x2a\x77\xe6\x82\x54\x8c\x3d\x28\x13\xe8\x03" + "\xe8\x9f\xb6\xa7\x0d\xbf\xc1\x00\x68\x22\x9a\xf0\xcc\xb1\xaa" + "\x16\x84\x8e\x24\x6b\x88\x69\x6d\xd6\x52\x63\xb2\x7f\x65\xa3" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\x99\xfb\x0b\x38\x94\x4d\x20\x85\xc8\xda\x3a\x64\x31\x44\x6f" + "\x6c\x3b\x46\x25\x50\xd7\x7f\xdf\xee\x75\x72\x71\xf9\x61\x40" + "\x63\xfa\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\xd3\xc9\x24" + "\x3f\x2d\x2e\x64\x93\xa8\x49\x29\x82\x75\xea\xbf\xe3\x53\x7f" + "\x8e\x45\x16\xdb\x5e\xc6\xdf\x39\xd2\xcb\xea\x62\xfb\x81\x03" + "\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xc4\x1b\xc9\x7a" + "\x96\x81\xce\x2e\xf2\x53\xc0\xd4\xa8\xb9\xa8\x12\x92\x45\x06" + "\xf1\xf4\xcd\x27\x7d\xff\xc1\x65\x75\xae\xb7\xc4\x98\x53\xd8" + "\xfa\x6d\x86\x63\xd8\x4e\xf5\x20\xe2\x9e\x96\x04\x36\x0c\x3f" + "\xac\x7d\x09\x42\x11\x13\x30\x2d\x7f\x60\x2c\xec\x2a\x34\xc3" + "\xd8\xba\x6d\x14\x75\x28\x56\xdc\x73\x6c\xb7\xd6\xba\x8a\xa3" + "\x9e\x09\x0e\xa4\xf3\x6b\x5d\x12\xc6\xe4\xdd\x8c\xb1\x98\xcd" + "\xde\xca\xad\xff\x86\xb6\x06\x25\x9b\x71\x84\xa0\x9b\x19\x14" + "\x88\xd0\xc7\x55\x99\xe0\x1e\x0e\x39\x67\x74\xdf\xf6\x29\xfa" + "\x92\xb6\xbb\xe6\xe1\x1c\xd9\xee\x65\xda\x13\xec\x50\x6a\x11" + "\x7e\xae\xb4\xac\x85\xa5\xc7\xcb\x43\x42\x36\x73\x34\x31\xb6" + "\x0b\x5e\xf0\x9e\x80\x49\xab\xc7\x79\xc5\xa7\xe3\x16\x35\x3a" + "\x48\xe6\xc0\x69\xe2\x70\x30\x20\x74\x47\x3e\x3a\x51\x01\x21" + "\x60\x15\x53\x40\x68\x6e\xe7\x9f\x73\xb6\x98\x3b\x6e\x50\xb8" + "\xb2\xe7\x42\x90\x77\x61\xd4\x22\x6c\x0b\x3d\x66\xe0\x1b\x7d" + "\xb0\xa1\xa9\xa9\xea\x0e\xf2\xab\xe0\x32\xf4\x49\x44\xcb\xae" + "\x60\x1d\xe1\xac\xd3\x34\x2b\x03\x97\x98\x2d\xda\xf8\xe8\x0b" + "\x81\x94\x98\x3a\xbd\x6d\x17\x18\x42\x58\x0c\xa3\x81\x82\x01" + "\x00\x0a\xa6\x89\xd6\xfa\xc5\x0b\xaa\x48\x12\x72\xf8\x30\x7a" + "\x2a\x34\x3a\x99\x3f\x50\xb6\x13\x5b\xc1\xa9\x0d\x6c\x99\x18" + "\x20\x2d\xe1\xe4\x3e\x31\x01\x8c\x50\x90\x97\xf6\x91\xf8\xb3" + "\x59\x0a\x2c\x05\x1d\x1f\x73\x71\x98\xc6\x57\xb9\xc1\x07\x53" + "\xc7\xe8\xa0\xe4\x2d\x0f\x44\x30\xa1\xcd\xa6\x79\x12\x50\x31" + "\xf5\x92\x2b\xfe\xdc\xee\x7c\x2a\xbc\xdd\x35\x53\xa5\x92\x08" + "\x51\xeb\xe7\x84\x9a\xf1\x2d\x4b\xfd\x00\xa5\x61\xde\x32\x28" + "\x5e\x41\x7f\x24\x40\xaa\x1b\x19\x40\x3d\x00\xec\x40\x14\xf0" + "\x3d\x75\x4f\x21\x8c\x2b\xfc\x84\x91\x81\x8c\x8b\xfb\xdb\xd6" + "\xd9\x48\x0f\x30\x9e\xc4\x1e\xf3\xcf\x2e\x36\x7b\x8e\x10\x80" + "\xf9\xe5\x8e\xba\x96\x07\x5e\x21\xa7\x0d\x37\x7b\xea\x7d\x23" + "\xa4\x67\x95\xa4\xb9\x5c\xdd\x17\x60\x22\xf9\xb2\x80\x0f\x06" + "\xd9\xb6\x4c\x81\x8d\xb9\xc2\xbc\x32\x4a\x87\xa2\x31\x5e\x34" + "\x58\xa3\xaa\xcb\x78\x99\x06\x33\xa0\x1f\xde\xdd\x30\xb8\x0a" + "\x34\xce\xb7\x45\xff\xde\xa8\x30\x36\x16\xda\xfa\x28\x83\x21" + "\x5c\x4f\x20\x53\x89\xc4\x84\x81\xad\x7a\x46\xa6\xc0\x5a\xbb" + "\xa8\x01\x3b\x00\x56\x9e\xf5\x50\x38\x9b\x0f\x52\x2b\xa1\x4c" + "\x80\x70\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2" + "\x2b\x80\x20\x10\xb9\xab\xba\x33\x4f\x94\xea\xb3\x05\x2b\x43" + "\x30\x38\x4d\x9b\x28\x34\x90\x9f\xa4\x3b\x33\x96\xf3\x3c\x5c" + "\x0d\x3b\x10\xf8\x22\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7" + "\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c" + "\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92" + "\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0" + "\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6" + "\xc9\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x2e\xfe\x11\x1f\x52\x42\x7b\x9e\x8b\x2b\xbf" + "\x2a\x2c\x8c\x22\xfc\xdb\xe8\xed\xd0\x3e\x12\xfa\x3f\x50\x3f" + "\xcb\xdc\x3e\xbb\x49\x53\x81\x03\x04\x38\x00\x82\x02\x03\x98"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x02\x80\x01\x02\xa1\x81\xfc\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa2\x2b\x80\x20\x10\xb9\xab\xba\x33\x4f\x94" + "\xea\xb3\x05\x2b\x43\x30\x38\x4d\x9b\x28\x34\x90\x9f\xa4\x3b" + "\x33\x96\xf3\x3c\x5c\x0d\x3b\x10\xf8\x22\x81\x03\x02\x10\x00" + "\x82\x02\x03\x98\xa2\x2b\x80\x20\xd4\x46\x35\xa3\xe4\x89\x30" + "\xbe\xab\xa5\xb3\xb6\x82\xb6\xa2\xb4\xc8\x19\x3f\xf9\xf4\xb4" + "\xf8\x6f\x3c\xd9\x80\x19\xd7\x1a\x0f\xad\x81\x03\x02\x10\x00" + "\x82\x02\x03\x98\xa3\x27\x80\x20\x23\xc9\xfd\x99\xdc\xf3\x74" + "\x06\xe3\x11\x57\x5e\x7a\x90\x4b\x0d\x0c\x36\xa7\x8d\x25\xbc" + "\xd5\x5f\x0d\x1f\x25\x08\x2e\x4f\xca\x1a\x81\x03\x01\x00\x00" + "\xa3\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d" + "\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7" + "\x1c\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82" + "\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b" + "\xf6\xc9\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh28() + { + testcase("Thresh28"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim9Cond + // ** Rsa10Cond + // ** Ed11Cond + // ** prefix1 + // *** prefix2 + // **** rsa3 + // ** prefix4 + // *** prefix5 + // **** rsa6 + // ** thresh7 + // *** rsa8 + + auto const rsa3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa3PublicKey{ + {0xbd, 0xd1, 0xc7, 0xf0, 0xb0, 0x3a, 0xa5, 0x5b, 0x3e, 0x49, 0x8d, + 0x4e, 0x00, 0x54, 0x89, 0xb9, 0x89, 0xcd, 0x4b, 0x43, 0xde, 0x59, + 0xf6, 0x7a, 0x67, 0x5c, 0x3a, 0xc6, 0xcf, 0x82, 0x3f, 0x35, 0x9c, + 0xcc, 0xda, 0xcd, 0xd3, 0x97, 0x86, 0x5b, 0xe9, 0xf6, 0x05, 0x55, + 0x0b, 0x26, 0xef, 0x1e, 0x88, 0xd5, 0xb6, 0xba, 0x14, 0x0a, 0xb2, + 0x76, 0xb9, 0xb3, 0x46, 0x0c, 0xc0, 0x80, 0x17, 0x13, 0x68, 0x23, + 0xdc, 0xec, 0x10, 0x18, 0xfc, 0xaa, 0xbe, 0xb3, 0xc4, 0xc7, 0xa9, + 0x84, 0xa6, 0x4e, 0x5c, 0x08, 0x6b, 0x7b, 0x4c, 0x81, 0x91, 0x79, + 0x5d, 0x90, 0x06, 0x15, 0xbb, 0x76, 0x2f, 0x5c, 0x53, 0x60, 0x0f, + 0xac, 0xf3, 0x7c, 0x49, 0xc5, 0x47, 0xec, 0xb3, 0xda, 0x93, 0x87, + 0xc1, 0xb9, 0xcf, 0x2c, 0xb5, 0xf0, 0x85, 0xad, 0xb4, 0x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0xc6, + 0xbf, 0x92, 0x9e, 0x4b, 0xb0, 0xb5, 0xaa, 0x71, 0x60, 0xd9, 0x31, + 0xd8, 0x5c, 0xc2, 0x9a, 0x69, 0x1d, 0x69, 0x3b, 0xb0, 0xff, 0x82, + 0x11, 0x31, 0xee, 0xae, 0x8f, 0xf9, 0x1b, 0xa0, 0x4e, 0x9e, 0xe6, + 0x1f, 0x92, 0x0b}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const rsa6Msg = "P5P4abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 0x40, 0xe4, 0x52, 0x30, + 0x42, 0x74, 0xfd, 0x35, 0x04, 0xde, 0x45, 0x68, 0xb3, 0x22, 0xdd, + 0xff, 0x41, 0x43, 0x69, 0x33, 0xc0, 0xff, 0x35, 0xb6, 0x6d, 0x15, + 0xe9, 0x54, 0x15, 0xeb, 0x1d, 0x07, 0xe2, 0x25, 0x2b, 0xdb, 0xaa, + 0x16, 0x8d, 0x0d, 0x7f, 0x05, 0xf0, 0xd2, 0x7d, 0xb4, 0x9b, 0x51, + 0x19, 0x20, 0x1e, 0x3d, 0xba, 0x50, 0x9e, 0x51, 0x13, 0x81, 0x43, + 0x55, 0x96, 0xca, 0xdb, 0x88, 0x1f, 0xef, 0x2d, 0x38, 0x3f, 0xae, + 0x8d, 0xac, 0xc8, 0x6f, 0x2b, 0xd5, 0xf0, 0x34, 0x1a, 0x99, 0x00, + 0x7c, 0x6d, 0xb3, 0x1b, 0x1d, 0x68, 0xdb, 0xf8, 0x1c, 0x59, 0x3a, + 0x63, 0x38, 0x7c, 0x1c, 0x14, 0xbc, 0x22, 0xcf, 0xc8, 0x9a, 0xc6, + 0x96, 0x6f, 0x3d, 0x03, 0x0b, 0x61, 0x6b, 0x7d, 0x75, 0x97, 0xe8, + 0x25, 0xb8, 0x2f, 0xfa, 0xf4, 0x07, 0x44, 0xdf, 0x00, 0x3d, 0xff, + 0x0d, 0xd5, 0x7f, 0x7f, 0xf3, 0x0c, 0x13, 0xac, 0x8d, 0xf8, 0x8c, + 0x79, 0xc5, 0xf3, 0x29, 0xdc, 0x23, 0x65, 0xd3, 0xd1, 0x1c, 0xa6, + 0x14, 0x78, 0x6a, 0x1a, 0xe3, 0x15, 0x8d, 0x8b, 0xdc, 0xa0, 0x5a, + 0xc7, 0x82, 0xb0, 0x03, 0x6c, 0x71, 0x43, 0x59, 0x24, 0xc7, 0x50, + 0x64, 0xb2, 0xa7, 0x69, 0xf5, 0xbd, 0xe6, 0x5e, 0xaa, 0x77, 0x59, + 0x60, 0x36, 0xc0, 0xe3, 0x42, 0x7f, 0x05, 0x3b, 0x4c, 0x02, 0x0e, + 0x70, 0x5a, 0x70, 0xc5, 0x2a, 0xeb, 0x94, 0x4d, 0x15, 0x09, 0xef, + 0xbb, 0x58, 0x42, 0x68, 0x05, 0x59, 0x70, 0xa0, 0x17, 0xb2, 0x8e, + 0xdf, 0x7b, 0x40, 0x5d, 0x21, 0x1e, 0xfe, 0x62, 0x58, 0xde, 0xfb, + 0x14, 0x91, 0x18, 0xf3, 0x4f, 0x9b, 0x36, 0x55, 0xcf, 0xb3, 0x5e, + 0xec, 0x4f, 0xcc, 0x6d, 0x13, 0x58, 0xc8, 0xa3, 0xa3, 0xee, 0x23, + 0x8a, 0xc2, 0xbf}}; + std::array const rsa6Sig{ + {0x33, 0xdc, 0xe4, 0xe6, 0x38, 0xb6, 0xe4, 0x31, 0x9e, 0x20, 0x73, + 0x45, 0x18, 0x20, 0xd6, 0xd8, 0x9d, 0x6a, 0xa3, 0xd6, 0x7c, 0x74, + 0x32, 0xec, 0xce, 0xed, 0x42, 0xfa, 0x5d, 0x3c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cc, 0x01, 0xad, 0x38, 0x1b, 0xcb, 0x85, 0x9f, 0xe2, 0xd2, + 0xc8, 0xee, 0xa8, 0xf5, 0x4c, 0xc8, 0xa2, 0xb2, 0x4f, 0xe0, 0xdf, + 0x73, 0x8a, 0x95, 0x70, 0xc2, 0xdf, 0x4d, 0x10, 0xcd, 0x71, 0xe1, + 0x5d, 0xc9, 0xf8, 0x8b, 0x1c, 0xa1, 0xc5, 0xdc, 0xa0, 0xa2, 0x33, + 0xd5, 0x8d, 0xde}}; + auto const prefix5Prefix = "P5"s; + auto const prefix5Msg = "P4abcdefghijklmnopqrstuvwxyz"s; + auto const prefix5MaxMsgLength = 28; + auto const prefix4Prefix = "P4"s; + auto const prefix4Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix4MaxMsgLength = 26; + auto const rsa8Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa8PublicKey{ + {0xb7, 0xf9, 0xf2, 0x4e, 0xc8, 0xd9, 0x79, 0xcb, 0x92, 0xdb, 0x0d, + 0x2d, 0x81, 0x30, 0x23, 0x20, 0xc1, 0x2f, 0x97, 0xd1, 0x90, 0x5e, + 0x52, 0x73, 0x04, 0x8d, 0x23, 0x6b, 0x9c, 0xe9, 0x7f, 0xb0, 0xda, + 0x3a, 0x75, 0x84, 0x60, 0xd2, 0xac, 0x55, 0xc5, 0x2a, 0x8e, 0x25, + 0x17, 0x64, 0x3e, 0x0d, 0x0f, 0x1f, 0x9c, 0x1d, 0x04, 0xfe, 0x36, + 0x26, 0xb7, 0x4b, 0xeb, 0xed, 0xa4, 0x73, 0x25, 0x86, 0x45, 0xa1, + 0x34, 0x33, 0xf3, 0xdd, 0x06, 0xd1, 0x8a, 0xc8, 0x9d, 0x00, 0x69, + 0xf2, 0x72, 0x7f, 0x00, 0x28, 0x08, 0x7b, 0x8b, 0x31, 0x1c, 0xf3, + 0xd3, 0x3f, 0x46, 0xc6, 0xc6, 0xa7, 0x29, 0x89, 0xbc, 0x85, 0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 0x79, 0x84, 0xf2, 0xfc, 0x14, 0x03, 0x72, 0x8c, 0x5e, 0x87, + 0x62, 0xd6, 0x21, 0x05, 0x59, 0xaa, 0x54, 0x14, 0x69, 0x21, 0xec, + 0xb1, 0xba, 0x41, 0xb5, 0x6c, 0x0a, 0x21, 0x31, 0x71, 0x82, 0x4c, + 0xd2, 0xdb, 0x37, 0x48, 0xe4, 0x41, 0xcc, 0xf8, 0xeb, 0xbc, 0x80, + 0xba, 0x33, 0xa6, 0x5b, 0x34, 0x96, 0xd2, 0x88, 0xb1, 0x70, 0x0c, + 0x45, 0x44, 0x27}}; + auto const thresh7Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa3 = std::make_unique( + makeSlice(rsa3PublicKey), makeSlice(rsa3Sig)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(rsa3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + auto prefix5 = std::make_unique( + makeSlice(prefix5Prefix), prefix5MaxMsgLength, std::move(rsa6)); + auto prefix4 = std::make_unique( + makeSlice(prefix4Prefix), prefix4MaxMsgLength, std::move(prefix5)); + auto rsa8 = std::make_unique( + makeSlice(rsa8PublicKey), makeSlice(rsa8Sig)); + std::vector> thresh7Subfulfillments; + thresh7Subfulfillments.emplace_back(std::move(rsa8)); + std::vector thresh7Subconditions{}; + auto thresh7 = std::make_unique( + std::move(thresh7Subfulfillments), std::move(thresh7Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix4)); + thresh0Subfulfillments.emplace_back(std::move(thresh7)); + std::vector thresh0Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x06\xe9\xa0\x82\x06\x6a\xa1\x82\x02\x26\x80\x02\x50" + "\x31\x81\x01\x1a\xa2\x82\x02\x1b\xa1\x82\x02\x17\x80\x02\x50" + "\x32\x81\x01\x1c\xa2\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01" + "\x00\xbd\xd1\xc7\xf0\xb0\x3a\xa5\x5b\x3e\x49\x8d\x4e\x00\x54" + "\x89\xb9\x89\xcd\x4b\x43\xde\x59\xf6\x7a\x67\x5c\x3a\xc6\xcf" + "\x82\x3f\x35\x9c\xcc\xda\xcd\xd3\x97\x86\x5b\xe9\xf6\x05\x55" + "\x0b\x26\xef\x1e\x88\xd5\xb6\xba\x14\x0a\xb2\x76\xb9\xb3\x46" + "\x0c\xc0\x80\x17\x13\x68\x23\xdc\xec\x10\x18\xfc\xaa\xbe\xb3" + "\xc4\xc7\xa9\x84\xa6\x4e\x5c\x08\x6b\x7b\x4c\x81\x91\x79\x5d" + "\x90\x06\x15\xbb\x76\x2f\x5c\x53\x60\x0f\xac\xf3\x7c\x49\xc5" + "\x47\xec\xb3\xda\x93\x87\xc1\xb9\xcf\x2c\xb5\xf0\x85\xad\xb4" + "\x38\x67\x88\xda\x3d\xfa\x01\xb7\x54\xd9\x41\x0b\x7b\x8a\x09" + "\xe0\x84\x7d\xbb\x89\xb2\xfc\x0b\x70\x36\x93\x56\x62\xcc\xb4" + "\xfc\xf9\x1f\x37\x92\x9b\x3a\x4e\x7c\xad\x4b\xa6\x76\x6f\xda" + "\xc4\x2f\x83\x53\xbd\x93\xa9\x76\x89\x53\xe1\x4d\xee\x27\x11" + "\x6f\xbc\x21\xad\x42\x9f\x29\xf6\x03\xdd\xec\xfa\xa1\x78\xd2" + "\xde\x29\x2e\xd8\x3a\x7f\xe9\x9b\x5d\xeb\x37\xb8\xb0\xa0\x66" + "\x3f\x02\xcd\x2a\x6e\xd3\x1c\xa5\x65\xdc\x73\xbe\x93\x54\x9a" + "\x2b\xf8\x32\x8b\xe8\xce\x9a\x59\xd0\x05\xeb\xbb\xac\xfc\x4c" + "\x4b\x2e\xac\x2a\xc3\x0f\x0a\xd7\x46\xaf\xfd\x22\x0d\x0d\x54" + "\xcc\x2f\x81\x82\x01\x00\xa3\xa1\xd4\x1a\x6c\x8a\xf9\x7b\xb1" + "\x8d\xb6\xc1\x9b\x68\x68\xad\x98\xeb\x72\xa3\xcb\xa3\x8a\x10" + "\x32\x2d\xbd\xeb\x95\xf8\x0b\x02\x0e\x75\xa9\x9e\xdc\xff\x59" + "\xa3\xd9\xec\x4f\x3f\x08\x4b\x7c\xa3\xfa\x17\x46\xef\x69\x8a" + "\xce\xe9\x1a\x77\x4a\xd2\x9b\xea\x58\xb1\x4a\x95\x18\x98\x40" + "\xec\x67\xc9\x58\xa0\x84\x5c\x78\x1b\x6b\xad\xb1\xf6\x2b\xd1" + "\x3b\xa2\x25\xc2\x5f\xc8\xb2\x08\xbd\x8e\xab\x1f\x1f\x07\xe1" + "\x98\xc0\x17\x96\xdc\x7f\x37\xb8\x09\x56\xe8\xdd\x51\xdf\x91" + "\x29\x1a\xd3\x7e\xe4\x37\x59\xf4\xfc\x61\xbe\xc4\xcc\x9f\x9a" + "\x8d\xc2\x01\xc7\xa5\xf5\x62\x89\x6a\x12\x98\xad\x4f\x1e\xa0" + "\x63\x25\xb5\x7b\xe3\x2a\x8a\x8a\x3c\x11\xe1\x99\x05\xf4\x13" + "\xe5\x4a\x8d\x2d\x71\x44\xe1\x7f\x74\x8f\xc0\x5e\xd0\xae\xac" + "\x0d\xbe\xf3\x66\xd0\x82\xa0\x5c\xf9\xe2\x35\xfd\x8b\xb3\x78" + "\x2b\xbc\x0d\x4f\x50\xc8\x1b\x64\xe6\x21\x90\x88\xcc\xb0\xc2" + "\xb8\x77\xb1\xf9\x03\x43\x84\x25\xf9\x86\x1f\x01\xdb\x4a\xbb" + "\xc6\xbf\x92\x9e\x4b\xb0\xb5\xaa\x71\x60\xd9\x31\xd8\x5c\xc2" + "\x9a\x69\x1d\x69\x3b\xb0\xff\x82\x11\x31\xee\xae\x8f\xf9\x1b" + "\xa0\x4e\x9e\xe6\x1f\x92\x0b\xa1\x82\x02\x26\x80\x02\x50\x34" + "\x81\x01\x1a\xa2\x82\x02\x1b\xa1\x82\x02\x17\x80\x02\x50\x35" + "\x81\x01\x1c\xa2\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00" + "\xd0\x07\xfc\x9d\xb0\xa1\xa6\x40\xe4\x52\x30\x42\x74\xfd\x35" + "\x04\xde\x45\x68\xb3\x22\xdd\xff\x41\x43\x69\x33\xc0\xff\x35" + "\xb6\x6d\x15\xe9\x54\x15\xeb\x1d\x07\xe2\x25\x2b\xdb\xaa\x16" + "\x8d\x0d\x7f\x05\xf0\xd2\x7d\xb4\x9b\x51\x19\x20\x1e\x3d\xba" + "\x50\x9e\x51\x13\x81\x43\x55\x96\xca\xdb\x88\x1f\xef\x2d\x38" + "\x3f\xae\x8d\xac\xc8\x6f\x2b\xd5\xf0\x34\x1a\x99\x00\x7c\x6d" + "\xb3\x1b\x1d\x68\xdb\xf8\x1c\x59\x3a\x63\x38\x7c\x1c\x14\xbc" + "\x22\xcf\xc8\x9a\xc6\x96\x6f\x3d\x03\x0b\x61\x6b\x7d\x75\x97" + "\xe8\x25\xb8\x2f\xfa\xf4\x07\x44\xdf\x00\x3d\xff\x0d\xd5\x7f" + "\x7f\xf3\x0c\x13\xac\x8d\xf8\x8c\x79\xc5\xf3\x29\xdc\x23\x65" + "\xd3\xd1\x1c\xa6\x14\x78\x6a\x1a\xe3\x15\x8d\x8b\xdc\xa0\x5a" + "\xc7\x82\xb0\x03\x6c\x71\x43\x59\x24\xc7\x50\x64\xb2\xa7\x69" + "\xf5\xbd\xe6\x5e\xaa\x77\x59\x60\x36\xc0\xe3\x42\x7f\x05\x3b" + "\x4c\x02\x0e\x70\x5a\x70\xc5\x2a\xeb\x94\x4d\x15\x09\xef\xbb" + "\x58\x42\x68\x05\x59\x70\xa0\x17\xb2\x8e\xdf\x7b\x40\x5d\x21" + "\x1e\xfe\x62\x58\xde\xfb\x14\x91\x18\xf3\x4f\x9b\x36\x55\xcf" + "\xb3\x5e\xec\x4f\xcc\x6d\x13\x58\xc8\xa3\xa3\xee\x23\x8a\xc2" + "\xbf\x81\x82\x01\x00\x33\xdc\xe4\xe6\x38\xb6\xe4\x31\x9e\x20" + "\x73\x45\x18\x20\xd6\xd8\x9d\x6a\xa3\xd6\x7c\x74\x32\xec\xce" + "\xed\x42\xfa\x5d\x3c\x16\xd2\x3d\x5a\xfe\x76\x8f\x11\x52\x9f" + "\x09\x56\x5c\x8f\xe6\xd5\xc8\x06\x0c\x5f\x58\xca\x56\x50\x24" + "\x24\x10\x0b\x92\xd6\x40\xda\x0d\x52\x45\x31\xeb\xc6\x34\x69" + "\x49\x04\x71\x4b\x1a\x5d\xaa\x6e\x52\x79\x7d\x01\x55\xa3\x8c" + "\x13\x01\xf9\x3c\x0c\xb7\xcd\x8f\x36\x49\xa1\xcc\xaf\xa4\x5d" + "\x4c\x56\x85\x17\x09\xf4\x64\x5a\xe8\x57\x63\xe1\xfc\xc5\x9d" + "\x5c\x0e\xde\xd7\x31\x00\x0f\x3e\x3b\xf1\x31\xf5\x3d\xd3\x52" + "\x09\x64\x25\x7b\x46\x38\x34\x8a\xb7\xab\x27\x84\xde\xdb\xfe" + "\xcd\x8f\x74\x68\xcd\xfa\x0f\x5b\xa1\xc8\x82\x9a\xa0\x5d\xe1" + "\xaa\x70\x92\xd6\x2d\x4e\x23\x54\xe0\xe2\xe8\xec\x81\xe8\x01" + "\xfb\x99\x1e\xfb\x5b\x66\x7f\x38\x3a\x3a\x56\xad\x6b\xf5\x2e" + "\x7e\xf2\xa1\xb6\x9b\x08\x9a\x8a\xa1\x44\x10\x18\x9f\x47\x5e" + "\x1b\x59\x74\x4b\xd0\xcc\x01\xad\x38\x1b\xcb\x85\x9f\xe2\xd2" + "\xc8\xee\xa8\xf5\x4c\xc8\xa2\xb2\x4f\xe0\xdf\x73\x8a\x95\x70" + "\xc2\xdf\x4d\x10\xcd\x71\xe1\x5d\xc9\xf8\x8b\x1c\xa1\xc5\xdc" + "\xa0\xa2\x33\xd5\x8d\xde\xa2\x82\x02\x12\xa0\x82\x02\x0c\xa3" + "\x82\x02\x08\x80\x82\x01\x00\xb7\xf9\xf2\x4e\xc8\xd9\x79\xcb" + "\x92\xdb\x0d\x2d\x81\x30\x23\x20\xc1\x2f\x97\xd1\x90\x5e\x52" + "\x73\x04\x8d\x23\x6b\x9c\xe9\x7f\xb0\xda\x3a\x75\x84\x60\xd2" + "\xac\x55\xc5\x2a\x8e\x25\x17\x64\x3e\x0d\x0f\x1f\x9c\x1d\x04" + "\xfe\x36\x26\xb7\x4b\xeb\xed\xa4\x73\x25\x86\x45\xa1\x34\x33" + "\xf3\xdd\x06\xd1\x8a\xc8\x9d\x00\x69\xf2\x72\x7f\x00\x28\x08" + "\x7b\x8b\x31\x1c\xf3\xd3\x3f\x46\xc6\xc6\xa7\x29\x89\xbc\x85" + "\x1e\xb8\x01\x8e\xe1\xf2\x6e\xe3\x08\xa8\x4d\x7d\x6c\x0f\x67" + "\x1b\x1d\xbf\x88\xbe\x0b\x0e\x6f\x20\xa8\xff\x2c\xea\x04\xb3" + "\x95\xe4\x2d\xb3\x72\xcf\xd7\x09\xca\xc9\x71\x41\x6c\x12\x91" + "\x16\x2a\x25\xb4\x2c\x5d\x6b\xdf\x39\x02\xd7\xf7\xd8\xbd\x2a" + "\xac\x8a\xcb\x40\x75\x16\x1e\xbf\xd3\x87\x47\x21\x0d\xcb\x8a" + "\xe3\x45\x8f\x1d\xad\x13\xfc\xe5\x14\xf2\xea\x3d\x14\x30\x5a" + "\x47\xce\xb1\xe1\x53\xae\x1f\x0b\x9a\x2f\xe1\x15\x58\x71\x1d" + "\xbd\x89\xdd\xb1\x01\x08\xe3\x5b\x9c\x5a\x50\x96\x50\x70\x6f" + "\x5a\x54\xce\x0c\x7a\xb6\x1a\xbc\xd1\xe3\x23\xe3\xe8\xb6\x9d" + "\xbe\xa9\x2f\x82\x23\xcc\x46\x2e\xe9\xe4\xa2\xdd\x4b\xff\x55" + "\x56\x78\x53\xdc\xf1\x5a\xfe\x53\x81\x82\x01\x00\x1c\x2d\x3a" + "\x14\x05\xa3\xeb\xc7\x6a\x70\x8d\x60\x17\xf8\x95\x0d\x38\x88" + "\x6a\x34\x31\xcb\xb0\x1b\x8c\xaf\x83\xd1\x15\x8f\xf8\x4c\xf8" + "\x5d\x20\x73\x7b\x6c\x4d\xe6\xf1\xe5\x64\x0c\x7a\x1a\x4b\xf9" + "\x6c\x78\x3e\xd6\xc2\x94\xbc\x40\x09\xd4\x96\x87\x46\xdc\x33" + "\xc4\x01\x6d\x17\x5a\xbb\x94\x61\x19\xd9\x6d\x04\xbd\xe1\xa9" + "\xc6\x4b\x4d\x15\x47\x46\x82\x3f\xa1\xf2\xe3\x20\x9d\x7a\xf4" + "\x46\x64\x05\xfc\x48\xf9\xed\xa8\x69\xdf\x5a\xef\x00\xe3\xa1" + "\x40\x0f\x9a\xe1\xab\x93\x4d\x01\x81\x77\x8e\xaf\xdd\x1b\xb4" + "\x1d\x5e\x8b\xe5\x81\x0c\x8c\x4f\x68\x58\x17\xfc\xce\xd3\xaf" + "\x22\x3d\x43\x80\xcc\xfe\x52\xc7\x20\x95\xaa\x77\x1a\x7b\x34" + "\xee\xd4\x72\xbb\xfb\x60\xaf\x2c\x18\xa7\x30\xbd\x64\xa2\xac" + "\x00\xff\x7a\xc8\xe2\xb4\xe1\x33\x40\x5e\x4f\xc2\x40\x89\x4b" + "\x3a\x7c\x1f\x26\xb7\x2b\xbe\x02\x61\xca\xb3\xde\xb4\x56\xea" + "\x96\x79\x84\xf2\xfc\x14\x03\x72\x8c\x5e\x87\x62\xd6\x21\x05" + "\x59\xaa\x54\x14\x69\x21\xec\xb1\xba\x41\xb5\x6c\x0a\x21\x31" + "\x71\x82\x4c\xd2\xdb\x37\x48\xe4\x41\xcc\xf8\xeb\xbc\x80\xba" + "\x33\xa6\x5b\x34\x96\xd2\x88\xb1\x70\x0c\x45\x44\x27\xa1\x00" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\x3c\x73\x38\xcf\x23\xc6\x31\x53\x28\xc4\x27\xf8\x95\x87\x99" + "\x83\x2d\x35\x3c\x03\x9b\xd1\xff\xff\x2e\x53\x20\xe9\x5e\x62" + "\xb9\xb7\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x41\x80\x08\xb2" + "\x60\x74\x57\x6d\xac\xed\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a" + "\x95\xa1\x49\x17\xc7\x65\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03" + "\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xef\xd5\x48\xb4\x17\xdd\xc8\x68\x63\x6e\x27" + "\x0b\x71\xd6\x36\x10\xfa\xc2\x5f\x16\x3d\xdf\xf0\x40\xdb\x3f" + "\xa4\xf4\x9e\x8b\x72\xf2\x81\x03\x04\x28\x74\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\xb8\x5b\x65\xa0\x60\x00" + "\x83\xb6\xaa\xdc\xc6\x47\xf5\x6e\x6f\x2d\xb0\xc8\xfd\xf4\x94" + "\x8b\x4e\x69\x34\xaa\xa1\xbf\xf0\x25\x34\x98\x81\x03\x01\x08" + "\x3a\x82\x02\x04\x10\xa1\x2b\x80\x20\xe4\x1a\x1f\x58\x06\x0b" + "\x5e\x27\x90\x67\x1e\x7e\x64\x57\x2f\x99\x6d\x22\xd7\xf1\xc4" + "\x73\x41\xb6\x54\xdc\x00\x55\xdb\x1a\x44\xb0\x81\x03\x01\x08" + "\x3a\x82\x02\x04\x10\xa2\x2b\x80\x20\x6e\xc1\x00\xdd\x7d\x47" + "\x0e\x6a\xe6\xb9\xc7\x74\x9b\x0e\x48\xc2\x70\x94\x85\x36\x85" + "\xdb\x44\xa5\x95\x7f\x68\x89\x25\x62\x8a\x17\x81\x03\x01\x04" + "\x00\x82\x02\x04\x10\xa3\x27\x80\x20\x3c\x73\x38\xcf\x23\xc6" + "\x31\x53\x28\xc4\x27\xf8\x95\x87\x99\x83\x2d\x35\x3c\x03\x9b" + "\xd1\xff\xff\x2e\x53\x20\xe9\x5e\x62\xb9\xb7\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x41\x80\x08\xb2\x60\x74\x57\x6d\xac\xed" + "\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95\xa1\x49\x17\xc7\x65" + "\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh29() + { + testcase("Thresh29"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim7Cond + // ** Rsa8Cond + // ** Ed9Cond + // ** Prefix10Cond + // ** Thresh13Cond + // ** prefix1 + // *** prefix2 + // **** rsa3 + // ** preim4 + // ** rsa5 + // ** ed6 + + auto const rsa3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa3PublicKey{ + {0xbd, 0xd1, 0xc7, 0xf0, 0xb0, 0x3a, 0xa5, 0x5b, 0x3e, 0x49, 0x8d, + 0x4e, 0x00, 0x54, 0x89, 0xb9, 0x89, 0xcd, 0x4b, 0x43, 0xde, 0x59, + 0xf6, 0x7a, 0x67, 0x5c, 0x3a, 0xc6, 0xcf, 0x82, 0x3f, 0x35, 0x9c, + 0xcc, 0xda, 0xcd, 0xd3, 0x97, 0x86, 0x5b, 0xe9, 0xf6, 0x05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, 0xa3, 0x2f, 0x6f, 0xb3, 0xd6, 0x98, 0xde, 0xab, 0xef, + 0xbf, 0x05, 0x9f, 0x7f, 0x97, 0x09, 0x4b, 0xca, 0x91, 0xd2, 0xd7, + 0xf3, 0xe8, 0x78, 0x6b, 0x16, 0xc3, 0x48, 0x00, 0xff, 0x60, 0xa7, + 0xc3, 0xd7, 0xf0, 0x01, 0x34, 0xec, 0xe5, 0xb6, 0x35, 0x8d, 0xef, + 0x65, 0xf2, 0xa2, 0xd9, 0xbf, 0xef, 0xe5, 0x78, 0x24, 0x9b, 0xf4, + 0xab, 0xd2, 0xec, 0xd1, 0xc5, 0x75, 0x40, 0x39, 0x06, 0x84, 0xdb, + 0x97, 0xb5, 0x8a, 0x0b, 0x52, 0xe2, 0x84, 0xba, 0xd3, 0x6a, 0x53, + 0x9d, 0xa0, 0xbb, 0x65, 0x36, 0x58, 0x56, 0x0e, 0x3b, 0xb4, 0xb0, + 0x45, 0x94, 0x7b, 0xbc, 0x03, 0xca, 0x4f, 0x48, 0xae, 0xe1, 0x97, + 0x70, 0xc3, 0x34, 0xbc, 0x39, 0x94, 0xa4, 0x7a, 0xf2, 0x39, 0xaa, + 0x8d, 0x11, 0xdc}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa5Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa5PublicKey{ + {0xc0, 0x00, 0xef, 0x8f, 0x4b, 0x81, 0x10, 0x1e, 0x52, 0xe0, 0x07, + 0x9f, 0x68, 0xe7, 0x2f, 0x92, 0xd4, 0x77, 0x3c, 0x1f, 0xa3, 0xff, + 0x72, 0x64, 0x5b, 0x37, 0xf1, 0xf3, 0xa3, 0xc5, 0xfb, 0xcd, 0xfb, + 0xda, 0xcc, 0x8b, 0x52, 0xe1, 0xde, 0xbc, 0x28, 0x8d, 0xe5, 0xad, + 0xab, 0x86, 0x61, 0x45, 0x97, 0x65, 0x37, 0x68, 0x26, 0x21, 0x92, + 0x17, 0xa3, 0xb0, 0x74, 0x5c, 0x8a, 0x45, 0x8d, 0x87, 0x5b, 0x9b, + 0xd1, 0x7b, 0x07, 0xc4, 0x8c, 0x67, 0xa0, 0xe9, 0x82, 0x0c, 0xe0, + 0x6b, 0xea, 0x91, 0x5c, 0xba, 0xe3, 0xd9, 0x9d, 0x39, 0xfd, 0x77, + 0xac, 0xcb, 0x33, 0x9b, 0x28, 0x51, 0x8d, 0xbf, 0x3e, 0xe4, 0x94, + 0x1c, 0x9a, 0x60, 0x71, 0x4b, 0x34, 0x07, 0x30, 0xda, 0x42, 0x46, + 0x0e, 0xb8, 0xb7, 0x2c, 0xf5, 0x2f, 0x4b, 0x9e, 0xe7, 0x64, 0x81, + 0xa1, 0xa2, 0x05, 0x66, 0x92, 0xe6, 0x75, 0x9f, 0x37, 0xae, 0x40, + 0xa9, 0x16, 0x08, 0x19, 0xe8, 0xdc, 0x47, 0xd6, 0x03, 0x29, 0xab, + 0xcc, 0x58, 0xa2, 0x37, 0x2a, 0x32, 0xb8, 0x15, 0xc7, 0x51, 0x91, + 0x73, 0xb9, 0x1d, 0xc6, 0xd0, 0x4f, 0x85, 0x86, 0xd5, 0xb3, 0x21, + 0x1a, 0x2a, 0x6c, 0xeb, 0x7f, 0xfe, 0x84, 0x17, 0x10, 0x2d, 0x0e, + 0xb4, 0xe1, 0xc2, 0x48, 0x4c, 0x3f, 0x61, 0xc7, 0x59, 0x75, 0xa7, + 0xc1, 0x75, 0xce, 0x67, 0x17, 0x42, 0x2a, 0x2f, 0x96, 0xef, 0x8a, + 0x2d, 0x74, 0xd2, 0x13, 0x68, 0xe1, 0xe9, 0xea, 0xfb, 0x73, 0x68, + 0xed, 0x8d, 0xd3, 0xac, 0x49, 0x09, 0xf9, 0xec, 0x62, 0xdf, 0x53, + 0xab, 0xfe, 0x90, 0x64, 0x4b, 0x92, 0x60, 0x0d, 0xdd, 0x00, 0xfe, + 0x02, 0xe6, 0xf3, 0x9b, 0x2b, 0xac, 0x4f, 0x70, 0xe8, 0x5b, 0x69, + 0x9c, 0x40, 0xd3, 0xeb, 0x37, 0xad, 0x6f, 0x37, 0xab, 0xf3, 0x79, + 0x8e, 0xcb, 0x1d}}; + std::array const rsa5Sig{ + {0x38, 0x4d, 0xe9, 0xae, 0x95, 0xe2, 0x4c, 0x3d, 0xc1, 0xdb, 0x7c, + 0xa8, 0x53, 0xd7, 0x43, 0x6a, 0x8f, 0x2b, 0x82, 0xf3, 0x8c, 0xa5, + 0x84, 0x84, 0x34, 0xb6, 0x84, 0xc0, 0xd2, 0xc4, 0x4a, 0xf7, 0xb7, + 0xa0, 0x68, 0xc4, 0x6d, 0x78, 0x1f, 0xc4, 0x44, 0xe3, 0x54, 0xc5, + 0xf7, 0x71, 0xd2, 0x3a, 0x85, 0xee, 0xf9, 0x07, 0xf0, 0xec, 0x2a, + 0x84, 0x47, 0xa4, 0xeb, 0xc5, 0x47, 0xbe, 0xf7, 0xa6, 0xc1, 0xe4, + 0x47, 0xa8, 0x39, 0x2e, 0xd1, 0xf7, 0x5e, 0x48, 0xe4, 0x77, 0x37, + 0xdb, 0x82, 0xc3, 0xf7, 0x8c, 0x00, 0xdd, 0xfd, 0x57, 0xc9, 0x07, + 0xb7, 0x82, 0xbe, 0xde, 0xd4, 0xe1, 0x11, 0xe3, 0xc7, 0xf8, 0xf7, + 0x82, 0xbe, 0xa2, 0x32, 0x92, 0x65, 0xcc, 0x7c, 0xb8, 0x6c, 0xb8, + 0x0b, 0x04, 0x52, 0x91, 0xd4, 0x9e, 0xf8, 0x9c, 0x33, 0xd5, 0xc5, + 0xe4, 0x63, 0xe0, 0xf4, 0x64, 0x05, 0x24, 0x89, 0x33, 0xac, 0x8b, + 0x55, 0xc2, 0x4b, 0x7f, 0x40, 0x6e, 0xc8, 0x38, 0x79, 0x68, 0x49, + 0xf4, 0xb2, 0x2f, 0x6a, 0x94, 0x96, 0xe7, 0xe9, 0xf1, 0xf1, 0x14, + 0x79, 0x7e, 0x36, 0x90, 0x0f, 0xc7, 0xc2, 0xa4, 0x4f, 0x75, 0xd6, + 0x25, 0xd7, 0xda, 0x84, 0x08, 0x76, 0x78, 0x02, 0xd6, 0x9b, 0x92, + 0x60, 0xeb, 0xad, 0x0f, 0x53, 0xbd, 0xab, 0xe1, 0xbb, 0x4e, 0x07, + 0x0c, 0xae, 0x43, 0xa8, 0x1a, 0xaf, 0x0d, 0xe8, 0x94, 0xbf, 0xa2, + 0x85, 0x70, 0xc2, 0x80, 0x1d, 0x3f, 0x82, 0xfc, 0xd0, 0x0e, 0xa5, + 0x47, 0xd1, 0x21, 0x1b, 0x44, 0x45, 0x54, 0x45, 0xbf, 0x80, 0xde, + 0x30, 0xbc, 0x00, 0x01, 0x66, 0xc1, 0x14, 0xb9, 0xdd, 0x7a, 0x9c, + 0xcb, 0xab, 0xc1, 0xc8, 0x46, 0x3f, 0x58, 0x88, 0x2d, 0xea, 0xa7, + 0x26, 0x77, 0x4a, 0x8f, 0x9b, 0x6c, 0x9f, 0xd9, 0xd6, 0x71, 0x67, + 0x97, 0x68, 0x1b}}; + auto const ed6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed6PublicKey{ + {0xa0, 0x45, 0x26, 0xcf, 0xee, 0x7e, 0xda, 0x68, 0xd9, 0x70, 0x23, + 0xac, 0x68, 0x48, 0x9e, 0x20, 0xa4, 0x5e, 0xf8, 0x51, 0xcb, 0xfe, + 0x72, 0xc1, 0x11, 0x5d, 0x25, 0x9c, 0xbc, 0xfd, 0xbb, 0x8b}}; + std::array const ed6Sig{ + {0x2a, 0x1d, 0xc0, 0x92, 0x24, 0x9a, 0x87, 0x5a, 0xc6, 0xaf, 0xa4, + 0x7f, 0xe1, 0x63, 0xc7, 0xca, 0xfd, 0x08, 0x47, 0xae, 0x2f, 0x98, + 0x07, 0xdc, 0x56, 0x9a, 0xfc, 0x2f, 0x0e, 0xa9, 0x37, 0x16, 0xe0, + 0x81, 0xff, 0x94, 0xb2, 0xab, 0x40, 0x2f, 0x9c, 0xa6, 0xc0, 0xe4, + 0xdf, 0xdf, 0xcd, 0x01, 0xf2, 0xdb, 0x9c, 0xff, 0x62, 0xe7, 0x2f, + 0x9d, 0x51, 0x6e, 0x80, 0xd1, 0x0c, 0x86, 0xd2, 0x01}}; + std::array const ed6SigningKey{ + {0x8f, 0xac, 0x15, 0x02, 0xce, 0xb4, 0x10, 0x27, 0x56, 0x91, 0x2b, + 0xd0, 0x57, 0xe7, 0x6c, 0xe0, 0xc5, 0x46, 0x65, 0x38, 0xf0, 0xc8, + 0x09, 0xe0, 0xb4, 0x57, 0xfb, 0x11, 0xfc, 0x00, 0xe9, 0xdf}}; + (void)ed6SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix10CondConditionFingerprint = { + {0x60, 0x73, 0x5a, 0xb9, 0xb9, 0xe7, 0xa2, 0x26, 0x7e, 0x17, 0x66, + 0x6b, 0xa8, 0x86, 0x7e, 0x34, 0xc6, 0x0b, 0x0a, 0xf6, 0x71, 0xa5, + 0x23, 0xb8, 0x9c, 0x2c, 0x5c, 0x94, 0x50, 0x52, 0x08, 0x52}}; + Condition const Prefix10Cond{Type::prefixSha256, + 67619, + Prefix10CondConditionFingerprint, + std::bitset<5>{8}}; + std::array const Thresh13CondConditionFingerprint = { + {0xb4, 0xbe, 0x05, 0x1e, 0x6d, 0x55, 0x80, 0x8f, 0x1d, 0x6f, 0x74, + 0xa2, 0x4a, 0x17, 0x58, 0x06, 0x2d, 0x71, 0x91, 0x1b, 0x98, 0x25, + 0xec, 0x7c, 0x4b, 0x77, 0xc3, 0x5d, 0x28, 0x00, 0xa8, 0x67}}; + Condition const Thresh13Cond{Type::thresholdSha256, + 66560, + Thresh13CondConditionFingerprint, + std::bitset<5>{8}}; + + auto rsa3 = std::make_unique( + makeSlice(rsa3PublicKey), makeSlice(rsa3Sig)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(rsa3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + auto rsa5 = std::make_unique( + makeSlice(rsa5PublicKey), makeSlice(rsa5Sig)); + auto ed6 = std::make_unique(ed6PublicKey, ed6Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim4)); + thresh0Subfulfillments.emplace_back(std::move(rsa5)); + thresh0Subfulfillments.emplace_back(std::move(ed6)); + std::vector thresh0Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond, Prefix10Cond, Thresh13Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x83\xa0\x82\x04\xa9\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x82\x02\x26\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x82\x02\x1b\xa1\x82\x02\x17\x80\x02\x50\x32\x81" + "\x01\x1c\xa2\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xbd" + "\xd1\xc7\xf0\xb0\x3a\xa5\x5b\x3e\x49\x8d\x4e\x00\x54\x89\xb9" + "\x89\xcd\x4b\x43\xde\x59\xf6\x7a\x67\x5c\x3a\xc6\xcf\x82\x3f" + "\x35\x9c\xcc\xda\xcd\xd3\x97\x86\x5b\xe9\xf6\x05\x55\x0b\x26" + "\xef\x1e\x88\xd5\xb6\xba\x14\x0a\xb2\x76\xb9\xb3\x46\x0c\xc0" + "\x80\x17\x13\x68\x23\xdc\xec\x10\x18\xfc\xaa\xbe\xb3\xc4\xc7" + "\xa9\x84\xa6\x4e\x5c\x08\x6b\x7b\x4c\x81\x91\x79\x5d\x90\x06" + "\x15\xbb\x76\x2f\x5c\x53\x60\x0f\xac\xf3\x7c\x49\xc5\x47\xec" + "\xb3\xda\x93\x87\xc1\xb9\xcf\x2c\xb5\xf0\x85\xad\xb4\x38\x67" + "\x88\xda\x3d\xfa\x01\xb7\x54\xd9\x41\x0b\x7b\x8a\x09\xe0\x84" + "\x7d\xbb\x89\xb2\xfc\x0b\x70\x36\x93\x56\x62\xcc\xb4\xfc\xf9" + "\x1f\x37\x92\x9b\x3a\x4e\x7c\xad\x4b\xa6\x76\x6f\xda\xc4\x2f" + "\x83\x53\xbd\x93\xa9\x76\x89\x53\xe1\x4d\xee\x27\x11\x6f\xbc" + "\x21\xad\x42\x9f\x29\xf6\x03\xdd\xec\xfa\xa1\x78\xd2\xde\x29" + "\x2e\xd8\x3a\x7f\xe9\x9b\x5d\xeb\x37\xb8\xb0\xa0\x66\x3f\x02" + "\xcd\x2a\x6e\xd3\x1c\xa5\x65\xdc\x73\xbe\x93\x54\x9a\x2b\xf8" + "\x32\x8b\xe8\xce\x9a\x59\xd0\x05\xeb\xbb\xac\xfc\x4c\x4b\x2e" + "\xac\x2a\xc3\x0f\x0a\xd7\x46\xaf\xfd\x22\x0d\x0d\x54\xcc\x2f" + "\x81\x82\x01\x00\xb4\x28\xb6\x26\x35\xee\x3a\x8a\xc6\xcd\x36" + "\x38\xac\xa5\x59\xc8\x8d\xd9\xc2\x0d\x37\xfb\x46\x87\xc3\x3f" + "\xcc\xc4\x74\xdc\x0a\x6a\x09\xcb\x1c\xbe\xe2\xd4\x1c\xa0\xde" + "\x3b\xc0\x38\x1e\x2c\x84\x38\xb9\xd1\x53\xfe\xa8\xd3\xac\x5f" + "\x1f\xd5\x2e\xf1\x70\x5f\xd8\x1e\x88\xc7\x7a\xc4\xba\x2f\x07" + "\x78\xbb\x53\x48\x1d\x77\x04\x45\x28\xb9\x9c\x58\x52\x86\x5c" + "\x49\x05\xe4\x9c\x8c\x70\x4f\x0a\xf9\x91\xc5\x82\xe7\x9b\x8f" + "\x68\x2e\x81\x94\x7d\x52\xf0\xb1\xc2\x1b\x1e\x75\xbf\x0f\x8e" + "\xe0\x11\x20\x50\x6a\xf9\xb0\x62\x39\xac\xc0\xcc\x73\x4a\x11" + "\xc9\x1a\x06\x4a\x16\xe6\x73\x96\x77\x20\x41\x57\x93\x9a\xa3" + "\x2f\x6f\xb3\xd6\x98\xde\xab\xef\xbf\x05\x9f\x7f\x97\x09\x4b" + "\xca\x91\xd2\xd7\xf3\xe8\x78\x6b\x16\xc3\x48\x00\xff\x60\xa7" + "\xc3\xd7\xf0\x01\x34\xec\xe5\xb6\x35\x8d\xef\x65\xf2\xa2\xd9" + "\xbf\xef\xe5\x78\x24\x9b\xf4\xab\xd2\xec\xd1\xc5\x75\x40\x39" + "\x06\x84\xdb\x97\xb5\x8a\x0b\x52\xe2\x84\xba\xd3\x6a\x53\x9d" + "\xa0\xbb\x65\x36\x58\x56\x0e\x3b\xb4\xb0\x45\x94\x7b\xbc\x03" + "\xca\x4f\x48\xae\xe1\x97\x70\xc3\x34\xbc\x39\x94\xa4\x7a\xf2" + "\x39\xaa\x8d\x11\xdc\xa3\x82\x02\x08\x80\x82\x01\x00\xc0\x00" + "\xef\x8f\x4b\x81\x10\x1e\x52\xe0\x07\x9f\x68\xe7\x2f\x92\xd4" + "\x77\x3c\x1f\xa3\xff\x72\x64\x5b\x37\xf1\xf3\xa3\xc5\xfb\xcd" + "\xfb\xda\xcc\x8b\x52\xe1\xde\xbc\x28\x8d\xe5\xad\xab\x86\x61" + "\x45\x97\x65\x37\x68\x26\x21\x92\x17\xa3\xb0\x74\x5c\x8a\x45" + "\x8d\x87\x5b\x9b\xd1\x7b\x07\xc4\x8c\x67\xa0\xe9\x82\x0c\xe0" + "\x6b\xea\x91\x5c\xba\xe3\xd9\x9d\x39\xfd\x77\xac\xcb\x33\x9b" + "\x28\x51\x8d\xbf\x3e\xe4\x94\x1c\x9a\x60\x71\x4b\x34\x07\x30" + "\xda\x42\x46\x0e\xb8\xb7\x2c\xf5\x2f\x4b\x9e\xe7\x64\x81\xa1" + "\xa2\x05\x66\x92\xe6\x75\x9f\x37\xae\x40\xa9\x16\x08\x19\xe8" + "\xdc\x47\xd6\x03\x29\xab\xcc\x58\xa2\x37\x2a\x32\xb8\x15\xc7" + "\x51\x91\x73\xb9\x1d\xc6\xd0\x4f\x85\x86\xd5\xb3\x21\x1a\x2a" + "\x6c\xeb\x7f\xfe\x84\x17\x10\x2d\x0e\xb4\xe1\xc2\x48\x4c\x3f" + "\x61\xc7\x59\x75\xa7\xc1\x75\xce\x67\x17\x42\x2a\x2f\x96\xef" + "\x8a\x2d\x74\xd2\x13\x68\xe1\xe9\xea\xfb\x73\x68\xed\x8d\xd3" + "\xac\x49\x09\xf9\xec\x62\xdf\x53\xab\xfe\x90\x64\x4b\x92\x60" + "\x0d\xdd\x00\xfe\x02\xe6\xf3\x9b\x2b\xac\x4f\x70\xe8\x5b\x69" + "\x9c\x40\xd3\xeb\x37\xad\x6f\x37\xab\xf3\x79\x8e\xcb\x1d\x81" + "\x82\x01\x00\x38\x4d\xe9\xae\x95\xe2\x4c\x3d\xc1\xdb\x7c\xa8" + "\x53\xd7\x43\x6a\x8f\x2b\x82\xf3\x8c\xa5\x84\x84\x34\xb6\x84" + "\xc0\xd2\xc4\x4a\xf7\xb7\xa0\x68\xc4\x6d\x78\x1f\xc4\x44\xe3" + "\x54\xc5\xf7\x71\xd2\x3a\x85\xee\xf9\x07\xf0\xec\x2a\x84\x47" + "\xa4\xeb\xc5\x47\xbe\xf7\xa6\xc1\xe4\x47\xa8\x39\x2e\xd1\xf7" + "\x5e\x48\xe4\x77\x37\xdb\x82\xc3\xf7\x8c\x00\xdd\xfd\x57\xc9" + "\x07\xb7\x82\xbe\xde\xd4\xe1\x11\xe3\xc7\xf8\xf7\x82\xbe\xa2" + "\x32\x92\x65\xcc\x7c\xb8\x6c\xb8\x0b\x04\x52\x91\xd4\x9e\xf8" + "\x9c\x33\xd5\xc5\xe4\x63\xe0\xf4\x64\x05\x24\x89\x33\xac\x8b" + "\x55\xc2\x4b\x7f\x40\x6e\xc8\x38\x79\x68\x49\xf4\xb2\x2f\x6a" + "\x94\x96\xe7\xe9\xf1\xf1\x14\x79\x7e\x36\x90\x0f\xc7\xc2\xa4" + "\x4f\x75\xd6\x25\xd7\xda\x84\x08\x76\x78\x02\xd6\x9b\x92\x60" + "\xeb\xad\x0f\x53\xbd\xab\xe1\xbb\x4e\x07\x0c\xae\x43\xa8\x1a" + "\xaf\x0d\xe8\x94\xbf\xa2\x85\x70\xc2\x80\x1d\x3f\x82\xfc\xd0" + "\x0e\xa5\x47\xd1\x21\x1b\x44\x45\x54\x45\xbf\x80\xde\x30\xbc" + "\x00\x01\x66\xc1\x14\xb9\xdd\x7a\x9c\xcb\xab\xc1\xc8\x46\x3f" + "\x58\x88\x2d\xea\xa7\x26\x77\x4a\x8f\x9b\x6c\x9f\xd9\xd6\x71" + "\x67\x97\x68\x1b\xa4\x64\x80\x20\xa0\x45\x26\xcf\xee\x7e\xda" + "\x68\xd9\x70\x23\xac\x68\x48\x9e\x20\xa4\x5e\xf8\x51\xcb\xfe" + "\x72\xc1\x11\x5d\x25\x9c\xbc\xfd\xbb\x8b\x81\x40\x2a\x1d\xc0" + "\x92\x24\x9a\x87\x5a\xc6\xaf\xa4\x7f\xe1\x63\xc7\xca\xfd\x08" + "\x47\xae\x2f\x98\x07\xdc\x56\x9a\xfc\x2f\x0e\xa9\x37\x16\xe0" + "\x81\xff\x94\xb2\xab\x40\x2f\x9c\xa6\xc0\xe4\xdf\xdf\xcd\x01" + "\xf2\xdb\x9c\xff\x62\xe7\x2f\x9d\x51\x6e\x80\xd1\x0c\x86\xd2" + "\x01\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b" + "\x80\x20\x60\x73\x5a\xb9\xb9\xe7\xa2\x26\x7e\x17\x66\x6b\xa8" + "\x86\x7e\x34\xc6\x0b\x0a\xf6\x71\xa5\x23\xb8\x9c\x2c\x5c\x94" + "\x50\x52\x08\x52\x81\x03\x01\x08\x23\x82\x02\x04\x10\xa2\x2b" + "\x80\x20\xb4\xbe\x05\x1e\x6d\x55\x80\x8f\x1d\x6f\x74\xa2\x4a" + "\x17\x58\x06\x2d\x71\x91\x1b\x98\x25\xec\x7c\x4b\x77\xc3\x5d" + "\x28\x00\xa8\x67\x81\x03\x01\x04\x00\x82\x02\x04\x10\xa3\x27" + "\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e" + "\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e" + "\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa" + "\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f" + "\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9" + "\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xdc\x31\x8d\x5e\xd0\x45\x54\x4d\x1e\x52\xe6" + "\x8e\x16\x52\x5c\x38\x85\xa5\xbf\x68\x47\x11\x58\x2a\xe5\xaf" + "\xc0\x5a\x1f\xff\xfb\x0b\x81\x03\x06\x34\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x60\x73\x5a\xb9\xb9\xe7\xa2\x26\x7e\x17\x66\x6b" + "\xa8\x86\x7e\x34\xc6\x0b\x0a\xf6\x71\xa5\x23\xb8\x9c\x2c\x5c" + "\x94\x50\x52\x08\x52\x81\x03\x01\x08\x23\x82\x02\x04\x10\xa1" + "\x2b\x80\x20\xe4\x1a\x1f\x58\x06\x0b\x5e\x27\x90\x67\x1e\x7e" + "\x64\x57\x2f\x99\x6d\x22\xd7\xf1\xc4\x73\x41\xb6\x54\xdc\x00" + "\x55\xdb\x1a\x44\xb0\x81\x03\x01\x08\x3a\x82\x02\x04\x10\xa2" + "\x2b\x80\x20\xb4\xbe\x05\x1e\x6d\x55\x80\x8f\x1d\x6f\x74\xa2" + "\x4a\x17\x58\x06\x2d\x71\x91\x1b\x98\x25\xec\x7c\x4b\x77\xc3" + "\x5d\x28\x00\xa8\x67\x81\x03\x01\x04\x00\x82\x02\x04\x10\xa3" + "\x27\x80\x20\x99\xfb\x0b\x38\x94\x4d\x20\x85\xc8\xda\x3a\x64" + "\x31\x44\x6f\x6c\x3b\x46\x25\x50\xd7\x7f\xdf\xee\x75\x72\x71" + "\xf9\x61\x40\x63\xfa\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xd1" + "\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20" + "\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91" + "\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\xd3\xc9\x24\x3f" + "\x2d\x2e\x64\x93\xa8\x49\x29\x82\x75\xea\xbf\xe3\x53\x7f\x8e" + "\x45\x16\xdb\x5e\xc6\xdf\x39\xd2\xcb\xea\x62\xfb\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25" + "\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe" + "\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh30() + { + testcase("Thresh30"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim14Cond + // ** Rsa15Cond + // ** Ed16Cond + // ** prefix1 + // *** prefix2 + // **** prefix3 + // ***** rsa4 + // ** prefix5 + // *** prefix6 + // **** prefix7 + // ***** rsa8 + // ** thresh9 + // *** Preim11Cond + // *** Rsa12Cond + // *** Ed13Cond + // *** rsa10 + + auto const rsa4Msg = "P3P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0xbb, 0xdf, 0x33, 0xa6, 0xb6, 0x24, 0xa0, 0x30, 0x3a, 0xc9, 0x88, + 0x1e, 0xff, 0x94, 0x71, 0x1f, 0x51, 0xf4, 0xbe, 0xd1, 0xd9, 0x3e, + 0x4e, 0x84, 0x89, 0x8b, 0xb7, 0xc8, 0x39, 0x3a, 0xad, 0x38, 0x31, + 0xaf, 0x3e, 0x6f, 0x87, 0xc6, 0xd7, 0x1b, 0x37, 0xc0, 0xff, 0x32, + 0x62, 0x7c, 0x4d, 0x70, 0x6b, 0x2c, 0x20, 0xe6, 0x31, 0xc4, 0xd8, + 0xc6, 0x86, 0x64, 0xc0, 0x53, 0xef, 0x3e, 0x3e, 0x06, 0x73, 0x72, + 0x10, 0xc2, 0xea, 0xc5, 0x4e, 0x72, 0x98, 0x16, 0x4a, 0x85, 0x24, + 0x0a, 0xaa, 0xeb, 0xac, 0xa5, 0x56, 0x55, 0x10, 0xad, 0x1b, 0x92, + 0x98, 0x4d, 0x12, 0xed, 0xd2, 0xa0, 0x31, 0x3a, 0xfb, 0x7f, 0x3a, + 0xf1, 0x29, 0xde, 0xf5, 0x13, 0x6a, 0x67, 0x87, 0x88, 0xd6, 0xcd, + 0x6f, 0x3d, 0x83, 0x05, 0xff, 0x33, 0x92, 0x0e, 0xcb, 0xb7, 0x80, + 0xab, 0x6d, 0xce, 0x1d, 0x8f, 0x17, 0x7a, 0xa1, 0xf8, 0x6b, 0x83, + 0x2e, 0x62, 0xe2, 0xd2, 0x9a, 0xac, 0x8b, 0xd6, 0xb6, 0x01, 0xa6, + 0xba, 0x85, 0xf0, 0x01, 0x96, 0x4b, 0x7f, 0x71, 0x40, 0x0d, 0xeb, + 0x7a, 0x45, 0xd7, 0x10, 0x29, 0x6a, 0x33, 0xb0, 0x01, 0xad, 0x10, + 0xad, 0xdd, 0xc9, 0xb8, 0x65, 0xc6, 0x40, 0x12, 0x4c, 0xc3, 0x54, + 0xfa, 0x95, 0xdb, 0x62, 0x3e, 0x5c, 0xbe, 0x5e, 0xc4, 0xab, 0x1c, + 0x39, 0xe1, 0xc0, 0x03, 0xef, 0xe3, 0x8b, 0x33, 0xd2, 0x93, 0xdd, + 0x63, 0x53, 0xd4, 0x02, 0x03, 0x05, 0x36, 0x8c, 0x9a, 0x2b, 0xf1, + 0x24, 0x19, 0xac, 0x17, 0x85, 0x81, 0xe7, 0x62, 0x7a, 0xe6, 0xab, + 0xae, 0xb4, 0x42, 0xd0, 0x93, 0x9d, 0xb3, 0x7d, 0x23, 0x1d, 0xd8, + 0x2f, 0x8b, 0x70, 0xf9, 0x3b, 0xca, 0x1d, 0xe2, 0x2f, 0xff, 0x2c, + 0xd1, 0x44, 0x07, 0xa8, 0x70, 0x63, 0xd7, 0xdb, 0x3b, 0x8d, 0x40, + 0x67, 0xcf, 0xcf}}; + auto const prefix3Prefix = "P3"s; + auto const prefix3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3MaxMsgLength = 30; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const rsa8Msg = "P7P6P5abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa8PublicKey{ + {0xb7, 0xf9, 0xf2, 0x4e, 0xc8, 0xd9, 0x79, 0xcb, 0x92, 0xdb, 0x0d, + 0x2d, 0x81, 0x30, 0x23, 0x20, 0xc1, 0x2f, 0x97, 0xd1, 0x90, 0x5e, + 0x52, 0x73, 0x04, 0x8d, 0x23, 0x6b, 0x9c, 0xe9, 0x7f, 0xb0, 0xda, + 0x3a, 0x75, 0x84, 0x60, 0xd2, 0xac, 0x55, 0xc5, 0x2a, 0x8e, 0x25, + 0x17, 0x64, 0x3e, 0x0d, 0x0f, 0x1f, 0x9c, 0x1d, 0x04, 0xfe, 0x36, + 0x26, 0xb7, 0x4b, 0xeb, 0xed, 0xa4, 0x73, 0x25, 0x86, 0x45, 0xa1, + 0x34, 0x33, 0xf3, 0xdd, 0x06, 0xd1, 0x8a, 0xc8, 0x9d, 0x00, 0x69, + 0xf2, 0x72, 0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+ {0x98, 0x82, 0xea, 0xf7, 0xad, 0x8a, 0x3b, 0x73, 0x66, 0x05, 0x85, + 0xb3, 0x96, 0xac, 0xce, 0xb2, 0x03, 0xe3, 0xe4, 0xad, 0xd3, 0x01, + 0x6a, 0x79, 0xe8, 0xba, 0xf6, 0x62, 0xc8, 0x3a, 0xa9, 0xa5, 0xdd, + 0x34, 0x55, 0xf2, 0xee, 0x2b, 0xc6, 0xc0, 0xe4, 0x8d, 0xb8, 0x7a, + 0x37, 0xe7, 0x94, 0x44, 0xf3, 0x11, 0xfb, 0x5f, 0x85, 0xf7, 0x76, + 0xb7, 0x64, 0xd1, 0xd3, 0xb1, 0x4e, 0xad, 0x2b, 0x21, 0xe6, 0xa0, + 0x19, 0xc0, 0xf1, 0xec, 0x86, 0xc3, 0xe5, 0x82, 0x69, 0xb4, 0x7c, + 0x49, 0x2a, 0xf3, 0x5b, 0x4c, 0x60, 0x38, 0x30, 0x41, 0x14, 0x15, + 0xe2, 0x21, 0x0d, 0x19, 0x54, 0xdf, 0xa6, 0x03, 0x44, 0xeb, 0x3a, + 0xfb, 0xf7, 0xb4, 0x1a, 0x83, 0xfa, 0x59, 0xcf, 0x13, 0xad, 0x45, + 0xee, 0x56, 0x12, 0xdc, 0x7e, 0xba, 0x51, 0x13, 0x55, 0xb5, 0xd7, + 0x2f, 0x34, 0xbc, 0x11, 0x95, 0xdb, 0x7b, 0x2d, 0x48, 0xf8, 0xae, + 0xb4, 0x4e, 0x6a, 0xa7, 0x97, 0x31, 0xe1, 0x89, 0xdb, 0x16, 0xc1, + 0xad, 0xca, 0xe6, 0x16, 0x34, 0xe5, 0x33, 0x7e, 0xcf, 0x73, 0x74, + 0x29, 0x68, 0x66, 0xe2, 0x5e, 0xd1, 0xb5, 0xb3, 0xae, 0x24, 0xd3, + 0xd6, 0x21, 0xdb, 0x3a, 0x56, 0x2d, 0xe4, 0xe7, 0xd0, 0x76, 0x51, + 0xba, 0x71, 0x6f, 0xe1, 0x61, 0x1d, 0x24, 0xe9, 0xfa, 0x79, 0x24, + 0x11, 0xcc, 0xdf, 0xc0, 0x65, 0xc2, 0xd6, 0xea, 0xdb, 0xa7, 0x62, + 0x07, 0x35, 0xff, 0x6e, 0x61, 0xb7, 0xcb, 0xdc, 0xcc, 0x47, 0x10, + 0xc8, 0xa3, 0x62, 0x97, 0x0d, 0xb0, 0xa1, 0xc2, 0xb7, 0x17, 0xab, + 0x09, 0xe2, 0xf5, 0x37, 0x4d, 0xbb, 0xac, 0xb0, 0x66, 0x1d, 0x0c, + 0x98, 0x71, 0x25, 0xc3, 0x51, 0x13, 0xd4, 0xb4, 0xd4, 0xb0, 0x2b, + 0xa9, 0x68, 0x03, 0x8a, 0xa5, 0xf8, 0xc1, 0xa8, 0xc4, 0xca, 0x8a, + 0x7d, 0x42, 0x50}}; + auto const prefix7Prefix = "P7"s; + auto const prefix7Msg = "P6P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix7MaxMsgLength = 30; + auto const prefix6Prefix = "P6"s; + auto const prefix6Msg = "P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6MaxMsgLength = 28; + auto const prefix5Prefix = "P5"s; + auto const prefix5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix5MaxMsgLength = 26; + auto const rsa10Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa10PublicKey{ + {0x9f, 0x01, 0x7b, 0x87, 0xfd, 0xbe, 0xa0, 0x02, 0x77, 0x00, 0x19, + 0x7f, 0x2f, 0xde, 0x80, 0xab, 0xdc, 0xd0, 0x14, 0xe9, 0x63, 0xe5, + 0xd6, 0xfb, 0x2c, 0xcb, 0xb0, 0x70, 0x88, 0xbe, 0xcb, 0x6d, 0x8e, + 0x56, 0xf3, 0x02, 0x34, 0xae, 0xec, 0x30, 0xf7, 0x41, 0xcf, 0xe7, + 0x07, 0x80, 0x52, 0x04, 0xa1, 0x16, 0x51, 0x15, 0x07, 0xba, 0xdb, + 0xc6, 0xe8, 0xce,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0x7a, 0x35, 0x41, 0xad, + 0xfd, 0x8e, 0xa8, 0x50, 0xe0, 0xf2, 0xab, 0x2d, 0xe2, 0x31, 0x39, + 0x82, 0x41, 0x4b}}; + std::array const rsa10Sig{ + {0x4e, 0xe2, 0xec, 0x3b, 0x26, 0xd6, 0x8e, 0xb5, 0x75, 0xba, 0x9a, + 0xaa, 0x68, 0xe6, 0x83, 0xed, 0xd0, 0xb3, 0x0e, 0x94, 0x5a, 0xde, + 0xf0, 0xbb, 0xa0, 0xf6, 0xb9, 0xc9, 0xba, 0xd3, 0x63, 0x0b, 0xfd, + 0xf1, 0x76, 0x74, 0xaa, 0x27, 0x4e, 0x62, 0x53, 0xe8, 0x8e, 0xd6, + 0x86, 0xd8, 0xb2, 0x27, 0x11, 0x1c, 0x21, 0x58, 0x51, 0xe6, 0xdf, + 0xca, 0x52, 0x12, 0xef, 0x91, 0x59, 0x8a, 0x25, 0x81, 0x92, 0xaa, + 0x50, 0x9f, 0x11, 0xb2, 0xa3, 0xea, 0x14, 0x60, 0x6f, 0x6f, 0xb1, + 0x25, 0x69, 0x4e, 0xb9, 0x87, 0x7f, 0x99, 0x8b, 0x55, 0xc7, 0xa7, + 0xd2, 0x2b, 0x8b, 0x8f, 0x9b, 0x09, 0xcc, 0xdb, 0x26, 0x05, 0xf5, + 0x13, 0x1f, 0xd1, 0xed, 0x28, 0x3b, 0xe7, 0xf6, 0x16, 0x0e, 0x9b, + 0x9e, 0x29, 0x37, 0xea, 0x0e, 0x7e, 0xf4, 0x86, 0x12, 0x7c, 0x90, + 0x65, 0xbc, 0xc2, 0xa1, 0xf1, 0x94, 0x98, 0xc4, 0xaf, 0x1d, 0xe3, + 0x75, 0x84, 0x67, 0xe6, 0x1d, 0xca, 0x5c, 0xe4, 0x19, 0x2b, 0xdd, + 0xb0, 0xb5, 0x8f, 0x0a, 0x4f, 0xdd, 0x11, 0xff, 0xbd, 0xa2, 0x8a, + 0x26, 0x27, 0x78, 0xe5, 0xc4, 0x4e, 0xa7, 0xe1, 0x79, 0x34, 0xb4, + 0xdd, 0xc8, 0xa2, 0x2a, 0xf8, 0x5d, 0x0e, 0xd1, 0x7e, 0xfa, 0xdb, + 0x1b, 0x8c, 0xc8, 0x1b, 0x82, 0x86, 0x70, 0x24, 0x3c, 0x8c, 0xfb, + 0x99, 0xa2, 0x48, 0xbb, 0xb9, 0x3e, 0x30, 0x41, 0x30, 0x0b, 0x66, + 0xe9, 0x24, 0xce, 0x04, 0x00, 0xc8, 0xec, 0x9a, 0x9d, 0x7b, 0x24, + 0x56, 0xb0, 0x94, 0xd4, 0x3f, 0xd0, 0x7e, 0x03, 0x33, 0xe5, 0xb3, + 0xb5, 0x96, 0x56, 0xa8, 0x4d, 0x82, 0xd1, 0x91, 0x8a, 0xd7, 0x08, + 0x2c, 0x9c, 0xda, 0xf0, 0x2b, 0xf8, 0x4a, 0x90, 0x50, 0x84, 0xdd, + 0xab, 0xbb, 0x6e, 0xf1, 0x5a, 0x5c, 0x5e, 0x29, 0xd2, 0x22, 0xc8, + 0x4c, 0x2a, 0x03}}; + auto const thresh9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim11CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim11Cond{Type::preimageSha256, + 9, + Preim11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa12CondConditionFingerprint = { + {0x38, 0xb9, 0xf0, 0xeb, 0x68, 0x8b, 0x9f, 0x55, 0x37, 0x9a, 0xec, + 0x07, 0xd4, 0xa2, 0x13, 0xac, 0x34, 0xa1, 0x67, 0x31, 0x34, 0xea, + 0xc2, 0x2f, 0xef, 0x13, 0xe3, 0x5c, 0xcf, 0x8f, 0x90, 0x1e}}; + Condition const Rsa12Cond{Type::rsaSha256, + 65536, + Rsa12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed13CondConditionFingerprint = { + {0x7c, 0x54, 0x6a, 0x6d, 0x7f, 0x00, 0x52, 0x31, 0x03, 0xe7, 0xb4, + 0x5b, 0x1c, 0x9f, 0x72, 0xeb, 0x3c, 0x18, 0x08, 0xa3, 0x24, 0xb2, + 0x63, 0x5f, 0x77, 0x55, 0x4a, 0x42, 0xdb, 0x1e, 0xff, 0x1e}}; + Condition const Ed13Cond{Type::ed25519Sha256, + 131072, + Ed13CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim14CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim14Cond{Type::preimageSha256, + 9, + Preim14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa15CondConditionFingerprint = { + {0x55, 0x6b, 0x6d, 0xe3, 0x00, 0xd4, 0xf3, 0x7e, 0x75, 0x3a, 0x68, + 0xfc, 0x25, 0xdf, 0xf2, 0xf7, 0x18, 0x54, 0xa5, 0x55, 0x0c, 0xa5, + 0xa9, 0x65, 0xbf, 0x66, 0x9e, 0x4e, 0x49, 0x56, 0x1e, 0xf1}}; + Condition const Rsa15Cond{Type::rsaSha256, + 65536, + Rsa15CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed16CondConditionFingerprint = { + {0xe4, 0x66, 0x69, 0x86, 0x87, 0x57, 0x0e, 0xac, 0xf1, 0xfd, 0x06, + 0x81, 0x48, 0x90, 0x82, 0x42, 0x48, 0x50, 0x75, 0x8e, 0xd4, 0x2d, + 0xf3, 0x02, 0x37, 0x89, 0x28, 0xc5, 0x68, 0xd7, 0xa0, 0x11}}; + Condition const Ed16Cond{Type::ed25519Sha256, + 131072, + Ed16CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + auto prefix3 = std::make_unique( + makeSlice(prefix3Prefix), prefix3MaxMsgLength, std::move(rsa4)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(prefix3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto rsa8 = std::make_unique( + makeSlice(rsa8PublicKey), makeSlice(rsa8Sig)); + auto prefix7 = std::make_unique( + makeSlice(prefix7Prefix), prefix7MaxMsgLength, std::move(rsa8)); + auto prefix6 = std::make_unique( + makeSlice(prefix6Prefix), prefix6MaxMsgLength, std::move(prefix7)); + auto prefix5 = std::make_unique( + makeSlice(prefix5Prefix), prefix5MaxMsgLength, std::move(prefix6)); + auto rsa10 = std::make_unique( + makeSlice(rsa10PublicKey), makeSlice(rsa10Sig)); + std::vector> thresh9Subfulfillments; + thresh9Subfulfillments.emplace_back(std::move(rsa10)); + std::vector thresh9Subconditions{ + {Preim11Cond, Rsa12Cond, Ed13Cond}}; + auto thresh9 = std::make_unique( + std::move(thresh9Subfulfillments), std::move(thresh9Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix5)); + thresh0Subfulfillments.emplace_back(std::move(thresh9)); + std::vector thresh0Subconditions{ + {Preim14Cond, Rsa15Cond, Ed16Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x07\x80\xa0\x82\x07\x01\xa1\x82\x02\x35\x80\x02\x50" + "\x31\x81\x01\x1a\xa2\x82\x02\x2a\xa1\x82\x02\x26\x80\x02\x50" + "\x32\x81\x01\x1c\xa2\x82\x02\x1b\xa1\x82\x02\x17\x80\x02\x50" + "\x33\x81\x01\x1e\xa2\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01" + "\x00\xbe\x09\xc5\xa4\x27\x29\xdf\xd4\x67\x76\xbe\xbf\x2c\xf3" + "\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67\x20\xfb\x7a\x27\x93\xc0\x78" + "\x47\x78\xd7\x15\x32\xee\x38\x81\x0d\x36\xa2\xc4\x65\x44\xe6" + "\x62\x26\xb9\x58\x13\xa4\x15\x82\xab\xb1\x16\x61\xfc\x01\x98" + "\xc6\x1a\x69\xc6\xba\x39\x3f\x01\x55\x3d\xd7\x8e\x14\x42\x6d" + "\x78\x74\x9b\x28\xcb\x31\x39\x98\x5a\x11\xdc\xc1\x18\x9d\x8d" + "\xb0\xcd\x1b\x4c\x10\xab\x14\x64\x19\xf1\x33\x15\x45\xc8\x92" + "\x82\x03\x82\x8a\xaa\xad\x94\xfc\x24\x11\x96\x99\x7e\x94\x5a" + "\x82\x57\x68\x61\x9f\x7b\x45\xe0\x99\x9e\x4f\x32\x50\x5f\x05" + "\xc8\x11\xae\xc4\x0c\x63\x18\x0e\x02\x59\x36\x25\x92\x06\x32" + "\xc7\x71\x47\x99\xcc\x0a\x6e\x0a\x58\x71\x3f\x5e\xb7\x78\xf7" + "\x98\x79\xdf\x74\xa4\xeb\xa9\x00\xfd\x81\xb3\xcf\x04\x8c\x5d" + "\x7d\xe7\xb2\x82\x90\x49\xbd\x69\xf3\x08\xe9\x92\xc6\x9e\x41" + "\xba\x74\xd8\x8d\x81\x97\x6f\x86\xab\xc9\xf1\x02\x31\xb4\xce" + "\x47\xb0\x39\xc8\xba\x51\xa7\x39\xf3\x71\xa2\x25\x27\x37\x6e" + "\x09\x6f\x19\x59\xbc\x65\xd9\xcd\x12\xd3\x2c\xa2\x78\xfa\x23" + "\x15\x1a\x82\x41\x91\x1b\xbe\x8a\xe7\xfe\x3c\x3c\x30\x32\xaa" + "\xe9\xf3\x81\x82\x01\x00\xbb\xdf\x33\xa6\xb6\x24\xa0\x30\x3a" + "\xc9\x88\x1e\xff\x94\x71\x1f\x51\xf4\xbe\xd1\xd9\x3e\x4e\x84" + "\x89\x8b\xb7\xc8\x39\x3a\xad\x38\x31\xaf\x3e\x6f\x87\xc6\xd7" + "\x1b\x37\xc0\xff\x32\x62\x7c\x4d\x70\x6b\x2c\x20\xe6\x31\xc4" + "\xd8\xc6\x86\x64\xc0\x53\xef\x3e\x3e\x06\x73\x72\x10\xc2\xea" + "\xc5\x4e\x72\x98\x16\x4a\x85\x24\x0a\xaa\xeb\xac\xa5\x56\x55" + "\x10\xad\x1b\x92\x98\x4d\x12\xed\xd2\xa0\x31\x3a\xfb\x7f\x3a" + "\xf1\x29\xde\xf5\x13\x6a\x67\x87\x88\xd6\xcd\x6f\x3d\x83\x05" + "\xff\x33\x92\x0e\xcb\xb7\x80\xab\x6d\xce\x1d\x8f\x17\x7a\xa1" + "\xf8\x6b\x83\x2e\x62\xe2\xd2\x9a\xac\x8b\xd6\xb6\x01\xa6\xba" + "\x85\xf0\x01\x96\x4b\x7f\x71\x40\x0d\xeb\x7a\x45\xd7\x10\x29" + "\x6a\x33\xb0\x01\xad\x10\xad\xdd\xc9\xb8\x65\xc6\x40\x12\x4c" + "\xc3\x54\xfa\x95\xdb\x62\x3e\x5c\xbe\x5e\xc4\xab\x1c\x39\xe1" + "\xc0\x03\xef\xe3\x8b\x33\xd2\x93\xdd\x63\x53\xd4\x02\x03\x05" + "\x36\x8c\x9a\x2b\xf1\x24\x19\xac\x17\x85\x81\xe7\x62\x7a\xe6" + "\xab\xae\xb4\x42\xd0\x93\x9d\xb3\x7d\x23\x1d\xd8\x2f\x8b\x70" + "\xf9\x3b\xca\x1d\xe2\x2f\xff\x2c\xd1\x44\x07\xa8\x70\x63\xd7" + "\xdb\x3b\x8d\x40\x67\xcf\xcf\xa1\x82\x02\x35\x80\x02\x50\x35" + "\x81\x01\x1a\xa2\x82\x02\x2a\xa1\x82\x02\x26\x80\x02\x50\x36" + "\x81\x01\x1c\xa2\x82\x02\x1b\xa1\x82\x02\x17\x80\x02\x50\x37" + "\x81\x01\x1e\xa2\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00" + "\xb7\xf9\xf2\x4e\xc8\xd9\x79\xcb\x92\xdb\x0d\x2d\x81\x30\x23" + "\x20\xc1\x2f\x97\xd1\x90\x5e\x52\x73\x04\x8d\x23\x6b\x9c\xe9" + "\x7f\xb0\xda\x3a\x75\x84\x60\xd2\xac\x55\xc5\x2a\x8e\x25\x17" + "\x64\x3e\x0d\x0f\x1f\x9c\x1d\x04\xfe\x36\x26\xb7\x4b\xeb\xed" + "\xa4\x73\x25\x86\x45\xa1\x34\x33\xf3\xdd\x06\xd1\x8a\xc8\x9d" + "\x00\x69\xf2\x72\x7f\x00\x28\x08\x7b\x8b\x31\x1c\xf3\xd3\x3f" + "\x46\xc6\xc6\xa7\x29\x89\xbc\x85\x1e\xb8\x01\x8e\xe1\xf2\x6e" + "\xe3\x08\xa8\x4d\x7d\x6c\x0f\x67\x1b\x1d\xbf\x88\xbe\x0b\x0e" + "\x6f\x20\xa8\xff\x2c\xea\x04\xb3\x95\xe4\x2d\xb3\x72\xcf\xd7" + "\x09\xca\xc9\x71\x41\x6c\x12\x91\x16\x2a\x25\xb4\x2c\x5d\x6b" + "\xdf\x39\x02\xd7\xf7\xd8\xbd\x2a\xac\x8a\xcb\x40\x75\x16\x1e" + "\xbf\xd3\x87\x47\x21\x0d\xcb\x8a\xe3\x45\x8f\x1d\xad\x13\xfc" + "\xe5\x14\xf2\xea\x3d\x14\x30\x5a\x47\xce\xb1\xe1\x53\xae\x1f" + "\x0b\x9a\x2f\xe1\x15\x58\x71\x1d\xbd\x89\xdd\xb1\x01\x08\xe3" + "\x5b\x9c\x5a\x50\x96\x50\x70\x6f\x5a\x54\xce\x0c\x7a\xb6\x1a" + "\xbc\xd1\xe3\x23\xe3\xe8\xb6\x9d\xbe\xa9\x2f\x82\x23\xcc\x46" + "\x2e\xe9\xe4\xa2\xdd\x4b\xff\x55\x56\x78\x53\xdc\xf1\x5a\xfe" + "\x53\x81\x82\x01\x00\x98\x82\xea\xf7\xad\x8a\x3b\x73\x66\x05" + "\x85\xb3\x96\xac\xce\xb2\x03\xe3\xe4\xad\xd3\x01\x6a\x79\xe8" + "\xba\xf6\x62\xc8\x3a\xa9\xa5\xdd\x34\x55\xf2\xee\x2b\xc6\xc0" + "\xe4\x8d\xb8\x7a\x37\xe7\x94\x44\xf3\x11\xfb\x5f\x85\xf7\x76" + "\xb7\x64\xd1\xd3\xb1\x4e\xad\x2b\x21\xe6\xa0\x19\xc0\xf1\xec" + "\x86\xc3\xe5\x82\x69\xb4\x7c\x49\x2a\xf3\x5b\x4c\x60\x38\x30" + "\x41\x14\x15\xe2\x21\x0d\x19\x54\xdf\xa6\x03\x44\xeb\x3a\xfb" + "\xf7\xb4\x1a\x83\xfa\x59\xcf\x13\xad\x45\xee\x56\x12\xdc\x7e" + "\xba\x51\x13\x55\xb5\xd7\x2f\x34\xbc\x11\x95\xdb\x7b\x2d\x48" + "\xf8\xae\xb4\x4e\x6a\xa7\x97\x31\xe1\x89\xdb\x16\xc1\xad\xca" + "\xe6\x16\x34\xe5\x33\x7e\xcf\x73\x74\x29\x68\x66\xe2\x5e\xd1" + "\xb5\xb3\xae\x24\xd3\xd6\x21\xdb\x3a\x56\x2d\xe4\xe7\xd0\x76" + "\x51\xba\x71\x6f\xe1\x61\x1d\x24\xe9\xfa\x79\x24\x11\xcc\xdf" + "\xc0\x65\xc2\xd6\xea\xdb\xa7\x62\x07\x35\xff\x6e\x61\xb7\xcb" + "\xdc\xcc\x47\x10\xc8\xa3\x62\x97\x0d\xb0\xa1\xc2\xb7\x17\xab" + "\x09\xe2\xf5\x37\x4d\xbb\xac\xb0\x66\x1d\x0c\x98\x71\x25\xc3" + "\x51\x13\xd4\xb4\xd4\xb0\x2b\xa9\x68\x03\x8a\xa5\xf8\xc1\xa8" + "\xc4\xca\x8a\x7d\x42\x50\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3" + "\x82\x02\x08\x80\x82\x01\x00\x9f\x01\x7b\x87\xfd\xbe\xa0\x02" + "\x77\x00\x19\x7f\x2f\xde\x80\xab\xdc\xd0\x14\xe9\x63\xe5\xd6" + "\xfb\x2c\xcb\xb0\x70\x88\xbe\xcb\x6d\x8e\x56\xf3\x02\x34\xae" + "\xec\x30\xf7\x41\xcf\xe7\x07\x80\x52\x04\xa1\x16\x51\x15\x07" + "\xba\xdb\xc6\xe8\xce\xa8\x8c\xa8\xb7\xaa\x4e\x08\x96\xbd\x5f" + "\xbd\x64\x0d\xe3\x88\xca\x7e\x1a\x20\x1f\x65\x44\x3a\xc8\x2c" + "\xc2\xdd\xc8\xc6\x9b\x8f\x01\x8e\x36\xc5\x52\x5a\xb1\x1d\x1d" + "\xc4\xf0\x9f\xa9\x51\x4d\xe6\xeb\x36\x9c\x2e\x2d\x08\x1c\xaf" + "\x67\xed\x83\xbb\x67\x77\x83\x24\x49\x97\x8c\x06\x0d\xca\x8b" + "\x45\xf4\x2b\xff\x94\x22\x7f\x04\x92\x81\xd6\xf5\x17\x7f\x41" + "\x2d\xc3\x4e\x86\x2a\x60\xc4\x0e\x74\xb0\x04\x3c\x48\xe4\xd8" + "\x09\xf6\x48\x35\x00\x09\xda\xaa\x31\x2f\x8b\x5f\x6d\x4c\x48" + "\x52\xb9\xd9\x43\xe8\x1e\x22\x68\x80\xbe\xff\xee\x11\x3b\x83" + "\x47\xfd\xec\x6e\x1d\x9c\x7b\xd8\xe3\x2a\x8b\xef\x2a\xb3\xa5" + "\xc1\x78\x3c\x0b\x0e\x31\xe6\x40\x80\xe1\xcb\x25\x56\xb3\x45" + "\x7e\x65\xb3\xd9\x1a\x8e\xf8\xb0\x65\x44\x89\x73\x90\x0f\xe7" + "\xcd\x1b\x68\x3b\xa4\x7a\x35\x41\xad\xfd\x8e\xa8\x50\xe0\xf2" + "\xab\x2d\xe2\x31\x39\x82\x41\x4b\x81\x82\x01\x00\x4e\xe2\xec" + "\x3b\x26\xd6\x8e\xb5\x75\xba\x9a\xaa\x68\xe6\x83\xed\xd0\xb3" + "\x0e\x94\x5a\xde\xf0\xbb\xa0\xf6\xb9\xc9\xba\xd3\x63\x0b\xfd" + "\xf1\x76\x74\xaa\x27\x4e\x62\x53\xe8\x8e\xd6\x86\xd8\xb2\x27" + "\x11\x1c\x21\x58\x51\xe6\xdf\xca\x52\x12\xef\x91\x59\x8a\x25" + "\x81\x92\xaa\x50\x9f\x11\xb2\xa3\xea\x14\x60\x6f\x6f\xb1\x25" + "\x69\x4e\xb9\x87\x7f\x99\x8b\x55\xc7\xa7\xd2\x2b\x8b\x8f\x9b" + "\x09\xcc\xdb\x26\x05\xf5\x13\x1f\xd1\xed\x28\x3b\xe7\xf6\x16" + "\x0e\x9b\x9e\x29\x37\xea\x0e\x7e\xf4\x86\x12\x7c\x90\x65\xbc" + "\xc2\xa1\xf1\x94\x98\xc4\xaf\x1d\xe3\x75\x84\x67\xe6\x1d\xca" + "\x5c\xe4\x19\x2b\xdd\xb0\xb5\x8f\x0a\x4f\xdd\x11\xff\xbd\xa2" + "\x8a\x26\x27\x78\xe5\xc4\x4e\xa7\xe1\x79\x34\xb4\xdd\xc8\xa2" + "\x2a\xf8\x5d\x0e\xd1\x7e\xfa\xdb\x1b\x8c\xc8\x1b\x82\x86\x70" + "\x24\x3c\x8c\xfb\x99\xa2\x48\xbb\xb9\x3e\x30\x41\x30\x0b\x66" + "\xe9\x24\xce\x04\x00\xc8\xec\x9a\x9d\x7b\x24\x56\xb0\x94\xd4" + "\x3f\xd0\x7e\x03\x33\xe5\xb3\xb5\x96\x56\xa8\x4d\x82\xd1\x91" + "\x8a\xd7\x08\x2c\x9c\xda\xf0\x2b\xf8\x4a\x90\x50\x84\xdd\xab" + "\xbb\x6e\xf1\x5a\x5c\x5e\x29\xd2\x22\xc8\x4c\x2a\x03\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x38\xb9" + "\xf0\xeb\x68\x8b\x9f\x55\x37\x9a\xec\x07\xd4\xa2\x13\xac\x34" + "\xa1\x67\x31\x34\xea\xc2\x2f\xef\x13\xe3\x5c\xcf\x8f\x90\x1e" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x7c\x54\x6a\x6d\x7f\x00" + "\x52\x31\x03\xe7\xb4\x5b\x1c\x9f\x72\xeb\x3c\x18\x08\xa3\x24" + "\xb2\x63\x5f\x77\x55\x4a\x42\xdb\x1e\xff\x1e\x81\x03\x02\x00" + "\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\x55\x6b\x6d\xe3\x00\xd4\xf3\x7e\x75\x3a\x68\xfc\x25\xdf" + "\xf2\xf7\x18\x54\xa5\x55\x0c\xa5\xa9\x65\xbf\x66\x9e\x4e\x49" + "\x56\x1e\xf1\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xe4\x66\x69" + "\x86\x87\x57\x0e\xac\xf1\xfd\x06\x81\x48\x90\x82\x42\x48\x50" + "\x75\x8e\xd4\x2d\xf3\x02\x37\x89\x28\xc5\x68\xd7\xa0\x11\x81" + "\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x15\xbd\xa2\xdb\x30\xcc\x80\x4a\xe1\x5b\xd3" + "\x5a\xa4\xb2\x76\x0d\x45\x14\x32\x31\xea\x97\xf3\x98\x9d\x35" + "\x52\x63\xb0\xec\x7d\x6b\x81\x03\x05\x34\x5a\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x18\x29\x6b\x75\xb4\x91" + "\xf8\xa2\x50\xdb\xfa\x69\x25\x3f\x8c\x49\x02\x8d\xa8\x49\xb0" + "\x35\xc2\x83\x45\x78\x89\x60\xd4\x01\x0b\xb2\x81\x03\x01\x0c" + "\x5a\x82\x02\x04\x10\xa1\x2b\x80\x20\x4a\x16\x1b\x87\x78\xfe" + "\x60\xe7\xeb\x5e\x6f\xdd\x60\x14\x93\x00\x2c\x90\x8b\x70\x78" + "\x8d\x90\x15\x21\xd3\x08\xe2\xad\x3f\x42\xe5\x81\x03\x01\x0c" + "\x5a\x82\x02\x04\x10\xa2\x2b\x80\x20\xf7\x98\x7b\x51\x67\x7b" + "\x5b\x54\x79\x4e\xee\xac\xfc\xf7\xec\xa9\x60\xe4\xb8\x44\x72" + "\x9e\x6c\x08\xcc\xa7\xd3\xc1\x9d\xa5\x3c\xe5\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x55\x6b\x6d\xe3\x00\xd4" + "\xf3\x7e\x75\x3a\x68\xfc\x25\xdf\xf2\xf7\x18\x54\xa5\x55\x0c" + "\xa5\xa9\x65\xbf\x66\x9e\x4e\x49\x56\x1e\xf1\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe4\x66\x69\x86\x87\x57\x0e\xac\xf1\xfd" + "\x06\x81\x48\x90\x82\x42\x48\x50\x75\x8e\xd4\x2d\xf3\x02\x37" + "\x89\x28\xc5\x68\xd7\xa0\x11\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh31() + { + testcase("Thresh31"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim8Cond + // ** Rsa9Cond + // ** Ed10Cond + // ** Prefix11Cond + // ** Thresh15Cond + // ** prefix1 + // *** prefix2 + // **** prefix3 + // ***** rsa4 + // ** preim5 + // ** rsa6 + // ** ed7 + + auto const rsa4Msg = "P3P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x18, 0xae, 0x0c, 0x01, 0x9b, 0xdd, 0x7d, 0x70, 0x97, 0x26, 0xae, + 0x8e, 0x4b, 0x3e, 0x19, 0xce, 0x9a, 0x11, 0x60, 0x2a, 0xb2, 0x43, + 0x4f, 0xe6, 0xe5, 0xc0, 0xa1, 0x3f, 0xa8, 0xfd, 0x89, 0xfd, 0xe8, + 0x02, 0xfe, 0x1b, 0x41, 0x03, 0xe7, 0xc3, 0x15, 0xe6, 0x47, 0xa6, + 0xb3, 0x15, 0x27, 0xfa, 0xe2, 0x81, 0x73, 0xf3, 0x48, 0x6e, 0x90, + 0x07, 0x6d, 0x2d, 0xf4, 0x8e, 0xba, 0xea, 0x60, 0x4b, 0x31, 0xf4, + 0xe4, 0xce, 0x0f, 0x9f, 0x9c, 0xbc, 0xe8, 0xd8, 0x73, 0xab, 0xcb, + 0xa2, 0xa4, 0xe4, 0xed, 0xd5, 0xd1, 0x5b, 0xe3, 0x72, 0x8d, 0x93, + 0xbd, 0xe6, 0x0a, 0x35, 0x22, 0x07, 0x66, 0x7c, 0x9f, 0x67, 0x49, + 0x24, 0xd9, 0x7d, 0xad, 0x83, 0x94, 0xcc, 0x8d, 0xac, 0x99, 0x21, + 0xfe, 0x79, 0x06, 0x42, 0x61, 0x18, 0x5a, 0xa3, 0x76, 0x8c, 0x60, + 0x3c, 0x71, 0x11, 0x43, 0xe8, 0x8e, 0xe2, 0x10, 0x0c, 0xcb, 0x9a, + 0x6a, 0x14, 0xe5, 0x7d, 0x98, 0x16, 0x56, 0x0b, 0x5c, 0x28, 0x8f, + 0xbe, 0x4d, 0x19, 0x70, 0xb9, 0x33, 0xab, 0xfb, 0x31, 0xe6, 0xc6, + 0x8c, 0x1d, 0x22, 0x83, 0x5e, 0x7b, 0xda, 0x60, 0x74, 0xbc, 0x86, + 0x87, 0x24, 0xd0, 0x55, 0x6c, 0xe1, 0x54, 0x75, 0x6b, 0x23, 0x15, + 0x81, 0x18, 0x6f, 0x0b, 0x43, 0x90, 0xa5, 0x0e, 0x2e, 0xf8, 0xeb, + 0xaa, 0xff, 0x77, 0x26, 0x4e, 0xad, 0x60, 0x07, 0x40, 0x72, 0x23, + 0x7e, 0x71, 0xa0, 0x40, 0xc7, 0x33, 0xac, 0x93, 0x5f, 0x72, 0x7b, + 0x9c, 0x0c, 0xe0, 0x3f, 0x99, 0x1a, 0xe8, 0xd1, 0x2d, 0xb6, 0x4f, + 0x40, 0x01, 0x26, 0x9f, 0x5e, 0x90, 0xda, 0xfc, 0xf4, 0x42, 0x23, + 0xf1, 0x0c, 0xf6, 0xd3, 0x0f, 0xd0, 0x90, 0x0d, 0x09, 0xcb, 0x68, + 0x8c, 0xc2, 0xee, 0xbb, 0x61, 0x5a, 0xaf, 0x74, 0xd0, 0x9f, 0x63, + 0x2d, 0x8d, 0x64}}; + auto const prefix3Prefix = "P3"s; + auto const prefix3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3MaxMsgLength = 30; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim5Preimage = "I am root"s; + auto const preim5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 0x40, 0xe4, 0x52, 0x30, + 0x42, 0x74, 0xfd, 0x35, 0x04, 0xde, 0x45, 0x68, 0xb3, 0x22, 0xdd, + 0xff, 0x41, 0x43, 0x69, 0x33, 0xc0, 0xff, 0x35, 0xb6, 0x6d, 0x15, + 0xe9, 0x54, 0x15, 0xeb, 0x1d, 0x07, 0xe2, 0x25, 0x2b, 0xdb, 0xaa, + 0x16, 0x8d, 0x0d, 0x7f, 0x05, 0xf0, 0xd2, 0x7d, 0xb4, 0x9b, 0x51, + 0x19, 0x20, 0x1e, 0x3d, 0xba, 0x50, 0x9e, 0x51, 0x13, 0x81, 0x43, + 0x55, 0x96, 0xca, 0xdb, 0x88, 0x1f, 0xef, 0x2d, 0x38, 0x3f, 0xae, + 0x8d, 0xac, 0xc8, 0x6f, 0x2b, 0xd5, 0xf0, 0x34, 0x1a, 0x99, 0x00, + 0x7c, 0x6d, 0xb3, 0x1b, 0x1d, 0x68, 0xdb, 0xf8, 0x1c, 0x59, 0x3a, + 0x63, 0x38, 0x7c, 0x1c, 0x14, 0xbc, 0x22, 0xcf, 0xc8, 0x9a, 0xc6, + 0x96, 0x6f, 0x3d, 0x03, 0x0b, 0x61, 0x6b, 0x7d, 0x75, 0x97, 0xe8, + 0x25, 0xb8, 0x2f, 0xfa, 0xf4, 0x07, 0x44, 0xdf, 0x00, 0x3d, 0xff, + 0x0d, 0xd5, 0x7f, 0x7f, 0xf3, 0x0c, 0x13, 0xac, 0x8d, 0xf8, 0x8c, + 0x79, 0xc5, 0xf3, 0x29, 0xdc, 0x23, 0x65, 0xd3, 0xd1, 0x1c, 0xa6, + 0x14, 0x78, 0x6a, 0x1a, 0xe3, 0x15, 0x8d, 0x8b, 0xdc, 0xa0, 0x5a, + 0xc7, 0x82, 0xb0, 0x03, 0x6c, 0x71, 0x43, 0x59, 0x24, 0xc7, 0x50, + 0x64, 0xb2, 0xa7, 0x69, 0xf5, 0xbd, 0xe6, 0x5e, 0xaa, 0x77, 0x59, + 0x60, 0x36, 0xc0, 0xe3, 0x42, 0x7f, 0x05, 0x3b, 0x4c, 0x02, 0x0e, + 0x70, 0x5a, 0x70, 0xc5, 0x2a, 0xeb, 0x94, 0x4d, 0x15, 0x09, 0xef, + 0xbb, 0x58, 0x42, 0x68, 0x05, 0x59, 0x70, 0xa0, 0x17, 0xb2, 0x8e, + 0xdf, 0x7b, 0x40, 0x5d, 0x21, 0x1e, 0xfe, 0x62, 0x58, 0xde, 0xfb, + 0x14, 0x91, 0x18, 0xf3, 0x4f, 0x9b, 0x36, 0x55, 0xcf, 0xb3, 0x5e, + 0xec, 0x4f, 0xcc, 0x6d, 0x13, 0x58, 0xc8, 0xa3, 0xa3, 0xee, 0x23, + 0x8a, 0xc2, 0xbf}}; + std::array const rsa6Sig{ + {0x53, 0x34, 0x07, 0xeb, 0x9f, 0x85, 0xcd, 0xf4, 0xa4, 0xa3, 0xde, + 0xbc, 0x9c, 0xc2, 0x6c, 0xf6, 0x97, 0x38, 0x83, 0xf7, 0x94, 0x80, + 0x77, 0x3b, 0xd2, 0xfb, 0xc9, 0x99, 0x29, 0x60, 0xf0, 0x09, 0xe5, + 0x87, 0x5f, 0x32, 0x61, 0x68, 0x9b, 0xd5, 0x69, 0x76, 0x74, 0x32, + 0x54, 0xf9, 0xba, 0x00, 0x37, 0x14, 0x1a, 0x78, 0x2c, 0x94, 0x20, + 0xd4, 0xd2, 0x3c, 0xd4, 0xf7, 0x28, 0xe4, 0xf1, 0x56, 0x34, 0x0a, + 0x84, 0xef, 0xf0, 0x27, 0x31, 0x5a, 0x9e, 0x33, 0x21, 0x23, 0xa3, + 0xc0, 0x56, 0x12, 0x33, 0xfe, 0x26, 0x89, 0x38, 0xca, 0x2c, 0x3d, + 0x06, 0x3d, 0x9c, 0x3b, 0xd0, 0x9f, 0xde, 0x5e, 0xd3, 0x29, 0x58, + 0x9e, 0xd4, 0x4f, 0x58, 0xf7, 0x27, 0x3d, 0x05, 0xf0, 0xcd, 0x52, + 0x21, 0xad, 0x33, 0x29, 0xb6, 0x0e, 0xe2, 0x20, 0x86, 0x54, 0xa6, + 0x44, 0xd6, 0x32, 0x37, 0xe0, 0xb2, 0xc5, 0x2f, 0xf4, 0x74, 0x7b, + 0x8f, 0xb8, 0x4a, 0xa4, 0xba, 0x72, 0x24, 0x43, 0xe1, 0x09, 0xfe, + 0x22, 0x65, 0x3b, 0xd0, 0x82, 0x52, 0x3f, 0x36, 0x4d, 0xda, 0xe8, + 0x49, 0x07, 0xcf, 0xe6, 0xd2, 0x59, 0x5d, 0x99, 0x99, 0x85, 0xc6, + 0x48, 0xea, 0x9c, 0x23, 0x3f, 0x03, 0xbf, 0xce, 0xd0, 0xe8, 0xc6, + 0x67, 0x78, 0x03, 0x57, 0xbb, 0x21, 0x2f, 0x56, 0x01, 0x53, 0xe6, + 0x30, 0x63, 0x2f, 0xf5, 0x37, 0x0d, 0x0f, 0xcf, 0x43, 0x62, 0xba, + 0x5e, 0xa8, 0xd2, 0xf4, 0x9c, 0x34, 0xac, 0xdd, 0x31, 0xba, 0x52, + 0x41, 0x9c, 0xe2, 0x1e, 0x12, 0x12, 0xd3, 0xd4, 0xdc, 0xac, 0x04, + 0x06, 0x1f, 0x52, 0xb5, 0x74, 0xe7, 0xcf, 0xc2, 0xed, 0x5f, 0x5e, + 0x0f, 0x41, 0x10, 0x12, 0x90, 0x59, 0x7c, 0x43, 0x8a, 0xd2, 0x79, + 0x0d, 0x6a, 0x01, 0x5c, 0x6b, 0x14, 0xa7, 0x99, 0x29, 0xf2, 0xe3, + 0x65, 0xfe, 0xd5}}; + auto const ed7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed7PublicKey{ + {0x58, 0xcf, 0x4b, 0xc5, 0x59, 0xdb, 0xba, 0x62, 0x25, 0x14, 0x3a, + 0xc0, 0xad, 0xab, 0x5e, 0x35, 0xa1, 0xb4, 0x0e, 0xc1, 0xaf, 0x3c, + 0xa8, 0x2f, 0x69, 0x2c, 0xb6, 0x25, 0xd7, 0xea, 0x15, 0xb3}}; + std::array const ed7Sig{ + {0xd0, 0xd1, 0x17, 0xe2, 0xb5, 0x40, 0x14, 0x81, 0x0b, 0x12, 0xd8, + 0xbe, 0x1d, 0x1c, 0xb0, 0x88, 0x27, 0xaf, 0x6e, 0xc3, 0x13, 0x71, + 0xea, 0xac, 0xf3, 0xd8, 0x6f, 0x38, 0x21, 0xe2, 0x6d, 0x77, 0xe9, + 0xa6, 0xba, 0x03, 0x2a, 0xe3, 0x50, 0xcb, 0x38, 0xbe, 0x36, 0xba, + 0x62, 0x6e, 0x37, 0x5c, 0x8d, 0x69, 0x9f, 0xf0, 0x43, 0x64, 0x83, + 0x82, 0x8e, 0xbe, 0xf5, 0xa6, 0x96, 0x35, 0xb7, 0x03}}; + std::array const ed7SigningKey{ + {0x9c, 0x02, 0x4b, 0x5e, 0x6a, 0x83, 0x35, 0x8a, 0x2a, 0x71, 0x70, + 0x4e, 0xab, 0x74, 0x72, 0x22, 0x33, 0x5a, 0x82, 0xd9, 0x8e, 0x9c, + 0x8c, 0x41, 0x62, 0x6b, 0x02, 0x62, 0xbd, 0x59, 0x31, 0xcb}}; + (void)ed7SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix11CondConditionFingerprint = { + {0xca, 0xa4, 0xd7, 0xc4, 0xe6, 0xb5, 0x04, 0x7f, 0x5e, 0x68, 0x00, + 0xe6, 0xc9, 0x74, 0xdf, 0x7c, 0x4a, 0xb8, 0xa8, 0xcd, 0x08, 0x91, + 0xc4, 0x08, 0x31, 0xc4, 0x87, 0xda, 0x96, 0xcd, 0xe6, 0x7d}}; + Condition const Prefix11Cond{Type::prefixSha256, + 68671, + Prefix11CondConditionFingerprint, + std::bitset<5>{8}}; + std::array const Thresh15CondConditionFingerprint = { + {0xe4, 0x99, 0xf9, 0xf9, 0x59, 0x6f, 0x60, 0x5f, 0x8f, 0xda, 0xa9, + 0x49, 0x9d, 0xf0, 0xf8, 0xd4, 0x95, 0x00, 0x23, 0xb7, 0x66, 0xaf, + 0x26, 0xb6, 0x2f, 0xee, 0x3f, 0xe0, 0x87, 0xd9, 0x92, 0x5b}}; + Condition const Thresh15Cond{Type::thresholdSha256, + 135168, + Thresh15CondConditionFingerprint, + std::bitset<5>{25}}; + + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + auto prefix3 = std::make_unique( + makeSlice(prefix3Prefix), prefix3MaxMsgLength, std::move(rsa4)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(prefix3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim5 = + std::make_unique(makeSlice(preim5Preimage)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + auto ed7 = std::make_unique(ed7PublicKey, ed7Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim5)); + thresh0Subfulfillments.emplace_back(std::move(rsa6)); + thresh0Subfulfillments.emplace_back(std::move(ed7)); + std::vector thresh0Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Prefix11Cond, Thresh15Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x92\xa0\x82\x04\xb8\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x82\x02\x35\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x82\x02\x2a\xa1\x82\x02\x26\x80\x02\x50\x32\x81" + "\x01\x1c\xa2\x82\x02\x1b\xa1\x82\x02\x17\x80\x02\x50\x33\x81" + "\x01\x1e\xa2\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xbe" + "\x09\xc5\xa4\x27\x29\xdf\xd4\x67\x76\xbe\xbf\x2c\xf3\xa2\x0b" + "\x42\xe4\xbf\xeb\xdd\x67\x20\xfb\x7a\x27\x93\xc0\x78\x47\x78" + "\xd7\x15\x32\xee\x38\x81\x0d\x36\xa2\xc4\x65\x44\xe6\x62\x26" + "\xb9\x58\x13\xa4\x15\x82\xab\xb1\x16\x61\xfc\x01\x98\xc6\x1a" + "\x69\xc6\xba\x39\x3f\x01\x55\x3d\xd7\x8e\x14\x42\x6d\x78\x74" + "\x9b\x28\xcb\x31\x39\x98\x5a\x11\xdc\xc1\x18\x9d\x8d\xb0\xcd" + "\x1b\x4c\x10\xab\x14\x64\x19\xf1\x33\x15\x45\xc8\x92\x82\x03" + "\x82\x8a\xaa\xad\x94\xfc\x24\x11\x96\x99\x7e\x94\x5a\x82\x57" + "\x68\x61\x9f\x7b\x45\xe0\x99\x9e\x4f\x32\x50\x5f\x05\xc8\x11" + "\xae\xc4\x0c\x63\x18\x0e\x02\x59\x36\x25\x92\x06\x32\xc7\x71" + "\x47\x99\xcc\x0a\x6e\x0a\x58\x71\x3f\x5e\xb7\x78\xf7\x98\x79" + "\xdf\x74\xa4\xeb\xa9\x00\xfd\x81\xb3\xcf\x04\x8c\x5d\x7d\xe7" + "\xb2\x82\x90\x49\xbd\x69\xf3\x08\xe9\x92\xc6\x9e\x41\xba\x74" + "\xd8\x8d\x81\x97\x6f\x86\xab\xc9\xf1\x02\x31\xb4\xce\x47\xb0" + "\x39\xc8\xba\x51\xa7\x39\xf3\x71\xa2\x25\x27\x37\x6e\x09\x6f" + "\x19\x59\xbc\x65\xd9\xcd\x12\xd3\x2c\xa2\x78\xfa\x23\x15\x1a" + "\x82\x41\x91\x1b\xbe\x8a\xe7\xfe\x3c\x3c\x30\x32\xaa\xe9\xf3" + "\x81\x82\x01\x00\x18\xae\x0c\x01\x9b\xdd\x7d\x70\x97\x26\xae" + "\x8e\x4b\x3e\x19\xce\x9a\x11\x60\x2a\xb2\x43\x4f\xe6\xe5\xc0" + "\xa1\x3f\xa8\xfd\x89\xfd\xe8\x02\xfe\x1b\x41\x03\xe7\xc3\x15" + "\xe6\x47\xa6\xb3\x15\x27\xfa\xe2\x81\x73\xf3\x48\x6e\x90\x07" + "\x6d\x2d\xf4\x8e\xba\xea\x60\x4b\x31\xf4\xe4\xce\x0f\x9f\x9c" + "\xbc\xe8\xd8\x73\xab\xcb\xa2\xa4\xe4\xed\xd5\xd1\x5b\xe3\x72" + "\x8d\x93\xbd\xe6\x0a\x35\x22\x07\x66\x7c\x9f\x67\x49\x24\xd9" + "\x7d\xad\x83\x94\xcc\x8d\xac\x99\x21\xfe\x79\x06\x42\x61\x18" + "\x5a\xa3\x76\x8c\x60\x3c\x71\x11\x43\xe8\x8e\xe2\x10\x0c\xcb" + "\x9a\x6a\x14\xe5\x7d\x98\x16\x56\x0b\x5c\x28\x8f\xbe\x4d\x19" + "\x70\xb9\x33\xab\xfb\x31\xe6\xc6\x8c\x1d\x22\x83\x5e\x7b\xda" + "\x60\x74\xbc\x86\x87\x24\xd0\x55\x6c\xe1\x54\x75\x6b\x23\x15" + "\x81\x18\x6f\x0b\x43\x90\xa5\x0e\x2e\xf8\xeb\xaa\xff\x77\x26" + "\x4e\xad\x60\x07\x40\x72\x23\x7e\x71\xa0\x40\xc7\x33\xac\x93" + "\x5f\x72\x7b\x9c\x0c\xe0\x3f\x99\x1a\xe8\xd1\x2d\xb6\x4f\x40" + "\x01\x26\x9f\x5e\x90\xda\xfc\xf4\x42\x23\xf1\x0c\xf6\xd3\x0f" + "\xd0\x90\x0d\x09\xcb\x68\x8c\xc2\xee\xbb\x61\x5a\xaf\x74\xd0" + "\x9f\x63\x2d\x8d\x64\xa3\x82\x02\x08\x80\x82\x01\x00\xd0\x07" + "\xfc\x9d\xb0\xa1\xa6\x40\xe4\x52\x30\x42\x74\xfd\x35\x04\xde" + "\x45\x68\xb3\x22\xdd\xff\x41\x43\x69\x33\xc0\xff\x35\xb6\x6d" + "\x15\xe9\x54\x15\xeb\x1d\x07\xe2\x25\x2b\xdb\xaa\x16\x8d\x0d" + "\x7f\x05\xf0\xd2\x7d\xb4\x9b\x51\x19\x20\x1e\x3d\xba\x50\x9e" + "\x51\x13\x81\x43\x55\x96\xca\xdb\x88\x1f\xef\x2d\x38\x3f\xae" + "\x8d\xac\xc8\x6f\x2b\xd5\xf0\x34\x1a\x99\x00\x7c\x6d\xb3\x1b" + "\x1d\x68\xdb\xf8\x1c\x59\x3a\x63\x38\x7c\x1c\x14\xbc\x22\xcf" + "\xc8\x9a\xc6\x96\x6f\x3d\x03\x0b\x61\x6b\x7d\x75\x97\xe8\x25" + "\xb8\x2f\xfa\xf4\x07\x44\xdf\x00\x3d\xff\x0d\xd5\x7f\x7f\xf3" + "\x0c\x13\xac\x8d\xf8\x8c\x79\xc5\xf3\x29\xdc\x23\x65\xd3\xd1" + "\x1c\xa6\x14\x78\x6a\x1a\xe3\x15\x8d\x8b\xdc\xa0\x5a\xc7\x82" + "\xb0\x03\x6c\x71\x43\x59\x24\xc7\x50\x64\xb2\xa7\x69\xf5\xbd" + "\xe6\x5e\xaa\x77\x59\x60\x36\xc0\xe3\x42\x7f\x05\x3b\x4c\x02" + "\x0e\x70\x5a\x70\xc5\x2a\xeb\x94\x4d\x15\x09\xef\xbb\x58\x42" + "\x68\x05\x59\x70\xa0\x17\xb2\x8e\xdf\x7b\x40\x5d\x21\x1e\xfe" + "\x62\x58\xde\xfb\x14\x91\x18\xf3\x4f\x9b\x36\x55\xcf\xb3\x5e" + "\xec\x4f\xcc\x6d\x13\x58\xc8\xa3\xa3\xee\x23\x8a\xc2\xbf\x81" + "\x82\x01\x00\x53\x34\x07\xeb\x9f\x85\xcd\xf4\xa4\xa3\xde\xbc" + "\x9c\xc2\x6c\xf6\x97\x38\x83\xf7\x94\x80\x77\x3b\xd2\xfb\xc9" + "\x99\x29\x60\xf0\x09\xe5\x87\x5f\x32\x61\x68\x9b\xd5\x69\x76" + "\x74\x32\x54\xf9\xba\x00\x37\x14\x1a\x78\x2c\x94\x20\xd4\xd2" + "\x3c\xd4\xf7\x28\xe4\xf1\x56\x34\x0a\x84\xef\xf0\x27\x31\x5a" + "\x9e\x33\x21\x23\xa3\xc0\x56\x12\x33\xfe\x26\x89\x38\xca\x2c" + "\x3d\x06\x3d\x9c\x3b\xd0\x9f\xde\x5e\xd3\x29\x58\x9e\xd4\x4f" + "\x58\xf7\x27\x3d\x05\xf0\xcd\x52\x21\xad\x33\x29\xb6\x0e\xe2" + "\x20\x86\x54\xa6\x44\xd6\x32\x37\xe0\xb2\xc5\x2f\xf4\x74\x7b" + "\x8f\xb8\x4a\xa4\xba\x72\x24\x43\xe1\x09\xfe\x22\x65\x3b\xd0" + "\x82\x52\x3f\x36\x4d\xda\xe8\x49\x07\xcf\xe6\xd2\x59\x5d\x99" + "\x99\x85\xc6\x48\xea\x9c\x23\x3f\x03\xbf\xce\xd0\xe8\xc6\x67" + "\x78\x03\x57\xbb\x21\x2f\x56\x01\x53\xe6\x30\x63\x2f\xf5\x37" + "\x0d\x0f\xcf\x43\x62\xba\x5e\xa8\xd2\xf4\x9c\x34\xac\xdd\x31" + "\xba\x52\x41\x9c\xe2\x1e\x12\x12\xd3\xd4\xdc\xac\x04\x06\x1f" + "\x52\xb5\x74\xe7\xcf\xc2\xed\x5f\x5e\x0f\x41\x10\x12\x90\x59" + "\x7c\x43\x8a\xd2\x79\x0d\x6a\x01\x5c\x6b\x14\xa7\x99\x29\xf2" + "\xe3\x65\xfe\xd5\xa4\x64\x80\x20\x58\xcf\x4b\xc5\x59\xdb\xba" + "\x62\x25\x14\x3a\xc0\xad\xab\x5e\x35\xa1\xb4\x0e\xc1\xaf\x3c" + "\xa8\x2f\x69\x2c\xb6\x25\xd7\xea\x15\xb3\x81\x40\xd0\xd1\x17" + "\xe2\xb5\x40\x14\x81\x0b\x12\xd8\xbe\x1d\x1c\xb0\x88\x27\xaf" + "\x6e\xc3\x13\x71\xea\xac\xf3\xd8\x6f\x38\x21\xe2\x6d\x77\xe9" + "\xa6\xba\x03\x2a\xe3\x50\xcb\x38\xbe\x36\xba\x62\x6e\x37\x5c" + "\x8d\x69\x9f\xf0\x43\x64\x83\x82\x8e\xbe\xf5\xa6\x96\x35\xb7" + "\x03\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b" + "\x80\x20\xca\xa4\xd7\xc4\xe6\xb5\x04\x7f\x5e\x68\x00\xe6\xc9" + "\x74\xdf\x7c\x4a\xb8\xa8\xcd\x08\x91\xc4\x08\x31\xc4\x87\xda" + "\x96\xcd\xe6\x7d\x81\x03\x01\x0c\x3f\x82\x02\x04\x10\xa2\x2b" + "\x80\x20\xe4\x99\xf9\xf9\x59\x6f\x60\x5f\x8f\xda\xa9\x49\x9d" + "\xf0\xf8\xd4\x95\x00\x23\xb7\x66\xaf\x26\xb6\x2f\xee\x3f\xe0" + "\x87\xd9\x92\x5b\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27" + "\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e" + "\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f" + "\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b" + "\xe6\x62\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda" + "\x09\xbe\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa" + "\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xe0\xdf\x1e\xf6\x3f\x23\x76\x8d\xeb\x6f\xf1" + "\x98\x70\x8b\x9f\xa6\x68\xce\x85\x85\x41\x2b\xee\x19\xae\xde" + "\x9b\x39\xa3\xbe\xbb\x60\x81\x03\x07\x40\x5a\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x18\x29\x6b\x75\xb4\x91\xf8\xa2\x50\xdb\xfa\x69" + "\x25\x3f\x8c\x49\x02\x8d\xa8\x49\xb0\x35\xc2\x83\x45\x78\x89" + "\x60\xd4\x01\x0b\xb2\x81\x03\x01\x0c\x5a\x82\x02\x04\x10\xa1" + "\x2b\x80\x20\xca\xa4\xd7\xc4\xe6\xb5\x04\x7f\x5e\x68\x00\xe6" + "\xc9\x74\xdf\x7c\x4a\xb8\xa8\xcd\x08\x91\xc4\x08\x31\xc4\x87" + "\xda\x96\xcd\xe6\x7d\x81\x03\x01\x0c\x3f\x82\x02\x04\x10\xa2" + "\x2b\x80\x20\xe4\x99\xf9\xf9\x59\x6f\x60\x5f\x8f\xda\xa9\x49" + "\x9d\xf0\xf8\xd4\x95\x00\x23\xb7\x66\xaf\x26\xb6\x2f\xee\x3f" + "\xe0\x87\xd9\x92\x5b\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88" + "\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb" + "\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xee" + "\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c" + "\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2" + "\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4" + "\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79" + "\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d" + "\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0" + "\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh32() + { + testcase("Thresh32"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim19Cond + // ** Rsa20Cond + // ** Ed21Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** rsa4 + // ** prefix5 + // *** prefix6 + // **** thresh7 + // ***** rsa8 + // ** thresh9 + // *** Preim16Cond + // *** Rsa17Cond + // *** Ed18Cond + // *** rsa10 + // *** thresh11 + // **** Preim13Cond + // **** Rsa14Cond + // **** Ed15Cond + // **** rsa12 + + auto const rsa4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x2a, 0xa2, 0x5f, 0xb6, 0x10, 0x69, 0x6b, 0xb9, 0xb2, 0xc8, 0xd4, + 0x4f, 0xb0, 0x4a, 0x25, 0xf1, 0xd9, 0x48, 0x2a, 0xf3, 0x87, 0x38, + 0x02, 0xc9, 0x83, 0x42, 0x13, 0x53, 0x8e, 0x81, 0xa6, 0xfb, 0x7c, + 0x74, 0x9a, 0x9c, 0x24, 0xbc, 0xd3, 0x82, 0xb4, 0xf6, 0x5d, 0xc7, + 0xb1, 0xef, 0x2b, 0x41, 0xc5, 0x84, 0x8d, 0x3e, 0x24, 0x2b, 0xca, + 0xe7, 0x25, 0xfa, 0x22, 0xf9, 0x1b, 0x99, 0x8d, 0xa5, 0xc2, 0x57, + 0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69, 0x79, 0xe3, 0x72, 0xdd, + 0x30, 0xfc, 0xe7}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const rsa8Msg = "P6P5abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa8PublicKey{ + {0xb7, 0xf9, 0xf2, 0x4e, 0xc8, 0xd9, 0x79, 0xcb, 0x92, 0xdb, 0x0d, + 0x2d, 0x81, 0x30, 0x23, 0x20, 0xc1, 0x2f, 0x97, 0xd1, 0x90, 0x5e, + 0x52, 0x73, 0x04, 0x8d, 0x23, 0x6b, 0x9c, 0xe9, 0x7f, 0xb0, 0xda, + 0x3a, 0x75, 0x84, 0x60, 0xd2, 0xac, 0x55, 0xc5, 0x2a, 0x8e, 0x25, + 0x17, 0x64, 0x3e, 0x0d, 0x0f, 0x1f, 0x9c, 0x1d, 0x04, 0xfe, 0x36, + 0x26, 0xb7, 0x4b, 0xeb, 0xed, 0xa4, 0x73, 0x25, 0x86, 0x45, 0xa1, + 0x34, 0x33, 0xf3, 0xdd, 0x06, 0xd1, 0x8a, 0xc8, 0x9d, 0x00, 0x69, + 0xf2, 0x72, 0x7f, 0x00, 0x28, 0x08, 0x7b, 0x8b, 0x31, 0x1c, 0xf3, + 0xd3, 0x3f, 0x46, 0xc6, 0xc6, 0xa7, 0x29, 0x89, 0xbc, 0x85, 0x1e, + 0xb8, 0x01, 0x8e, 0xe1, 0xf2, 0x6e, 0xe3, 0x08, 0xa8, 0x4d, 0x7d, + 0x6c, 0x0f, 0x67, 0x1b, 0x1d, 0xbf, 0x88, 0xbe, 0x0b, 0x0e, 0x6f, + 0x20, 0xa8, 0xff, 0x2c, 0xea, 0x04, 0xb3, 0x95, 0xe4, 0x2d, 0xb3, + 0x72, 0xcf, 0xd7, 0x09, 0xca, 0xc9, 0x71, 0x41, 0x6c, 0x12, 0x91, + 0x16, 0x2a, 0x25, 0xb4, 0x2c, 0x5d, 0x6b, 0xdf, 0x39, 0x02, 0xd7, + 0xf7, 0xd8, 0xbd, 0x2a, 0xac, 0x8a, 0xcb, 0x40, 0x75, 0x16, 0x1e, + 0xbf, 0xd3, 0x87, 0x47, 0x21, 0x0d, 0xcb, 0x8a, 0xe3, 0x45, 0x8f, + 0x1d, 0xad, 0x13, 0xfc, 0xe5, 0x14, 0xf2, 0xea, 0x3d, 0x14, 0x30, + 0x5a, 0x47, 0xce, 0xb1, 0xe1, 0x53, 0xae, 0x1f, 0x0b, 0x9a, 0x2f, + 0xe1, 0x15, 0x58, 0x71, 0x1d, 0xbd, 0x89, 0xdd, 0xb1, 0x01, 0x08, + 0xe3, 0x5b, 0x9c, 0x5a, 0x50, 0x96, 0x50, 0x70, 0x6f, 0x5a, 0x54, + 0xce, 0x0c, 0x7a, 0xb6, 0x1a, 0xbc, 0xd1, 0xe3, 0x23, 0xe3, 0xe8, + 0xb6, 0x9d, 0xbe, 0xa9, 0x2f, 0x82, 0x23, 0xcc, 0x46, 0x2e, 0xe9, + 0xe4, 0xa2, 0xdd, 0x4b, 0xff, 0x55, 0x56, 0x78, 0x53, 0xdc, 0xf1, + 0x5a, 0xfe, 0x53}}; + std::array const rsa8Sig{ + {0x9e, 0x64, 0x0a, 0x26, 0xf0, 0x75, 0xc8, 0x22, 0x26, 0x60, 0x57, + 0x32, 0x09, 0x23, 0x34, 0xa3, 0xd9, 0xa7, 0x3d, 0xd5, 0x0f, 0xe0, + 0x78, 0xa7, 0xe3, 0x28, 0x81, 0x66, 0x89, 0x75, 0x9d, 0x7a, 0x72, + 0xf6, 0x7d, 0x39, 0x1a, 0xd5, 0xce, 0xfc, 0xd8, 0x46, 0x8f, 0xea, + 0x75, 0x6a, 0xe6, 0x12, 0xa2, 0x9a, 0xc8,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ea, 0xb2, 0xf0, 0x4d, 0x51, 0x3b, 0x3b, 0x28, 0x2e, 0xfb, 0x65, + 0x35, 0x0c, 0xec, 0x32, 0x48, 0xdb, 0x15, 0x0e, 0xde, 0xb0, 0xe9, + 0x3b, 0xcf, 0xd2}}; + auto const thresh7Msg = "P6P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6Prefix = "P6"s; + auto const prefix6Msg = "P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6MaxMsgLength = 28; + auto const prefix5Prefix = "P5"s; + auto const prefix5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix5MaxMsgLength = 26; + auto const rsa10Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa10PublicKey{ + {0x9f, 0x01, 0x7b, 0x87, 0xfd, 0xbe, 0xa0, 0x02, 0x77, 0x00, 0x19, + 0x7f, 0x2f, 0xde, 0x80, 0xab, 0xdc, 0xd0, 0x14, 0xe9, 0x63, 0xe5, + 0xd6, 0xfb, 0x2c, 0xcb, 0xb0, 0x70, 0x88, 0xbe, 0xcb, 0x6d, 0x8e, + 0x56, 0xf3, 0x02, 0x34, 0xae, 0xec, 0x30, 0xf7, 0x41, 0xcf, 0xe7, + 0x07, 0x80, 0x52, 0x04, 0xa1, 0x16, 0x51, 0x15, 0x07, 0xba, 0xdb, + 0xc6, 0xe8, 0xce, 0xa8, 0x8c, 0xa8, 0xb7, 0xaa, 0x4e, 0x08, 0x96, + 0xbd, 0x5f, 0xbd, 0x64, 0x0d, 0xe3, 0x88, 0xca, 0x7e, 0x1a, 0x20, + 0x1f, 0x65, 0x44, 0x3a, 0xc8, 0x2c, 0xc2, 0xdd, 0xc8, 0xc6, 0x9b, + 0x8f, 0x01, 0x8e, 0x36, 0xc5, 0x52, 0x5a, 0xb1, 0x1d, 0x1d, 0xc4, + 0xf0, 0x9f, 0xa9, 0x51, 0x4d, 0xe6, 0xeb, 0x36, 0x9c, 0x2e, 0x2d, + 0x08, 0x1c, 0xaf, 0x67, 0xed, 0x83, 0xbb, 0x67, 0x77, 0x83, 0x24, + 0x49, 0x97, 0x8c, 0x06, 0x0d, 0xca, 0x8b, 0x45, 0xf4, 0x2b, 0xff, + 0x94, 0x22, 0x7f, 0x04, 0x92, 0x81, 0xd6, 0xf5, 0x17, 0x7f, 0x41, + 0x2d, 0xc3, 0x4e, 0x86, 0x2a, 0x60, 0xc4, 0x0e, 0x74, 0xb0, 0x04, + 0x3c, 0x48, 0xe4, 0xd8, 0x09, 0xf6, 0x48, 0x35, 0x00, 0x09, 0xda, + 0xaa, 0x31, 0x2f, 0x8b, 0x5f, 0x6d, 0x4c, 0x48, 0x52, 0xb9, 0xd9, + 0x43, 0xe8, 0x1e, 0x22, 0x68, 0x80, 0xbe, 0xff, 0xee, 0x11, 0x3b, + 0x83, 0x47, 0xfd, 0xec, 0x6e, 0x1d, 0x9c, 0x7b, 0xd8, 0xe3, 0x2a, + 0x8b, 0xef, 0x2a, 0xb3, 0xa5, 0xc1, 0x78, 0x3c, 0x0b, 0x0e, 0x31, + 0xe6, 0x40, 0x80, 0xe1, 0xcb, 0x25, 0x56, 0xb3, 0x45, 0x7e, 0x65, + 0xb3, 0xd9, 0x1a, 0x8e, 0xf8, 0xb0, 0x65, 0x44, 0x89, 0x73, 0x90, + 0x0f, 0xe7, 0xcd, 0x1b, 0x68, 0x3b, 0xa4, 0x7a, 0x35, 0x41, 0xad, + 0xfd, 0x8e, 0xa8, 0x50, 0xe0, 0xf2, 0xab, 0x2d, 0xe2, 0x31, 0x39, + 0x82, 0x41, 0x4b}}; + std::array const rsa10Sig{ + {0x06, 0xd1, 0xd0, 0xc8, 0x4b, 0x80, 0x19, 0xea, 0xcb, 0xd2, 0xd1, + 0x02, 0x54, 0x15, 0x6a, 0x08, 0x36, 0x5c, 0x6c, 0xf6, 0x74, 0x23, + 0xd2, 0x65, 0xec, 0x72, 0xef, 0x9a, 0x0c, 0xfa, 0xb8, 0xd1, 0xb0, + 0xd4, 0x37, 0x1c, 0xd6, 0xdd, 0x3d, 0xa4, 0x2d, 0x67, 0xf0, 0xb9, + 0xfd, 0x61, 0x54, 0x20, 0x27, 0xc2, 0x5f, 0x9b, 0x50, 0x00, 0x96, + 0x28, 0x6a, 0xe0, 0x5e, 0xdf, 0x09, 0x23, 0xfd, 0x05, 0xf1, 0x21, + 0xf0, 0xc9, 0x9c, 0x9a, 0xc3, 0x7e, 0x05, 0x4e, 0x75, 0x3e, 0xb7, + 0x41, 0xe2, 0x06, 0xa0, 0xfe, 0x5a, 0x95, 0x11, 0x1c, 0x8f, 0x9c, + 0x98, 0x02, 0xd3, 0x76, 0xea, 0x8e, 0x50, 0x35, 0x0c, 0x25, 0xe6, + 0xe8, 0x97, 0xba, 0xf0, 0x18, 0x65, 0x31, 0x7b, 0x89, 0xea, 0xf7, + 0x13, 0x13, 0x93, 0x58, 0x0e, 0x18, 0x04, 0xd1, 0xe6, 0xb7, 0x74, + 0xf8, 0xb6, 0x85, 0x33, 0x5d, 0x87, 0x10, 0x76, 0x18, 0xa5, 0xb3, + 0x86, 0xb9, 0x43, 0x98, 0x4b, 0x5f, 0xcc, 0x78, 0xb3, 0x32, 0xab, + 0x5e, 0x74, 0xea, 0x34, 0xba, 0x9d, 0xda, 0x97, 0xe4, 0x29, 0xd8, + 0xfb, 0x78, 0x78, 0x28, 0x30, 0x5b, 0x1c, 0xfa, 0x19, 0x9b, 0x97, + 0x60, 0xaa, 0x92, 0x18, 0x9e, 0x40, 0x2b, 0x63, 0x9a, 0xab, 0xd5, + 0x9a, 0x0a, 0xc3, 0x33, 0x06, 0x6d, 0x1d, 0xbb, 0xb0, 0x32, 0x7e, + 0x31, 0x37, 0x80, 0xc8, 0x7c, 0xeb, 0xaf, 0x43, 0xd7, 0x6e, 0x60, + 0x10, 0x84, 0x9e, 0xca, 0xa2, 0xf8, 0x61, 0xcc, 0x65, 0x5f, 0x6f, + 0x1f, 0x68, 0xac, 0x45, 0xa6, 0xf9, 0x7b, 0xd5, 0x39, 0xdd, 0x66, + 0xa9, 0x47, 0xc9, 0x25, 0xba, 0xfc, 0x46, 0x60, 0x9d, 0x04, 0xee, + 0xb4, 0x6c, 0x04, 0x99, 0x26, 0xe5, 0x65, 0xab, 0x63, 0xa3, 0x3f, + 0x6c, 0xad, 0x44, 0x2a, 0x38, 0x1e, 0xe7, 0x27, 0x86, 0x87, 0xc3, + 0xe6, 0x87, 0x4b}}; + auto const rsa12Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa12PublicKey{ + {0xd9, 0x25, 0xc3, 0xba, 0x0a, 0x46, 0x6e, 0xa9, 0x1d, 0x05, 0xd7, + 0x54, 0xf1, 0xff, 0xf4, 0xaf, 0xe5, 0x13, 0xcf, 0xd6, 0x74, 0xb0, + 0xcf, 0xc2, 0x8c, 0x68, 0x5c, 0xa9, 0xf3, 0x44, 0x4b, 0xfd, 0x4a, + 0x4d, 0x29, 0x64, 0xbc, 0xa8, 0x98, 0xf5, 0x35, 0x0a, 0x65, 0xe5, + 0xcd, 0x5d, 0x08, 0x9f, 0x58, 0x22, 0xed, 0x21, 0x78, 0x04, 0x4d, + 0x2a, 0xce, 0x80, 0x33, 0x19, 0x5b, 0x7a, 0xbd, 0xa6, 0x89, 0xfa, + 0x80, 0xa4, 0xf5, 0x32, 0xa6, 0xb1, 0x34, 0x61, 0x55, 0x5a, 0xbd, + 0x05, 0xaf, 0x4b, 0x4b, 0xdf, 0xe0, 0xa9, 0x3e, 0x1d, 0x2f, 0x3e, + 0xaf, 0x0c, 0x65, 0x32, 0xc6, 0xf2, 0xe0, 0x5c, 0x09, 0xc0, 0xa2, + 0x41, 0xe6, 0xc9, 0x96, 0x5e, 0x88, 0x62, 0x4a, 0x28, 0x4b, 0x23, + 0x2f, 0xcf, 0xb3, 0xb7, 0x1e, 0x11, 0x7f, 0xc4, 0x63, 0x1a, 0xe4, + 0x24, 0x29, 0x46, 0xf4, 0x48, 0xde, 0x30, 0x45, 0x97, 0xf8, 0x6c, + 0x8d, 0x4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 0x91, 0x8a, 0xb7, 0x66, 0x94, 0xaf, 0x41, 0x8f, + 0x45, 0x5d, 0xa7, 0xe7, 0xbb, 0x2d, 0x15, 0xbc, 0x92, 0x5a, 0x0e, + 0x5c, 0xf8, 0x56}}; + auto const thresh11Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim13CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim13Cond{Type::preimageSha256, + 9, + Preim13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa14CondConditionFingerprint = { + {0x32, 0xec, 0xaa, 0x5e, 0xa6, 0x88, 0xdc, 0xe4, 0x81, 0x0f, 0x93, + 0x0f, 0x65, 0xde, 0x87, 0xfd, 0x54, 0x8c, 0x79, 0x04, 0x81, 0xe3, + 0x63, 0x3f, 0x3d, 0x08, 0xa1, 0xba, 0x0a, 0x24, 0x2b, 0x46}}; + Condition const Rsa14Cond{Type::rsaSha256, + 65536, + Rsa14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed15CondConditionFingerprint = { + {0x40, 0xd1, 0x9a, 0x63, 0x62, 0x9b, 0xc0, 0x76, 0xab, 0x11, 0x73, + 0x42, 0x86, 0xb3, 0x20, 0x9d, 0x23, 0xe8, 0x5e, 0xee, 0xb9, 0x82, + 0x5d, 0x93, 0xe3, 0xac, 0xad, 0xa0, 0x40, 0x41, 0x51, 0x1b}}; + Condition const Ed15Cond{Type::ed25519Sha256, + 131072, + Ed15CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim16CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim16Cond{Type::preimageSha256, + 9, + Preim16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa17CondConditionFingerprint = { + {0x78, 0xe3, 0x04, 0xf4, 0xa6, 0x16, 0x68, 0x4c, 0x1b, 0xcf, 0x3a, + 0x32, 0xff, 0xbc, 0x75, 0x1a, 0xe6, 0x08, 0x9b, 0xff, 0xba, 0x79, + 0xf4, 0x39, 0x7a, 0xfc, 0xe1, 0x6f, 0xff, 0x3e, 0xb3, 0x75}}; + Condition const Rsa17Cond{Type::rsaSha256, + 65536, + Rsa17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed18CondConditionFingerprint = { + {0x0d, 0xea, 0xc5, 0x16, 0x5c, 0x62, 0xb8, 0xd1, 0xa4, 0xe7, 0x5a, + 0x07, 0x58, 0x00, 0x79, 0x51, 0x88, 0x21, 0xe9, 0x4d, 0xba, 0x73, + 0x7b, 0xad, 0x60, 0x9c, 0x5c, 0x26, 0x00, 0x2e, 0xd1, 0x51}}; + Condition const Ed18Cond{Type::ed25519Sha256, + 131072, + Ed18CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + std::vector thresh3Subconditions{}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto rsa8 = std::make_unique( + makeSlice(rsa8PublicKey), makeSlice(rsa8Sig)); + std::vector> thresh7Subfulfillments; + thresh7Subfulfillments.emplace_back(std::move(rsa8)); + std::vector thresh7Subconditions{}; + auto thresh7 = std::make_unique( + std::move(thresh7Subfulfillments), std::move(thresh7Subconditions)); + auto prefix6 = std::make_unique( + makeSlice(prefix6Prefix), prefix6MaxMsgLength, std::move(thresh7)); + auto prefix5 = std::make_unique( + makeSlice(prefix5Prefix), prefix5MaxMsgLength, std::move(prefix6)); + auto rsa10 = std::make_unique( + makeSlice(rsa10PublicKey), makeSlice(rsa10Sig)); + auto rsa12 = std::make_unique( + makeSlice(rsa12PublicKey), makeSlice(rsa12Sig)); + std::vector> thresh11Subfulfillments; + thresh11Subfulfillments.emplace_back(std::move(rsa12)); + std::vector thresh11Subconditions{ + {Preim13Cond, Rsa14Cond, Ed15Cond}}; + auto thresh11 = std::make_unique( + std::move(thresh11Subfulfillments), + std::move(thresh11Subconditions)); + std::vector> thresh9Subfulfillments; + thresh9Subfulfillments.emplace_back(std::move(rsa10)); + thresh9Subfulfillments.emplace_back(std::move(thresh11)); + std::vector thresh9Subconditions{ + {Preim16Cond, Rsa17Cond, Ed18Cond}}; + auto thresh9 = std::make_unique( + std::move(thresh9Subfulfillments), std::move(thresh9Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix5)); + thresh0Subfulfillments.emplace_back(std::move(thresh9)); + std::vector thresh0Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x0a\x05\xa0\x82\x09\x86\xa1\x82\x02\x30\x80\x02\x50" + "\x31\x81\x01\x1a\xa2\x82\x02\x25\xa1\x82\x02\x21\x80\x02\x50" + "\x32\x81\x01\x1c\xa2\x82\x02\x16\xa2\x82\x02\x12\xa0\x82\x02" + "\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xbe\x09\xc5\xa4\x27\x29" + "\xdf\xd4\x67\x76\xbe\xbf\x2c\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd" + "\x67\x20\xfb\x7a\x27\x93\xc0\x78\x47\x78\xd7\x15\x32\xee\x38" + "\x81\x0d\x36\xa2\xc4\x65\x44\xe6\x62\x26\xb9\x58\x13\xa4\x15" + "\x82\xab\xb1\x16\x61\xfc\x01\x98\xc6\x1a\x69\xc6\xba\x39\x3f" + "\x01\x55\x3d\xd7\x8e\x14\x42\x6d\x78\x74\x9b\x28\xcb\x31\x39" + "\x98\x5a\x11\xdc\xc1\x18\x9d\x8d\xb0\xcd\x1b\x4c\x10\xab\x14" + "\x64\x19\xf1\x33\x15\x45\xc8\x92\x82\x03\x82\x8a\xaa\xad\x94" + "\xfc\x24\x11\x96\x99\x7e\x94\x5a\x82\x57\x68\x61\x9f\x7b\x45" + "\xe0\x99\x9e\x4f\x32\x50\x5f\x05\xc8\x11\xae\xc4\x0c\x63\x18" + "\x0e\x02\x59\x36\x25\x92\x06\x32\xc7\x71\x47\x99\xcc\x0a\x6e" + "\x0a\x58\x71\x3f\x5e\xb7\x78\xf7\x98\x79\xdf\x74\xa4\xeb\xa9" + "\x00\xfd\x81\xb3\xcf\x04\x8c\x5d\x7d\xe7\xb2\x82\x90\x49\xbd" + "\x69\xf3\x08\xe9\x92\xc6\x9e\x41\xba\x74\xd8\x8d\x81\x97\x6f" + "\x86\xab\xc9\xf1\x02\x31\xb4\xce\x47\xb0\x39\xc8\xba\x51\xa7" + "\x39\xf3\x71\xa2\x25\x27\x37\x6e\x09\x6f\x19\x59\xbc\x65\xd9" + "\xcd\x12\xd3\x2c\xa2\x78\xfa\x23\x15\x1a\x82\x41\x91\x1b\xbe" + "\x8a\xe7\xfe\x3c\x3c\x30\x32\xaa\xe9\xf3\x81\x82\x01\x00\x2a" + "\xa2\x5f\xb6\x10\x69\x6b\xb9\xb2\xc8\xd4\x4f\xb0\x4a\x25\xf1" + "\xd9\x48\x2a\xf3\x87\x38\x02\xc9\x83\x42\x13\x53\x8e\x81\xa6" + "\xfb\x7c\x74\x9a\x9c\x24\xbc\xd3\x82\xb4\xf6\x5d\xc7\xb1\xef" + "\x2b\x41\xc5\x84\x8d\x3e\x24\x2b\xca\xe7\x25\xfa\x22\xf9\x1b" + "\x99\x8d\xa5\xc2\x57\xef\xc9\x92\xbd\x20\x65\x40\x39\x7b\xc9" + "\xcf\x55\x11\xf0\x9c\x36\xdc\xc8\x8e\x02\x6e\xa6\x1d\x3d\xe7" + "\xb1\xd0\x60\x28\x7b\xbe\xcd\x3b\x51\x00\xce\x9b\x43\xc8\x26" + "\x7e\x82\xc3\x6a\xf6\x01\x6b\x4e\xc6\xe5\x4b\x8c\xcb\x3c\xff" + "\x21\x11\x8f\x5e\x54\xde\x1a\x25\xba\x5f\xe8\x33\xa5\xe6\x04" + "\x15\xf7\xd1\xd8\x9e\x2e\xce\xb3\x88\x82\x80\x75\xcc\x04\x52" + "\x41\x1a\x72\x8c\x56\x68\xd1\x48\x5c\xeb\xea\x1c\xa8\xe9\xa0" + "\x5c\x84\x00\x32\xc2\x0b\x90\xb4\xa6\x8c\x61\x3f\x72\xb5\x7e" + "\xe2\x2a\xad\x43\x42\xe5\x0a\xd2\xc3\x89\x72\x40\x11\x3b\x5a" + "\xed\x63\x03\xcc\x36\x48\x32\x01\xbe\x96\x25\x83\xa5\xcd\xbc" + "\x81\x95\xfa\xe0\x54\x35\xbd\x6d\x07\xf7\xae\x35\xc5\x05\x4d" + "\x55\x69\x09\xf2\x98\xbd\x83\x6c\xed\x2f\x15\x9c\xac\x6b\xe0" + "\x28\x85\x6f\x06\x0d\x5c\x11\x69\x79\xe3\x72\xdd\x30\xfc\xe7" + "\xa1\x00\xa1\x82\x02\x30\x80\x02\x50\x35\x81\x01\x1a\xa2\x82" + "\x02\x25\xa1\x82\x02\x21\x80\x02\x50\x36\x81\x01\x1c\xa2\x82" + "\x02\x16\xa2\x82\x02\x12\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80" + "\x82\x01\x00\xb7\xf9\xf2\x4e\xc8\xd9\x79\xcb\x92\xdb\x0d\x2d" + "\x81\x30\x23\x20\xc1\x2f\x97\xd1\x90\x5e\x52\x73\x04\x8d\x23" + "\x6b\x9c\xe9\x7f\xb0\xda\x3a\x75\x84\x60\xd2\xac\x55\xc5\x2a" + "\x8e\x25\x17\x64\x3e\x0d\x0f\x1f\x9c\x1d\x04\xfe\x36\x26\xb7" + "\x4b\xeb\xed\xa4\x73\x25\x86\x45\xa1\x34\x33\xf3\xdd\x06\xd1" + "\x8a\xc8\x9d\x00\x69\xf2\x72\x7f\x00\x28\x08\x7b\x8b\x31\x1c" + "\xf3\xd3\x3f\x46\xc6\xc6\xa7\x29\x89\xbc\x85\x1e\xb8\x01\x8e" + "\xe1\xf2\x6e\xe3\x08\xa8\x4d\x7d\x6c\x0f\x67\x1b\x1d\xbf\x88" + "\xbe\x0b\x0e\x6f\x20\xa8\xff\x2c\xea\x04\xb3\x95\xe4\x2d\xb3" + "\x72\xcf\xd7\x09\xca\xc9\x71\x41\x6c\x12\x91\x16\x2a\x25\xb4" + "\x2c\x5d\x6b\xdf\x39\x02\xd7\xf7\xd8\xbd\x2a\xac\x8a\xcb\x40" + "\x75\x16\x1e\xbf\xd3\x87\x47\x21\x0d\xcb\x8a\xe3\x45\x8f\x1d" + "\xad\x13\xfc\xe5\x14\xf2\xea\x3d\x14\x30\x5a\x47\xce\xb1\xe1" + "\x53\xae\x1f\x0b\x9a\x2f\xe1\x15\x58\x71\x1d\xbd\x89\xdd\xb1" + "\x01\x08\xe3\x5b\x9c\x5a\x50\x96\x50\x70\x6f\x5a\x54\xce\x0c" + "\x7a\xb6\x1a\xbc\xd1\xe3\x23\xe3\xe8\xb6\x9d\xbe\xa9\x2f\x82" + "\x23\xcc\x46\x2e\xe9\xe4\xa2\xdd\x4b\xff\x55\x56\x78\x53\xdc" + "\xf1\x5a\xfe\x53\x81\x82\x01\x00\x9e\x64\x0a\x26\xf0\x75\xc8" + "\x22\x26\x60\x57\x32\x09\x23\x34\xa3\xd9\xa7\x3d\xd5\x0f\xe0" + "\x78\xa7\xe3\x28\x81\x66\x89\x75\x9d\x7a\x72\xf6\x7d\x39\x1a" + "\xd5\xce\xfc\xd8\x46\x8f\xea\x75\x6a\xe6\x12\xa2\x9a\xc8\x7e" + "\x0a\x27\x72\x01\x63\x5b\xd3\x8f\x22\x3a\x0f\x21\xf3\x87\x76" + "\x5b\x8d\x12\x0f\x82\x0a\x3e\x0d\x17\x81\x6b\x56\xcc\x67\x8a" + "\x1f\x30\x2f\xea\xf8\x38\xd2\xa1\xe5\xab\xd2\x1e\x15\xe7\x11" + "\x4b\xb4\x61\x03\x24\x08\x0e\xbb\x55\xbe\x26\xbd\xfc\x8b\x5d" + "\xd3\x49\xac\xb6\x64\xa7\x96\x08\x34\x86\x9f\xc1\x08\x66\x3e" + "\xbf\x15\x4b\x0f\xda\xb2\x6b\x27\x57\x14\x02\xc4\xf8\x39\xc6" + "\xbd\xd5\x9b\x00\x39\xc4\xfa\x58\x77\x6b\x4d\x37\xc5\x5a\xac" + "\xc7\x52\x85\x31\xbf\xd1\xf1\xc5\xd9\x52\x4e\xa8\x46\xe9\xa4" + "\x86\xe7\xc6\x5d\x6f\x60\x4e\xbf\x3b\x0f\x2d\x69\x56\x51\x1d" + "\x11\xed\x02\xe5\x1d\x69\x34\x58\xcf\xf7\x1c\x32\xd7\x3d\x2a" + "\xe2\x9f\xb0\x73\x11\x8b\xf7\x68\xbc\x48\x3d\xee\xda\x58\xd0" + "\x7d\x38\x94\xe3\x5e\x2a\xdf\xb9\x3d\xe7\x41\x42\x9d\xb9\xea" + "\xb2\xf0\x4d\x51\x3b\x3b\x28\x2e\xfb\x65\x35\x0c\xec\x32\x48" + "\xdb\x15\x0e\xde\xb0\xe9\x3b\xcf\xd2\xa1\x00\xa2\x82\x05\x1a" + "\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82\x02" + "\x08\x80\x82\x01\x00\xd9\x25\xc3\xba\x0a\x46\x6e\xa9\x1d\x05" + "\xd7\x54\xf1\xff\xf4\xaf\xe5\x13\xcf\xd6\x74\xb0\xcf\xc2\x8c" + "\x68\x5c\xa9\xf3\x44\x4b\xfd\x4a\x4d\x29\x64\xbc\xa8\x98\xf5" + "\x35\x0a\x65\xe5\xcd\x5d\x08\x9f\x58\x22\xed\x21\x78\x04\x4d" + "\x2a\xce\x80\x33\x19\x5b\x7a\xbd\xa6\x89\xfa\x80\xa4\xf5\x32" + "\xa6\xb1\x34\x61\x55\x5a\xbd\x05\xaf\x4b\x4b\xdf\xe0\xa9\x3e" + "\x1d\x2f\x3e\xaf\x0c\x65\x32\xc6\xf2\xe0\x5c\x09\xc0\xa2\x41" + "\xe6\xc9\x96\x5e\x88\x62\x4a\x28\x4b\x23\x2f\xcf\xb3\xb7\x1e" + "\x11\x7f\xc4\x63\x1a\xe4\x24\x29\x46\xf4\x48\xde\x30\x45\x97" + "\xf8\x6c\x8d\x4e\x4a\xce\x5e\x41\xb2\xb7\x5a\xd5\x94\x42\x5a" + "\x14\xd1\x11\x99\xc5\xeb\x66\xbe\xb1\xc6\xc3\xdb\x2f\x8f\xa0" + "\x6c\xa9\x27\x0f\xc0\x92\x77\x0b\x8d\x66\xb8\x93\x0b\xc0\x5c" + "\xcb\x51\x4e\xa3\x83\xd2\xbd\x04\xd8\xc0\x0c\xb2\xf7\x38\x4e" + "\x6a\xec\xfe\x76\xd9\x71\x0b\x90\x21\x7c\xbf\x07\xc4\xd8\x4c" + "\x6d\xb9\x35\x48\x5d\x82\xea\x61\xc5\x14\xff\x25\x50\x47\xaf" + "\x06\x58\xa9\x95\x2c\xdd\xe5\xbd\x95\x4a\x7b\x27\xa1\x46\xe3" + "\xf0\x16\xe8\xf9\xba\x43\xb8\x77\xdc\x87\x81\x3a\xc0\xf2\xed" + "\x3b\x03\x5e\xe6\x89\x71\x81\x82\x01\x00\x91\xcd\xe0\x14\x34" + "\x05\x33\x6e\x82\x94\xb4\xfb\xec\xb9\xf5\x38\xf3\x0c\xce\x7f" + "\x2e\xfb\xce\xe6\x8f\xf3\x1a\xf9\x08\x5c\xbb\xcd\xe3\xb7\xac" + "\xcf\x47\x72\x90\xf4\x1b\x0f\x4e\x36\x34\xd3\xd1\xb7\x5a\x74" + "\xfd\x8e\x96\xd5\x08\xe7\x19\xd5\xb8\x97\xed\x26\x3f\x51\xdb" + "\xdb\xec\xa3\x43\xc1\xa3\x80\xcb\x36\x77\xb9\x2a\xd3\xc3\xde" + "\x3d\xe2\xd7\x30\xf7\x78\x8d\x4d\xea\x6e\xcf\xe7\xbc\xbb\x18" + "\x7c\xef\xdc\xe9\x6e\x19\xb3\x78\xed\x9f\x02\xc8\x5e\xc3\x4a" + "\x8a\x43\xa2\xd9\x83\x72\x66\xa6\x7c\x4c\xd2\x8c\xbd\xf4\x21" + "\x01\xe8\x11\xdb\x57\x96\x20\xd3\x48\xa8\x08\x34\x38\xf6\x44" + "\xc8\xee\xc3\xe4\xdb\xe9\xef\x3a\x98\x4f\x8b\x17\x0c\xe6\xe3" + "\x67\x26\xef\xbd\x76\x4d\xec\xe6\x88\xa4\x60\x3c\xeb\x40\x8d" + "\xf7\x0d\x24\x5c\x90\x4a\x3e\xc3\x2a\xb6\xfc\x1c\x98\x90\xfe" + "\x06\xf0\x2e\xf3\xeb\xb7\x25\x91\xc0\x40\xe1\x52\x07\xa3\x33" + "\xb8\xe9\xf5\xc5\x1f\xe1\x71\x79\xdd\x5e\x92\xb9\x6a\x4b\x62" + "\x31\x22\x8f\xf8\xbf\x4c\xf7\xe4\x59\x66\xd0\x02\x9c\x26\xc0" + "\xa1\x82\xa2\x5f\x91\x8a\xb7\x66\x94\xaf\x41\x8f\x45\x5d\xa7" + "\xe7\xbb\x2d\x15\xbc\x92\x5a\x0e\x5c\xf8\x56\xa1\x79\xa0\x25" + "\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54" + "\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee" + "\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x32\xec\xaa\x5e" + "\xa6\x88\xdc\xe4\x81\x0f\x93\x0f\x65\xde\x87\xfd\x54\x8c\x79" + "\x04\x81\xe3\x63\x3f\x3d\x08\xa1\xba\x0a\x24\x2b\x46\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x40\xd1\x9a\x63\x62\x9b\xc0\x76" + "\xab\x11\x73\x42\x86\xb3\x20\x9d\x23\xe8\x5e\xee\xb9\x82\x5d" + "\x93\xe3\xac\xad\xa0\x40\x41\x51\x1b\x81\x03\x02\x00\x00\xa3" + "\x82\x02\x08\x80\x82\x01\x00\x9f\x01\x7b\x87\xfd\xbe\xa0\x02" + "\x77\x00\x19\x7f\x2f\xde\x80\xab\xdc\xd0\x14\xe9\x63\xe5\xd6" + "\xfb\x2c\xcb\xb0\x70\x88\xbe\xcb\x6d\x8e\x56\xf3\x02\x34\xae" + "\xec\x30\xf7\x41\xcf\xe7\x07\x80\x52\x04\xa1\x16\x51\x15\x07" + "\xba\xdb\xc6\xe8\xce\xa8\x8c\xa8\xb7\xaa\x4e\x08\x96\xbd\x5f" + "\xbd\x64\x0d\xe3\x88\xca\x7e\x1a\x20\x1f\x65\x44\x3a\xc8\x2c" + "\xc2\xdd\xc8\xc6\x9b\x8f\x01\x8e\x36\xc5\x52\x5a\xb1\x1d\x1d" + "\xc4\xf0\x9f\xa9\x51\x4d\xe6\xeb\x36\x9c\x2e\x2d\x08\x1c\xaf" + "\x67\xed\x83\xbb\x67\x77\x83\x24\x49\x97\x8c\x06\x0d\xca\x8b" + "\x45\xf4\x2b\xff\x94\x22\x7f\x04\x92\x81\xd6\xf5\x17\x7f\x41" + "\x2d\xc3\x4e\x86\x2a\x60\xc4\x0e\x74\xb0\x04\x3c\x48\xe4\xd8" + "\x09\xf6\x48\x35\x00\x09\xda\xaa\x31\x2f\x8b\x5f\x6d\x4c\x48" + "\x52\xb9\xd9\x43\xe8\x1e\x22\x68\x80\xbe\xff\xee\x11\x3b\x83" + "\x47\xfd\xec\x6e\x1d\x9c\x7b\xd8\xe3\x2a\x8b\xef\x2a\xb3\xa5" + "\xc1\x78\x3c\x0b\x0e\x31\xe6\x40\x80\xe1\xcb\x25\x56\xb3\x45" + "\x7e\x65\xb3\xd9\x1a\x8e\xf8\xb0\x65\x44\x89\x73\x90\x0f\xe7" + "\xcd\x1b\x68\x3b\xa4\x7a\x35\x41\xad\xfd\x8e\xa8\x50\xe0\xf2" + "\xab\x2d\xe2\x31\x39\x82\x41\x4b\x81\x82\x01\x00\x06\xd1\xd0" + "\xc8\x4b\x80\x19\xea\xcb\xd2\xd1\x02\x54\x15\x6a\x08\x36\x5c" + "\x6c\xf6\x74\x23\xd2\x65\xec\x72\xef\x9a\x0c\xfa\xb8\xd1\xb0" + "\xd4\x37\x1c\xd6\xdd\x3d\xa4\x2d\x67\xf0\xb9\xfd\x61\x54\x20" + "\x27\xc2\x5f\x9b\x50\x00\x96\x28\x6a\xe0\x5e\xdf\x09\x23\xfd" + "\x05\xf1\x21\xf0\xc9\x9c\x9a\xc3\x7e\x05\x4e\x75\x3e\xb7\x41" + "\xe2\x06\xa0\xfe\x5a\x95\x11\x1c\x8f\x9c\x98\x02\xd3\x76\xea" + "\x8e\x50\x35\x0c\x25\xe6\xe8\x97\xba\xf0\x18\x65\x31\x7b\x89" + "\xea\xf7\x13\x13\x93\x58\x0e\x18\x04\xd1\xe6\xb7\x74\xf8\xb6" + "\x85\x33\x5d\x87\x10\x76\x18\xa5\xb3\x86\xb9\x43\x98\x4b\x5f" + "\xcc\x78\xb3\x32\xab\x5e\x74\xea\x34\xba\x9d\xda\x97\xe4\x29" + "\xd8\xfb\x78\x78\x28\x30\x5b\x1c\xfa\x19\x9b\x97\x60\xaa\x92" + "\x18\x9e\x40\x2b\x63\x9a\xab\xd5\x9a\x0a\xc3\x33\x06\x6d\x1d" + "\xbb\xb0\x32\x7e\x31\x37\x80\xc8\x7c\xeb\xaf\x43\xd7\x6e\x60" + "\x10\x84\x9e\xca\xa2\xf8\x61\xcc\x65\x5f\x6f\x1f\x68\xac\x45" + "\xa6\xf9\x7b\xd5\x39\xdd\x66\xa9\x47\xc9\x25\xba\xfc\x46\x60" + "\x9d\x04\xee\xb4\x6c\x04\x99\x26\xe5\x65\xab\x63\xa3\x3f\x6c" + "\xad\x44\x2a\x38\x1e\xe7\x27\x86\x87\xc3\xe6\x87\x4b\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x78\xe3" + "\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32\xff\xbc\x75\x1a\xe6" + "\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1\x6f\xff\x3e\xb3\x75" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c\x62" + "\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d\xba" + "\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02\x00" + "\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\x8d\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57\xca\xf4" + "\x9d\x63\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9\xc6\xa3" + "\xf1\x33\xfd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x95\x3c\x86" + "\x65\x91\x76\x69\x6b\x72\x61\xaa\x76\x15\x2a\xd7\x25\x4f\x32" + "\xb7\x73\x7a\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81" + "\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xdb\xaf\x3b\x8d\x0a\xa7\xbc\xe9\xf2\xeb\xfc" + "\x09\xb0\x90\x49\x85\x9f\x11\xc6\xf3\x29\xa5\x08\x84\x44\x0c" + "\x31\xc7\x06\x4e\x1c\x80\x81\x03\x07\x48\x3a\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x04\xe4\x3d\xf1\xcf\xac" + "\x9e\xa9\xc0\x8d\xa8\x8f\x58\xb5\x4f\xbc\xca\x4d\xa4\x18\xdc" + "\x0c\xe5\x16\x71\x59\x6e\x8a\xe8\x74\x15\x5f\x81\x03\x01\x0c" + "\x3a\x82\x02\x04\x30\xa1\x2b\x80\x20\x52\xe3\xd6\xd2\x1f\xe6" + "\x3f\x3e\x0e\x6d\xec\xa7\xc7\x36\xc2\x78\x9c\x75\x35\xc7\x20" + "\x8d\x81\x74\xcf\x3b\xb4\xfd\xe9\xd0\x13\xfc\x81\x03\x01\x0c" + "\x3a\x82\x02\x04\x30\xa2\x2b\x80\x20\xc5\x9c\xef\xd5\x25\x20" + "\x48\xc6\x95\xdc\xf8\xbf\xb9\x7a\x06\x0e\x96\xfc\x3c\x9b\x95" + "\x9d\xd3\x3d\x7a\xfb\x30\xb1\x0f\x32\xc1\xf3\x81\x03\x04\x24" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x8d\xb0\x2c\xb1\x28\xc3" + "\xf4\x97\x50\x84\x64\x57\xca\xf4\x9d\x63\x08\x73\xfc\xde\x2f" + "\x90\xf0\xf2\xec\x79\xa9\xc6\xa3\xf1\x33\xfd\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x95\x3c\x86\x65\x91\x76\x69\x6b\x72\x61" + "\xaa\x76\x15\x2a\xd7\x25\x4f\x32\xb7\x73\x7a\xb2\x49\x0c\x0b" + "\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh33() + { + testcase("Thresh33"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim8Cond + // ** Rsa9Cond + // ** Ed10Cond + // ** Prefix11Cond + // ** Thresh15Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** rsa4 + // ** preim5 + // ** rsa6 + // ** ed7 + + auto const rsa4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x65, 0xcc, 0xc2, 0xdb, 0x2c, 0x4a, 0x48, 0x45, 0x02, 0xa3, 0x30, + 0x35, 0x15, 0xc5, 0x93, 0xd8, 0x4a, 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xf6, 0x88, 0xba, 0x40, 0x0b, 0x88, 0x81, 0x83, 0x17, 0x9f, 0x16, + 0x08, 0x24, 0x23, 0xa7, 0xd8, 0x4c, 0x1f, 0xb9, 0xe6, 0xf4, 0x09, + 0x58, 0x31, 0x0a, 0x4e, 0x9d, 0xcf, 0x04, 0x0c, 0x1e, 0x9a, 0x82, + 0xe1, 0x85, 0x5b, 0x76, 0x0e, 0x01, 0x43, 0x03, 0x39, 0x75, 0x0d, + 0x8c, 0x8d, 0x3c, 0x87, 0x1c, 0x8f, 0xd3, 0x69, 0xa3, 0x6b, 0x58, + 0xa4, 0x9c, 0xf7}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim5Preimage = "I am root"s; + auto const preim5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 0x40, 0xe4, 0x52, 0x30, + 0x42, 0x74, 0xfd, 0x35, 0x04, 0xde, 0x45, 0x68, 0xb3, 0x22, 0xdd, + 0xff, 0x41, 0x43, 0x69, 0x33, 0xc0, 0xff, 0x35, 0xb6, 0x6d, 0x15, + 0xe9, 0x54, 0x15, 0xeb, 0x1d, 0x07, 0xe2, 0x25, 0x2b, 0xdb, 0xaa, + 0x16, 0x8d, 0x0d, 0x7f, 0x05, 0xf0, 0xd2, 0x7d, 0xb4, 0x9b, 0x51, + 0x19, 0x20, 0x1e, 0x3d, 0xba, 0x50, 0x9e, 0x51, 0x13, 0x81, 0x43, + 0x55, 0x96, 0xca, 0xdb, 0x88, 0x1f, 0xef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xfa, 0x49, + 0xe3, 0x6c, 0x6d, 0x09, 0x78, 0xd4, 0x4f, 0x5b, 0xc9, 0xd5, 0x73, + 0x39, 0x35, 0x7c, 0x71, 0xd5, 0x4b, 0x4d, 0xb3, 0x2d, 0x3e, 0x27, + 0xd7, 0xc5, 0xf5, 0x16, 0x7e, 0xc7, 0x1a, 0x15, 0x2a, 0xe3, 0x34, + 0xa2, 0x52, 0x4d, 0xb2, 0x5a, 0x26, 0x78, 0xcf, 0x18, 0xcb, 0xe5, + 0xb6, 0xd1, 0x06, 0xa2, 0xce, 0x21, 0x54, 0x7a, 0xdf, 0x40, 0xe3, + 0x72, 0x93, 0xf3, 0x63, 0xeb, 0xfc, 0x59, 0x30, 0xbd, 0xd0, 0x5c, + 0xb5, 0xad, 0x40, 0x96, 0xa5, 0xd7, 0xb2, 0x60, 0x21, 0xf8, 0x98, + 0x52, 0x08, 0x41}}; + auto const ed7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed7PublicKey{ + {0x58, 0xcf, 0x4b, 0xc5, 0x59, 0xdb, 0xba, 0x62, 0x25, 0x14, 0x3a, + 0xc0, 0xad, 0xab, 0x5e, 0x35, 0xa1, 0xb4, 0x0e, 0xc1, 0xaf, 0x3c, + 0xa8, 0x2f, 0x69, 0x2c, 0xb6, 0x25, 0xd7, 0xea, 0x15, 0xb3}}; + std::array const ed7Sig{ + {0xd0, 0xd1, 0x17, 0xe2, 0xb5, 0x40, 0x14, 0x81, 0x0b, 0x12, 0xd8, + 0xbe, 0x1d, 0x1c, 0xb0, 0x88, 0x27, 0xaf, 0x6e, 0xc3, 0x13, 0x71, + 0xea, 0xac, 0xf3, 0xd8, 0x6f, 0x38, 0x21, 0xe2, 0x6d, 0x77, 0xe9, + 0xa6, 0xba, 0x03, 0x2a, 0xe3, 0x50, 0xcb, 0x38, 0xbe, 0x36, 0xba, + 0x62, 0x6e, 0x37, 0x5c, 0x8d, 0x69, 0x9f, 0xf0, 0x43, 0x64, 0x83, + 0x82, 0x8e, 0xbe, 0xf5, 0xa6, 0x96, 0x35, 0xb7, 0x03}}; + std::array const ed7SigningKey{ + {0x9c, 0x02, 0x4b, 0x5e, 0x6a, 0x83, 0x35, 0x8a, 0x2a, 0x71, 0x70, + 0x4e, 0xab, 0x74, 0x72, 0x22, 0x33, 0x5a, 0x82, 0xd9, 0x8e, 0x9c, + 0x8c, 0x41, 0x62, 0x6b, 0x02, 0x62, 0xbd, 0x59, 0x31, 0xcb}}; + (void)ed7SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix11CondConditionFingerprint = { + {0x1e, 0xa8, 0x13, 0x71, 0x0c, 0x9f, 0x0b, 0xbf, 0x8b, 0x0d, 0xbf, + 0xa8, 0xc0, 0xb7, 0xc2, 0xe6, 0xfa, 0x63, 0xc1, 0x2f, 0xa0, 0x4c, + 0x89, 0x82, 0xb8, 0x87, 0xdc, 0xc2, 0xe1, 0xc8, 0x5b, 0x56}}; + Condition const Prefix11Cond{Type::prefixSha256, + 68643, + Prefix11CondConditionFingerprint, + std::bitset<5>{12}}; + std::array const Thresh15CondConditionFingerprint = { + {0xe6, 0x58, 0xca, 0x4d, 0x80, 0x1f, 0x92, 0xbc, 0xe5, 0x84, 0x9f, + 0xef, 0xe8, 0x04, 0x6a, 0x6d, 0x8d, 0xc9, 0x06, 0xd8, 0x60, 0x2d, + 0x6e, 0x1e, 0x78, 0x38, 0xd7, 0xf9, 0x66, 0x62, 0x7d, 0x23}}; + Condition const Thresh15Cond{Type::thresholdSha256, + 271360, + Thresh15CondConditionFingerprint, + std::bitset<5>{25}}; + + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + std::vector thresh3Subconditions{}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim5 = + std::make_unique(makeSlice(preim5Preimage)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + auto ed7 = std::make_unique(ed7PublicKey, ed7Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim5)); + thresh0Subfulfillments.emplace_back(std::move(rsa6)); + thresh0Subfulfillments.emplace_back(std::move(ed7)); + std::vector thresh0Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Prefix11Cond, Thresh15Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x8d\xa0\x82\x04\xb3\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x82\x02\x30\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x82\x02\x25\xa1\x82\x02\x21\x80\x02\x50\x32\x81" + "\x01\x1c\xa2\x82\x02\x16\xa2\x82\x02\x12\xa0\x82\x02\x0c\xa3" + "\x82\x02\x08\x80\x82\x01\x00\xbe\x09\xc5\xa4\x27\x29\xdf\xd4" + "\x67\x76\xbe\xbf\x2c\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67\x20" + "\xfb\x7a\x27\x93\xc0\x78\x47\x78\xd7\x15\x32\xee\x38\x81\x0d" + "\x36\xa2\xc4\x65\x44\xe6\x62\x26\xb9\x58\x13\xa4\x15\x82\xab" + "\xb1\x16\x61\xfc\x01\x98\xc6\x1a\x69\xc6\xba\x39\x3f\x01\x55" + "\x3d\xd7\x8e\x14\x42\x6d\x78\x74\x9b\x28\xcb\x31\x39\x98\x5a" + "\x11\xdc\xc1\x18\x9d\x8d\xb0\xcd\x1b\x4c\x10\xab\x14\x64\x19" + "\xf1\x33\x15\x45\xc8\x92\x82\x03\x82\x8a\xaa\xad\x94\xfc\x24" + "\x11\x96\x99\x7e\x94\x5a\x82\x57\x68\x61\x9f\x7b\x45\xe0\x99" + "\x9e\x4f\x32\x50\x5f\x05\xc8\x11\xae\xc4\x0c\x63\x18\x0e\x02" + "\x59\x36\x25\x92\x06\x32\xc7\x71\x47\x99\xcc\x0a\x6e\x0a\x58" + "\x71\x3f\x5e\xb7\x78\xf7\x98\x79\xdf\x74\xa4\xeb\xa9\x00\xfd" + "\x81\xb3\xcf\x04\x8c\x5d\x7d\xe7\xb2\x82\x90\x49\xbd\x69\xf3" + "\x08\xe9\x92\xc6\x9e\x41\xba\x74\xd8\x8d\x81\x97\x6f\x86\xab" + "\xc9\xf1\x02\x31\xb4\xce\x47\xb0\x39\xc8\xba\x51\xa7\x39\xf3" + "\x71\xa2\x25\x27\x37\x6e\x09\x6f\x19\x59\xbc\x65\xd9\xcd\x12" + "\xd3\x2c\xa2\x78\xfa\x23\x15\x1a\x82\x41\x91\x1b\xbe\x8a\xe7" + "\xfe\x3c\x3c\x30\x32\xaa\xe9\xf3\x81\x82\x01\x00\x65\xcc\xc2" + "\xdb\x2c\x4a\x48\x45\x02\xa3\x30\x35\x15\xc5\x93\xd8\x4a\x42" + "\x99\xf6\x40\x02\x90\xc6\x24\x0c\x88\x8b\x83\x45\x47\x60\x47" + "\x34\x8c\x70\x0b\xb4\xf6\xd9\xe6\xd5\xdb\x06\x88\xd7\x23\x78" + "\x14\x2d\x06\xad\xa6\x9e\x16\x74\xa1\xe4\x88\xbe\x29\x5d\x9d" + "\xe0\x89\x42\xd6\xb4\x11\x52\x8f\xdf\x6c\xd2\x2e\xb2\xf1\xa3" + "\xd4\x55\x45\x8a\xa8\xf9\xcc\xdc\x38\x42\xc1\xa6\x9b\xfb\x9b" + "\x64\x42\xfc\x98\x50\xfd\xfa\xa3\xf8\x2c\xd1\x09\x96\x5b\x1e" + "\xfc\x39\x3c\x8d\xde\xe8\x90\xf5\x34\xa2\x37\x1d\xc7\x09\x4c" + "\x2a\x3b\x88\xe0\x1e\xb7\xb6\xeb\xcc\x76\x56\x57\x21\x9d\x04" + "\x9b\xc2\xa2\x4f\x26\x40\xe7\xd5\x7b\xce\x5c\x31\x64\x1b\x86" + "\x7e\x03\xda\xbc\x43\xa3\xe8\xcb\x10\xff\xbc\x0a\xe3\x16\x03" + "\x71\x50\x21\xd8\x2d\x91\x33\xd3\xe9\xb4\xdb\xfb\xec\xf8\x16" + "\xcf\x5b\x4d\x05\x68\xcd\x05\x14\x20\x69\x80\x80\x6b\xeb\x80" + "\xf6\x88\xba\x40\x0b\x88\x81\x83\x17\x9f\x16\x08\x24\x23\xa7" + "\xd8\x4c\x1f\xb9\xe6\xf4\x09\x58\x31\x0a\x4e\x9d\xcf\x04\x0c" + "\x1e\x9a\x82\xe1\x85\x5b\x76\x0e\x01\x43\x03\x39\x75\x0d\x8c" + "\x8d\x3c\x87\x1c\x8f\xd3\x69\xa3\x6b\x58\xa4\x9c\xf7\xa1\x00" + "\xa3\x82\x02\x08\x80\x82\x01\x00\xd0\x07\xfc\x9d\xb0\xa1\xa6" + "\x40\xe4\x52\x30\x42\x74\xfd\x35\x04\xde\x45\x68\xb3\x22\xdd" + "\xff\x41\x43\x69\x33\xc0\xff\x35\xb6\x6d\x15\xe9\x54\x15\xeb" + "\x1d\x07\xe2\x25\x2b\xdb\xaa\x16\x8d\x0d\x7f\x05\xf0\xd2\x7d" + "\xb4\x9b\x51\x19\x20\x1e\x3d\xba\x50\x9e\x51\x13\x81\x43\x55" + "\x96\xca\xdb\x88\x1f\xef\x2d\x38\x3f\xae\x8d\xac\xc8\x6f\x2b" + "\xd5\xf0\x34\x1a\x99\x00\x7c\x6d\xb3\x1b\x1d\x68\xdb\xf8\x1c" + "\x59\x3a\x63\x38\x7c\x1c\x14\xbc\x22\xcf\xc8\x9a\xc6\x96\x6f" + "\x3d\x03\x0b\x61\x6b\x7d\x75\x97\xe8\x25\xb8\x2f\xfa\xf4\x07" + "\x44\xdf\x00\x3d\xff\x0d\xd5\x7f\x7f\xf3\x0c\x13\xac\x8d\xf8" + "\x8c\x79\xc5\xf3\x29\xdc\x23\x65\xd3\xd1\x1c\xa6\x14\x78\x6a" + "\x1a\xe3\x15\x8d\x8b\xdc\xa0\x5a\xc7\x82\xb0\x03\x6c\x71\x43" + "\x59\x24\xc7\x50\x64\xb2\xa7\x69\xf5\xbd\xe6\x5e\xaa\x77\x59" + "\x60\x36\xc0\xe3\x42\x7f\x05\x3b\x4c\x02\x0e\x70\x5a\x70\xc5" + "\x2a\xeb\x94\x4d\x15\x09\xef\xbb\x58\x42\x68\x05\x59\x70\xa0" + "\x17\xb2\x8e\xdf\x7b\x40\x5d\x21\x1e\xfe\x62\x58\xde\xfb\x14" + "\x91\x18\xf3\x4f\x9b\x36\x55\xcf\xb3\x5e\xec\x4f\xcc\x6d\x13" + "\x58\xc8\xa3\xa3\xee\x23\x8a\xc2\xbf\x81\x82\x01\x00\xb8\xf0" + "\x67\xcd\x37\x8c\x69\x5d\xee\xf7\x18\xd8\x9b\xbb\x4b\x49\xbb" + "\xc7\x1d\xbf\xa3\x27\x46\x4e\xd1\x15\xb9\xa2\xbe\x4d\x47\x6b" + "\x5c\xf1\x2f\x78\x8e\x2e\xa6\xf7\x42\xf5\xb1\x79\x63\x4f\xbd" + "\xc1\xbc\x93\x36\xf4\xcc\xe0\x44\x90\x43\x3d\xfe\xff\x42\xf2" + "\x58\x31\xdf\xbe\x9c\x9b\x9f\xbb\x64\xb2\x2a\x8f\x25\x61\x26" + "\x40\xd0\x9c\x0c\xde\x36\x71\x72\xfb\xc4\x6f\xac\x1f\x7e\xd0" + "\xb0\x31\x5c\x51\xea\xe0\xb4\x6a\x8a\xa0\x26\x28\xbc\x7d\x10" + "\x97\xd1\x06\xdd\x69\xe3\x39\x6b\x77\x8c\xec\x08\x10\x22\x8a" + "\xd1\x22\x06\xf6\x2a\x51\x78\x6f\x0e\x4c\x6d\xbd\xce\xce\xef" + "\x7b\x2a\x58\x76\xac\xae\x4f\xd0\x52\xac\xe7\xa3\xb3\xf4\xff" + "\x17\xa3\xab\x0a\x22\x83\xa8\x18\x35\x9b\xa2\xd6\x33\xe0\xb3" + "\x46\x2a\xac\xa6\xd1\xc0\xd2\xfa\x49\xe3\x6c\x6d\x09\x78\xd4" + "\x4f\x5b\xc9\xd5\x73\x39\x35\x7c\x71\xd5\x4b\x4d\xb3\x2d\x3e" + "\x27\xd7\xc5\xf5\x16\x7e\xc7\x1a\x15\x2a\xe3\x34\xa2\x52\x4d" + "\xb2\x5a\x26\x78\xcf\x18\xcb\xe5\xb6\xd1\x06\xa2\xce\x21\x54" + "\x7a\xdf\x40\xe3\x72\x93\xf3\x63\xeb\xfc\x59\x30\xbd\xd0\x5c" + "\xb5\xad\x40\x96\xa5\xd7\xb2\x60\x21\xf8\x98\x52\x08\x41\xa4" + "\x64\x80\x20\x58\xcf\x4b\xc5\x59\xdb\xba\x62\x25\x14\x3a\xc0" + "\xad\xab\x5e\x35\xa1\xb4\x0e\xc1\xaf\x3c\xa8\x2f\x69\x2c\xb6" + "\x25\xd7\xea\x15\xb3\x81\x40\xd0\xd1\x17\xe2\xb5\x40\x14\x81" + "\x0b\x12\xd8\xbe\x1d\x1c\xb0\x88\x27\xaf\x6e\xc3\x13\x71\xea" + "\xac\xf3\xd8\x6f\x38\x21\xe2\x6d\x77\xe9\xa6\xba\x03\x2a\xe3" + "\x50\xcb\x38\xbe\x36\xba\x62\x6e\x37\x5c\x8d\x69\x9f\xf0\x43" + "\x64\x83\x82\x8e\xbe\xf5\xa6\x96\x35\xb7\x03\xa1\x81\xd3\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x1e\xa8\x13" + "\x71\x0c\x9f\x0b\xbf\x8b\x0d\xbf\xa8\xc0\xb7\xc2\xe6\xfa\x63" + "\xc1\x2f\xa0\x4c\x89\x82\xb8\x87\xdc\xc2\xe1\xc8\x5b\x56\x81" + "\x03\x01\x0c\x23\x82\x02\x04\x30\xa2\x2b\x80\x20\xe6\x58\xca" + "\x4d\x80\x1f\x92\xbc\xe5\x84\x9f\xef\xe8\x04\x6a\x6d\x8d\xc9" + "\x06\xd8\x60\x2d\x6e\x1e\x78\x38\xd7\xf9\x66\x62\x7d\x23\x81" + "\x03\x04\x24\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xe5\x15\x0a" + "\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70\x64\x51\xeb\x6f" + "\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7\xe4\x52\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4\x30\x65" + "\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79\x5f\x41" + "\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xbe\x50\xad\xaf\xd5\x5c\x30\xbd\x9c\xa8\x79" + "\x8b\xe4\x9c\x31\xcc\x0c\x76\x39\x6b\x8b\xe0\x7f\xb8\xa0\x98" + "\xd8\x7e\xe7\xb5\xb9\xa7\x81\x03\x09\x54\x3a\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x1e\xa8\x13\x71\x0c\x9f\x0b\xbf\x8b\x0d\xbf\xa8" + "\xc0\xb7\xc2\xe6\xfa\x63\xc1\x2f\xa0\x4c\x89\x82\xb8\x87\xdc" + "\xc2\xe1\xc8\x5b\x56\x81\x03\x01\x0c\x23\x82\x02\x04\x30\xa1" + "\x2b\x80\x20\x52\xe3\xd6\xd2\x1f\xe6\x3f\x3e\x0e\x6d\xec\xa7" + "\xc7\x36\xc2\x78\x9c\x75\x35\xc7\x20\x8d\x81\x74\xcf\x3b\xb4" + "\xfd\xe9\xd0\x13\xfc\x81\x03\x01\x0c\x3a\x82\x02\x04\x30\xa2" + "\x2b\x80\x20\xe6\x58\xca\x4d\x80\x1f\x92\xbc\xe5\x84\x9f\xef" + "\xe8\x04\x6a\x6d\x8d\xc9\x06\xd8\x60\x2d\x6e\x1e\x78\x38\xd7" + "\xf9\x66\x62\x7d\x23\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88" + "\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb" + "\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xee" + "\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c" + "\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2" + "\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4" + "\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79" + "\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d" + "\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0" + "\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh34() + { + testcase("Thresh34"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim30Cond + // ** Rsa31Cond + // ** Ed32Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim5Cond + // ***** Rsa6Cond + // ***** Ed7Cond + // ***** rsa4 + // ** prefix8 + // *** prefix9 + // **** thresh10 + // ***** Preim12Cond + // ***** Rsa13Cond + // ***** Ed14Cond + // ***** rsa11 + // ** thresh15 + // *** Preim22Cond + // *** Rsa23Cond + // *** Ed24Cond + // *** Thresh25Cond + // *** rsa16 + // *** thresh17 + // **** Preim19Cond + // **** Rsa20Cond + // **** Ed21Cond + // **** rsa18 + + auto const rsa4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x58, 0xe8, 0x27, 0x48, 0x76, 0x66, 0xe6, 0x93, 0x9e, 0x24, 0xeb, + 0x5b, 0xfc, 0x4a, 0xa6, 0x2d, 0xa4, 0xf6, 0x98, 0x4b, 0x20, 0x51, + 0x31, 0x06, 0xf4, 0x01, 0x45, 0x48, 0xf4, 0xe0, 0xe1, 0xdd, 0x3f, + 0x57, 0xf9, 0x93, 0xeb, 0x72, 0xcf, 0x67, 0x5b, 0xf8, 0xcf, 0x94, + 0x1a, 0xc9, 0xc7, 0x64, 0x41, 0x8c, 0x89, 0x29, 0xe1, 0x8a, 0x59, + 0xac, 0x51, 0xf5, 0xec, 0xf8, 0x6d, 0x36, 0x5d, 0x83, 0x81, 0x0d, + 0xc0, 0x7f, 0x52, 0x9d, 0x32, 0x50, 0x43, 0x18, 0x08, 0x70, 0x01, + 0xce, 0xd7, 0xa6, 0x37, 0x7b, 0x70, 0xfe, 0x69, 0x02, 0x88, 0x82, + 0x4c, 0x90, 0x07, 0x75, 0x63, 0xc1, 0xf1, 0x20, 0x84, 0x10, 0xb2, + 0xd0, 0xc6, 0x85, 0xa0, 0x40, 0xc5, 0xc4, 0xeb, 0x69, 0xe5, 0x75, + 0x28, 0xc9, 0x14, 0x99, 0x10, 0xb3, 0xde, 0x5a, 0x23, 0x01, 0x86, + 0xed, 0x7f, 0x0d, 0x81, 0x4b, 0x2e, 0xd4, 0xe1, 0x21, 0x7f, 0x53, + 0x78, 0x87, 0x74, 0xc7, 0xc3, 0xb7, 0xdd, 0xe6, 0x50, 0x92, 0x57, + 0xeb, 0x20, 0xee, 0x9c, 0x75, 0x7d, 0xc9, 0x00, 0xea, 0x2f, 0xb6, + 0x76, 0x3f, 0x61, 0x67, 0x51, 0x42, 0x88, 0x5e, 0x5a, 0xd2, 0xac, + 0x09, 0x8c, 0x00, 0x39, 0x79, 0x15, 0x80, 0x7d, 0xf7, 0xb2, 0x6a, + 0xc8, 0x30, 0x5e, 0x5b, 0x28, 0x4e, 0x0f, 0x1a, 0x04, 0x37, 0xe9, + 0x02, 0xd6, 0x1c, 0x6a, 0x8f, 0xa9, 0xef, 0x8b, 0x40, 0x02, 0xad, + 0x72, 0x53, 0x11, 0xe6, 0x9e, 0x40, 0x26, 0xca, 0xeb, 0xea, 0x1b, + 0x44, 0xbd, 0xd0, 0xcf, 0xd1, 0x1b, 0xd2, 0xc0, 0x27, 0x38, 0x1d, + 0x51, 0x69, 0x4f, 0xd0, 0x78, 0x43, 0x65, 0x7d, 0x81, 0x7c, 0x7b, + 0x61, 0xc6, 0xc2, 0xd1, 0x47, 0xe4, 0xcc, 0x04, 0x9f, 0x40, 0xce, + 0x44, 0x68, 0x62, 0x38, 0xcf, 0x67, 0x46, 0x50, 0x06, 0xb3, 0x2e, + 0x32, 0x21, 0x94}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const rsa11Msg = "P9P8abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa11PublicKey{ + {0xa8, 0xc7, 0x5e, 0x5a, 0xe9, 0xc7, 0xcb, 0xbc, 0x9c, 0x92, 0xb7, + 0xb8, 0x76, 0x67, 0x90, 0xc2, 0x53, 0xa9, 0x3a, 0x4b, 0x2c, 0xab, + 0xdb, 0x80, 0x6e, 0xec, 0x50, 0xbe, 0x9e, 0x5e, 0x96, 0x64, 0x8f, + 0xdf, 0x93, 0xb2, 0xb0, 0xc0, 0xb9, 0x7d, 0xc6, 0xc9, 0x75, 0x6b, + 0x73, 0xb1, 0xd6, 0x0b, 0xe5, 0xbb, 0x2a, 0xf5, 0xdc, 0xc0, 0xd5, + 0x09, 0x95, 0xd3, 0xf5, 0xcf, 0x82, 0xb9, 0x43, 0x93, 0xdf, 0x5a, + 0xd4, 0x4f, 0xa0, 0x60, 0x20, 0x41, 0x01, 0xb0, 0x8f, 0x2a, 0x58, + 0xd5, 0x05, 0xa1, 0x71, 0x14, 0x29, 0x91, 0xd6, 0x79, 0x5a, 0xb3, + 0x3b, 0xbe, 0x29, 0x3c, 0x68, 0x87, 0x48, 0x94, 0xb7, 0xb3, 0x29, + 0xd9, 0xff, 0xeb, 0x06, 0xfd, 0x1d, 0xcf, 0x3e, 0x7c, 0x14, 0x95, + 0xfa, 0xa3, 0xc0, 0x25, 0x46, 0xa4, 0xd3, 0x2d, 0xb5, 0x5f, 0x6b, + 0x86, 0x18, 0xb4, 0x2f, 0x7b, 0x07, 0x76, 0xf9, 0xf8, 0x6d, 0x57, + 0x62, 0x41, 0x79, 0x30, 0x3c, 0x81, 0x6e, 0x8a, 0xda, 0x87, 0x6e, + 0x1d, 0x64, 0x6d, 0x39, 0x40, 0xd5, 0x5a, 0xb2, 0x2d, 0xba, 0xb8, + 0x7a, 0x3b, 0x60, 0xd6, 0x96, 0x55, 0xfe, 0x1e, 0x71, 0x09, 0x33, + 0xad, 0x05, 0xb2, 0x73, 0xd2, 0x2b, 0xf1, 0x26, 0x06, 0xd9, 0x15, + 0xfc, 0x48, 0x36, 0xa4, 0xa2, 0x25, 0x90, 0x96, 0x9c, 0x3a, 0x6a, + 0x0a, 0xd8, 0x9b, 0x4f, 0xc6, 0x1a, 0xef, 0x18, 0xe9, 0x34, 0x0f, + 0x85, 0x06, 0xbc, 0xc0, 0xeb, 0x4d, 0x3b, 0x6c, 0x7e, 0xa8, 0x54, + 0x01, 0x03, 0x0c, 0x5c, 0x24, 0x58, 0x61, 0xcd, 0xf1, 0x31, 0x88, + 0x5e, 0x00, 0x15, 0x1e, 0x9a, 0x81, 0x99, 0x0b, 0x1a, 0x33, 0xc5, + 0xa6, 0x6c, 0xb4, 0xfb, 0x4e, 0x84, 0x94, 0x9c, 0x7e, 0x2b, 0x00, + 0x4d, 0x5c, 0xcf, 0xc2, 0xa6, 0xa5, 0x36, 0xc6, 0xee, 0x72, 0x8e, + 0x1e, 0x18, 0xaf}}; + std::array const rsa11Sig{ + {0x72, 0x99, 0xa4, 0x26, 0x5c, 0x5f, 0x2a, 0x6c, 0xc8, 0xc7, 0xdc, + 0x15, 0xb0, 0xdf, 0x90, 0x46, 0xc3, 0x90, 0xfc, 0x44, 0x68, 0x8a, + 0x3a, 0x78, 0xeb, 0x05, 0x53, 0x15, 0x6c, 0xbb, 0x7a, 0x30, 0x0c, + 0x0f, 0xe9, 0x88, 0x28, 0x30, 0x52, 0x5a, 0x6e, 0x3e, 0x65, 0xe3, + 0xcb, 0xc3, 0x99, 0xd2, 0x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, + 0x74, 0x64, 0x7e, 0x1f, 0xd6, 0x2e, 0x94, 0x21, 0xb8, 0xe3, 0x00, + 0x98, 0xb3, 0xf3, 0xb8, 0x17, 0x50, 0x25, 0x82, 0xb9, 0x32, 0xe3, + 0x66, 0x3c, 0x12}}; + auto const thresh10Msg = "P9P8abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim12CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim12Cond{Type::preimageSha256, + 9, + Preim12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa13CondConditionFingerprint = { + {0x65, 0x58, 0x3c, 0x41, 0x23, 0xcb, 0x17, 0xee, 0x38, 0xf7, 0x10, + 0x74, 0xdb, 0xa3, 0x24, 0xb4, 0x5b, 0x39, 0x35, 0xc1, 0x1a, 0xa6, + 0xbd, 0xbc, 0xc8, 0xea, 0x71, 0x39, 0x33, 0xe5, 0xd5, 0x1a}}; + Condition const Rsa13Cond{Type::rsaSha256, + 65536, + Rsa13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed14CondConditionFingerprint = { + {0xde, 0x4c, 0x08, 0x88, 0x5c, 0xfe, 0x31, 0x01, 0xbe, 0xe9, 0xe4, + 0x12, 0xce, 0x03, 0x59, 0x75, 0xb3, 0x7b, 0xac, 0x62, 0x26, 0xfa, + 0x78, 0x07, 0x59, 0x64, 0x4e, 0x5e, 0x89, 0x64, 0x17, 0x04}}; + Condition const Ed14Cond{Type::ed25519Sha256, + 131072, + Ed14CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix9Prefix = "P9"s; + auto const prefix9Msg = "P8abcdefghijklmnopqrstuvwxyz"s; + auto const prefix9MaxMsgLength = 28; + auto const prefix8Prefix = "P8"s; + auto const prefix8Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix8MaxMsgLength = 26; + auto const rsa16Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa16PublicKey{ + {0xe8, 0x03, 0x7c, 0xff, 0x40, 0x68, 0x5d, 0xc7, 0xb8, 0xd0, 0x9f, + 0x9a, 0x83, 0xf9, 0x02, 0xe6, 0xfe, 0xa5, 0xb9, 0x0e, 0x9f, 0xdc, + 0x44, 0x74, 0x59, 0x3e, 0xef, 0x61, 0xdc, 0xb6, 0x4b, 0x49, 0xfe, + 0x1a, 0x67, 0x73, 0x38, 0x7b, 0x1c, 0xb4, 0xfa, 0x24, 0x39, 0xe4, + 0xbb, 0x74, 0x1b, 0xe4, 0x66, 0xfd, 0x85, 0x6f, 0x8d, 0x92, 0x3e, + 0x04, 0x70, 0xb4, 0x21, 0x01, 0xcf, 0x07, 0xf2, 0xeb, 0x11, 0x2c, + 0xaa, 0x9d, 0x37, 0xbb, 0xf3, 0x8d, 0x9b, 0xbc, 0x17, 0x60, 0xe4, + 0xe3, 0xae, 0x79, 0x92, 0x97, 0x3a, 0xe8, 0xd8, 0x74, 0xc5, 0x9d, + 0xeb, 0x15, 0x22, 0x8b, 0xae, 0x51, 0x13, 0x78, 0x21, 0xca, 0xbd, + 0x6a, 0xa6, 0x24, 0x93, 0x8f, 0xe6, 0x23, 0x12, 0x52, 0xe1, 0x75, + 0xda, 0x55, 0x26, 0xcc, 0x95, 0xa0, 0x75, 0x31, 0x0a, 0x6e, 0x27, + 0x14, 0x63, 0x70, 0x04, 0xd7, 0xe4, 0x36, 0x21, 0x3a, 0x9e, 0xff, + 0xe3, 0x16, 0x21, 0xc1, 0xfc, 0x6d, 0xc5, 0xe2, 0x80, 0xb9, 0x26, + 0xc6, 0x4f, 0x3c, 0xc2, 0xd5, 0x25, 0xf1, 0xb9, 0x88, 0xac, 0xc7, + 0xfe, 0xde, 0xd6, 0x7e, 0x60, 0x41, 0x82, 0xde, 0x25, 0x28, 0x1f, + 0x09, 0xda, 0x10, 0x01, 0x27, 0xf4, 0x63, 0x10, 0xa2, 0x4e, 0x1d, + 0xc2, 0x19, 0x32, 0xb3, 0x87, 0xc2, 0xcf, 0xac, 0x3c, 0x2b, 0xcd, + 0x5e, 0x79, 0x1f, 0x19, 0xea, 0x70, 0x56, 0x31, 0x59, 0x0e, 0x13, + 0x95, 0x05, 0xb7, 0xf9, 0xff, 0xd9, 0x0b, 0x49, 0xce, 0xd0, 0x6f, + 0xae, 0x90, 0x44, 0xb3, 0x6b, 0x60, 0xc9, 0x72, 0xf7, 0x83, 0x24, + 0x5e, 0x15, 0x25, 0x1c, 0xb8, 0x76, 0x71, 0x84, 0x33, 0x14, 0xf1, + 0xf0, 0x07, 0x7f, 0x2f, 0x95, 0xee, 0x3c, 0x36, 0x67, 0x36, 0xb4, + 0xae, 0x1c, 0xb5, 0x02, 0xa2, 0xdc, 0x0e, 0xed, 0xf2, 0x63, 0x0d, + 0x52, 0x61, 0xe3}}; + std::array const rsa16Sig{ + {0xe5, 0xdf, 0x99, 0xfb, 0xeb, 0xf9, 0x3a, 0xf6, 0x9b, 0x20, 0x22, + 0x26, 0xd8, 0x45, 0xc3, 0x39, 0x8f, 0xda, 0x68, 0x89, 0x6c, 0x65, + 0xd6, 0xa5, 0xc3, 0xfb, 0x04, 0x8a, 0xb7, 0x0e, 0x59, 0x7e, 0xa1, + 0xb7, 0xc9, 0xa7, 0x99, 0x35, 0x59, 0x00, 0x9d, 0xe6, 0x3b, 0xf9, + 0xba, 0x53, 0x0e, 0x4c, 0xb6, 0x67, 0xaf, 0x1a, 0x27, 0x91, 0x40, + 0x91, 0xd5, 0x49, 0xde, 0x7b, 0x78, 0xca, 0xb0, 0xa7, 0x7d, 0xda, + 0x99, 0xe8, 0xf7, 0x64, 0x0d, 0xf0, 0xca, 0x23, 0x3c, 0x69, 0x63, + 0x7e, 0x3d, 0x4d, 0xb0, 0xa6, 0xc4, 0xc4, 0x49, 0x14, 0xf6, 0x02, + 0x64, 0x09, 0x6f, 0x07, 0x3c, 0xc5, 0xf7, 0x3b, 0x8a, 0x22, 0xa3, + 0xa5, 0xe1, 0x88, 0xa8, 0xef, 0xb0, 0x45, 0x75, 0x2e, 0x44, 0xe8, + 0x6c, 0x11, 0x72, 0xe5, 0x7d, 0x81, 0x83, 0x7f, 0x65, 0x83, 0x84, + 0xc7, 0xb7, 0x44, 0x38, 0x3a, 0xce, 0x1e, 0x45, 0xc8, 0xd9, 0x25, + 0xb8, 0x11, 0xb5, 0x4d, 0xa9, 0xa1, 0xe3, 0x11, 0x4f, 0x80, 0x9e, + 0x0b, 0x49, 0x1e, 0xb6, 0x56, 0xe3, 0x3b, 0x03, 0x02, 0x11, 0xcb, + 0x0c, 0xc7, 0x1f, 0x73, 0x23, 0x33, 0xcc, 0xf0, 0x54, 0xfc, 0x28, + 0x1f, 0xef, 0x2e, 0x8c, 0x41, 0x84, 0x25, 0xaf, 0x85, 0xfe, 0x9a, + 0xa3, 0x83, 0x8a, 0x30, 0x02, 0x51, 0xfb, 0x32, 0x97, 0xb4, 0xaa, + 0x27, 0x8b, 0x27, 0xf6, 0xe9, 0xb9, 0xfa, 0x32, 0xae, 0xda, 0x10, + 0x71, 0xe9, 0xc8, 0x3c, 0xa7, 0xe6, 0x01, 0x0a, 0x59, 0x24, 0x2c, + 0xa6, 0xd2, 0x6d, 0xfa, 0xc6, 0x3d, 0xb1, 0x65, 0x44, 0xf0, 0x2e, + 0x3e, 0xd0, 0xf9, 0x54, 0x20, 0x2f, 0xbc, 0xf4, 0x29, 0xce, 0xf3, + 0x74, 0x65, 0x32, 0xfb, 0x76, 0xf3, 0x4d, 0x5b, 0x8f, 0x6d, 0x29, + 0xdf, 0x31, 0x96, 0x39, 0x99, 0xa5, 0xea, 0x17, 0x71, 0xb5, 0xb0, + 0xf9, 0x8b, 0x4d}}; + auto const rsa18Msg = "abcdefghijklmnopqrstuvwx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c6, + 0x92, 0x23, 0x80, 0xaa, 0x05, 0x38, 0xaf, 0x97, 0x4c, 0x10, 0xde, + 0x84, 0x60, 0x13, 0x17, 0xda, 0xb9, 0xb0, 0xfc, 0x48, 0x09, 0x83, + 0x3f, 0x51, 0x75, 0x19, 0xad, 0x68, 0x35, 0xc7, 0x8c, 0xb0, 0xb3, + 0xd8, 0xff, 0x0f, 0xee, 0x77, 0xb4, 0x50, 0x3a, 0x5b, 0x92, 0x23, + 0xf9, 0x0f, 0xf5, 0x60, 0x86, 0x12, 0x57, 0xad, 0x52, 0xbe, 0x88, + 0x8a, 0x40, 0x08, 0x3e, 0x02, 0x0e, 0x2f, 0x1b, 0xa9, 0x29, 0x28, + 0x2b, 0x15, 0x53, 0x89, 0xef, 0x64, 0x1a, 0xc3, 0x4a, 0x12, 0x17, + 0x26, 0xb5, 0xeb}}; + std::array const rsa18Sig{ + {0xe8, 0x9f, 0xc0, 0x7a, 0xf4, 0x6c, 0x09, 0xb5, 0x0e, 0xad, 0x3b, + 0x20, 0xfa, 0xbe, 0xd8, 0xa3, 0xed, 0xfe, 0xdc, 0xdc, 0x87, 0xa5, + 0x2d, 0x22, 0x2e, 0x36, 0x0d, 0x42, 0x1d, 0x41, 0x55, 0x85, 0xe5, + 0x62, 0xa9, 0x0b, 0x8a, 0xba, 0xed, 0x95, 0x7d, 0xaf, 0x43, 0x20, + 0x33, 0x33, 0x6f, 0xa5, 0x55, 0xd9, 0x8b, 0xd6, 0x77, 0xb0, 0x40, + 0xea, 0xb2, 0x18, 0x5b, 0x91, 0xcd, 0x4f, 0xb6, 0x7c, 0xb8, 0x6a, + 0x7e, 0x6e, 0xb1, 0xe4, 0xf4, 0x2b, 0x41, 0xeb, 0x91, 0xfc, 0x0f, + 0x82, 0xa6, 0x2e, 0xdf, 0xda, 0xb6, 0x41, 0xad, 0x2b, 0xdc, 0x44, + 0xb5, 0x02, 0xc0, 0x3b, 0x98, 0x9c, 0x34, 0x23, 0x82, 0xc3, 0xe8, + 0x3a, 0xca, 0x33, 0x9b, 0x52, 0x1a, 0x87, 0x4d, 0x5e, 0x8a, 0x8b, + 0x9d, 0xae, 0x49, 0x93, 0xa2, 0x50, 0xb0, 0xdc, 0x19, 0x72, 0x34, + 0xce, 0x17, 0x24, 0x29, 0xbe, 0xb2, 0xe5, 0xf7, 0xb5, 0x87, 0x69, + 0xb9, 0xdc, 0xde, 0xf6, 0x5c, 0xb1, 0x1b, 0xd2, 0xa0, 0xe8, 0x93, + 0x06, 0x77, 0x40, 0x0c, 0xdb, 0x4b, 0x4f, 0x8f, 0x31, 0x74, 0x0c, + 0xb6, 0xf4, 0x59, 0x6f, 0x19, 0x2e, 0x62, 0xf8, 0x11, 0x00, 0x1e, + 0x39, 0xed, 0x6f, 0xf5, 0x33, 0x9f, 0x07, 0x06, 0x1b, 0xdb, 0x79, + 0x71, 0x73, 0xc9, 0xcd, 0x1f, 0xc8, 0x5d, 0x56, 0x47, 0xcf, 0x9d, + 0x48, 0x58, 0xff, 0x10, 0xcb, 0x74, 0x9d, 0xa1, 0xd6, 0x14, 0x10, + 0x0a, 0x10, 0x88, 0x3f, 0x21, 0xfa, 0xd2, 0x0d, 0x8c, 0xea, 0xe9, + 0x9c, 0xb1, 0x3f, 0x0b, 0x08, 0xcb, 0x06, 0x2b, 0xe9, 0x46, 0x36, + 0xb3, 0xb2, 0xe7, 0x3b, 0x0c, 0x9b, 0xf4, 0x29, 0x30, 0xfb, 0xd2, + 0x38, 0xeb, 0xc5, 0x58, 0x0b, 0x19, 0xaf, 0x23, 0x5e, 0x54, 0xf2, + 0x65, 0x18, 0x46, 0xf3, 0x5c, 0x61, 0xc5, 0x5a, 0x3e, 0xe5, 0x9a, + 0x87, 0x69, 0x94}}; + auto const thresh17Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh15Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim22CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim22Cond{Type::preimageSha256, + 9, + Preim22CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa23CondConditionFingerprint = { + {0x4a, 0x64, 0xbf, 0x23, 0xa9, 0x2b, 0xec, 0x55, 0x00, 0x3d, 0x55, + 0xf5, 0xbf, 0x3f, 0x26, 0x49, 0x18, 0xbb, 0xe0, 0xda, 0xf8, 0x0c, + 0xf4, 0x5c, 0x8a, 0x33, 0x74, 0xb6, 0x58, 0xa4, 0x38, 0x30}}; + Condition const Rsa23Cond{Type::rsaSha256, + 65536, + Rsa23CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed24CondConditionFingerprint = { + {0x6b, 0xf3, 0xe3, 0x0f, 0x92, 0x6d, 0x45, 0x8d, 0xae, 0xd2, 0x8a, + 0x2a, 0x3e, 0x53, 0x37, 0x1f, 0x57, 0x82, 0x21, 0x60, 0xe4, 0x5b, + 0x88, 0x9a, 0x9d, 0x13, 0xa2, 0x56, 0x13, 0x88, 0x9e, 0x21}}; + Condition const Ed24Cond{Type::ed25519Sha256, + 131072, + Ed24CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh25CondConditionFingerprint = { + {0x52, 0x94, 0xc9, 0xdb, 0x6a, 0xb5, 0x13, 0xd0, 0x42, 0x2a, 0x94, + 0xaf, 0x6c, 0xd2, 0x92, 0xab, 0xcb, 0x41, 0xc8, 0x85, 0xf7, 0xec, + 0x46, 0xf2, 0x1c, 0x65, 0xc4, 0x0b, 0x4a, 0x5a, 0x8e, 0x5e}}; + Condition const Thresh25Cond{Type::thresholdSha256, + 135168, + Thresh25CondConditionFingerprint, + std::bitset<5>{25}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim30CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim30Cond{Type::preimageSha256, + 9, + Preim30CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa31CondConditionFingerprint = { + {0x34, 0x77, 0x63, 0xd7, 0x27, 0x76, 0x4d, 0x3a, 0x9b, 0x6c, 0xdb, + 0x09, 0xed, 0xd8, 0x5f, 0xc2, 0x12, 0x9e, 0x9c, 0xc4, 0xc8, 0xa6, + 0x62, 0xcf, 0x14, 0xde, 0x09, 0x30, 0x64, 0x8e, 0xf4, 0x84}}; + Condition const Rsa31Cond{Type::rsaSha256, + 65536, + Rsa31CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed32CondConditionFingerprint = { + {0xe9, 0x54, 0x85, 0xb7, 0x7d, 0xa1, 0x1f, 0x2f, 0xaa, 0x84, 0x72, + 0x3f, 0x4e, 0x3f, 0x09, 0xa7, 0x49, 0xf2, 0x15, 0x2a, 0xe6, 0x13, + 0x5b, 0x68, 0xb6, 0xe1, 0x98, 0xa6, 0x89, 0x76, 0x08, 0x05}}; + Condition const Ed32Cond{Type::ed25519Sha256, + 131072, + Ed32CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto rsa11 = std::make_unique( + makeSlice(rsa11PublicKey), makeSlice(rsa11Sig)); + std::vector> thresh10Subfulfillments; + thresh10Subfulfillments.emplace_back(std::move(rsa11)); + std::vector thresh10Subconditions{ + {Preim12Cond, Rsa13Cond, Ed14Cond}}; + auto thresh10 = std::make_unique( + std::move(thresh10Subfulfillments), + std::move(thresh10Subconditions)); + auto prefix9 = std::make_unique( + makeSlice(prefix9Prefix), prefix9MaxMsgLength, std::move(thresh10)); + auto prefix8 = std::make_unique( + makeSlice(prefix8Prefix), prefix8MaxMsgLength, std::move(prefix9)); + auto rsa16 = std::make_unique( + makeSlice(rsa16PublicKey), makeSlice(rsa16Sig)); + auto rsa18 = std::make_unique( + makeSlice(rsa18PublicKey), makeSlice(rsa18Sig)); + std::vector> thresh17Subfulfillments; + thresh17Subfulfillments.emplace_back(std::move(rsa18)); + std::vector thresh17Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond}}; + auto thresh17 = std::make_unique( + std::move(thresh17Subfulfillments), + std::move(thresh17Subconditions)); + std::vector> thresh15Subfulfillments; + thresh15Subfulfillments.emplace_back(std::move(rsa16)); + thresh15Subfulfillments.emplace_back(std::move(thresh17)); + std::vector thresh15Subconditions{ + {Preim22Cond, Rsa23Cond, Ed24Cond, Thresh25Cond}}; + auto thresh15 = std::make_unique( + std::move(thresh15Subfulfillments), + std::move(thresh15Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix8)); + thresh0Subfulfillments.emplace_back(std::move(thresh15)); + std::vector thresh0Subconditions{ + {Preim30Cond, Rsa31Cond, Ed32Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x0b\x25\xa0\x82\x0a\xa6\xa1\x82\x02\xa9\x80\x02\x50" + "\x31\x81\x01\x1a\xa2\x82\x02\x9e\xa1\x82\x02\x9a\x80\x02\x50" + "\x32\x81\x01\x1c\xa2\x82\x02\x8f\xa2\x82\x02\x8b\xa0\x82\x02" + "\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xbe\x09\xc5\xa4\x27\x29" + "\xdf\xd4\x67\x76\xbe\xbf\x2c\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd" + "\x67\x20\xfb\x7a\x27\x93\xc0\x78\x47\x78\xd7\x15\x32\xee\x38" + "\x81\x0d\x36\xa2\xc4\x65\x44\xe6\x62\x26\xb9\x58\x13\xa4\x15" + "\x82\xab\xb1\x16\x61\xfc\x01\x98\xc6\x1a\x69\xc6\xba\x39\x3f" + "\x01\x55\x3d\xd7\x8e\x14\x42\x6d\x78\x74\x9b\x28\xcb\x31\x39" + "\x98\x5a\x11\xdc\xc1\x18\x9d\x8d\xb0\xcd\x1b\x4c\x10\xab\x14" + "\x64\x19\xf1\x33\x15\x45\xc8\x92\x82\x03\x82\x8a\xaa\xad\x94" + "\xfc\x24\x11\x96\x99\x7e\x94\x5a\x82\x57\x68\x61\x9f\x7b\x45" + "\xe0\x99\x9e\x4f\x32\x50\x5f\x05\xc8\x11\xae\xc4\x0c\x63\x18" + "\x0e\x02\x59\x36\x25\x92\x06\x32\xc7\x71\x47\x99\xcc\x0a\x6e" + "\x0a\x58\x71\x3f\x5e\xb7\x78\xf7\x98\x79\xdf\x74\xa4\xeb\xa9" + "\x00\xfd\x81\xb3\xcf\x04\x8c\x5d\x7d\xe7\xb2\x82\x90\x49\xbd" + "\x69\xf3\x08\xe9\x92\xc6\x9e\x41\xba\x74\xd8\x8d\x81\x97\x6f" + "\x86\xab\xc9\xf1\x02\x31\xb4\xce\x47\xb0\x39\xc8\xba\x51\xa7" + "\x39\xf3\x71\xa2\x25\x27\x37\x6e\x09\x6f\x19\x59\xbc\x65\xd9" + "\xcd\x12\xd3\x2c\xa2\x78\xfa\x23\x15\x1a\x82\x41\x91\x1b\xbe" + "\x8a\xe7\xfe\x3c\x3c\x30\x32\xaa\xe9\xf3\x81\x82\x01\x00\x58" + "\xe8\x27\x48\x76\x66\xe6\x93\x9e\x24\xeb\x5b\xfc\x4a\xa6\x2d" + "\xa4\xf6\x98\x4b\x20\x51\x31\x06\xf4\x01\x45\x48\xf4\xe0\xe1" + "\xdd\x3f\x57\xf9\x93\xeb\x72\xcf\x67\x5b\xf8\xcf\x94\x1a\xc9" + "\xc7\x64\x41\x8c\x89\x29\xe1\x8a\x59\xac\x51\xf5\xec\xf8\x6d" + "\x36\x5d\x83\x81\x0d\xc0\x7f\x52\x9d\x32\x50\x43\x18\x08\x70" + "\x01\xce\xd7\xa6\x37\x7b\x70\xfe\x69\x02\x88\x82\x4c\x90\x07" + "\x75\x63\xc1\xf1\x20\x84\x10\xb2\xd0\xc6\x85\xa0\x40\xc5\xc4" + "\xeb\x69\xe5\x75\x28\xc9\x14\x99\x10\xb3\xde\x5a\x23\x01\x86" + "\xed\x7f\x0d\x81\x4b\x2e\xd4\xe1\x21\x7f\x53\x78\x87\x74\xc7" + "\xc3\xb7\xdd\xe6\x50\x92\x57\xeb\x20\xee\x9c\x75\x7d\xc9\x00" + "\xea\x2f\xb6\x76\x3f\x61\x67\x51\x42\x88\x5e\x5a\xd2\xac\x09" + "\x8c\x00\x39\x79\x15\x80\x7d\xf7\xb2\x6a\xc8\x30\x5e\x5b\x28" + "\x4e\x0f\x1a\x04\x37\xe9\x02\xd6\x1c\x6a\x8f\xa9\xef\x8b\x40" + "\x02\xad\x72\x53\x11\xe6\x9e\x40\x26\xca\xeb\xea\x1b\x44\xbd" + "\xd0\xcf\xd1\x1b\xd2\xc0\x27\x38\x1d\x51\x69\x4f\xd0\x78\x43" + "\x65\x7d\x81\x7c\x7b\x61\xc6\xc2\xd1\x47\xe4\xcc\x04\x9f\x40" + "\xce\x44\x68\x62\x38\xcf\x67\x46\x50\x06\xb3\x2e\x32\x21\x94" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1" + "\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59" + "\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e" + "\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91" + "\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03" + "\x02\x00\x00\xa1\x82\x02\xa9\x80\x02\x50\x38\x81\x01\x1a\xa2" + "\x82\x02\x9e\xa1\x82\x02\x9a\x80\x02\x50\x39\x81\x01\x1c\xa2" + "\x82\x02\x8f\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82\x02\x08" + "\x80\x82\x01\x00\xa8\xc7\x5e\x5a\xe9\xc7\xcb\xbc\x9c\x92\xb7" + "\xb8\x76\x67\x90\xc2\x53\xa9\x3a\x4b\x2c\xab\xdb\x80\x6e\xec" + "\x50\xbe\x9e\x5e\x96\x64\x8f\xdf\x93\xb2\xb0\xc0\xb9\x7d\xc6" + "\xc9\x75\x6b\x73\xb1\xd6\x0b\xe5\xbb\x2a\xf5\xdc\xc0\xd5\x09" + "\x95\xd3\xf5\xcf\x82\xb9\x43\x93\xdf\x5a\xd4\x4f\xa0\x60\x20" + "\x41\x01\xb0\x8f\x2a\x58\xd5\x05\xa1\x71\x14\x29\x91\xd6\x79" + "\x5a\xb3\x3b\xbe\x29\x3c\x68\x87\x48\x94\xb7\xb3\x29\xd9\xff" + "\xeb\x06\xfd\x1d\xcf\x3e\x7c\x14\x95\xfa\xa3\xc0\x25\x46\xa4" + "\xd3\x2d\xb5\x5f\x6b\x86\x18\xb4\x2f\x7b\x07\x76\xf9\xf8\x6d" + "\x57\x62\x41\x79\x30\x3c\x81\x6e\x8a\xda\x87\x6e\x1d\x64\x6d" + "\x39\x40\xd5\x5a\xb2\x2d\xba\xb8\x7a\x3b\x60\xd6\x96\x55\xfe" + "\x1e\x71\x09\x33\xad\x05\xb2\x73\xd2\x2b\xf1\x26\x06\xd9\x15" + "\xfc\x48\x36\xa4\xa2\x25\x90\x96\x9c\x3a\x6a\x0a\xd8\x9b\x4f" + "\xc6\x1a\xef\x18\xe9\x34\x0f\x85\x06\xbc\xc0\xeb\x4d\x3b\x6c" + "\x7e\xa8\x54\x01\x03\x0c\x5c\x24\x58\x61\xcd\xf1\x31\x88\x5e" + "\x00\x15\x1e\x9a\x81\x99\x0b\x1a\x33\xc5\xa6\x6c\xb4\xfb\x4e" + "\x84\x94\x9c\x7e\x2b\x00\x4d\x5c\xcf\xc2\xa6\xa5\x36\xc6\xee" + "\x72\x8e\x1e\x18\xaf\x81\x82\x01\x00\x72\x99\xa4\x26\x5c\x5f" + "\x2a\x6c\xc8\xc7\xdc\x15\xb0\xdf\x90\x46\xc3\x90\xfc\x44\x68" + "\x8a\x3a\x78\xeb\x05\x53\x15\x6c\xbb\x7a\x30\x0c\x0f\xe9\x88" + "\x28\x30\x52\x5a\x6e\x3e\x65\xe3\xcb\xc3\x99\xd2\xdd\xf8\x46" + "\x74\xd0\x4c\x6f\x07\xe2\x3a\x6f\x38\xd5\x50\xb1\x1b\xc3\xf0" + "\xa0\x8d\xe2\x1c\x47\x34\x6c\x59\xa7\x27\x13\x81\xe8\x6d\xfb" + "\xc6\x67\x23\x93\x1a\x91\xdc\x14\xf6\x46\xb2\x0a\xa2\x1a\x29" + "\xde\xc0\xe8\x08\x39\x24\x01\x54\xa4\x84\x46\x71\x20\x2c\xf8" + "\x43\x38\x1c\xed\xdd\x62\xaa\x78\xd9\x50\x4f\x3b\x9a\xd2\x38" + "\xda\x79\xed\x24\x1a\x33\x24\x89\xc4\x83\x2b\x6f\x9f\xbf\x86" + "\xc4\x4c\xf0\x64\x06\x69\x43\x71\x8b\x0e\xd4\x79\x23\x19\x81" + "\x27\x14\x3d\xd3\xa8\x62\xd9\x53\xcd\x2a\xc8\x5b\xe9\x84\x53" + "\x0b\xad\xca\xe5\x4b\xc8\xa3\x11\xc3\xe1\xaf\x08\x5d\x9d\xd1" + "\xcf\x88\x8b\xf1\x95\x28\x06\x2f\x1d\x24\x06\xaf\x29\xba\x65" + "\x35\x19\xed\xfd\x73\xdd\xf8\x72\xab\x64\x0b\x0a\x4f\xc9\x6d" + "\xc7\x64\x99\x11\xec\xe6\x27\x12\xbc\x0e\x5c\xdd\x0b\x27\x5e" + "\x74\x64\x7e\x1f\xd6\x2e\x94\x21\xb8\xe3\x00\x98\xb3\xf3\xb8" + "\x17\x50\x25\x82\xb9\x32\xe3\x66\x3c\x12\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x65\x58\x3c\x41\x23" + "\xcb\x17\xee\x38\xf7\x10\x74\xdb\xa3\x24\xb4\x5b\x39\x35\xc1" + "\x1a\xa6\xbd\xbc\xc8\xea\x71\x39\x33\xe5\xd5\x1a\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\xde\x4c\x08\x88\x5c\xfe\x31\x01\xbe" + "\xe9\xe4\x12\xce\x03\x59\x75\xb3\x7b\xac\x62\x26\xfa\x78\x07" + "\x59\x64\x4e\x5e\x89\x64\x17\x04\x81\x03\x02\x00\x00\xa2\x82" + "\x05\x48\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3" + "\x82\x02\x08\x80\x82\x01\x00\xee\x21\x9d\x3a\x07\x91\x46\x8c" + "\x0b\xfe\x9c\xe9\x61\x7b\xd4\xf4\x10\x59\xe6\x20\x0d\xd2\x48" + "\x5f\xf8\x7e\x89\xf3\x16\x39\x5d\xc1\x53\x72\x06\x1a\x36\xe7" + "\x3f\x62\xcb\xc2\xbd\x44\x9d\xa9\x0f\xb2\x03\xa8\xc7\xca\xaa" + "\x6b\x2a\x7b\xfe\x18\x93\x0c\x0e\x8e\x75\x56\xda\x2e\x47\x6f" + "\x14\x6a\x5b\xfd\x8c\x70\xda\x4b\x43\xc8\x45\x51\x13\x0b\x22" + "\x2f\x1a\x5f\x5c\x59\x4c\xa0\x3f\x85\xd2\x2f\x81\x37\x57\x40" + "\x51\xb5\xf3\x1c\x20\x5b\x31\x95\xc7\x4b\x02\xb0\x64\x9f\xdc" + "\xcb\xc0\xa7\x76\x95\xbe\x4a\x1e\xcb\xf7\x54\xcc\xa7\x9b\x51" + "\xdd\xe5\x9f\xa0\xbb\x2d\x4e\x8b\xf0\x24\xbb\xbf\xc3\xac\x4e" + "\x17\xfc\xd5\xf6\x6e\x3d\x78\xad\x5e\x68\x58\xd7\x09\x3d\x1f" + "\xd9\xf3\xc2\x7b\x62\x45\xe1\xe9\xbe\x89\x72\x87\x40\x1d\x28" + "\x9b\xf6\xc6\x92\x23\x80\xaa\x05\x38\xaf\x97\x4c\x10\xde\x84" + "\x60\x13\x17\xda\xb9\xb0\xfc\x48\x09\x83\x3f\x51\x75\x19\xad" + "\x68\x35\xc7\x8c\xb0\xb3\xd8\xff\x0f\xee\x77\xb4\x50\x3a\x5b" + "\x92\x23\xf9\x0f\xf5\x60\x86\x12\x57\xad\x52\xbe\x88\x8a\x40" + "\x08\x3e\x02\x0e\x2f\x1b\xa9\x29\x28\x2b\x15\x53\x89\xef\x64" + "\x1a\xc3\x4a\x12\x17\x26\xb5\xeb\x81\x82\x01\x00\xe8\x9f\xc0" + "\x7a\xf4\x6c\x09\xb5\x0e\xad\x3b\x20\xfa\xbe\xd8\xa3\xed\xfe" + "\xdc\xdc\x87\xa5\x2d\x22\x2e\x36\x0d\x42\x1d\x41\x55\x85\xe5" + "\x62\xa9\x0b\x8a\xba\xed\x95\x7d\xaf\x43\x20\x33\x33\x6f\xa5" + "\x55\xd9\x8b\xd6\x77\xb0\x40\xea\xb2\x18\x5b\x91\xcd\x4f\xb6" + "\x7c\xb8\x6a\x7e\x6e\xb1\xe4\xf4\x2b\x41\xeb\x91\xfc\x0f\x82" + "\xa6\x2e\xdf\xda\xb6\x41\xad\x2b\xdc\x44\xb5\x02\xc0\x3b\x98" + "\x9c\x34\x23\x82\xc3\xe8\x3a\xca\x33\x9b\x52\x1a\x87\x4d\x5e" + "\x8a\x8b\x9d\xae\x49\x93\xa2\x50\xb0\xdc\x19\x72\x34\xce\x17" + "\x24\x29\xbe\xb2\xe5\xf7\xb5\x87\x69\xb9\xdc\xde\xf6\x5c\xb1" + "\x1b\xd2\xa0\xe8\x93\x06\x77\x40\x0c\xdb\x4b\x4f\x8f\x31\x74" + "\x0c\xb6\xf4\x59\x6f\x19\x2e\x62\xf8\x11\x00\x1e\x39\xed\x6f" + "\xf5\x33\x9f\x07\x06\x1b\xdb\x79\x71\x73\xc9\xcd\x1f\xc8\x5d" + "\x56\x47\xcf\x9d\x48\x58\xff\x10\xcb\x74\x9d\xa1\xd6\x14\x10" + "\x0a\x10\x88\x3f\x21\xfa\xd2\x0d\x8c\xea\xe9\x9c\xb1\x3f\x0b" + "\x08\xcb\x06\x2b\xe9\x46\x36\xb3\xb2\xe7\x3b\x0c\x9b\xf4\x29" + "\x30\xfb\xd2\x38\xeb\xc5\x58\x0b\x19\xaf\x23\x5e\x54\xf2\x65" + "\x18\x46\xf3\x5c\x61\xc5\x5a\x3e\xe5\x9a\x87\x69\x94\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x8d\xb0" + "\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57\xca\xf4\x9d\x63\x08" + "\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9\xc6\xa3\xf1\x33\xfd" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x95\x3c\x86\x65\x91\x76" + "\x69\x6b\x72\x61\xaa\x76\x15\x2a\xd7\x25\x4f\x32\xb7\x73\x7a" + "\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81\x03\x02\x00" + "\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xe8\x03\x7c\xff\x40\x68" + "\x5d\xc7\xb8\xd0\x9f\x9a\x83\xf9\x02\xe6\xfe\xa5\xb9\x0e\x9f" + "\xdc\x44\x74\x59\x3e\xef\x61\xdc\xb6\x4b\x49\xfe\x1a\x67\x73" + "\x38\x7b\x1c\xb4\xfa\x24\x39\xe4\xbb\x74\x1b\xe4\x66\xfd\x85" + "\x6f\x8d\x92\x3e\x04\x70\xb4\x21\x01\xcf\x07\xf2\xeb\x11\x2c" + "\xaa\x9d\x37\xbb\xf3\x8d\x9b\xbc\x17\x60\xe4\xe3\xae\x79\x92" + "\x97\x3a\xe8\xd8\x74\xc5\x9d\xeb\x15\x22\x8b\xae\x51\x13\x78" + "\x21\xca\xbd\x6a\xa6\x24\x93\x8f\xe6\x23\x12\x52\xe1\x75\xda" + "\x55\x26\xcc\x95\xa0\x75\x31\x0a\x6e\x27\x14\x63\x70\x04\xd7" + "\xe4\x36\x21\x3a\x9e\xff\xe3\x16\x21\xc1\xfc\x6d\xc5\xe2\x80" + "\xb9\x26\xc6\x4f\x3c\xc2\xd5\x25\xf1\xb9\x88\xac\xc7\xfe\xde" + "\xd6\x7e\x60\x41\x82\xde\x25\x28\x1f\x09\xda\x10\x01\x27\xf4" + "\x63\x10\xa2\x4e\x1d\xc2\x19\x32\xb3\x87\xc2\xcf\xac\x3c\x2b" + "\xcd\x5e\x79\x1f\x19\xea\x70\x56\x31\x59\x0e\x13\x95\x05\xb7" + "\xf9\xff\xd9\x0b\x49\xce\xd0\x6f\xae\x90\x44\xb3\x6b\x60\xc9" + "\x72\xf7\x83\x24\x5e\x15\x25\x1c\xb8\x76\x71\x84\x33\x14\xf1" + "\xf0\x07\x7f\x2f\x95\xee\x3c\x36\x67\x36\xb4\xae\x1c\xb5\x02" + "\xa2\xdc\x0e\xed\xf2\x63\x0d\x52\x61\xe3\x81\x82\x01\x00\xe5" + "\xdf\x99\xfb\xeb\xf9\x3a\xf6\x9b\x20\x22\x26\xd8\x45\xc3\x39" + "\x8f\xda\x68\x89\x6c\x65\xd6\xa5\xc3\xfb\x04\x8a\xb7\x0e\x59" + "\x7e\xa1\xb7\xc9\xa7\x99\x35\x59\x00\x9d\xe6\x3b\xf9\xba\x53" + "\x0e\x4c\xb6\x67\xaf\x1a\x27\x91\x40\x91\xd5\x49\xde\x7b\x78" + "\xca\xb0\xa7\x7d\xda\x99\xe8\xf7\x64\x0d\xf0\xca\x23\x3c\x69" + "\x63\x7e\x3d\x4d\xb0\xa6\xc4\xc4\x49\x14\xf6\x02\x64\x09\x6f" + "\x07\x3c\xc5\xf7\x3b\x8a\x22\xa3\xa5\xe1\x88\xa8\xef\xb0\x45" + "\x75\x2e\x44\xe8\x6c\x11\x72\xe5\x7d\x81\x83\x7f\x65\x83\x84" + "\xc7\xb7\x44\x38\x3a\xce\x1e\x45\xc8\xd9\x25\xb8\x11\xb5\x4d" + "\xa9\xa1\xe3\x11\x4f\x80\x9e\x0b\x49\x1e\xb6\x56\xe3\x3b\x03" + "\x02\x11\xcb\x0c\xc7\x1f\x73\x23\x33\xcc\xf0\x54\xfc\x28\x1f" + "\xef\x2e\x8c\x41\x84\x25\xaf\x85\xfe\x9a\xa3\x83\x8a\x30\x02" + "\x51\xfb\x32\x97\xb4\xaa\x27\x8b\x27\xf6\xe9\xb9\xfa\x32\xae" + "\xda\x10\x71\xe9\xc8\x3c\xa7\xe6\x01\x0a\x59\x24\x2c\xa6\xd2" + "\x6d\xfa\xc6\x3d\xb1\x65\x44\xf0\x2e\x3e\xd0\xf9\x54\x20\x2f" + "\xbc\xf4\x29\xce\xf3\x74\x65\x32\xfb\x76\xf3\x4d\x5b\x8f\x6d" + "\x29\xdf\x31\x96\x39\x99\xa5\xea\x17\x71\xb5\xb0\xf9\x8b\x4d" + "\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80" + "\x20\x52\x94\xc9\xdb\x6a\xb5\x13\xd0\x42\x2a\x94\xaf\x6c\xd2" + "\x92\xab\xcb\x41\xc8\x85\xf7\xec\x46\xf2\x1c\x65\xc4\x0b\x4a" + "\x5a\x8e\x5e\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80" + "\x20\x4a\x64\xbf\x23\xa9\x2b\xec\x55\x00\x3d\x55\xf5\xbf\x3f" + "\x26\x49\x18\xbb\xe0\xda\xf8\x0c\xf4\x5c\x8a\x33\x74\xb6\x58" + "\xa4\x38\x30\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x6b\xf3\xe3" + "\x0f\x92\x6d\x45\x8d\xae\xd2\x8a\x2a\x3e\x53\x37\x1f\x57\x82" + "\x21\x60\xe4\x5b\x88\x9a\x9d\x13\xa2\x56\x13\x88\x9e\x21\x81" + "\x03\x02\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa3\x27\x80\x20\x34\x77\x63\xd7\x27\x76\x4d\x3a\x9b\x6c\xdb" + "\x09\xed\xd8\x5f\xc2\x12\x9e\x9c\xc4\xc8\xa6\x62\xcf\x14\xde" + "\x09\x30\x64\x8e\xf4\x84\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\xe9\x54\x85\xb7\x7d\xa1\x1f\x2f\xaa\x84\x72\x3f\x4e\x3f\x09" + "\xa7\x49\xf2\x15\x2a\xe6\x13\x5b\x68\xb6\xe1\x98\xa6\x89\x76" + "\x08\x05\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xe7\x3e\x6b\x56\x97\x05\xaa\xcb\x7a\xe0\x69" + "\x44\x0b\x10\x45\xce\x50\x5c\x09\xcb\xc3\x4c\xae\x03\x14\xae" + "\x4d\x7e\x1b\xe6\x57\x7b\x81\x03\x08\x80\x74\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\xe0\xb6\xf1\x67\x69\x17" + "\x2f\x63\xba\xa5\x29\x71\x2e\xde\x30\xa1\xfa\xd4\xb5\x43\x13" + "\xf0\xa0\xa3\x6b\xcc\x5f\xb2\xbd\x04\x3f\xd3\x81\x03\x02\x18" + "\x3a\x82\x02\x03\xb8\xa1\x2b\x80\x20\xe3\xb4\xf2\x64\xe2\xa9" + "\xb5\x0f\x19\x9b\x6e\x98\xca\x39\x70\xdc\xf4\x9d\x75\x97\x69" + "\x0c\xe0\x4b\x4b\xc3\x44\x49\x07\x46\x6a\x07\x81\x03\x02\x18" + "\x3a\x82\x02\x03\xb8\xa2\x2b\x80\x20\x8e\xee\x2e\xef\xef\x99" + "\xde\xc2\x51\x78\x1b\x84\xcd\x89\x54\x90\x86\x77\x5e\xad\x82" + "\x4b\x44\x99\x52\x5d\x06\xde\xd4\x6d\x6e\x60\x81\x03\x04\x38" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x34\x77\x63\xd7\x27\x76" + "\x4d\x3a\x9b\x6c\xdb\x09\xed\xd8\x5f\xc2\x12\x9e\x9c\xc4\xc8" + "\xa6\x62\xcf\x14\xde\x09\x30\x64\x8e\xf4\x84\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe9\x54\x85\xb7\x7d\xa1\x1f\x2f\xaa\x84" + "\x72\x3f\x4e\x3f\x09\xa7\x49\xf2\x15\x2a\xe6\x13\x5b\x68\xb6" + "\xe1\x98\xa6\x89\x76\x08\x05\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh35() + { + testcase("Thresh35"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim11Cond + // ** Rsa12Cond + // ** Ed13Cond + // ** Prefix14Cond + // ** Thresh21Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim5Cond + // ***** Rsa6Cond + // ***** Ed7Cond + // ***** rsa4 + // ** preim8 + // ** rsa9 + // ** ed10 + + auto const rsa4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4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x8c, 0x79, 0x11, 0x6b, 0x47, 0xb8, 0x61, 0x5d, + 0x3a, 0x31, 0x5c, 0x1d, 0xbd, 0x56, 0xfa, 0xa2, 0x96, 0x32, 0xb4, + 0xaa, 0x29, 0x8a, 0x70, 0xbb, 0xbe, 0xe9, 0x35, 0xf5, 0xfc, 0xac, + 0x73, 0xa9, 0x02, 0x4a, 0x8e, 0x7b, 0x42, 0xd7, 0x57, 0xf2, 0x91, + 0x9b, 0x8c, 0x7d, 0x3d, 0x32, 0xb4, 0x56, 0x6b, 0x9a, 0x72, 0x86, + 0xc8, 0x10, 0x34, 0x10, 0xbd, 0x63, 0x7d, 0x40, 0x4a, 0x67, 0xbd, + 0xe7, 0x6c, 0xf9, 0xa4, 0xb0, 0xd6, 0x57, 0x35, 0xb4, 0xba, 0x1d, + 0x0a, 0xad, 0x4f}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim8Preimage = "I am root"s; + auto const preim8Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa9PublicKey{ + {0xb6, 0x7b, 0xe2, 0x98, 0x9f, 0xff, 0x6c, 0x37, 0xd0, 0xb6, 0x64, + 0x19, 0xfb, 0xa0, 0x21, 0x18, 0xe2, 0xc0, 0xd1, 0x92, 0xbd, 0x04, + 0xa6, 0xd2, 0xb4, 0x7e, 0xc6, 0x6a, 0x1a, 0x34, 0x20, 0x7b, 0xfe, + 0x84, 0xeb, 0xe8, 0xc1, 0x6f, 0xfd, 0xdc, 0x0a, 0xfe, 0x60, 0x55, + 0xb6, 0xfc, 0x86, 0x5a, 0x21, 0xbf, 0xf1, 0x39, 0xfa, 0xec, 0x42, + 0xca, 0x57, 0xb3, 0x3e, 0x3f, 0xe6, 0x26, 0x5a, 0xb7, 0x4a, 0x5f, + 0xbb, 0xb1, 0xf5, 0x91, 0x85, 0x92, 0x3e, 0x6a, 0x18, 0x48, 0x4d, + 0x9e, 0xdd, 0x08, 0x25, 0xa3, 0x3b, 0x3d, 0x75, 0x9a, 0xbe, 0xee, + 0x0d, 0x6e, 0xd2, 0x5d, 0xe2, 0xbd, 0xed, 0x45, 0x60, 0xef, 0xa0, + 0x37, 0xfd, 0xbb, 0xcf, 0x30, 0x97, 0xf1, 0x5b, 0xc8, 0x9c, 0x29, + 0x33, 0x67, 0x3e, 0x23, 0x33, 0x7f, 0x36, 0xd4, 0x75, 0x8b, 0xa1, + 0xcf, 0x9e, 0xe6, 0xc5, 0x63, 0x63, 0xb0, 0x3f, 0xa0, 0xc2, 0xa2, + 0x10, 0xc9, 0xb2, 0x6b, 0xaa, 0x67, 0xc9, 0xf5, 0xb8, 0xbf, 0x5b, + 0x97, 0xe5, 0x29, 0xf2, 0xbb, 0xc7, 0x22, 0x0f, 0x1f, 0xc1, 0xf6, + 0xca, 0x4a, 0x8a, 0x46, 0x89, 0xa0, 0xca, 0x4e, 0x49, 0x9d, 0xfc, + 0x23, 0xd3, 0xb4, 0xdb, 0xc6, 0x84, 0x45, 0xbd, 0x9f, 0x10, 0x86, + 0xe2, 0xf0, 0x47, 0x7b, 0x75, 0xbf, 0x25, 0x99, 0x02, 0x2c, 0xdb, + 0x6b, 0xd6, 0x2b, 0x67, 0x0d, 0xcd, 0x46, 0x63, 0xbd, 0xce, 0x1c, + 0xc5, 0x56, 0x63, 0x58, 0x5b, 0xc8, 0xb2, 0x58, 0x42, 0xf6, 0xaf, + 0xce, 0x47, 0xb2, 0xa9, 0x2a, 0x71, 0x8b, 0x82, 0xf4, 0x72, 0xff, + 0xef, 0xe7, 0xc1, 0x70, 0x12, 0xfa, 0xb8, 0xad, 0xb2, 0xfe, 0xa9, + 0x14, 0xe7, 0xc2, 0xec, 0x12, 0xbf, 0x29, 0x5a, 0x65, 0x91, 0x74, + 0x82, 0xd3, 0x77, 0x1f, 0x14, 0xbf, 0x5f, 0x41, 0x11, 0x6c, 0x7c, + 0x22, 0x70, 0x65}}; + std::array const rsa9Sig{ + {0x41, 0x08, 0x39, 0x38, 0x0d, 0x83, 0xce, 0x97, 0x57, 0x83, 0xa6, + 0x47, 0xe1, 0x28, 0x4a, 0xf4, 0x86, 0x38, 0xad, 0x1a, 0x46, 0x73, + 0x4a, 0xb7, 0x1e, 0x07, 0xfe, 0xbd, 0xc1, 0x80, 0x31, 0x21, 0xa4, + 0x63, 0xd0, 0x76, 0x63, 0x50, 0x63, 0x8a, 0xe7, 0x63, 0xe8, 0x0a, + 0x3e, 0x32, 0x43, 0xf7, 0xe4, 0x5b, 0x7b, 0x3d, 0x47, 0x9c, 0xd0, + 0x13, 0xf2, 0x76, 0x57, 0x1a, 0x18, 0x2d, 0x91, 0x3f, 0x76, 0xd4, + 0x29, 0xe4, 0x38, 0x99, 0xf0, 0x41, 0x41, 0xfa, 0x4d, 0x37, 0xbc, + 0xe8, 0x8e, 0xf5, 0xd0, 0x37, 0xf0, 0x8c, 0x27, 0x88, 0x99, 0xfa, + 0x5f, 0xd9, 0xbf, 0x71, 0x78, 0x06, 0x06, 0x4c, 0x2c, 0xdd, 0x83, + 0xb6, 0x31, 0xc5, 0x1d, 0xf9, 0x08, 0x60, 0x4a, 0x15, 0x4e, 0x95, + 0x60, 0xd7, 0xc9, 0x85, 0xc5, 0x17, 0xa3, 0x71, 0x75, 0x9d, 0x23, + 0x3b, 0xa1, 0x5e, 0xa2, 0x57, 0x37, 0x15, 0xf4, 0xce, 0x52, 0xef, + 0x47, 0xd3, 0x16, 0x23, 0x94, 0xd6, 0xdd, 0x1a, 0x4d, 0x8d, 0xa2, + 0xb5, 0x0a, 0x48, 0x01, 0x09, 0x3a, 0x3b, 0x80, 0x8f, 0xec, 0x02, + 0xa5, 0x6d, 0x37, 0x87, 0x17, 0xcb, 0xa5, 0x77, 0x9f, 0x39, 0x33, + 0x7b, 0x7c, 0x09, 0x77, 0x3e, 0xec, 0x02, 0xb2, 0x9a, 0xca, 0x55, + 0x3f, 0x65, 0xaa, 0x1a, 0x9c, 0x4c, 0xba, 0x2b, 0x41, 0xba, 0x52, + 0x5b, 0x89, 0x29, 0xd6, 0xb2, 0xbe, 0x50, 0x37, 0xc6, 0xa3, 0x11, + 0x2f, 0x90, 0x20, 0x7a, 0x63, 0xa4, 0xdd, 0xe2, 0xdf, 0x72, 0x26, + 0x99, 0x93, 0x58, 0x14, 0xd1, 0x15, 0x6e, 0x33, 0xf7, 0xd5, 0x98, + 0x32, 0x65, 0xb9, 0x50, 0xe2, 0x84, 0x15, 0x71, 0x53, 0xa5, 0x37, + 0x3c, 0x7c, 0x71, 0x47, 0x4e, 0xae, 0x13, 0xdf, 0x3c, 0x5c, 0xc7, + 0x68, 0x6a, 0xcf, 0x28, 0x41, 0x8a, 0xcc, 0xe2, 0x83, 0x45, 0x3a, + 0xb8, 0x84, 0x0d}}; + auto const ed10Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed10PublicKey{ + {0x7a, 0xdc, 0x65, 0x52, 0x0f, 0xca, 0x06, 0x72, 0x5c, 0xe4, 0x65, + 0x57, 0x82, 0x6d, 0x3f, 0x57, 0x1f, 0xc6, 0xc6, 0xe4, 0x5d, 0xaf, + 0x08, 0xda, 0xe2, 0x07, 0x02, 0xcb, 0x42, 0x3d, 0x2a, 0xd0}}; + std::array const ed10Sig{ + {0xf2, 0x7c, 0x5f, 0x61, 0xec, 0xbc, 0xc2, 0x8c, 0xad, 0xd0, 0xd3, + 0xcb, 0x89, 0xab, 0xac, 0xe4, 0x01, 0x6f, 0x90, 0x60, 0x6f, 0x89, + 0xc0, 0xd9, 0xca, 0x2b, 0x4b, 0xfd, 0x78, 0x80, 0xae, 0xf9, 0xd0, + 0x3f, 0x45, 0x7a, 0xb2, 0x26, 0x0c, 0xee, 0xc5, 0x06, 0x0e, 0x94, + 0x6b, 0xf8, 0xfe, 0x96, 0x4f, 0x0d, 0xa0, 0x2c, 0x66, 0x78, 0xa5, + 0x60, 0xfe, 0x47, 0x1e, 0xa9, 0x88, 0x76, 0x55, 0x03}}; + std::array const ed10SigningKey{ + {0x84, 0x04, 0xdd, 0x34, 0x6a, 0x4d, 0x40, 0xef, 0x70, 0xf7, 0xef, + 0x7f, 0x25, 0xf4, 0xd0, 0xa0, 0xa8, 0xad, 0xc1, 0x51, 0x1c, 0x16, + 0x57, 0x9d, 0x5e, 0xd9, 0xa6, 0x45, 0xda, 0xff, 0x5e, 0x1e}}; + (void)ed10SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim11CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim11Cond{Type::preimageSha256, + 9, + Preim11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa12CondConditionFingerprint = { + {0x38, 0xb9, 0xf0, 0xeb, 0x68, 0x8b, 0x9f, 0x55, 0x37, 0x9a, 0xec, + 0x07, 0xd4, 0xa2, 0x13, 0xac, 0x34, 0xa1, 0x67, 0x31, 0x34, 0xea, + 0xc2, 0x2f, 0xef, 0x13, 0xe3, 0x5c, 0xcf, 0x8f, 0x90, 0x1e}}; + Condition const Rsa12Cond{Type::rsaSha256, + 65536, + Rsa12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed13CondConditionFingerprint = { + {0x7c, 0x54, 0x6a, 0x6d, 0x7f, 0x00, 0x52, 0x31, 0x03, 0xe7, 0xb4, + 0x5b, 0x1c, 0x9f, 0x72, 0xeb, 0x3c, 0x18, 0x08, 0xa3, 0x24, 0xb2, + 0x63, 0x5f, 0x77, 0x55, 0x4a, 0x42, 0xdb, 0x1e, 0xff, 0x1e}}; + Condition const Ed13Cond{Type::ed25519Sha256, + 131072, + Ed13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix14CondConditionFingerprint = { + {0x26, 0xd2, 0x1f, 0x33, 0xe4, 0xab, 0x28, 0x70, 0x49, 0x03, 0x2f, + 0x8a, 0x9e, 0xb1, 0xbd, 0xe8, 0x51, 0xc2, 0x70, 0xa4, 0x7a, 0xa1, + 0xa1, 0xc9, 0x35, 0xe5, 0x39, 0xf1, 0x97, 0xba, 0xb1, 0xb8}}; + Condition const Prefix14Cond{Type::prefixSha256, + 137251, + Prefix14CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh21CondConditionFingerprint = { + {0x6f, 0xe1, 0x6e, 0x14, 0x5b, 0xe3, 0xa8, 0x1f, 0x91, 0x88, 0x33, + 0xb3, 0x3e, 0xdc, 0x51, 0x88, 0x3f, 0x7d, 0x54, 0x43, 0xe9, 0x03, + 0x02, 0x32, 0xfb, 0xbc, 0x58, 0x8e, 0x22, 0x3d, 0x56, 0x35}}; + Condition const Thresh21Cond{Type::thresholdSha256, + 276480, + Thresh21CondConditionFingerprint, + std::bitset<5>{25}}; + + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim8 = + std::make_unique(makeSlice(preim8Preimage)); + auto rsa9 = std::make_unique( + makeSlice(rsa9PublicKey), makeSlice(rsa9Sig)); + auto ed10 = std::make_unique(ed10PublicKey, ed10Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim8)); + thresh0Subfulfillments.emplace_back(std::move(rsa9)); + thresh0Subfulfillments.emplace_back(std::move(ed10)); + std::vector thresh0Subconditions{ + {Preim11Cond, Rsa12Cond, Ed13Cond, Prefix14Cond, Thresh21Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x06\x06\xa0\x82\x05\x2c\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x82\x02\xa9\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x82\x02\x9e\xa1\x82\x02\x9a\x80\x02\x50\x32\x81" + "\x01\x1c\xa2\x82\x02\x8f\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3" + "\x82\x02\x08\x80\x82\x01\x00\xbe\x09\xc5\xa4\x27\x29\xdf\xd4" + "\x67\x76\xbe\xbf\x2c\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67\x20" + "\xfb\x7a\x27\x93\xc0\x78\x47\x78\xd7\x15\x32\xee\x38\x81\x0d" + "\x36\xa2\xc4\x65\x44\xe6\x62\x26\xb9\x58\x13\xa4\x15\x82\xab" + "\xb1\x16\x61\xfc\x01\x98\xc6\x1a\x69\xc6\xba\x39\x3f\x01\x55" + "\x3d\xd7\x8e\x14\x42\x6d\x78\x74\x9b\x28\xcb\x31\x39\x98\x5a" + "\x11\xdc\xc1\x18\x9d\x8d\xb0\xcd\x1b\x4c\x10\xab\x14\x64\x19" + "\xf1\x33\x15\x45\xc8\x92\x82\x03\x82\x8a\xaa\xad\x94\xfc\x24" + "\x11\x96\x99\x7e\x94\x5a\x82\x57\x68\x61\x9f\x7b\x45\xe0\x99" + "\x9e\x4f\x32\x50\x5f\x05\xc8\x11\xae\xc4\x0c\x63\x18\x0e\x02" + "\x59\x36\x25\x92\x06\x32\xc7\x71\x47\x99\xcc\x0a\x6e\x0a\x58" + "\x71\x3f\x5e\xb7\x78\xf7\x98\x79\xdf\x74\xa4\xeb\xa9\x00\xfd" + "\x81\xb3\xcf\x04\x8c\x5d\x7d\xe7\xb2\x82\x90\x49\xbd\x69\xf3" + "\x08\xe9\x92\xc6\x9e\x41\xba\x74\xd8\x8d\x81\x97\x6f\x86\xab" + "\xc9\xf1\x02\x31\xb4\xce\x47\xb0\x39\xc8\xba\x51\xa7\x39\xf3" + "\x71\xa2\x25\x27\x37\x6e\x09\x6f\x19\x59\xbc\x65\xd9\xcd\x12" + "\xd3\x2c\xa2\x78\xfa\x23\x15\x1a\x82\x41\x91\x1b\xbe\x8a\xe7" + "\xfe\x3c\x3c\x30\x32\xaa\xe9\xf3\x81\x82\x01\x00\x2a\x82\x2f" + "\xa5\xfb\xed\xa1\xbb\x2c\x97\xfa\x4a\xc4\x3a\x74\xf5\x49\xb3" + "\x58\x51\xcf\x41\xb5\xfe\x8e\xe8\xff\x8d\xd9\x8e\x24\x08\x9c" + "\x6b\x15\x13\xea\x5d\xed\x19\x32\x4d\xd9\x87\x08\x1f\x8d\x0a" + "\x67\xcd\xa3\x52\x85\xec\xe3\x93\x08\x88\xaa\x82\x90\x8b\x3a" + "\x3b\x70\xcd\xd0\x1c\x03\x8f\x6d\x8d\xb5\xfb\xdd\xe3\xfe\x45" + "\x02\x62\x4a\x18\xf3\xfa\xf6\xb7\x6c\x39\x06\x65\xab\xa1\x0e" + "\xf4\x81\x81\x25\xa5\x86\xfc\x85\xe1\x0b\x2f\xa8\x4f\x1d\x47" + "\x6c\x99\x49\x6f\x4a\x04\xec\x2b\x7f\xd2\x9a\x3d\x74\x44\x7c" + "\x46\x79\x5a\x62\xf6\x53\xc7\x73\xb1\xd4\xc9\x9e\x9a\x06\x77" + "\x95\x4e\xf4\x1d\xc3\x1a\x77\x40\xb2\x88\xf2\xdb\x64\x3f\x0e" + "\xb8\xf9\x93\x03\x90\x3d\x99\xea\x89\xe9\x6f\xfb\xd0\x7e\x7a" + "\x53\x6b\x48\xff\xba\xfa\x41\xf4\xdc\xf6\xc6\x8c\x79\x11\x6b" + "\x47\xb8\x61\x5d\x3a\x31\x5c\x1d\xbd\x56\xfa\xa2\x96\x32\xb4" + "\xaa\x29\x8a\x70\xbb\xbe\xe9\x35\xf5\xfc\xac\x73\xa9\x02\x4a" + "\x8e\x7b\x42\xd7\x57\xf2\x91\x9b\x8c\x7d\x3d\x32\xb4\x56\x6b" + "\x9a\x72\x86\xc8\x10\x34\x10\xbd\x63\x7d\x40\x4a\x67\xbd\xe7" + "\x6c\xf9\xa4\xb0\xd6\x57\x35\xb4\xba\x1d\x0a\xad\x4f\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xee\x75" + "\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c\x70" + "\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2\xa0" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6" + "\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2" + "\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00" + "\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xb6\x7b\xe2\x98\x9f\xff" + "\x6c\x37\xd0\xb6\x64\x19\xfb\xa0\x21\x18\xe2\xc0\xd1\x92\xbd" + "\x04\xa6\xd2\xb4\x7e\xc6\x6a\x1a\x34\x20\x7b\xfe\x84\xeb\xe8" + "\xc1\x6f\xfd\xdc\x0a\xfe\x60\x55\xb6\xfc\x86\x5a\x21\xbf\xf1" + "\x39\xfa\xec\x42\xca\x57\xb3\x3e\x3f\xe6\x26\x5a\xb7\x4a\x5f" + "\xbb\xb1\xf5\x91\x85\x92\x3e\x6a\x18\x48\x4d\x9e\xdd\x08\x25" + "\xa3\x3b\x3d\x75\x9a\xbe\xee\x0d\x6e\xd2\x5d\xe2\xbd\xed\x45" + "\x60\xef\xa0\x37\xfd\xbb\xcf\x30\x97\xf1\x5b\xc8\x9c\x29\x33" + "\x67\x3e\x23\x33\x7f\x36\xd4\x75\x8b\xa1\xcf\x9e\xe6\xc5\x63" + "\x63\xb0\x3f\xa0\xc2\xa2\x10\xc9\xb2\x6b\xaa\x67\xc9\xf5\xb8" + "\xbf\x5b\x97\xe5\x29\xf2\xbb\xc7\x22\x0f\x1f\xc1\xf6\xca\x4a" + "\x8a\x46\x89\xa0\xca\x4e\x49\x9d\xfc\x23\xd3\xb4\xdb\xc6\x84" + "\x45\xbd\x9f\x10\x86\xe2\xf0\x47\x7b\x75\xbf\x25\x99\x02\x2c" + "\xdb\x6b\xd6\x2b\x67\x0d\xcd\x46\x63\xbd\xce\x1c\xc5\x56\x63" + "\x58\x5b\xc8\xb2\x58\x42\xf6\xaf\xce\x47\xb2\xa9\x2a\x71\x8b" + "\x82\xf4\x72\xff\xef\xe7\xc1\x70\x12\xfa\xb8\xad\xb2\xfe\xa9" + "\x14\xe7\xc2\xec\x12\xbf\x29\x5a\x65\x91\x74\x82\xd3\x77\x1f" + "\x14\xbf\x5f\x41\x11\x6c\x7c\x22\x70\x65\x81\x82\x01\x00\x41" + "\x08\x39\x38\x0d\x83\xce\x97\x57\x83\xa6\x47\xe1\x28\x4a\xf4" + "\x86\x38\xad\x1a\x46\x73\x4a\xb7\x1e\x07\xfe\xbd\xc1\x80\x31" + "\x21\xa4\x63\xd0\x76\x63\x50\x63\x8a\xe7\x63\xe8\x0a\x3e\x32" + "\x43\xf7\xe4\x5b\x7b\x3d\x47\x9c\xd0\x13\xf2\x76\x57\x1a\x18" + "\x2d\x91\x3f\x76\xd4\x29\xe4\x38\x99\xf0\x41\x41\xfa\x4d\x37" + "\xbc\xe8\x8e\xf5\xd0\x37\xf0\x8c\x27\x88\x99\xfa\x5f\xd9\xbf" + "\x71\x78\x06\x06\x4c\x2c\xdd\x83\xb6\x31\xc5\x1d\xf9\x08\x60" + "\x4a\x15\x4e\x95\x60\xd7\xc9\x85\xc5\x17\xa3\x71\x75\x9d\x23" + "\x3b\xa1\x5e\xa2\x57\x37\x15\xf4\xce\x52\xef\x47\xd3\x16\x23" + "\x94\xd6\xdd\x1a\x4d\x8d\xa2\xb5\x0a\x48\x01\x09\x3a\x3b\x80" + "\x8f\xec\x02\xa5\x6d\x37\x87\x17\xcb\xa5\x77\x9f\x39\x33\x7b" + "\x7c\x09\x77\x3e\xec\x02\xb2\x9a\xca\x55\x3f\x65\xaa\x1a\x9c" + "\x4c\xba\x2b\x41\xba\x52\x5b\x89\x29\xd6\xb2\xbe\x50\x37\xc6" + "\xa3\x11\x2f\x90\x20\x7a\x63\xa4\xdd\xe2\xdf\x72\x26\x99\x93" + "\x58\x14\xd1\x15\x6e\x33\xf7\xd5\x98\x32\x65\xb9\x50\xe2\x84" + "\x15\x71\x53\xa5\x37\x3c\x7c\x71\x47\x4e\xae\x13\xdf\x3c\x5c" + "\xc7\x68\x6a\xcf\x28\x41\x8a\xcc\xe2\x83\x45\x3a\xb8\x84\x0d" + "\xa4\x64\x80\x20\x7a\xdc\x65\x52\x0f\xca\x06\x72\x5c\xe4\x65" + "\x57\x82\x6d\x3f\x57\x1f\xc6\xc6\xe4\x5d\xaf\x08\xda\xe2\x07" + "\x02\xcb\x42\x3d\x2a\xd0\x81\x40\xf2\x7c\x5f\x61\xec\xbc\xc2" + "\x8c\xad\xd0\xd3\xcb\x89\xab\xac\xe4\x01\x6f\x90\x60\x6f\x89" + "\xc0\xd9\xca\x2b\x4b\xfd\x78\x80\xae\xf9\xd0\x3f\x45\x7a\xb2" + "\x26\x0c\xee\xc5\x06\x0e\x94\x6b\xf8\xfe\x96\x4f\x0d\xa0\x2c" + "\x66\x78\xa5\x60\xfe\x47\x1e\xa9\x88\x76\x55\x03\xa1\x81\xd3" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x26\xd2" + "\x1f\x33\xe4\xab\x28\x70\x49\x03\x2f\x8a\x9e\xb1\xbd\xe8\x51" + "\xc2\x70\xa4\x7a\xa1\xa1\xc9\x35\xe5\x39\xf1\x97\xba\xb1\xb8" + "\x81\x03\x02\x18\x23\x82\x02\x03\xb8\xa2\x2b\x80\x20\x6f\xe1" + "\x6e\x14\x5b\xe3\xa8\x1f\x91\x88\x33\xb3\x3e\xdc\x51\x88\x3f" + "\x7d\x54\x43\xe9\x03\x02\x32\xfb\xbc\x58\x8e\x22\x3d\x56\x35" + "\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x38\xb9" + "\xf0\xeb\x68\x8b\x9f\x55\x37\x9a\xec\x07\xd4\xa2\x13\xac\x34" + "\xa1\x67\x31\x34\xea\xc2\x2f\xef\x13\xe3\x5c\xcf\x8f\x90\x1e" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x7c\x54\x6a\x6d\x7f\x00" + "\x52\x31\x03\xe7\xb4\x5b\x1c\x9f\x72\xeb\x3c\x18\x08\xa3\x24" + "\xb2\x63\x5f\x77\x55\x4a\x42\xdb\x1e\xff\x1e\x81\x03\x02\x00" + "\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x3c\xdb\x7f\xbc\x90\x60\xa4\xd7\x22\x75\x2b" + "\xab\xeb\x34\x0e\x81\xbf\x4a\x78\xd8\x06\x39\x41\xb3\x91\xd5" + "\xbd\xb3\xfb\x25\x29\x04\x81\x03\x0a\x8c\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x26\xd2\x1f\x33\xe4\xab\x28\x70\x49\x03\x2f\x8a" + "\x9e\xb1\xbd\xe8\x51\xc2\x70\xa4\x7a\xa1\xa1\xc9\x35\xe5\x39" + "\xf1\x97\xba\xb1\xb8\x81\x03\x02\x18\x23\x82\x02\x03\xb8\xa1" + "\x2b\x80\x20\xe3\xb4\xf2\x64\xe2\xa9\xb5\x0f\x19\x9b\x6e\x98" + "\xca\x39\x70\xdc\xf4\x9d\x75\x97\x69\x0c\xe0\x4b\x4b\xc3\x44" + "\x49\x07\x46\x6a\x07\x81\x03\x02\x18\x3a\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\x6f\xe1\x6e\x14\x5b\xe3\xa8\x1f\x91\x88\x33\xb3" + "\x3e\xdc\x51\x88\x3f\x7d\x54\x43\xe9\x03\x02\x32\xfb\xbc\x58" + "\x8e\x22\x3d\x56\x35\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x38\xb9\xf0\xeb\x68\x8b\x9f\x55\x37\x9a\xec\x07" + "\xd4\xa2\x13\xac\x34\xa1\x67\x31\x34\xea\xc2\x2f\xef\x13\xe3" + "\x5c\xcf\x8f\x90\x1e\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xe5" + "\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70\x64\x51" + "\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7\xe4" + "\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4" + "\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79" + "\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x7c\x54\x6a\x6d\x7f\x00\x52\x31\x03" + "\xe7\xb4\x5b\x1c\x9f\x72\xeb\x3c\x18\x08\xa3\x24\xb2\x63\x5f" + "\x77\x55\x4a\x42\xdb\x1e\xff\x1e\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh36() + { + testcase("Thresh36"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim27Cond + // ** Rsa28Cond + // ** Ed29Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** rsa4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** rsa6 + // ** prefix13 + // *** prefix14 + // **** thresh15 + // ***** Preim22Cond + // ***** Rsa23Cond + // ***** Ed24Cond + // ***** rsa16 + // ***** thresh17 + // ****** Preim19Cond + // ****** Rsa20Cond + // ****** Ed21Cond + // ****** rsa18 + // ** thresh25 + // *** rsa26 + + auto const rsa4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0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 0xab, 0xd4, + 0x39, 0x28, 0xa9, 0x00, 0x8a, 0x98, 0x2f, 0xee, 0xd8, 0x3b, 0xfb, + 0x6c, 0x7e, 0x14, 0xb7, 0xe6, 0xe3, 0xba, 0xa5, 0x10, 0x7b, 0x42, + 0x36, 0xf8, 0x29, 0xac, 0x11, 0xd6, 0x93, 0x6c, 0x95, 0x93, 0x95, + 0x98, 0x1a, 0x39, 0xbb, 0x39, 0x65, 0xe8, 0xab, 0xf9, 0xe7, 0xce, + 0x50, 0xb6, 0x5b, 0xb1, 0x55, 0x62, 0x61, 0x40, 0xfc, 0x49, 0xa7, + 0x97, 0x93, 0x81, 0xe2, 0x6f, 0x7a, 0x1f, 0xbb, 0x6f, 0x34, 0x72, + 0xec, 0xe9, 0x49, 0x54, 0x83, 0xda, 0xd6, 0xd8, 0x0a, 0x65, 0x45, + 0xa8, 0x75, 0x04, 0x40, 0x3b, 0xad, 0xbe, 0x40, 0x4d, 0xfa, 0x08, + 0x08, 0x03, 0x08, 0x9a, 0x25, 0xff, 0x5a, 0x6f, 0xe7, 0x08, 0xcd, + 0x9f, 0x73, 0xe3, 0xb6, 0x83, 0x02, 0xae, 0xa1, 0x12, 0xf8, 0x0a, + 0xab, 0xc6, 0x2d}}; + auto const rsa6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 0x40, 0xe4, 0x52, 0x30, + 0x42, 0x74, 0xfd, 0x35, 0x04, 0xde, 0x45, 0x68, 0xb3, 0x22, 0xdd, + 0xff, 0x41, 0x43, 0x69, 0x33, 0xc0, 0xff, 0x35, 0xb6, 0x6d, 0x15, + 0xe9, 0x54, 0x15, 0xeb, 0x1d, 0x07, 0xe2, 0x25, 0x2b, 0xdb, 0xaa, + 0x16, 0x8d, 0x0d, 0x7f, 0x05, 0xf0, 0xd2, 0x7d, 0xb4, 0x9b, 0x51, + 0x19, 0x20, 0x1e, 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f, 0xb3, 0x5e, + 0xec, 0x4f, 0xcc, 0x6d, 0x13, 0x58, 0xc8, 0xa3, 0xa3, 0xee, 0x23, + 0x8a, 0xc2, 0xbf}}; + std::array const rsa6Sig{ + {0x19, 0x7e, 0x74, 0x80, 0x4d, 0x64, 0xb4, 0x9b, 0xab, 0x92, 0x44, + 0x03, 0x95, 0xa2, 0x0f, 0x8f, 0x4d, 0x90, 0x8f, 0x2c, 0xf1, 0x03, + 0xc9, 0x57, 0xab, 0x6e, 0x6c, 0x65, 0x6d, 0xa1, 0x3a, 0xd2, 0xa5, + 0x38, 0x92, 0x25, 0x87, 0xd1, 0x33, 0x4e, 0x18, 0xbf, 0xf3, 0x29, + 0xa1, 0x08, 0xc3, 0xdc, 0xbd, 0x58, 0xe4, 0x48, 0x30, 0x18, 0x40, + 0x75, 0xa7, 0x4e, 0x53, 0x96, 0xb3, 0x43, 0x10, 0x11, 0xec, 0xd1, + 0x4c, 0xfa, 0x4f, 0xe3, 0x23, 0x1e, 0x39, 0xf0, 0x71, 0xc2, 0xa7, + 0x53, 0x1a, 0x7d, 0xe7, 0x9b, 0x3f, 0xb2, 0x24, 0x67, 0x91, 0x0f, + 0x1a, 0x02, 0xf3, 0x84, 0x39, 0x43, 0x1f, 0x65, 0x3a, 0x8f, 0xeb, + 0xc7, 0xb0, 0x94, 0xbb, 0xf6, 0x39, 0x25, 0xb2, 0x68, 0x2f, 0x5a, + 0xf2, 0x1a, 0x66, 0x26, 0x00, 0xd6, 0x84, 0xef, 0x56, 0x52, 0x0e, + 0xd4, 0x74, 0xd2, 0x3d, 0xe2, 0x4b, 0x8b, 0x10, 0xeb, 0xd7, 0x43, + 0x84, 0x09, 0x55, 0xe9, 0x2c, 0xfd, 0x68, 0xc3, 0x12, 0x88, 0x77, + 0xda, 0x84, 0x72, 0x4d, 0x40, 0x35, 0xce, 0x69, 0xbb, 0xec, 0x3d, + 0xec, 0x72, 0x68, 0x54, 0x23, 0xef, 0x84, 0xa5, 0x29, 0xfa, 0xff, + 0x09, 0xfd, 0x4c, 0x92, 0x4d, 0xd6, 0xc2, 0x2a, 0x1d, 0x78, 0xbf, + 0x72, 0x53, 0x74, 0x5c, 0xfd, 0x08, 0xa2, 0xcf, 0xaf, 0xf0, 0x74, + 0x60, 0xce, 0xd3, 0x21, 0x12, 0x38, 0xd2, 0x30, 0x30, 0x5e, 0x42, + 0x64, 0xa3, 0xcc, 0x30, 0xb3, 0xf9, 0x35, 0x61, 0xc8, 0x6d, 0x7f, + 0xf9, 0x86, 0x22, 0xfa, 0xfc, 0x50, 0x86, 0x4d, 0x18, 0x85, 0xd2, + 0xd3, 0x37, 0x69, 0x5e, 0xde, 0x88, 0xe1, 0x9d, 0x00, 0x69, 0xaa, + 0xa4, 0x5e, 0x91, 0x8b, 0x8d, 0x68, 0xdf, 0xb0, 0x8b, 0x08, 0x30, + 0x9a, 0x5e, 0x90, 0x9d, 0xe1, 0xa2, 0xbe, 0xfb, 0x61, 0xdb, 0x6f, + 0x7d, 0x29, 0xef}}; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const rsa16Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa16PublicKey{ + {0xe8, 0x03, 0x7c, 0xff, 0x40, 0x68, 0x5d, 0xc7, 0xb8, 0xd0, 0x9f, + 0x9a, 0x83, 0xf9, 0x02, 0xe6, 0xfe, 0xa5, 0xb9, 0x0e, 0x9f, 0xdc, + 0x44, 0x74, 0x59, 0x3e, 0xef, 0x61, 0xdc, 0xb6, 0x4b, 0x49, 0xfe, + 0x1a, 0x67, 0x73, 0x38, 0x7b, 0x1c, 0xb4, 0xfa, 0x24, 0x39, 0xe4, + 0xbb, 0x74, 0x1b, 0xe4, 0x66, 0xfd, 0x85, 0x6f, 0x8d, 0x92, 0x3e, + 0x04, 0x70, 0xb4, 0x21, 0x01, 0xcf, 0x07, 0xf2, 0xeb, 0x11, 0x2c, + 0xaa, 0x9d, 0x37, 0xbb, 0xf3, 0x8d, 0x9b, 0xbc, 0x17, 0x60, 0xe4, + 0xe3, 0xae, 0x79, 0x92, 0x97, 0x3a, 0xe8, 0xd8, 0x74, 0xc5, 0x9d, + 0xeb, 0x15, 0x22, 0x8b, 0xae, 0x51, 0x13, 0x78, 0x21, 0xca, 0xbd, + 0x6a, 0xa6, 0x24, 0x93, 0x8f, 0xe6, 0x23, 0x12, 0x52, 0xe1, 0x75, + 0xda, 0x55, 0x26, 0xcc, 0x95, 0xa0, 0x75, 0x31, 0x0a, 0x6e, 0x27, + 0x14, 0x63, 0x70, 0x04, 0xd7, 0xe4, 0x36, 0x21, 0x3a, 0x9e, 0xff, + 0xe3, 0x16, 0x21, 0xc1, 0xfc, 0x6d, 0xc5, 0xe2, 0x80, 0xb9, 0x26, + 0xc6, 0x4f, 0x3c, 0xc2, 0xd5, 0x25, 0xf1, 0xb9, 0x88, 0xac, 0xc7, + 0xfe, 0xde, 0xd6, 0x7e, 0x60, 0x41, 0x82, 0xde, 0x25, 0x28, 0x1f, + 0x09, 0xda, 0x10, 0x01, 0x27, 0xf4, 0x63, 0x10, 0xa2, 0x4e, 0x1d, + 0xc2, 0x19, 0x32, 0xb3, 0x87, 0xc2, 0xcf, 0xac, 0x3c, 0x2b, 0xcd, + 0x5e, 0x79, 0x1f, 0x19, 0xea, 0x70, 0x56, 0x31, 0x59, 0x0e, 0x13, + 0x95, 0x05, 0xb7, 0xf9, 0xff, 0xd9, 0x0b, 0x49, 0xce, 0xd0, 0x6f, + 0xae, 0x90, 0x44, 0xb3, 0x6b, 0x60, 0xc9, 0x72, 0xf7, 0x83, 0x24, + 0x5e, 0x15, 0x25, 0x1c, 0xb8, 0x76, 0x71, 0x84, 0x33, 0x14, 0xf1, + 0xf0, 0x07, 0x7f, 0x2f, 0x95, 0xee, 0x3c, 0x36, 0x67, 0x36, 0xb4, + 0xae, 0x1c, 0xb5, 0x02, 0xa2, 0xdc, 0x0e, 0xed, 0xf2, 0x63, 0x0d, + 0x52, 0x61, 0xe3}}; + std::array const rsa16Sig{ + {0x5c, 0x70, 0xa5, 0x22, 0x8c, 0x3f, 0x51, 0x83, 0x5d, 0x61, 0x8c, + 0x06, 0x54, 0x56, 0x1d, 0x8e, 0x0d, 0xd0, 0x90, 0x43, 0x53, 0x75, + 0x19, 0x62, 0x89, 0xe4, 0xc7, 0x19, 0x32, 0x40, 0xa2, 0xc4, 0xd3, + 0x8c, 0x7c, 0x37, 0xf3, 0x13, 0x48, 0x57, 0x74, 0x99, 0x16, 0x88, + 0xe5, 0x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, 0xa3, 0xc0, 0x5e, 0xa9, 0x4d, 0x6e, 0x4b, + 0x19, 0x9f, 0xbd, 0x1a, 0x33, 0xdf, 0xda, 0x45, 0x86, 0xc9, 0x71, + 0x8c, 0x17, 0x08, 0x79, 0x21, 0x23, 0x26, 0x4a, 0x2e, 0x04, 0xc3, + 0xc8, 0x24, 0x6b}}; + auto const rsa18Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa18PublicKey{ + {0xee, 0x21, 0x9d, 0x3a, 0x07, 0x91, 0x46, 0x8c, 0x0b, 0xfe, 0x9c, + 0xe9, 0x61, 0x7b, 0xd4, 0xf4, 0x10, 0x59, 0xe6, 0x20, 0x0d, 0xd2, + 0x48, 0x5f, 0xf8, 0x7e, 0x89, 0xf3, 0x16, 0x39, 0x5d, 0xc1, 0x53, + 0x72, 0x06, 0x1a, 0x36, 0xe7, 0x3f, 0x62, 0xcb, 0xc2, 0xbd, 0x44, + 0x9d, 0xa9, 0x0f, 0xb2, 0x03, 0xa8, 0xc7, 0xca, 0xaa, 0x6b, 0x2a, + 0x7b, 0xfe, 0x18, 0x93, 0x0c, 0x0e, 0x8e, 0x75, 0x56, 0xda, 0x2e, + 0x47, 0x6f, 0x14, 0x6a, 0x5b, 0xfd, 0x8c, 0x70, 0xda, 0x4b, 0x43, + 0xc8, 0x45, 0x51, 0x13, 0x0b, 0x22, 0x2f, 0x1a, 0x5f, 0x5c, 0x59, + 0x4c, 0xa0, 0x3f, 0x85, 0xd2, 0x2f, 0x81, 0x37, 0x57, 0x40, 0x51, + 0xb5, 0xf3, 0x1c, 0x20, 0x5b, 0x31, 0x95, 0xc7, 0x4b, 0x02, 0xb0, + 0x64, 0x9f, 0xdc, 0xcb, 0xc0, 0xa7, 0x76, 0x95, 0xbe, 0x4a, 0x1e, + 0xcb, 0xf7, 0x54, 0xcc, 0xa7, 0x9b, 0x51, 0xdd, 0xe5, 0x9f, 0xa0, + 0xbb, 0x2d, 0x4e, 0x8b, 0xf0, 0x24, 0xbb, 0xbf, 0xc3, 0xac, 0x4e, + 0x17, 0xfc, 0xd5, 0xf6, 0x6e, 0x3d, 0x78, 0xad, 0x5e, 0x68, 0x58, + 0xd7, 0x09, 0x3d, 0x1f, 0xd9, 0xf3, 0xc2, 0x7b, 0x62, 0x45, 0xe1, + 0xe9, 0xbe, 0x89, 0x72, 0x87, 0x40, 0x1d, 0x28, 0x9b, 0xf6, 0xc6, + 0x92, 0x23, 0x80, 0xaa, 0x05, 0x38, 0xaf, 0x97, 0x4c, 0x10, 0xde, + 0x84, 0x60, 0x13, 0x17, 0xda, 0xb9, 0xb0, 0xfc, 0x48, 0x09, 0x83, + 0x3f, 0x51, 0x75, 0x19, 0xad, 0x68, 0x35, 0xc7, 0x8c, 0xb0, 0xb3, + 0xd8, 0xff, 0x0f, 0xee, 0x77, 0xb4, 0x50, 0x3a, 0x5b, 0x92, 0x23, + 0xf9, 0x0f, 0xf5, 0x60, 0x86, 0x12, 0x57, 0xad, 0x52, 0xbe, 0x88, + 0x8a, 0x40, 0x08, 0x3e, 0x02, 0x0e, 0x2f, 0x1b, 0xa9, 0x29, 0x28, + 0x2b, 0x15, 0x53, 0x89, 0xef, 0x64, 0x1a, 0xc3, 0x4a, 0x12, 0x17, + 0x26, 0xb5, 0xeb}}; + std::array const rsa18Sig{ + {0x3a, 0xee, 0x6e, 0x73, 0x40, 0x3e, 0xc0, 0xef, 0xf5, 0x53, 0xc7, + 0x04, 0x99, 0x1a, 0x36, 0xc3, 0xee, 0x09, 0xe8, 0x27, 0xde, 0xbc, + 0xe9, 0x9a, 0x9f, 0x4b, 0x07, 0x43, 0xf1, 0xb2, 0xc1, 0x78, 0x2e, + 0xb7, 0x04, 0x8f, 0xe7, 0x28, 0xfe, 0xb7, 0x1b, 0x9d, 0xb8, 0x41, + 0x7b, 0xa9, 0x40, 0x77, 0x0d, 0x04, 0xbe, 0xf4, 0x86, 0xaa, 0xad, + 0x15, 0xfc, 0x62, 0x7a, 0x3a, 0xaa,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x07, 0x17, 0x1c, 0x69, 0xb8, 0x7f, 0x84, 0x09, 0x9f, 0xef, 0xad, + 0x55, 0x9c, 0xaf}}; + auto const thresh17Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh15Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim22CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim22Cond{Type::preimageSha256, + 9, + Preim22CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa23CondConditionFingerprint = { + {0x4a, 0x64, 0xbf, 0x23, 0xa9, 0x2b, 0xec, 0x55, 0x00, 0x3d, 0x55, + 0xf5, 0xbf, 0x3f, 0x26, 0x49, 0x18, 0xbb, 0xe0, 0xda, 0xf8, 0x0c, + 0xf4, 0x5c, 0x8a, 0x33, 0x74, 0xb6, 0x58, 0xa4, 0x38, 0x30}}; + Condition const Rsa23Cond{Type::rsaSha256, + 65536, + Rsa23CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed24CondConditionFingerprint = { + {0x6b, 0xf3, 0xe3, 0x0f, 0x92, 0x6d, 0x45, 0x8d, 0xae, 0xd2, 0x8a, + 0x2a, 0x3e, 0x53, 0x37, 0x1f, 0x57, 0x82, 0x21, 0x60, 0xe4, 0x5b, + 0x88, 0x9a, 0x9d, 0x13, 0xa2, 0x56, 0x13, 0x88, 0x9e, 0x21}}; + Condition const Ed24Cond{Type::ed25519Sha256, + 131072, + Ed24CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix14Prefix = "P14"s; + auto const prefix14Msg = "P13abcdefghijklmnopqrstuvwxyz"s; + auto const prefix14MaxMsgLength = 29; + auto const prefix13Prefix = "P13"s; + auto const prefix13Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix13MaxMsgLength = 26; + auto const rsa26Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa26PublicKey{ + {0xb5, 0x57, 0xe1, 0x34, 0xbf, 0x2e, 0x84, 0x70, 0x7c, 0x38, 0x6e, + 0x15, 0x48, 0x91, 0xa2, 0x92, 0x5e, 0xcd, 0x38, 0x82, 0x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, 0x7e, 0x6b, 0x5e, 0x7f, 0x88, 0x47, 0x53, + 0x12, 0x06, 0x12, 0x0d, 0x0c, 0x78, 0xa4, 0x5a, 0x10, 0x0d, 0x07, + 0xd7, 0x3f, 0xca, 0x32, 0xed, 0xd5, 0x51, 0xf3, 0x3d, 0x99, 0x9d, + 0x32, 0xf6, 0x59, 0x17, 0x0a, 0x0f, 0x51, 0x32, 0xa2, 0xb7, 0x25, + 0x29, 0x84, 0xae, 0x4e, 0x1a, 0x34, 0xea, 0xea, 0x93, 0x67, 0x86, + 0x74, 0xcd, 0x73}}; + std::array const rsa26Sig{ + {0xb3, 0xd7, 0x50, 0xc7, 0x1d, 0x26, 0x50, 0x39, 0x55, 0x03, 0xfd, + 0xc1, 0xee, 0x85, 0x8f, 0x1d, 0x7a, 0x85, 0x33, 0x72, 0xed, 0x11, + 0x4b, 0xeb, 0x96, 0xee, 0x1a, 0x33, 0xa7, 0x3a, 0x70, 0x83, 0xbf, + 0x73, 0x06, 0x8d, 0xa5, 0xf4, 0x17, 0x4c, 0xbe, 0x6e, 0x92, 0x06, + 0x16, 0x78, 0x5d, 0xc6, 0x55, 0x3b, 0xd3, 0xa0, 0x3a, 0xa8, 0xe4, + 0xfa, 0xac, 0xe4, 0x4b, 0x87, 0xc6, 0x96, 0x4f, 0x25, 0xc1, 0x71, + 0x25, 0x8a, 0x9f, 0x90, 0xc8, 0xe5, 0xed, 0xf1, 0x5f, 0xe5, 0x12, + 0x03, 0x01, 0xcb, 0x98, 0xe7, 0xbd, 0xd0, 0x3e, 0x05, 0xa8, 0x00, + 0x34, 0xd7, 0x4d, 0x83, 0x1f, 0x41, 0x40, 0x91, 0x60, 0xc4, 0x33, + 0x07, 0xa2, 0x8c, 0x85, 0xae, 0x56, 0xc0, 0xe1, 0xc3, 0x01, 0x33, + 0xa9, 0x64, 0x6f, 0x98, 0xbe, 0x31, 0xa8, 0x8f, 0xba, 0xda, 0x27, + 0x79, 0x7b, 0x1e, 0x61, 0xc4, 0x34, 0xa1, 0x33, 0xc4, 0x27, 0x89, + 0xe8, 0x61, 0xc0, 0xa5, 0xa3, 0x45, 0x75, 0xd0, 0x58, 0x7b, 0x35, + 0x13, 0x9d, 0x47, 0x15, 0x13, 0x74, 0x59, 0x9e, 0x55, 0x06, 0x89, + 0x21, 0xb7, 0x75, 0x88, 0x80, 0x96, 0x72, 0x21, 0xe2, 0x97, 0x14, + 0xd2, 0xf9, 0x6d, 0x1b, 0xba, 0x32, 0x5c, 0xdb, 0xdf, 0x09, 0x29, + 0x90, 0xb3, 0xb7, 0x0e, 0x09, 0x93, 0x01, 0x81, 0x51, 0xcf, 0x56, + 0x9f, 0xc0, 0xea, 0x10, 0x27, 0xe1, 0xfa, 0xf4, 0xbd, 0x5b, 0x0c, + 0xab, 0x6d, 0xbe, 0xcd, 0x83, 0x23, 0xc6, 0xa9, 0x76, 0x6a, 0x0c, + 0xbb, 0x5d, 0x88, 0xc1, 0xcf, 0xda, 0xf7, 0xdf, 0xf2, 0x5a, 0x06, + 0x8d, 0xb7, 0xd2, 0x19, 0xd6, 0xb5, 0x8b, 0xda, 0xe0, 0x6a, 0x1f, + 0x01, 0xae, 0x2c, 0x4f, 0x37, 0xe3, 0x0e, 0x31, 0xbf, 0x8b, 0x55, + 0x6d, 0xe0, 0x46, 0x6c, 0xa3, 0xd2, 0x49, 0xf8, 0xbe, 0x20, 0x3d, + 0xc8, 0x59, 0x89}}; + auto const thresh25Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim27CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim27Cond{Type::preimageSha256, + 9, + Preim27CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa28CondConditionFingerprint = { + {0x58, 0xac, 0x94, 0x55, 0x27, 0x79, 0x7a, 0x0c, 0xac, 0x84, 0x2d, + 0x5c, 0x13, 0x32, 0xee, 0x84, 0x25, 0xb8, 0xb8, 0xec, 0x25, 0x0d, + 0x40, 0xee, 0xc0, 0xd4, 0x79, 0x18, 0x3f, 0xc6, 0xbc, 0xd7}}; + Condition const Rsa28Cond{Type::rsaSha256, + 65536, + Rsa28CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed29CondConditionFingerprint = { + {0xc5, 0x39, 0xb2, 0xc7, 0xc4, 0x92, 0x8a, 0x29, 0xf3, 0x72, 0xb4, + 0x6c, 0xa5, 0x0d, 0x8c, 0xbe, 0x43, 0xda, 0xc9, 0xac, 0x6c, 0x26, + 0x7c, 0x44, 0xb9, 0x3f, 0xee, 0x40, 0xcc, 0x8e, 0x41, 0x3c}}; + Condition const Ed29Cond{Type::ed25519Sha256, + 131072, + Ed29CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(rsa6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto rsa16 = std::make_unique( + makeSlice(rsa16PublicKey), makeSlice(rsa16Sig)); + auto rsa18 = std::make_unique( + makeSlice(rsa18PublicKey), makeSlice(rsa18Sig)); + std::vector> thresh17Subfulfillments; + thresh17Subfulfillments.emplace_back(std::move(rsa18)); + std::vector thresh17Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond}}; + auto thresh17 = std::make_unique( + std::move(thresh17Subfulfillments), + std::move(thresh17Subconditions)); + std::vector> thresh15Subfulfillments; + thresh15Subfulfillments.emplace_back(std::move(rsa16)); + thresh15Subfulfillments.emplace_back(std::move(thresh17)); + std::vector thresh15Subconditions{ + {Preim22Cond, Rsa23Cond, Ed24Cond}}; + auto thresh15 = std::make_unique( + std::move(thresh15Subfulfillments), + std::move(thresh15Subconditions)); + auto prefix14 = std::make_unique( + makeSlice(prefix14Prefix), + prefix14MaxMsgLength, + std::move(thresh15)); + auto prefix13 = std::make_unique( + makeSlice(prefix13Prefix), + prefix13MaxMsgLength, + std::move(prefix14)); + auto rsa26 = std::make_unique( + makeSlice(rsa26PublicKey), makeSlice(rsa26Sig)); + std::vector> thresh25Subfulfillments; + thresh25Subfulfillments.emplace_back(std::move(rsa26)); + std::vector thresh25Subconditions{}; + auto thresh25 = std::make_unique( + std::move(thresh25Subfulfillments), + std::move(thresh25Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix13)); + thresh0Subfulfillments.emplace_back(std::move(thresh25)); + std::vector thresh0Subconditions{ + {Preim27Cond, Rsa28Cond, Ed29Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x0d\x0f\xa0\x82\x0c\x90\xa1\x82\x05\x38\x80\x02\x50" + "\x31\x81\x01\x1a\xa2\x82\x05\x2d\xa1\x82\x05\x29\x80\x02\x50" + "\x32\x81\x01\x1c\xa2\x82\x05\x1e\xa2\x82\x05\x1a\xa0\x82\x04" + "\x9b\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80\x82" + "\x01\x00\xd0\x07\xfc\x9d\xb0\xa1\xa6\x40\xe4\x52\x30\x42\x74" + "\xfd\x35\x04\xde\x45\x68\xb3\x22\xdd\xff\x41\x43\x69\x33\xc0" + "\xff\x35\xb6\x6d\x15\xe9\x54\x15\xeb\x1d\x07\xe2\x25\x2b\xdb" + "\xaa\x16\x8d\x0d\x7f\x05\xf0\xd2\x7d\xb4\x9b\x51\x19\x20\x1e" + "\x3d\xba\x50\x9e\x51\x13\x81\x43\x55\x96\xca\xdb\x88\x1f\xef" + "\x2d\x38\x3f\xae\x8d\xac\xc8\x6f\x2b\xd5\xf0\x34\x1a\x99\x00" + "\x7c\x6d\xb3\x1b\x1d\x68\xdb\xf8\x1c\x59\x3a\x63\x38\x7c\x1c" + "\x14\xbc\x22\xcf\xc8\x9a\xc6\x96\x6f\x3d\x03\x0b\x61\x6b\x7d" + "\x75\x97\xe8\x25\xb8\x2f\xfa\xf4\x07\x44\xdf\x00\x3d\xff\x0d" + "\xd5\x7f\x7f\xf3\x0c\x13\xac\x8d\xf8\x8c\x79\xc5\xf3\x29\xdc" + "\x23\x65\xd3\xd1\x1c\xa6\x14\x78\x6a\x1a\xe3\x15\x8d\x8b\xdc" + "\xa0\x5a\xc7\x82\xb0\x03\x6c\x71\x43\x59\x24\xc7\x50\x64\xb2" + "\xa7\x69\xf5\xbd\xe6\x5e\xaa\x77\x59\x60\x36\xc0\xe3\x42\x7f" + "\x05\x3b\x4c\x02\x0e\x70\x5a\x70\xc5\x2a\xeb\x94\x4d\x15\x09" + "\xef\xbb\x58\x42\x68\x05\x59\x70\xa0\x17\xb2\x8e\xdf\x7b\x40" + "\x5d\x21\x1e\xfe\x62\x58\xde\xfb\x14\x91\x18\xf3\x4f\x9b\x36" + "\x55\xcf\xb3\x5e\xec\x4f\xcc\x6d\x13\x58\xc8\xa3\xa3\xee\x23" + "\x8a\xc2\xbf\x81\x82\x01\x00\x19\x7e\x74\x80\x4d\x64\xb4\x9b" + "\xab\x92\x44\x03\x95\xa2\x0f\x8f\x4d\x90\x8f\x2c\xf1\x03\xc9" + "\x57\xab\x6e\x6c\x65\x6d\xa1\x3a\xd2\xa5\x38\x92\x25\x87\xd1" + "\x33\x4e\x18\xbf\xf3\x29\xa1\x08\xc3\xdc\xbd\x58\xe4\x48\x30" + "\x18\x40\x75\xa7\x4e\x53\x96\xb3\x43\x10\x11\xec\xd1\x4c\xfa" + "\x4f\xe3\x23\x1e\x39\xf0\x71\xc2\xa7\x53\x1a\x7d\xe7\x9b\x3f" + "\xb2\x24\x67\x91\x0f\x1a\x02\xf3\x84\x39\x43\x1f\x65\x3a\x8f" + "\xeb\xc7\xb0\x94\xbb\xf6\x39\x25\xb2\x68\x2f\x5a\xf2\x1a\x66" + "\x26\x00\xd6\x84\xef\x56\x52\x0e\xd4\x74\xd2\x3d\xe2\x4b\x8b" + "\x10\xeb\xd7\x43\x84\x09\x55\xe9\x2c\xfd\x68\xc3\x12\x88\x77" + "\xda\x84\x72\x4d\x40\x35\xce\x69\xbb\xec\x3d\xec\x72\x68\x54" + "\x23\xef\x84\xa5\x29\xfa\xff\x09\xfd\x4c\x92\x4d\xd6\xc2\x2a" + "\x1d\x78\xbf\x72\x53\x74\x5c\xfd\x08\xa2\xcf\xaf\xf0\x74\x60" + "\xce\xd3\x21\x12\x38\xd2\x30\x30\x5e\x42\x64\xa3\xcc\x30\xb3" + "\xf9\x35\x61\xc8\x6d\x7f\xf9\x86\x22\xfa\xfc\x50\x86\x4d\x18" + "\x85\xd2\xd3\x37\x69\x5e\xde\x88\xe1\x9d\x00\x69\xaa\xa4\x5e" + "\x91\x8b\x8d\x68\xdf\xb0\x8b\x08\x30\x9a\x5e\x90\x9d\xe1\xa2" + "\xbe\xfb\x61\xdb\x6f\x7d\x29\xef\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4" + "\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57" + "\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4" + "\x46\xab\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4" + "\x00\xd5\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00\xa3\x82\x02\x08" + "\x80\x82\x01\x00\xbe\x09\xc5\xa4\x27\x29\xdf\xd4\x67\x76\xbe" + "\xbf\x2c\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67\x20\xfb\x7a\x27" + "\x93\xc0\x78\x47\x78\xd7\x15\x32\xee\x38\x81\x0d\x36\xa2\xc4" + "\x65\x44\xe6\x62\x26\xb9\x58\x13\xa4\x15\x82\xab\xb1\x16\x61" + "\xfc\x01\x98\xc6\x1a\x69\xc6\xba\x39\x3f\x01\x55\x3d\xd7\x8e" + "\x14\x42\x6d\x78\x74\x9b\x28\xcb\x31\x39\x98\x5a\x11\xdc\xc1" + "\x18\x9d\x8d\xb0\xcd\x1b\x4c\x10\xab\x14\x64\x19\xf1\x33\x15" + "\x45\xc8\x92\x82\x03\x82\x8a\xaa\xad\x94\xfc\x24\x11\x96\x99" + "\x7e\x94\x5a\x82\x57\x68\x61\x9f\x7b\x45\xe0\x99\x9e\x4f\x32" + "\x50\x5f\x05\xc8\x11\xae\xc4\x0c\x63\x18\x0e\x02\x59\x36\x25" + "\x92\x06\x32\xc7\x71\x47\x99\xcc\x0a\x6e\x0a\x58\x71\x3f\x5e" + "\xb7\x78\xf7\x98\x79\xdf\x74\xa4\xeb\xa9\x00\xfd\x81\xb3\xcf" + "\x04\x8c\x5d\x7d\xe7\xb2\x82\x90\x49\xbd\x69\xf3\x08\xe9\x92" + "\xc6\x9e\x41\xba\x74\xd8\x8d\x81\x97\x6f\x86\xab\xc9\xf1\x02" + "\x31\xb4\xce\x47\xb0\x39\xc8\xba\x51\xa7\x39\xf3\x71\xa2\x25" + "\x27\x37\x6e\x09\x6f\x19\x59\xbc\x65\xd9\xcd\x12\xd3\x2c\xa2" + "\x78\xfa\x23\x15\x1a\x82\x41\x91\x1b\xbe\x8a\xe7\xfe\x3c\x3c" + "\x30\x32\xaa\xe9\xf3\x81\x82\x01\x00\x7a\x00\xea\x2b\x2b\x43" + "\xdc\xa7\x14\x1c\xb2\x89\xfc\x42\xae\x7d\x49\x77\xf1\xe3\x3a" + "\x91\xfb\x78\x87\x6f\xc1\x60\x3e\x0a\x55\x37\xa1\xb6\x9b\xc5" + "\xab\xe4\x8b\x70\xb6\xa9\xe5\x5d\xf0\x6f\x7b\xf0\xa4\x8a\x78" + "\x0e\x1b\x15\xd6\xcc\xb2\xcf\xde\x96\xa5\x6c\x08\x7c\x4f\xdd" + "\xab\xda\x5e\x3b\x30\xd3\x7f\xe4\xf4\xc7\x4c\xc0\xc5\x36\x12" + "\x5b\xe3\x8f\x20\xe6\x2b\xa9\xcd\x3c\xd5\x97\x93\xbe\x94\x06" + "\xb4\xb8\x96\x7e\x03\xa2\xcb\x1e\x55\x70\xde\xe7\xed\x77\x0a" + "\xf4\xc4\x34\xc4\x44\xd7\xc2\xc2\x37\x8b\x18\x7c\xc1\xc3\x2e" + "\xf2\x0d\x94\x35\x61\x6e\x5e\xad\x06\xf0\x44\x89\x21\x84\x5a" + "\xab\xd4\x39\x28\xa9\x00\x8a\x98\x2f\xee\xd8\x3b\xfb\x6c\x7e" + "\x14\xb7\xe6\xe3\xba\xa5\x10\x7b\x42\x36\xf8\x29\xac\x11\xd6" + "\x93\x6c\x95\x93\x95\x98\x1a\x39\xbb\x39\x65\xe8\xab\xf9\xe7" + "\xce\x50\xb6\x5b\xb1\x55\x62\x61\x40\xfc\x49\xa7\x97\x93\x81" + "\xe2\x6f\x7a\x1f\xbb\x6f\x34\x72\xec\xe9\x49\x54\x83\xda\xd6" + "\xd8\x0a\x65\x45\xa8\x75\x04\x40\x3b\xad\xbe\x40\x4d\xfa\x08" + "\x08\x03\x08\x9a\x25\xff\x5a\x6f\xe7\x08\xcd\x9f\x73\xe3\xb6" + "\x83\x02\xae\xa1\x12\xf8\x0a\xab\xc6\x2d\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xaf\x93\xfd\x22\x45" + "\xc2\x08\xab\x43\xf7\x45\x56\x63\xec\xaf\x15\x33\xa0\x2a\xb4" + "\x9e\x15\xb4\x6e\xda\x87\x35\xde\x09\x4b\x06\x31\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\x55\xcc\xd1\xa2\x2c\x90\x8d\xe3\x2e" + "\x42\xd4\xe0\x65\xb2\xf7\xda\xc0\x07\x1e\xd3\x23\x0f\xfe\x78" + "\x13\xa2\x86\x61\xc4\x34\x28\x50\x81\x03\x02\x00\x00\xa1\x82" + "\x05\x3a\x80\x03\x50\x31\x33\x81\x01\x1a\xa2\x82\x05\x2e\xa1" + "\x82\x05\x2a\x80\x03\x50\x31\x34\x81\x01\x1d\xa2\x82\x05\x1e" + "\xa2\x82\x05\x1a\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82\x02" + "\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xee\x21\x9d\x3a\x07\x91" + "\x46\x8c\x0b\xfe\x9c\xe9\x61\x7b\xd4\xf4\x10\x59\xe6\x20\x0d" + "\xd2\x48\x5f\xf8\x7e\x89\xf3\x16\x39\x5d\xc1\x53\x72\x06\x1a" + "\x36\xe7\x3f\x62\xcb\xc2\xbd\x44\x9d\xa9\x0f\xb2\x03\xa8\xc7" + "\xca\xaa\x6b\x2a\x7b\xfe\x18\x93\x0c\x0e\x8e\x75\x56\xda\x2e" + "\x47\x6f\x14\x6a\x5b\xfd\x8c\x70\xda\x4b\x43\xc8\x45\x51\x13" + "\x0b\x22\x2f\x1a\x5f\x5c\x59\x4c\xa0\x3f\x85\xd2\x2f\x81\x37" + "\x57\x40\x51\xb5\xf3\x1c\x20\x5b\x31\x95\xc7\x4b\x02\xb0\x64" + "\x9f\xdc\xcb\xc0\xa7\x76\x95\xbe\x4a\x1e\xcb\xf7\x54\xcc\xa7" + "\x9b\x51\xdd\xe5\x9f\xa0\xbb\x2d\x4e\x8b\xf0\x24\xbb\xbf\xc3" + "\xac\x4e\x17\xfc\xd5\xf6\x6e\x3d\x78\xad\x5e\x68\x58\xd7\x09" + "\x3d\x1f\xd9\xf3\xc2\x7b\x62\x45\xe1\xe9\xbe\x89\x72\x87\x40" + "\x1d\x28\x9b\xf6\xc6\x92\x23\x80\xaa\x05\x38\xaf\x97\x4c\x10" + "\xde\x84\x60\x13\x17\xda\xb9\xb0\xfc\x48\x09\x83\x3f\x51\x75" + "\x19\xad\x68\x35\xc7\x8c\xb0\xb3\xd8\xff\x0f\xee\x77\xb4\x50" + "\x3a\x5b\x92\x23\xf9\x0f\xf5\x60\x86\x12\x57\xad\x52\xbe\x88" + "\x8a\x40\x08\x3e\x02\x0e\x2f\x1b\xa9\x29\x28\x2b\x15\x53\x89" + "\xef\x64\x1a\xc3\x4a\x12\x17\x26\xb5\xeb\x81\x82\x01\x00\x3a" + "\xee\x6e\x73\x40\x3e\xc0\xef\xf5\x53\xc7\x04\x99\x1a\x36\xc3" + "\xee\x09\xe8\x27\xde\xbc\xe9\x9a\x9f\x4b\x07\x43\xf1\xb2\xc1" + "\x78\x2e\xb7\x04\x8f\xe7\x28\xfe\xb7\x1b\x9d\xb8\x41\x7b\xa9" + "\x40\x77\x0d\x04\xbe\xf4\x86\xaa\xad\x15\xfc\x62\x7a\x3a\xaa" + "\xdd\x1b\xa6\xfa\x03\x8c\xf3\x70\x79\x98\x1b\xe6\xf1\xef\x91" + "\x3b\x39\x5f\x08\x36\xd9\xda\x95\x51\xa4\xbf\x83\xeb\x3e\x4c" + "\xa5\x32\x21\x6f\x56\x8b\xcd\x75\x93\xcf\xef\x98\xcc\x8f\x2d" + "\x52\xff\x2a\x5b\x3d\x79\xb5\xc6\x06\x87\x9d\x09\xc7\xff\x7a" + "\xd9\xc7\x72\x3a\xbd\x78\xdd\xab\x8f\xf6\xdd\x5d\xf6\xad\xc9" + "\xb9\xd0\x15\x73\x11\x54\x0a\xe1\xfd\x37\x81\x01\x05\x29\x80" + "\x11\xb7\x9c\x01\x38\x1a\xc5\x29\x9d\x90\x03\xe2\x72\x8b\x8f" + "\x28\x0a\x75\x36\xfb\x61\x5b\x02\x8d\x31\x8c\x8f\x01\x2e\x06" + "\xef\x3a\xaa\x4d\x49\x1a\x14\x0c\xf7\x7c\x46\xc8\x5f\xa7\x34" + "\x27\xb8\x76\xcf\x98\x36\xf5\x5b\x38\xe8\x41\x71\xb8\xab\x3e" + "\x06\xc1\x10\x5e\x02\x9a\xa5\x5a\x52\x97\xff\xd8\x87\x8e\xdb" + "\xfa\xd8\x0f\x8b\xeb\xe0\xe2\x50\x47\xd3\x33\xd9\x51\x11\x6d" + "\x5f\x07\x17\x1c\x69\xb8\x7f\x84\x09\x9f\xef\xad\x55\x9c\xaf" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\x8d\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57\xca\xf4\x9d" + "\x63\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9\xc6\xa3\xf1" + "\x33\xfd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x95\x3c\x86\x65" + "\x91\x76\x69\x6b\x72\x61\xaa\x76\x15\x2a\xd7\x25\x4f\x32\xb7" + "\x73\x7a\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81\x03" + "\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xe8\x03\x7c\xff" + "\x40\x68\x5d\xc7\xb8\xd0\x9f\x9a\x83\xf9\x02\xe6\xfe\xa5\xb9" + "\x0e\x9f\xdc\x44\x74\x59\x3e\xef\x61\xdc\xb6\x4b\x49\xfe\x1a" + "\x67\x73\x38\x7b\x1c\xb4\xfa\x24\x39\xe4\xbb\x74\x1b\xe4\x66" + "\xfd\x85\x6f\x8d\x92\x3e\x04\x70\xb4\x21\x01\xcf\x07\xf2\xeb" + "\x11\x2c\xaa\x9d\x37\xbb\xf3\x8d\x9b\xbc\x17\x60\xe4\xe3\xae" + "\x79\x92\x97\x3a\xe8\xd8\x74\xc5\x9d\xeb\x15\x22\x8b\xae\x51" + "\x13\x78\x21\xca\xbd\x6a\xa6\x24\x93\x8f\xe6\x23\x12\x52\xe1" + "\x75\xda\x55\x26\xcc\x95\xa0\x75\x31\x0a\x6e\x27\x14\x63\x70" + "\x04\xd7\xe4\x36\x21\x3a\x9e\xff\xe3\x16\x21\xc1\xfc\x6d\xc5" + "\xe2\x80\xb9\x26\xc6\x4f\x3c\xc2\xd5\x25\xf1\xb9\x88\xac\xc7" + "\xfe\xde\xd6\x7e\x60\x41\x82\xde\x25\x28\x1f\x09\xda\x10\x01" + "\x27\xf4\x63\x10\xa2\x4e\x1d\xc2\x19\x32\xb3\x87\xc2\xcf\xac" + "\x3c\x2b\xcd\x5e\x79\x1f\x19\xea\x70\x56\x31\x59\x0e\x13\x95" + "\x05\xb7\xf9\xff\xd9\x0b\x49\xce\xd0\x6f\xae\x90\x44\xb3\x6b" + "\x60\xc9\x72\xf7\x83\x24\x5e\x15\x25\x1c\xb8\x76\x71\x84\x33" + "\x14\xf1\xf0\x07\x7f\x2f\x95\xee\x3c\x36\x67\x36\xb4\xae\x1c" + "\xb5\x02\xa2\xdc\x0e\xed\xf2\x63\x0d\x52\x61\xe3\x81\x82\x01" + "\x00\x5c\x70\xa5\x22\x8c\x3f\x51\x83\x5d\x61\x8c\x06\x54\x56" + "\x1d\x8e\x0d\xd0\x90\x43\x53\x75\x19\x62\x89\xe4\xc7\x19\x32" + "\x40\xa2\xc4\xd3\x8c\x7c\x37\xf3\x13\x48\x57\x74\x99\x16\x88" + "\xe5\x43\xaa\x9b\x5e\x50\x16\xad\xd4\x56\x2e\xeb\xd6\x8d\x26" + "\xdc\xa5\x6f\x4d\x1a\x82\xcf\x42\xe8\xd9\x0b\x0b\xb9\x2e\xc9" + "\x57\xb2\x67\x3b\xf6\x6c\x70\x14\xa2\x88\xb3\xc7\xe0\xff\x89" + "\x3c\x27\xe9\x1d\xfe\x9e\xd4\xab\x30\x5a\x79\x31\xb8\x52\xf9" + "\xf9\xe8\x52\x0e\xb2\xb7\xf7\xce\x85\xd7\xc9\x0d\x1a\x23\x8d" + "\xd3\xbd\x7d\x9b\xaf\x4b\xce\xe5\x86\x5f\x49\xc9\xb6\x8c\x2c" + "\x7f\x9e\x76\x52\x0a\xe5\xd3\xca\xef\xc5\x5f\x28\xb7\x7e\xb3" + "\x2b\x59\xa8\xd2\x73\xdf\x79\x4e\x45\xb0\xb8\x32\xbf\x2c\x7a" + "\x8c\xcd\x92\xe5\xe7\x7d\xd8\x12\x5f\xb7\xbb\x51\xce\x98\x22" + "\xaa\x2d\x13\xc5\x01\xa5\xd7\xfa\xe9\xe9\x92\x72\xb6\xb2\x05" + "\x7b\x01\x84\xc9\xa2\x8e\xfc\x94\x20\x9d\x0b\x5e\xcd\x91\xfa" + "\x01\x08\x74\xca\x8c\xb0\xa6\x86\xea\xd2\xd6\x7c\x49\x96\xfa" + "\xa3\xc0\x5e\xa9\x4d\x6e\x4b\x19\x9f\xbd\x1a\x33\xdf\xda\x45" + "\x86\xc9\x71\x8c\x17\x08\x79\x21\x23\x26\x4a\x2e\x04\xc3\xc8" + "\x24\x6b\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27" + "\x80\x20\x4a\x64\xbf\x23\xa9\x2b\xec\x55\x00\x3d\x55\xf5\xbf" + "\x3f\x26\x49\x18\xbb\xe0\xda\xf8\x0c\xf4\x5c\x8a\x33\x74\xb6" + "\x58\xa4\x38\x30\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x6b\xf3" + "\xe3\x0f\x92\x6d\x45\x8d\xae\xd2\x8a\x2a\x3e\x53\x37\x1f\x57" + "\x82\x21\x60\xe4\x5b\x88\x9a\x9d\x13\xa2\x56\x13\x88\x9e\x21" + "\x81\x03\x02\x00\x00\xa2\x82\x02\x12\xa0\x82\x02\x0c\xa3\x82" + "\x02\x08\x80\x82\x01\x00\xb5\x57\xe1\x34\xbf\x2e\x84\x70\x7c" + "\x38\x6e\x15\x48\x91\xa2\x92\x5e\xcd\x38\x82\x1e\xd9\x87\x29" + "\x5c\xbe\x27\x83\x24\xc4\x29\xa3\x5a\x77\x08\xca\x20\xf3\xc2" + "\xb7\xb8\xe8\x38\xbc\x88\xfe\x33\x91\xcf\x15\x24\x52\x3d\x98" + "\x86\xc1\xc7\xdd\xb3\xfe\xfe\xcd\xc6\x72\x58\x1a\x91\xb5\x41" + "\xe0\xbb\xf9\xa9\x4e\x9d\x54\xa5\xcb\x4a\xee\xd7\x04\xa4\xd7" + "\x32\x6a\x28\x73\xd9\x37\x14\x1a\x02\x65\x08\xf7\x8f\x2f\x54" + "\x78\x4d\x3b\x2a\xdd\x39\xdc\x5a\x37\xde\x2b\x53\x7f\x2e\xf6" + "\x9a\x30\x37\xa0\x13\xd7\x0f\xe1\x22\xc7\xda\xf6\xb4\xda\x66" + "\x9d\xe5\xfe\x86\x0e\x44\xab\x0e\x4d\xf5\x19\xb5\x7a\x6a\x31" + "\x1d\x69\x49\xb9\x3f\xf6\x36\x46\x43\x98\x79\xab\x66\x31\x88" + "\x9b\xf7\xa4\x9e\x94\xb3\x84\x5a\xb8\x83\xdf\xab\xc9\x5a\x22" + "\xa6\x61\x1a\xe7\x7f\x17\x28\xea\x2b\xb8\xcc\x3f\xdb\xc6\x7f" + "\x8b\xcb\x44\xda\x3e\x92\xda\x61\x47\xda\x59\x4c\x59\x7e\x6b" + "\x5e\x7f\x88\x47\x53\x12\x06\x12\x0d\x0c\x78\xa4\x5a\x10\x0d" + "\x07\xd7\x3f\xca\x32\xed\xd5\x51\xf3\x3d\x99\x9d\x32\xf6\x59" + "\x17\x0a\x0f\x51\x32\xa2\xb7\x25\x29\x84\xae\x4e\x1a\x34\xea" + "\xea\x93\x67\x86\x74\xcd\x73\x81\x82\x01\x00\xb3\xd7\x50\xc7" + "\x1d\x26\x50\x39\x55\x03\xfd\xc1\xee\x85\x8f\x1d\x7a\x85\x33" + "\x72\xed\x11\x4b\xeb\x96\xee\x1a\x33\xa7\x3a\x70\x83\xbf\x73" + "\x06\x8d\xa5\xf4\x17\x4c\xbe\x6e\x92\x06\x16\x78\x5d\xc6\x55" + "\x3b\xd3\xa0\x3a\xa8\xe4\xfa\xac\xe4\x4b\x87\xc6\x96\x4f\x25" + "\xc1\x71\x25\x8a\x9f\x90\xc8\xe5\xed\xf1\x5f\xe5\x12\x03\x01" + "\xcb\x98\xe7\xbd\xd0\x3e\x05\xa8\x00\x34\xd7\x4d\x83\x1f\x41" + "\x40\x91\x60\xc4\x33\x07\xa2\x8c\x85\xae\x56\xc0\xe1\xc3\x01" + "\x33\xa9\x64\x6f\x98\xbe\x31\xa8\x8f\xba\xda\x27\x79\x7b\x1e" + "\x61\xc4\x34\xa1\x33\xc4\x27\x89\xe8\x61\xc0\xa5\xa3\x45\x75" + "\xd0\x58\x7b\x35\x13\x9d\x47\x15\x13\x74\x59\x9e\x55\x06\x89" + "\x21\xb7\x75\x88\x80\x96\x72\x21\xe2\x97\x14\xd2\xf9\x6d\x1b" + "\xba\x32\x5c\xdb\xdf\x09\x29\x90\xb3\xb7\x0e\x09\x93\x01\x81" + "\x51\xcf\x56\x9f\xc0\xea\x10\x27\xe1\xfa\xf4\xbd\x5b\x0c\xab" + "\x6d\xbe\xcd\x83\x23\xc6\xa9\x76\x6a\x0c\xbb\x5d\x88\xc1\xcf" + "\xda\xf7\xdf\xf2\x5a\x06\x8d\xb7\xd2\x19\xd6\xb5\x8b\xda\xe0" + "\x6a\x1f\x01\xae\x2c\x4f\x37\xe3\x0e\x31\xbf\x8b\x55\x6d\xe0" + "\x46\x6c\xa3\xd2\x49\xf8\xbe\x20\x3d\xc8\x59\x89\xa1\x00\xa1" + "\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x58" + "\xac\x94\x55\x27\x79\x7a\x0c\xac\x84\x2d\x5c\x13\x32\xee\x84" + "\x25\xb8\xb8\xec\x25\x0d\x40\xee\xc0\xd4\x79\x18\x3f\xc6\xbc" + "\xd7\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xc5\x39\xb2\xc7\xc4" + "\x92\x8a\x29\xf3\x72\xb4\x6c\xa5\x0d\x8c\xbe\x43\xda\xc9\xac" + "\x6c\x26\x7c\x44\xb9\x3f\xee\x40\xcc\x8e\x41\x3c\x81\x03\x02" + "\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xf4\x98\xda\x77\x71\x75\xc1\x27\x4a\xd1\xaf" + "\x91\x1a\x0f\xd3\x1a\x25\x6e\x75\xdb\x33\x20\x41\x02\x51\xba" + "\x6b\x1f\x27\xe8\x63\x24\x81\x03\x0a\x70\x77\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x09\xf8\x06\xa1\x44\xca" + "\xc9\x9c\xe5\x42\x22\xb4\x30\xdb\x7b\x77\x05\x07\x06\xcb\x55" + "\xbc\xb8\xc4\xaf\xc2\x2b\xfd\xe4\xc6\x2d\xac\x81\x03\x04\x2c" + "\x3a\x82\x02\x03\xb8\xa1\x2b\x80\x20\xbf\xf9\x43\x39\x52\xe5" + "\x58\x41\x92\x5c\xfa\xc2\xf3\xb5\xc3\xa0\xcc\xf3\x0c\x14\xdb" + "\x64\x48\x48\x39\x8a\x45\xe8\x88\x9c\x2e\xe6\x81\x03\x04\x2c" + "\x3d\x82\x02\x03\xb8\xa2\x2b\x80\x20\x9d\x40\xda\xe1\xb8\x80" + "\x53\x4d\xbb\xe6\x39\x47\x3a\x9a\x9b\x08\x33\x20\x19\x7d\xc7" + "\x4c\xec\x83\x97\xad\x9a\xcf\x0c\x2e\xa2\x9f\x81\x03\x01\x04" + "\x00\x82\x02\x04\x10\xa3\x27\x80\x20\x58\xac\x94\x55\x27\x79" + "\x7a\x0c\xac\x84\x2d\x5c\x13\x32\xee\x84\x25\xb8\xb8\xec\x25" + "\x0d\x40\xee\xc0\xd4\x79\x18\x3f\xc6\xbc\xd7\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xc5\x39\xb2\xc7\xc4\x92\x8a\x29\xf3\x72" + "\xb4\x6c\xa5\x0d\x8c\xbe\x43\xda\xc9\xac\x6c\x26\x7c\x44\xb9" + "\x3f\xee\x40\xcc\x8e\x41\x3c\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh37() + { + testcase("Thresh37"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim16Cond + // ** Rsa17Cond + // ** Ed18Cond + // ** Prefix19Cond + // ** Thresh31Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** rsa4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** rsa6 + // ** preim13 + // ** rsa14 + // ** ed15 + + auto const rsa4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x75, 0xeb, 0x6d, 0x6a, 0x90, 0x26, 0xd0, 0xbc, 0x47, 0x71, 0x64, + 0xe2, 0xb6, 0x89, 0xff, 0xe5, 0xc8, 0xc2, 0x63, 0xe3, 0x94, 0x14, + 0x43, 0x43, 0xb0, 0x67, 0xf9, 0x09, 0xa2, 0xf0, 0x28, 0x96, 0xa7, + 0x12, 0x1c, 0x7e, 0x0e, 0xb6, 0x53, 0xc4, 0x8a, 0x6f, 0x70, 0x26, + 0x99, 0xe2, 0x2f, 0xce, 0x57, 0xdd, 0x91, 0xbc, 0xc4, 0x02, 0xf6, + 0xeb, 0x88, 0x06, 0x39, 0xcd, 0x6d, 0x78, 0x5b, 0x9c, 0xe7, 0x95, + 0x8c, 0xe1, 0x56, 0xf6, 0x5d, 0x61, 0x0b, 0x68, 0xf7, 0x37, 0x5b, + 0x8c, 0x29, 0x95, 0x2b, 0xc6, 0x6b, 0x3c, 0xb8, 0x67, 0x30, 0xd8, + 0x20, 0xb2, 0xaf, 0xfc, 0x38, 0xf6, 0x70, 0x49, 0x25, 0x8b, 0x8a, + 0x8f, 0x6d, 0xa3, 0x81, 0x5a, 0x47, 0x9b, 0x1a, 0xd1, 0xe6, 0xce, + 0xa7, 0x2e, 0x04, 0xfc, 0xd0, 0x44, 0x85, 0xcf, 0xc6, 0x18, 0xc2, + 0x76, 0x16, 0xac, 0x41, 0xe6, 0x05, 0xdc, 0x13, 0x08, 0xb3, 0xfc, + 0x75, 0x9d, 0xca, 0x5c, 0x6d, 0x21, 0xa9, 0x60, 0x9a, 0xd2, 0x17, + 0x3d, 0x04, 0x52, 0x7d, 0x6e, 0xe1, 0xd9, 0x27, 0x6c, 0x3c, 0x24, + 0xc9, 0x64, 0x2b, 0x3f, 0x23, 0x7c, 0xde, 0xf1, 0x58, 0xf9, 0xb1, + 0x60, 0xfb, 0x26, 0x73, 0x0e, 0x35, 0x91, 0xdc, 0xdc, 0x11, 0x2c, + 0xdd, 0x8b, 0x56, 0x8f, 0x84, 0x13, 0x83, 0x8c, 0xe9, 0x97, 0x93, + 0xba, 0x16, 0x37, 0x19, 0xb4, 0x88, 0x21, 0x68, 0xb3, 0xfa, 0x55, + 0xcb, 0xaa, 0xed, 0x66, 0x6a, 0x0b, 0x4e, 0x7e, 0xd1, 0xf3, 0xf3, + 0x60, 0xd0, 0x8c, 0x52, 0x34, 0x7a, 0x62, 0xfb, 0x61, 0x80, 0xc3, + 0xdc, 0xf8, 0xc2, 0x11, 0xa8, 0xea, 0xd5, 0xe0, 0x00, 0xb3, 0x1e, + 0x92, 0x0e, 0xde, 0xe7, 0xcb, 0xce, 0x8b, 0x41, 0x82, 0x24, 0xe2, + 0x4e, 0x2b, 0x7f, 0x3c, 0x14, 0x08, 0x4f, 0xb2, 0x99, 0x87, 0x42, + 0x46, 0x74, 0xf5}}; + auto const rsa6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 0x40, 0xe4, 0x52, 0x30, + 0x42, 0x74, 0xfd, 0x35, 0x04, 0xde, 0x45, 0x68, 0xb3, 0x22, 0xdd, + 0xff, 0x41, 0x43, 0x69, 0x33, 0xc0, 0xff, 0x35, 0xb6, 0x6d, 0x15, + 0xe9, 0x54, 0x15, 0xeb, 0x1d, 0x07, 0xe2, 0x25, 0x2b, 0xdb, 0xaa, + 0x16, 0x8d, 0x0d, 0x7f, 0x05, 0xf0, 0xd2, 0x7d, 0xb4, 0x9b, 0x51, + 0x19, 0x20, 0x1e, 0x3d, 0xba, 0x50, 0x9e, 0x51, 0x13, 0x81, 0x43, + 0x55, 0x96, 0xca, 0xdb, 0x88, 0x1f, 0xef, 0x2d, 0x38, 0x3f, 0xae, + 0x8d, 0xac, 0xc8, 0x6f, 0x2b, 0xd5, 0xf0, 0x34, 0x1a, 0x99, 0x00, + 0x7c, 0x6d, 0xb3, 0x1b, 0x1d, 0x68, 0xdb, 0xf8, 0x1c, 0x59, 0x3a, + 0x63, 0x38, 0x7c, 0x1c, 0x14, 0xbc, 0x22, 0xcf, 0xc8, 0x9a, 0xc6, + 0x96, 0x6f, 0x3d, 0x03, 0x0b, 0x61, 0x6b, 0x7d, 0x75, 0x97, 0xe8, + 0x25, 0xb8, 0x2f, 0xfa, 0xf4, 0x07, 0x44, 0xdf, 0x00, 0x3d, 0xff, + 0x0d, 0xd5, 0x7f, 0x7f, 0xf3, 0x0c, 0x13, 0xac, 0x8d, 0xf8, 0x8c, + 0x79, 0xc5, 0xf3, 0x29, 0xdc, 0x23, 0x65, 0xd3, 0xd1, 0x1c, 0xa6, + 0x14, 0x78, 0x6a, 0x1a, 0xe3, 0x15, 0x8d, 0x8b, 0xdc, 0xa0, 0x5a, + 0xc7, 0x82, 0xb0, 0x03, 0x6c, 0x71, 0x43, 0x59, 0x24, 0xc7, 0x50, + 0x64, 0xb2, 0xa7, 0x69, 0xf5, 0xbd, 0xe6, 0x5e, 0xaa, 0x77, 0x59, + 0x60, 0x36, 0xc0, 0xe3, 0x42, 0x7f, 0x05, 0x3b, 0x4c, 0x02, 0x0e, + 0x70, 0x5a, 0x70, 0xc5, 0x2a, 0xeb, 0x94, 0x4d, 0x15, 0x09, 0xef, + 0xbb, 0x58, 0x42, 0x68, 0x05, 0x59, 0x70, 0xa0, 0x17, 0xb2, 0x8e, + 0xdf, 0x7b, 0x40, 0x5d, 0x21, 0x1e, 0xfe, 0x62, 0x58, 0xde, 0xfb, + 0x14, 0x91, 0x18, 0xf3, 0x4f, 0x9b, 0x36, 0x55, 0xcf, 0xb3, 0x5e, + 0xec, 0x4f, 0xcc, 0x6d, 0x13, 0x58, 0xc8, 0xa3, 0xa3, 0xee, 0x23, + 0x8a, 0xc2, 0xbf}}; + std::array const rsa6Sig{ + {0x8f, 0x50, 0xf6, 0x90, 0x72, 0x4f, 0x68, 0xd9, 0x05, 0x3c, 0xfa, + 0x98, 0x98,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b, 0xdc, 0x33, 0xcc, 0x6e, 0x1e, + 0xf1, 0x6f, 0x05, 0x23, 0xc3, 0x9d, 0xea, 0x90, 0x28, 0xb4, 0x5e, + 0x93, 0xbd, 0xf6, 0xa7, 0x12, 0x22, 0x7f, 0xa7, 0xcc, 0xc5, 0x10, + 0x0d, 0x5b, 0x44, 0x37, 0x2e, 0x07, 0xf5, 0x4c, 0x4e, 0x46, 0x5b, + 0x97, 0xe6, 0xac, 0xf5, 0xe2, 0xdf, 0x60, 0x4b, 0x8f, 0xf6, 0x83, + 0x79, 0x3f, 0x92, 0x73, 0xcc, 0x54, 0xe3, 0x97, 0x77, 0x81, 0xf8, + 0x40, 0x95, 0x07}}; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim13Preimage = "I am root"s; + auto const preim13Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa14Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa14PublicKey{ + {0xbd, 0x63, 0x74, 0xd9, 0xc0, 0x3e, 0x0c, 0x57, 0x55, 0x99, 0x00, + 0xf3, 0xa8, 0x03, 0xdc, 0x9a, 0x6c, 0x14, 0xfc, 0x83, 0x33, 0x63, + 0x87, 0x35, 0x9c, 0xfe, 0xc3, 0x00, 0xb4, 0x8b, 0x03, 0xc7, 0x5f, + 0x0a, 0xe2, 0x94, 0xaa, 0x3f, 0x76, 0x15, 0xb1, 0xb9, 0xf6, 0x5f, + 0x0a, 0x87, 0x0c, 0x5c, 0x35, 0xbc, 0x2f, 0x0f, 0x04, 0xdd, 0x9d, + 0x12, 0x8d, 0x94, 0xeb, 0x8b, 0x93, 0xb4, 0x4e, 0x96, 0x20, 0xb7, + 0x17, 0xa0, 0x8e, 0xff, 0x9e, 0x1f, 0x43, 0xbf, 0xd6, 0x6a, 0x1e, + 0xb6, 0x0d, 0x7f, 0x2c, 0x08, 0x67, 0xa5, 0xe7, 0xa3, 0xb6, 0xd2, + 0x63, 0x6a, 0xf2, 0xeb, 0xd1, 0x21, 0x83, 0x8f, 0xa0, 0x25, 0x4a, + 0xc6, 0xcb, 0x4e, 0x66, 0xc3, 0x5f, 0x37, 0xdf, 0x5c, 0x12, 0xb7, + 0xb8, 0xfa, 0x7a, 0x57, 0x91, 0x9d, 0x55, 0xa6, 0x96, 0x91, 0xee, + 0x94, 0xb0, 0xcc, 0x45, 0xd3, 0x76, 0x70, 0x6f, 0x12, 0xbd, 0x81, + 0x9d, 0x08, 0x1b, 0x6d, 0x55, 0x3c, 0x19, 0x56, 0x9c, 0xcf, 0xc4, + 0xb4, 0x63, 0x8a, 0x87, 0x35, 0x2b, 0x4c, 0xc6, 0xe1, 0x0d, 0x74, + 0x31, 0xaa, 0xc6, 0x25, 0x0d, 0x90, 0x55, 0x14, 0xf1, 0x73, 0x09, + 0x93, 0xba, 0xc6, 0xda, 0x52, 0x7f, 0xc2, 0xdd, 0x9d, 0xb2, 0x4f, + 0x92, 0x43, 0xa6, 0xc9, 0x2c, 0x22, 0xc4, 0x5a, 0x22, 0xc2, 0x56, + 0xac, 0xfa, 0x6a, 0x37, 0x6a, 0x0c, 0x22, 0x72, 0x5d, 0x30, 0x50, + 0x4a, 0x6b, 0x93, 0xab, 0xcf, 0x69, 0x5a, 0x09, 0xd2, 0x5a, 0x87, + 0x31, 0x80, 0xa7, 0x5b, 0xe4, 0x34, 0x42, 0x13, 0x44, 0x1d, 0xe6, + 0xf9, 0x27, 0x21, 0xa7, 0x03, 0x74, 0x64, 0x18, 0xfa, 0xd0, 0x68, + 0x28, 0x73, 0x37, 0x3c, 0xf6, 0x63, 0x10, 0x56, 0xcc, 0x25, 0x08, + 0xb9, 0xad, 0xc8, 0x25, 0x64, 0xd1, 0x9c, 0x7c, 0xe7, 0x6c, 0xa6, + 0x12, 0x2c, 0x7d}}; + std::array const rsa14Sig{ + {0x50, 0xac, 0xaf, 0xc3, 0x2a, 0x30, 0x1e, 0x0e, 0x4b, 0xb2, 0xa3, + 0x27, 0x10, 0x23, 0x44, 0x4c, 0x7f, 0xce, 0xbb, 0x36, 0xe8, 0xdd, + 0x1a, 0x19, 0x0f, 0xe9, 0x3b, 0xff, 0x9f, 0x20, 0xa7, 0x8d, 0xed, + 0xe6, 0xb1, 0x85, 0x8d, 0x98, 0x71, 0x9b, 0xfe, 0x42, 0xa1, 0x34, + 0xb1, 0xd3, 0x44, 0x53, 0x4c, 0x3a, 0x00, 0xd6, 0x4d, 0xa6, 0x43, + 0xe1, 0x9c, 0x0c, 0x10, 0xfa, 0xed, 0x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 0x22, 0xbb, 0xbf, 0x66, 0x80, 0x19, 0x66, 0x51, 0x6e, 0x44, + 0x82, 0xd9, 0x66}}; + auto const ed15Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed15PublicKey{ + {0x37, 0x86, 0xc1, 0x8d, 0x06, 0xf2, 0xe9, 0x58, 0x82, 0x95, 0xcd, + 0xb6, 0x5d, 0x37, 0x28, 0xc9, 0x72, 0xa9, 0x41, 0x20, 0xdc, 0x78, + 0x3d, 0xac, 0x24, 0x8c, 0xb0, 0x6f, 0x1e, 0x44, 0x22, 0xc3}}; + std::array const ed15Sig{ + {0xd8, 0x59, 0x56, 0xbd, 0x99, 0x5c, 0xdd, 0xcd, 0x82, 0x9b, 0xea, + 0x14, 0x18, 0x09, 0x9a, 0x8c, 0x54, 0xff, 0xb3, 0xd4, 0xf3, 0xbf, + 0xc1, 0x4b, 0x70, 0x2a, 0xc9, 0x69, 0x5d, 0x42, 0x8a, 0x34, 0x08, + 0x74, 0x3a, 0xef, 0x8b, 0xd9, 0x2e, 0x7a, 0x0d, 0xb7, 0xdb, 0x68, + 0xb3, 0xa8, 0xb8, 0x12, 0x3a, 0x11, 0x60, 0x20, 0xee, 0xd9, 0x1e, + 0x4a, 0xb6, 0x33, 0x94, 0x27, 0x4e, 0x83, 0xf0, 0x0e}}; + std::array const ed15SigningKey{ + {0x0e, 0x2d, 0x40, 0x72, 0x23, 0x7c, 0x11, 0x66, 0xdb, 0xe2, 0xa2, + 0x6e, 0x4a, 0x4e, 0x95, 0x3a, 0x03, 0x78, 0x62, 0x84, 0x2b, 0x40, + 0x3e, 0xc5, 0xa8, 0x93, 0x4d, 0xb5, 0xe0, 0xe4, 0xc5, 0xdd}}; + (void)ed15SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim16CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim16Cond{Type::preimageSha256, + 9, + Preim16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa17CondConditionFingerprint = { + {0x78, 0xe3, 0x04, 0xf4, 0xa6, 0x16, 0x68, 0x4c, 0x1b, 0xcf, 0x3a, + 0x32, 0xff, 0xbc, 0x75, 0x1a, 0xe6, 0x08, 0x9b, 0xff, 0xba, 0x79, + 0xf4, 0x39, 0x7a, 0xfc, 0xe1, 0x6f, 0xff, 0x3e, 0xb3, 0x75}}; + Condition const Rsa17Cond{Type::rsaSha256, + 65536, + Rsa17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed18CondConditionFingerprint = { + {0x0d, 0xea, 0xc5, 0x16, 0x5c, 0x62, 0xb8, 0xd1, 0xa4, 0xe7, 0x5a, + 0x07, 0x58, 0x00, 0x79, 0x51, 0x88, 0x21, 0xe9, 0x4d, 0xba, 0x73, + 0x7b, 0xad, 0x60, 0x9c, 0x5c, 0x26, 0x00, 0x2e, 0xd1, 0x51}}; + Condition const Ed18Cond{Type::ed25519Sha256, + 131072, + Ed18CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix19CondConditionFingerprint = { + {0x62, 0xc0, 0xc8, 0x90, 0x3e, 0x6b, 0x0d, 0x25, 0x86, 0x6e, 0x86, + 0x17, 0xf6, 0x5b, 0xc5, 0xa5, 0xff, 0xe8, 0x42, 0xff, 0xae, 0xcd, + 0x19, 0xdd, 0x55, 0x7a, 0x60, 0xa6, 0x73, 0xc5, 0xef, 0x52}}; + Condition const Prefix19Cond{Type::prefixSha256, + 273443, + Prefix19CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh31CondConditionFingerprint = { + {0x14, 0xe2, 0x21, 0xc5, 0x92, 0xb6, 0x3f, 0x66, 0xb2, 0xce, 0x07, + 0xc4, 0x86, 0xe3, 0x14, 0x28, 0x95, 0xac, 0x99, 0x5f, 0xf0, 0x19, + 0xd0, 0x77, 0x05, 0xb1, 0xd6, 0x31, 0xa9, 0xe0, 0x61, 0x31}}; + Condition const Thresh31Cond{Type::thresholdSha256, + 66560, + Thresh31CondConditionFingerprint, + std::bitset<5>{8}}; + + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(rsa6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim13 = + std::make_unique(makeSlice(preim13Preimage)); + auto rsa14 = std::make_unique( + makeSlice(rsa14PublicKey), makeSlice(rsa14Sig)); + auto ed15 = std::make_unique(ed15PublicKey, ed15Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim13)); + thresh0Subfulfillments.emplace_back(std::move(rsa14)); + thresh0Subfulfillments.emplace_back(std::move(ed15)); + std::vector thresh0Subconditions{ + {Preim16Cond, Rsa17Cond, Ed18Cond, Prefix19Cond, Thresh31Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x08\x95\xa0\x82\x07\xbb\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x82\x05\x38\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x82\x05\x2d\xa1\x82\x05\x29\x80\x02\x50\x32\x81" + "\x01\x1c\xa2\x82\x05\x1e\xa2\x82\x05\x1a\xa0\x82\x04\x9b\xa2" + "\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00" + "\xd0\x07\xfc\x9d\xb0\xa1\xa6\x40\xe4\x52\x30\x42\x74\xfd\x35" + "\x04\xde\x45\x68\xb3\x22\xdd\xff\x41\x43\x69\x33\xc0\xff\x35" + "\xb6\x6d\x15\xe9\x54\x15\xeb\x1d\x07\xe2\x25\x2b\xdb\xaa\x16" + "\x8d\x0d\x7f\x05\xf0\xd2\x7d\xb4\x9b\x51\x19\x20\x1e\x3d\xba" + "\x50\x9e\x51\x13\x81\x43\x55\x96\xca\xdb\x88\x1f\xef\x2d\x38" + "\x3f\xae\x8d\xac\xc8\x6f\x2b\xd5\xf0\x34\x1a\x99\x00\x7c\x6d" + "\xb3\x1b\x1d\x68\xdb\xf8\x1c\x59\x3a\x63\x38\x7c\x1c\x14\xbc" + "\x22\xcf\xc8\x9a\xc6\x96\x6f\x3d\x03\x0b\x61\x6b\x7d\x75\x97" + "\xe8\x25\xb8\x2f\xfa\xf4\x07\x44\xdf\x00\x3d\xff\x0d\xd5\x7f" + "\x7f\xf3\x0c\x13\xac\x8d\xf8\x8c\x79\xc5\xf3\x29\xdc\x23\x65" + "\xd3\xd1\x1c\xa6\x14\x78\x6a\x1a\xe3\x15\x8d\x8b\xdc\xa0\x5a" + "\xc7\x82\xb0\x03\x6c\x71\x43\x59\x24\xc7\x50\x64\xb2\xa7\x69" + "\xf5\xbd\xe6\x5e\xaa\x77\x59\x60\x36\xc0\xe3\x42\x7f\x05\x3b" + "\x4c\x02\x0e\x70\x5a\x70\xc5\x2a\xeb\x94\x4d\x15\x09\xef\xbb" + "\x58\x42\x68\x05\x59\x70\xa0\x17\xb2\x8e\xdf\x7b\x40\x5d\x21" + "\x1e\xfe\x62\x58\xde\xfb\x14\x91\x18\xf3\x4f\x9b\x36\x55\xcf" + "\xb3\x5e\xec\x4f\xcc\x6d\x13\x58\xc8\xa3\xa3\xee\x23\x8a\xc2" + "\xbf\x81\x82\x01\x00\x8f\x50\xf6\x90\x72\x4f\x68\xd9\x05\x3c" + "\xfa\x98\x98\x9c\x43\xf2\xb4\xe6\x83\x4a\x54\x30\x3c\x98\x57" + "\x90\x4c\xad\x49\xe3\x53\x0b\x0c\x2d\xea\xe0\x4d\xbe\xd1\xcf" + "\x69\x2f\xb8\xd2\x65\x83\x46\x9f\x24\x89\xd7\xf8\xf7\x2b\xd4" + "\x6e\x75\xe2\x04\x12\x2e\xa5\x6c\x98\xf7\x7f\xf8\x64\xfc\x40" + "\x68\x59\x2d\xfe\x8d\xfe\x79\x21\xa3\xa3\x38\x9a\x0b\xdd\xf5" + "\x1d\x5f\x45\xf9\x31\xb2\x78\x2c\x25\xac\x43\x3a\x73\x70\xfd" + "\x0c\xb1\xa2\x63\xa9\xa8\xc1\xac\xe8\x56\xe2\x3b\x1d\x8e\xc8" + "\x12\xc1\xea\x2b\xb2\x32\x14\x68\x9d\x2a\x76\xe2\x6b\x97\xd9" + "\x79\x0c\x59\xe5\x1e\x46\xef\x8d\x8a\xd7\x5d\xae\x1c\x78\xa9" + "\xce\x98\x07\xfa\x05\x9d\x0f\x8c\xcc\x44\x9d\x8c\x9e\xaf\xc8" + "\xcd\x68\x14\xd8\xcb\x38\xd9\x6c\x60\xe9\x88\xf4\x8d\x3a\x20" + "\xa8\x46\x77\xa7\x7b\x7d\x37\xa6\xf1\xef\xa0\x6a\x80\x95\x41" + "\xbf\x9b\x9b\xdc\x33\xcc\x6e\x1e\xf1\x6f\x05\x23\xc3\x9d\xea" + "\x90\x28\xb4\x5e\x93\xbd\xf6\xa7\x12\x22\x7f\xa7\xcc\xc5\x10" + "\x0d\x5b\x44\x37\x2e\x07\xf5\x4c\x4e\x46\x5b\x97\xe6\xac\xf5" + "\xe2\xdf\x60\x4b\x8f\xf6\x83\x79\x3f\x92\x73\xcc\x54\xe3\x97" + "\x77\x81\xf8\x40\x95\x07\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30" + "\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c" + "\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81" + "\x01\x09\xa3\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa" + "\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf" + "\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab" + "\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5" + "\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82" + "\x01\x00\xbe\x09\xc5\xa4\x27\x29\xdf\xd4\x67\x76\xbe\xbf\x2c" + "\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67\x20\xfb\x7a\x27\x93\xc0" + "\x78\x47\x78\xd7\x15\x32\xee\x38\x81\x0d\x36\xa2\xc4\x65\x44" + "\xe6\x62\x26\xb9\x58\x13\xa4\x15\x82\xab\xb1\x16\x61\xfc\x01" + "\x98\xc6\x1a\x69\xc6\xba\x39\x3f\x01\x55\x3d\xd7\x8e\x14\x42" + "\x6d\x78\x74\x9b\x28\xcb\x31\x39\x98\x5a\x11\xdc\xc1\x18\x9d" + "\x8d\xb0\xcd\x1b\x4c\x10\xab\x14\x64\x19\xf1\x33\x15\x45\xc8" + "\x92\x82\x03\x82\x8a\xaa\xad\x94\xfc\x24\x11\x96\x99\x7e\x94" + "\x5a\x82\x57\x68\x61\x9f\x7b\x45\xe0\x99\x9e\x4f\x32\x50\x5f" + "\x05\xc8\x11\xae\xc4\x0c\x63\x18\x0e\x02\x59\x36\x25\x92\x06" + "\x32\xc7\x71\x47\x99\xcc\x0a\x6e\x0a\x58\x71\x3f\x5e\xb7\x78" + "\xf7\x98\x79\xdf\x74\xa4\xeb\xa9\x00\xfd\x81\xb3\xcf\x04\x8c" + "\x5d\x7d\xe7\xb2\x82\x90\x49\xbd\x69\xf3\x08\xe9\x92\xc6\x9e" + "\x41\xba\x74\xd8\x8d\x81\x97\x6f\x86\xab\xc9\xf1\x02\x31\xb4" + "\xce\x47\xb0\x39\xc8\xba\x51\xa7\x39\xf3\x71\xa2\x25\x27\x37" + "\x6e\x09\x6f\x19\x59\xbc\x65\xd9\xcd\x12\xd3\x2c\xa2\x78\xfa" + "\x23\x15\x1a\x82\x41\x91\x1b\xbe\x8a\xe7\xfe\x3c\x3c\x30\x32" + "\xaa\xe9\xf3\x81\x82\x01\x00\x75\xeb\x6d\x6a\x90\x26\xd0\xbc" + "\x47\x71\x64\xe2\xb6\x89\xff\xe5\xc8\xc2\x63\xe3\x94\x14\x43" + "\x43\xb0\x67\xf9\x09\xa2\xf0\x28\x96\xa7\x12\x1c\x7e\x0e\xb6" + "\x53\xc4\x8a\x6f\x70\x26\x99\xe2\x2f\xce\x57\xdd\x91\xbc\xc4" + "\x02\xf6\xeb\x88\x06\x39\xcd\x6d\x78\x5b\x9c\xe7\x95\x8c\xe1" + "\x56\xf6\x5d\x61\x0b\x68\xf7\x37\x5b\x8c\x29\x95\x2b\xc6\x6b" + "\x3c\xb8\x67\x30\xd8\x20\xb2\xaf\xfc\x38\xf6\x70\x49\x25\x8b" + "\x8a\x8f\x6d\xa3\x81\x5a\x47\x9b\x1a\xd1\xe6\xce\xa7\x2e\x04" + "\xfc\xd0\x44\x85\xcf\xc6\x18\xc2\x76\x16\xac\x41\xe6\x05\xdc" + "\x13\x08\xb3\xfc\x75\x9d\xca\x5c\x6d\x21\xa9\x60\x9a\xd2\x17" + "\x3d\x04\x52\x7d\x6e\xe1\xd9\x27\x6c\x3c\x24\xc9\x64\x2b\x3f" + "\x23\x7c\xde\xf1\x58\xf9\xb1\x60\xfb\x26\x73\x0e\x35\x91\xdc" + "\xdc\x11\x2c\xdd\x8b\x56\x8f\x84\x13\x83\x8c\xe9\x97\x93\xba" + "\x16\x37\x19\xb4\x88\x21\x68\xb3\xfa\x55\xcb\xaa\xed\x66\x6a" + "\x0b\x4e\x7e\xd1\xf3\xf3\x60\xd0\x8c\x52\x34\x7a\x62\xfb\x61" + "\x80\xc3\xdc\xf8\xc2\x11\xa8\xea\xd5\xe0\x00\xb3\x1e\x92\x0e" + "\xde\xe7\xcb\xce\x8b\x41\x82\x24\xe2\x4e\x2b\x7f\x3c\x14\x08" + "\x4f\xb2\x99\x87\x42\x46\x74\xf5\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\xaf\x93\xfd\x22\x45\xc2\x08" + "\xab\x43\xf7\x45\x56\x63\xec\xaf\x15\x33\xa0\x2a\xb4\x9e\x15" + "\xb4\x6e\xda\x87\x35\xde\x09\x4b\x06\x31\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x55\xcc\xd1\xa2\x2c\x90\x8d\xe3\x2e\x42\xd4" + "\xe0\x65\xb2\xf7\xda\xc0\x07\x1e\xd3\x23\x0f\xfe\x78\x13\xa2" + "\x86\x61\xc4\x34\x28\x50\x81\x03\x02\x00\x00\xa3\x82\x02\x08" + "\x80\x82\x01\x00\xbd\x63\x74\xd9\xc0\x3e\x0c\x57\x55\x99\x00" + "\xf3\xa8\x03\xdc\x9a\x6c\x14\xfc\x83\x33\x63\x87\x35\x9c\xfe" + "\xc3\x00\xb4\x8b\x03\xc7\x5f\x0a\xe2\x94\xaa\x3f\x76\x15\xb1" + "\xb9\xf6\x5f\x0a\x87\x0c\x5c\x35\xbc\x2f\x0f\x04\xdd\x9d\x12" + "\x8d\x94\xeb\x8b\x93\xb4\x4e\x96\x20\xb7\x17\xa0\x8e\xff\x9e" + "\x1f\x43\xbf\xd6\x6a\x1e\xb6\x0d\x7f\x2c\x08\x67\xa5\xe7\xa3" + "\xb6\xd2\x63\x6a\xf2\xeb\xd1\x21\x83\x8f\xa0\x25\x4a\xc6\xcb" + "\x4e\x66\xc3\x5f\x37\xdf\x5c\x12\xb7\xb8\xfa\x7a\x57\x91\x9d" + "\x55\xa6\x96\x91\xee\x94\xb0\xcc\x45\xd3\x76\x70\x6f\x12\xbd" + "\x81\x9d\x08\x1b\x6d\x55\x3c\x19\x56\x9c\xcf\xc4\xb4\x63\x8a" + "\x87\x35\x2b\x4c\xc6\xe1\x0d\x74\x31\xaa\xc6\x25\x0d\x90\x55" + "\x14\xf1\x73\x09\x93\xba\xc6\xda\x52\x7f\xc2\xdd\x9d\xb2\x4f" + "\x92\x43\xa6\xc9\x2c\x22\xc4\x5a\x22\xc2\x56\xac\xfa\x6a\x37" + "\x6a\x0c\x22\x72\x5d\x30\x50\x4a\x6b\x93\xab\xcf\x69\x5a\x09" + "\xd2\x5a\x87\x31\x80\xa7\x5b\xe4\x34\x42\x13\x44\x1d\xe6\xf9" + "\x27\x21\xa7\x03\x74\x64\x18\xfa\xd0\x68\x28\x73\x37\x3c\xf6" + "\x63\x10\x56\xcc\x25\x08\xb9\xad\xc8\x25\x64\xd1\x9c\x7c\xe7" + "\x6c\xa6\x12\x2c\x7d\x81\x82\x01\x00\x50\xac\xaf\xc3\x2a\x30" + "\x1e\x0e\x4b\xb2\xa3\x27\x10\x23\x44\x4c\x7f\xce\xbb\x36\xe8" + "\xdd\x1a\x19\x0f\xe9\x3b\xff\x9f\x20\xa7\x8d\xed\xe6\xb1\x85" + "\x8d\x98\x71\x9b\xfe\x42\xa1\x34\xb1\xd3\x44\x53\x4c\x3a\x00" + "\xd6\x4d\xa6\x43\xe1\x9c\x0c\x10\xfa\xed\x6a\xaf\x84\x50\x9c" + "\xb7\xa9\x0a\x90\x65\x06\xc0\xb9\x2f\xf6\xd4\xb0\xaa\x09\x9b" + "\x23\x72\x10\x25\x59\x91\x83\x54\x16\xaa\xf9\x68\x9c\x9f\x45" + "\x8f\x3c\x2c\x90\x7f\x91\xf2\x80\x3f\x08\xa8\x39\x90\x76\x08" + "\x58\xcb\x49\x4b\x48\xd6\xdd\x60\xda\x10\x23\xd0\x3e\x4d\xe1" + "\xee\x4d\x50\xb1\x44\xf0\x64\xda\xea\x4b\x2f\x7a\xec\xa8\xb5" + "\xbd\x98\xf3\x8e\x48\x55\x64\xd9\x44\x7d\xe9\xb6\x99\x7f\x0d" + "\x4f\x3f\xc8\xf4\x7d\x85\x71\x68\xc9\x95\x7b\xf5\xc9\xe3\x7c" + "\x5c\x78\x00\xb0\xf0\xbb\xa3\xeb\x39\x23\xf8\x24\x5a\x66\x71" + "\xe6\xbf\xa0\xf0\x9c\xc2\x8b\x2d\xa6\x30\x3a\xb9\x86\xcc\x97" + "\x6d\x23\x05\xb9\x48\xbd\x2b\xc3\x15\xcb\xe2\xdb\x97\x2d\x89" + "\x63\xee\x99\x8e\x42\x74\x35\x74\x66\x27\xc7\xca\x7f\xdb\x6a" + "\x96\x87\xed\xff\x86\x7a\xd3\x49\x66\xfa\x6e\xe5\x22\xbb\xbf" + "\x66\x80\x19\x66\x51\x6e\x44\x82\xd9\x66\xa4\x64\x80\x20\x37" + "\x86\xc1\x8d\x06\xf2\xe9\x58\x82\x95\xcd\xb6\x5d\x37\x28\xc9" + "\x72\xa9\x41\x20\xdc\x78\x3d\xac\x24\x8c\xb0\x6f\x1e\x44\x22" + "\xc3\x81\x40\xd8\x59\x56\xbd\x99\x5c\xdd\xcd\x82\x9b\xea\x14" + "\x18\x09\x9a\x8c\x54\xff\xb3\xd4\xf3\xbf\xc1\x4b\x70\x2a\xc9" + "\x69\x5d\x42\x8a\x34\x08\x74\x3a\xef\x8b\xd9\x2e\x7a\x0d\xb7" + "\xdb\x68\xb3\xa8\xb8\x12\x3a\x11\x60\x20\xee\xd9\x1e\x4a\xb6" + "\x33\x94\x27\x4e\x83\xf0\x0e\xa1\x81\xd3\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2b\x80\x20\x62\xc0\xc8\x90\x3e\x6b\x0d" + "\x25\x86\x6e\x86\x17\xf6\x5b\xc5\xa5\xff\xe8\x42\xff\xae\xcd" + "\x19\xdd\x55\x7a\x60\xa6\x73\xc5\xef\x52\x81\x03\x04\x2c\x23" + "\x82\x02\x03\xb8\xa2\x2b\x80\x20\x14\xe2\x21\xc5\x92\xb6\x3f" + "\x66\xb2\xce\x07\xc4\x86\xe3\x14\x28\x95\xac\x99\x5f\xf0\x19" + "\xd0\x77\x05\xb1\xd6\x31\xa9\xe0\x61\x31\x81\x03\x01\x04\x00" + "\x82\x02\x04\x10\xa3\x27\x80\x20\x78\xe3\x04\xf4\xa6\x16\x68" + "\x4c\x1b\xcf\x3a\x32\xff\xbc\x75\x1a\xe6\x08\x9b\xff\xba\x79" + "\xf4\x39\x7a\xfc\xe1\x6f\xff\x3e\xb3\x75\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c\x62\xb8\xd1\xa4\xe7\x5a" + "\x07\x58\x00\x79\x51\x88\x21\xe9\x4d\xba\x73\x7b\xad\x60\x9c" + "\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x3f\x01\x30\xe1\x76\xb4\x40\x67\x87\xb6\x97" + "\x1d\x78\x07\xfd\xf1\x43\xbe\x11\xbb\x2c\xf4\x15\x2d\xae\x34" + "\x31\x8c\xd3\xde\x7c\x9b\x81\x03\x0c\x7c\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x09\xf8\x06\xa1\x44\xca\xc9\x9c\xe5\x42\x22\xb4" + "\x30\xdb\x7b\x77\x05\x07\x06\xcb\x55\xbc\xb8\xc4\xaf\xc2\x2b" + "\xfd\xe4\xc6\x2d\xac\x81\x03\x04\x2c\x3a\x82\x02\x03\xb8\xa1" + "\x2b\x80\x20\x62\xc0\xc8\x90\x3e\x6b\x0d\x25\x86\x6e\x86\x17" + "\xf6\x5b\xc5\xa5\xff\xe8\x42\xff\xae\xcd\x19\xdd\x55\x7a\x60" + "\xa6\x73\xc5\xef\x52\x81\x03\x04\x2c\x23\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\x14\xe2\x21\xc5\x92\xb6\x3f\x66\xb2\xce\x07\xc4" + "\x86\xe3\x14\x28\x95\xac\x99\x5f\xf0\x19\xd0\x77\x05\xb1\xd6" + "\x31\xa9\xe0\x61\x31\x81\x03\x01\x04\x00\x82\x02\x04\x10\xa3" + "\x27\x80\x20\x32\xec\xaa\x5e\xa6\x88\xdc\xe4\x81\x0f\x93\x0f" + "\x65\xde\x87\xfd\x54\x8c\x79\x04\x81\xe3\x63\x3f\x3d\x08\xa1" + "\xba\x0a\x24\x2b\x46\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x78" + "\xe3\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32\xff\xbc\x75\x1a" + "\xe6\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1\x6f\xff\x3e\xb3" + "\x75\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c" + "\x62\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d" + "\xba\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x40\xd1\x9a\x63\x62\x9b\xc0\x76\xab" + "\x11\x73\x42\x86\xb3\x20\x9d\x23\xe8\x5e\xee\xb9\x82\x5d\x93" + "\xe3\xac\xad\xa0\x40\x41\x51\x1b\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh38() + { + testcase("Thresh38"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim40Cond + // ** Rsa41Cond + // ** Ed42Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** Thresh13Cond + // ***** rsa4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** rsa6 + // ** prefix18 + // *** prefix19 + // **** thresh20 + // ***** Preim27Cond + // ***** Rsa28Cond + // ***** Ed29Cond + // ***** Thresh30Cond + // ***** rsa21 + // ***** thresh22 + // ****** Preim24Cond + // ****** Rsa25Cond + // ****** Ed26Cond + // ****** rsa23 + // ** thresh35 + // *** Preim37Cond + // *** Rsa38Cond + // *** Ed39Cond + // *** rsa36 + + auto const rsa4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x4b, 0xb1, 0x58, 0xca, 0xac, 0x8e, 0x5c, 0x70, 0xde, 0x76, 0xb9, + 0x25, 0x14, 0x94, 0xac, 0x94, 0xa3, 0x50, 0xca, 0x85, 0xca, 0xb8, + 0x2f, 0x8b, 0x0e, 0x8e, 0x38, 0x94, 0x4d, 0x36, 0xfc, 0x53, 0x24, + 0x60, 0xdb, 0x40, 0x7f, 0xba, 0xd2, 0xe7, 0x40, 0x55, 0x5f, 0x55, + 0xfb, 0xcb, 0x04, 0xa2, 0x37, 0x7f, 0x3c, 0xcb, 0x9a, 0xf2, 0x18, + 0x9b, 0x6f, 0x4e, 0x48, 0x57, 0x85, 0xda, 0x25, 0xed, 0xf1, 0x4a, + 0xfd, 0xf6, 0x2b, 0xaf, 0x70, 0x9d, 0x44, 0x2a, 0xed, 0xa1, 0xcb, + 0xf2, 0x88, 0xeb, 0x31, 0x9d, 0x14, 0x0b, 0xd5, 0xa3, 0xc9, 0xc8, + 0x09, 0xea, 0x92, 0x17, 0x3f, 0xa7, 0xbd, 0x4f, 0xbf, 0x57, 0x06, + 0x8f, 0x6e, 0x99, 0xb6, 0xc7, 0xdd, 0xfa, 0x9a, 0xa2, 0x29, 0x3b, + 0xed, 0x1e, 0x4f, 0xbf, 0xb2, 0x06, 0x98, 0xa0, 0x7e, 0x3f, 0xae, + 0xa0, 0xe0, 0x3d, 0xef, 0xce, 0x40, 0xde, 0x44, 0xe6, 0x2e, 0x3c, + 0x0a, 0x22, 0x91, 0xfe, 0xe1, 0xf9, 0x16, 0xbd, 0x60, 0x0b, 0x4a, + 0xdc, 0xcf, 0xb4, 0x67, 0x94, 0xf6, 0x6c, 0x70, 0x35, 0xbe, 0xbd, + 0xa6, 0xcd, 0x45, 0x6c, 0x93, 0x58, 0x06, 0xe2, 0x54, 0xdf, 0x75, + 0x06, 0xc3, 0x95, 0x97, 0x23, 0x68, 0xbd, 0xd6, 0x47, 0x6d, 0x13, + 0xab, 0xf5, 0x15, 0xb3, 0xd6, 0xa8, 0xd7, 0xd5, 0xee, 0xdc, 0xb9, + 0x23, 0x26, 0x32, 0xb0, 0x20, 0x70, 0x66, 0x70, 0x88, 0xbf, 0xcb, + 0x87, 0x12, 0x5b, 0x4b, 0xa5, 0x95, 0xdf, 0x5a, 0xe0, 0xf6, 0x53, + 0x5c, 0xb3, 0xf7, 0x45, 0xb8, 0xef, 0x54, 0x7b, 0x4b, 0x43, 0xaf, + 0xac, 0x81, 0x74, 0xa8, 0x70, 0x73, 0x7f, 0xbc, 0x90, 0x63, 0x31, + 0xa6, 0x76, 0x4e, 0xab, 0x9d, 0xcd, 0x05, 0x72, 0xac, 0x57, 0x28, + 0x62, 0x56, 0xa3, 0x31, 0xe6, 0x97, 0xec, 0xb9, 0x90, 0x12, 0xa2, + 0xb7, 0x14, 0xa4}}; + auto const rsa6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 0x40, 0xe4, 0x52, 0x30, + 0x42, 0x74, 0xfd, 0x35, 0x04, 0xde, 0x45, 0x68, 0xb3, 0x22, 0xdd, + 0xff, 0x41, 0x43, 0x69, 0x33, 0xc0, 0xff, 0x35, 0xb6, 0x6d, 0x15, + 0xe9, 0x54, 0x15, 0xeb, 0x1d, 0x07, 0xe2, 0x25, 0x2b, 0xdb, 0xaa, + 0x16, 0x8d, 0x0d, 0x7f, 0x05, 0xf0, 0xd2, 0x7d, 0xb4, 0x9b, 0x51, + 0x19, 0x20, 0x1e, 0x3d, 0xba, 0x50, 0x9e, 0x51, 0x13, 0x81, 0x43, + 0x55, 0x96, 0xca, 0xdb, 0x88, 0x1f, 0xef, 0x2d, 0x38, 0x3f, 0xae, + 0x8d, 0xac, 0xc8, 0x6f, 0x2b, 0xd5, 0xf0, 0x34, 0x1a, 0x99, 0x00, + 0x7c, 0x6d, 0xb3, 0x1b, 0x1d, 0x68, 0xdb, 0xf8, 0x1c, 0x59, 0x3a, + 0x63, 0x38, 0x7c, 0x1c, 0x14, 0xbc, 0x22, 0xcf, 0xc8, 0x9a, 0xc6, + 0x96, 0x6f, 0x3d, 0x03, 0x0b, 0x61, 0x6b, 0x7d, 0x75, 0x97, 0xe8, + 0x25, 0xb8, 0x2f, 0xfa, 0xf4, 0x07, 0x44, 0xdf, 0x00, 0x3d, 0xff, + 0x0d, 0xd5, 0x7f, 0x7f, 0xf3, 0x0c, 0x13, 0xac, 0x8d, 0xf8, 0x8c, + 0x79, 0xc5, 0xf3, 0x29, 0xdc, 0x23, 0x65, 0xd3, 0xd1, 0x1c, 0xa6, + 0x14, 0x78, 0x6a, 0x1a, 0xe3, 0x15, 0x8d, 0x8b, 0xdc, 0xa0, 0x5a, + 0xc7, 0x82, 0xb0, 0x03, 0x6c, 0x71, 0x43, 0x59, 0x24, 0xc7, 0x50, + 0x64, 0xb2, 0xa7, 0x69, 0xf5, 0xbd, 0xe6, 0x5e, 0xaa, 0x77, 0x59, + 0x60, 0x36, 0xc0, 0xe3, 0x42, 0x7f, 0x05, 0x3b, 0x4c, 0x02, 0x0e, + 0x70, 0x5a, 0x70, 0xc5, 0x2a, 0xeb, 0x94, 0x4d, 0x15, 0x09, 0xef, + 0xbb, 0x58, 0x42, 0x68, 0x05, 0x59, 0x70, 0xa0, 0x17, 0xb2, 0x8e, + 0xdf, 0x7b, 0x40, 0x5d, 0x21, 0x1e, 0xfe, 0x62, 0x58, 0xde, 0xfb, + 0x14, 0x91, 0x18, 0xf3, 0x4f, 0x9b, 0x36, 0x55, 0xcf, 0xb3, 0x5e, + 0xec, 0x4f, 0xcc, 0x6d, 0x13, 0x58, 0xc8, 0xa3, 0xa3, 0xee, 0x23, + 0x8a, 0xc2, 0xbf}}; + std::array const rsa6Sig{ + {0xc8, 0x04, 0x6c, 0x89, 0x2b, 0x18, 0x92, 0x6f, 0x2b, 0xbf, 0xd9, + 0x66, 0x00, 0x88, 0x38, 0xe6, 0x0c, 0xed, 0xe2, 0x49, 0x01, 0x3d, + 0x2c, 0x40, 0xaa, 0x49, 0xf7, 0xc2, 0x63, 0x0b, 0x35, 0x18, 0xbc, + 0xe1, 0x33, 0xf6, 0x38, 0xb6, 0xc5, 0xf7, 0x99, 0x5a, 0x63, 0x72, + 0xfa, 0x48, 0xe9, 0x88, 0x84, 0x7b, 0xf5, 0x2c, 0x41, 0x03, 0xcb, + 0x4d, 0xc1, 0x8f, 0xb5, 0xf8, 0x74, 0x1e, 0x9c, 0x5e, 0xae, 0xe6, + 0xc7, 0xf0, 0x5c, 0xb3, 0xd7, 0x82, 0x8d, 0x9b, 0xa3, 0x88, 0x91, + 0x4d, 0x54, 0x53, 0x64, 0x22, 0x59, 0x53, 0xe4, 0x3e, 0xf5, 0xf1, + 0x15, 0xff, 0xb5, 0x0b, 0x5f, 0xf5, 0x68, 0x34, 0x64, 0xef, 0x28, + 0xc0, 0x2e, 0x25, 0xc1, 0x17, 0x47, 0x9c, 0xaa, 0x97, 0xf6, 0x5e, + 0x35, 0xda, 0x64, 0x37, 0xc1, 0x82, 0x25, 0xbc, 0x0b, 0x4b, 0xda, + 0x53, 0xa2, 0xb4, 0xa8, 0xcd, 0x91, 0x85, 0x09, 0xaa, 0xae, 0x2f, + 0x16, 0x94, 0x6c, 0xe9, 0x61, 0x24, 0x26, 0xec, 0x39, 0x41, 0x9b, + 0x0c, 0x44, 0x7b, 0xe9, 0x95, 0x2d, 0xd7, 0x86, 0xec, 0x5d, 0x64, + 0x00, 0x25, 0xea, 0xbd, 0x74, 0x06, 0x32, 0x5a, 0xbe, 0x62, 0x2d, + 0xfe, 0xc0, 0x7a, 0xd8, 0xbb, 0x46, 0x4a, 0xae, 0x7c, 0x17, 0xa5, + 0x0e, 0xce, 0xdd, 0x30, 0xb4, 0xd6, 0x0c, 0x7a, 0xe5, 0xf6, 0xbc, + 0x7d, 0x63, 0x9d, 0xc1, 0x1c, 0x99, 0x24, 0x0b, 0x72, 0x13, 0xf9, + 0x0a, 0xd6, 0x47, 0xd4, 0x1d, 0x50, 0x07, 0xcc, 0x79, 0xf8, 0x31, + 0x79, 0x02, 0x3a, 0xeb, 0xe3, 0x61, 0x03, 0x4b, 0x52, 0xaa, 0x1f, + 0xca, 0xcc, 0x84, 0x99, 0x99, 0x25, 0x11, 0xac, 0x8b, 0xea, 0x18, + 0x9d, 0x71, 0x6e, 0x4c, 0x7c, 0x3e, 0x7b, 0x92, 0xd0, 0x3d, 0x19, + 0xa7, 0xf8, 0x71, 0x2b, 0x7c, 0xb9, 0xb1, 0x6d, 0x55, 0xcb, 0xff, + 0x50, 0x9d, 0x33}}; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh13CondConditionFingerprint = { + {0xd9, 0x95, 0x6e, 0x6e, 0x8b, 0x3b, 0x8b, 0x3b, 0xd7, 0x11, 0x4b, + 0x11, 0x21, 0x26, 0x48, 0xbd, 0x92, 0x55, 0x47, 0x42, 0x66, 0x8f, + 0xc1, 0x5f, 0xb4, 0x03, 0x78, 0x32, 0x05, 0xc5, 0x0e, 0x82}}; + Condition const Thresh13Cond{Type::thresholdSha256, + 135168, + Thresh13CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const rsa21Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa21PublicKey{ + {0xde, 0x0b, 0xb1, 0x46, 0x39,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 0x74, 0xb7, + 0x08, 0x27, 0x2d, 0xc5, 0x48, 0x0d, 0x81, 0x3d, 0x9a, 0xdb, 0x4d, + 0x29, 0x82, 0x22, 0x56, 0x19, 0x63, 0xac, 0x94, 0x55, 0xd4, 0x56, + 0x7e, 0x5a, 0x2f, 0x75, 0x82, 0xcb, 0xb5, 0x95, 0x9a, 0x35, 0x10, + 0x74, 0xc6, 0xa9, 0x10, 0x8a, 0xdb, 0x72, 0xfe, 0x57, 0x6a, 0x34, + 0x46, 0xc8, 0x45, 0x7c, 0xb0, 0xc8, 0x19, 0xc9, 0x0e, 0x22, 0xd2, + 0x6f, 0xa5, 0x8f, 0x99, 0x55, 0x4f, 0xc9, 0x4c, 0xa0, 0xd3, 0xf0, + 0x94, 0x07, 0x69}}; + std::array const rsa21Sig{ + {0xaa, 0x0a, 0xe7, 0x8b, 0x70, 0xd3, 0x51, 0xff, 0x74, 0xf4, 0xd0, + 0x7d, 0xf0, 0x83, 0x44, 0x43, 0x7d, 0x20, 0xc2, 0xf1, 0x71, 0xa3, + 0x93, 0xe0, 0x26, 0xe3, 0x2c, 0x73, 0xab, 0x00, 0xa4, 0x34, 0xde, + 0xce, 0x52, 0xa0, 0x26, 0xa8, 0xe1, 0xcb, 0xae, 0x81, 0x51, 0x47, + 0xd5, 0xf4, 0x42, 0xd7, 0xd8, 0xcc, 0x6c, 0xe4, 0x72, 0x29, 0xbf, + 0xfd, 0xf7, 0x0d, 0xce, 0xd9, 0xea, 0x1f, 0xbe, 0x2e, 0xbc, 0xf6, + 0x7c, 0x58, 0x89, 0x0c, 0xab, 0x1b, 0x11, 0xfe, 0x79, 0x1d, 0x2f, + 0x0a, 0x6f, 0x80, 0x13, 0x1d, 0x7c, 0xe3, 0x56, 0x4b, 0xd0, 0x6a, + 0x9f, 0xed, 0xff, 0xcb, 0x68, 0x4b, 0xaf, 0xd4, 0x84, 0xba, 0xfd, + 0xa1, 0xcb, 0xd4, 0xe3, 0x8e, 0x08, 0xc5, 0x8e, 0x6b, 0xfd, 0x50, + 0xf5, 0xa1, 0x97, 0xfe, 0x12, 0xf8, 0x11, 0x07, 0x88, 0xa1, 0xa6, + 0xc2, 0xbc, 0x92, 0x80, 0x40, 0x2c, 0xd3, 0x7c, 0xfc, 0xce, 0xed, + 0xad, 0x90, 0x3e, 0x58, 0xd6, 0x23, 0x71, 0x64, 0x7c, 0x77, 0x67, + 0x8d, 0x80, 0xd9, 0x77, 0x3c, 0xe2, 0x30, 0x3c, 0x99, 0xfb, 0xbf, + 0xc3, 0x99, 0xcd, 0xa3, 0x64, 0xcf, 0xf0, 0x5e, 0x00, 0x27, 0xa6, + 0xdc, 0xe1, 0x58, 0x17, 0x73, 0x79, 0x80, 0x68, 0x8a, 0xa5, 0xb1, + 0x5d, 0x31, 0x9e, 0xb2, 0x8e, 0x1b, 0x01, 0xb9, 0x65, 0x05, 0x7f, + 0xd0, 0xd5, 0x9f, 0x13, 0x81, 0x35, 0x6b, 0xe2, 0x01, 0x0d, 0xce, + 0xfa, 0x21, 0x31, 0x20, 0x98, 0xb1, 0x89, 0xc5, 0x3b, 0xfd, 0x6d, + 0xf4, 0xf7, 0x44, 0xd6, 0xea, 0xed, 0x77, 0xa6, 0xe9, 0xa2, 0x74, + 0xad, 0xef, 0x39, 0xc7, 0x68, 0xca, 0x14, 0x68, 0x61, 0xb6, 0xc3, + 0x95, 0x78, 0xc3, 0x96, 0xc4, 0xc7, 0xe2, 0x80, 0x82, 0xe5, 0x3a, + 0xf8, 0x7b, 0x7d, 0x9d, 0x7a, 0x9a, 0xe5, 0x32, 0x8e, 0x64, 0xe7, + 0xbc, 0x3c, 0xd7}}; + auto const rsa23Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa23PublicKey{ + {0xd7, 0x79, 0x96, 0xb4, 0xf5, 0x56, 0xa2, 0xdf, 0x83, 0xa7, 0x6e, + 0x70, 0xe7, 0xc9, 0xfb, 0x04, 0xba, 0x4b, 0x39, 0x10, 0xe2, 0xe7,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 0x08, 0x9e, 0x34, 0xa1, 0x71, 0x35, + 0x66, 0xe9, 0x54, 0xee, 0xff, 0x90, 0xce, 0x8f, 0x51, 0x96, 0xa6, + 0x14, 0x66, 0x35, 0xa4, 0x62, 0xbf, 0x99, 0xe7, 0xab, 0x6e, 0x1e, + 0x29, 0x14, 0x6e, 0x84, 0x87, 0xad, 0x99, 0xad, 0x35, 0xc4, 0xfe, + 0xb9, 0x38, 0x08, 0x1b, 0xc3, 0x8c, 0x69, 0x99, 0x8a, 0x32, 0x90, + 0x69, 0xa4, 0x5f}}; + std::array const rsa23Sig{ + {0x99, 0x20, 0x75, 0xb7, 0xc7, 0x30, 0x66, 0x13, 0xa1, 0x4e, 0x32, + 0xfe, 0xde, 0x53, 0xa2, 0xc3, 0x50, 0x19, 0x2b, 0xa7, 0x0b, 0x13, + 0x1d, 0x78, 0xaf, 0x1d, 0xcd, 0x78, 0x50, 0xd9, 0x3e, 0x8b, 0x59, + 0xe8, 0x37, 0xbb, 0x0b, 0xd9, 0x58, 0xe7, 0x8b, 0x60, 0x7e, 0x07, + 0xbf, 0x46, 0x94, 0x2e, 0x3b, 0xe0, 0xfb, 0x70, 0x6b, 0xc2, 0xbd, + 0x7d, 0x21, 0x23, 0x79, 0x2a, 0x40, 0xf5, 0xb1, 0x39, 0xc5, 0xa9, + 0x64, 0x52, 0x4f, 0xed, 0xa1, 0x50, 0x3f, 0xa4, 0x07, 0x9a, 0xa1, + 0x2d, 0x50, 0x9f, 0xcd, 0xeb, 0x9a, 0x32, 0xd4, 0x24, 0x49, 0x00, + 0x7f, 0x7e, 0xbd, 0xdb, 0xce, 0x37, 0x19, 0xbe, 0xd7, 0x36, 0xe8, + 0xd9, 0x34, 0xdc, 0x61, 0xbb, 0x4c, 0xc1, 0x2b, 0xef, 0x16, 0x19, + 0x53, 0xea, 0x85, 0x61, 0x36, 0xeb, 0x95, 0xa2, 0xd4, 0xa9, 0x34, + 0xd8, 0xf0, 0xe5, 0xf4, 0x72, 0xee, 0x01, 0x88, 0xed, 0x2f, 0xc2, + 0x56, 0x51, 0x4c, 0x02, 0xae, 0x2b, 0xcd, 0x89, 0x62, 0xd9, 0xa1, + 0xe6, 0x53, 0x47, 0xc9, 0xe6, 0xe0, 0x05, 0x7e, 0xcb, 0x21, 0x6a, + 0x00, 0xdb, 0x2b, 0x43, 0x2a, 0xdf, 0x58, 0x93, 0x16, 0x28, 0x08, + 0x0a, 0x09, 0x96, 0xf0, 0xba, 0x0f, 0x01, 0x7b, 0x2a, 0x80, 0xb5, + 0x15, 0x5f, 0x59, 0x69, 0xe2, 0x10, 0x51, 0x88, 0x98, 0x93, 0xdb, + 0xf2, 0x7b, 0x0d, 0xf6, 0x93, 0x0e, 0x03, 0x06, 0xc6, 0xfa, 0xb4, + 0x4c, 0x9b, 0x15, 0xdf, 0x7f, 0x46, 0x10, 0x22, 0xcf, 0xb0, 0xc3, + 0xca, 0x8e, 0xe0, 0xae, 0x08, 0x4d, 0xaf, 0x65, 0x03, 0xc6, 0x20, + 0x64, 0x0e, 0x4d, 0x1b, 0x03, 0x1e, 0xa0, 0x6b, 0xdf, 0x1c, 0x69, + 0x2a, 0x8b, 0xad, 0xea, 0xd2, 0x4c, 0x1b, 0x93, 0x41, 0xc4, 0xbc, + 0x55, 0x0c, 0x35, 0xda, 0xaf, 0xac, 0xed, 0x6b, 0xdc, 0xe5, 0x3d, + 0x23, 0x86, 0xbc}}; + auto const thresh22Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim24CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim24Cond{Type::preimageSha256, + 9, + Preim24CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa25CondConditionFingerprint = { + {0xb2, 0x7f, 0x94, 0xe3, 0xdf, 0x0c, 0x9a, 0x71, 0x3a, 0xd2, 0xeb, + 0x71, 0x91, 0x72, 0x40, 0xb9, 0xcb, 0xb7, 0xac, 0xbc, 0x77, 0x0a, + 0x08, 0x85, 0x07, 0xa3, 0x85, 0x4e, 0x7e, 0xc9, 0x50, 0x96}}; + Condition const Rsa25Cond{Type::rsaSha256, + 65536, + Rsa25CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed26CondConditionFingerprint = { + {0xd6, 0x2f, 0x07, 0xbd, 0x56, 0xfe, 0x9a, 0x02, 0x8c, 0x98, 0x1a, + 0x72, 0x17, 0xb6, 0x26, 0x90, 0x51, 0xaf, 0xe4, 0xea, 0x51, 0x64, + 0xe0, 0x58, 0x3e, 0x85, 0xc9, 0x29, 0x22, 0x94, 0xa1, 0xbf}}; + Condition const Ed26Cond{Type::ed25519Sha256, + 131072, + Ed26CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh20Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim27CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim27Cond{Type::preimageSha256, + 9, + Preim27CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa28CondConditionFingerprint = { + {0x58, 0xac, 0x94, 0x55, 0x27, 0x79, 0x7a, 0x0c, 0xac, 0x84, 0x2d, + 0x5c, 0x13, 0x32, 0xee, 0x84, 0x25, 0xb8, 0xb8, 0xec, 0x25, 0x0d, + 0x40, 0xee, 0xc0, 0xd4, 0x79, 0x18, 0x3f, 0xc6, 0xbc, 0xd7}}; + Condition const Rsa28Cond{Type::rsaSha256, + 65536, + Rsa28CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed29CondConditionFingerprint = { + {0xc5, 0x39, 0xb2, 0xc7, 0xc4, 0x92, 0x8a, 0x29, 0xf3, 0x72, 0xb4, + 0x6c, 0xa5, 0x0d, 0x8c, 0xbe, 0x43, 0xda, 0xc9, 0xac, 0x6c, 0x26, + 0x7c, 0x44, 0xb9, 0x3f, 0xee, 0x40, 0xcc, 0x8e, 0x41, 0x3c}}; + Condition const Ed29Cond{Type::ed25519Sha256, + 131072, + Ed29CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh30CondConditionFingerprint = { + {0x55, 0x54, 0x55, 0x25, 0x4a, 0x1e, 0xf0, 0x5c, 0x22, 0x0f, 0xc2, + 0x46, 0xc5, 0x9b, 0x13, 0x25, 0x51, 0x61, 0xdf, 0x62, 0x52, 0x25, + 0x82, 0x17, 0xe4, 0xd6, 0xdf, 0x1f, 0xfd, 0x8c, 0x68, 0x15}}; + Condition const Thresh30Cond{Type::thresholdSha256, + 135168, + Thresh30CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix19Prefix = "P19"s; + auto const prefix19Msg = "P18abcdefghijklmnopqrstuvwxyz"s; + auto const prefix19MaxMsgLength = 29; + auto const prefix18Prefix = "P18"s; + auto const prefix18Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix18MaxMsgLength = 26; + auto const rsa36Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa36PublicKey{ + {0xad, 0xe5, 0x0b, 0x45, 0xd6, 0x59, 0x1f, 0x85, 0xec, 0x50, 0x5f, + 0x4a, 0x96, 0x9d, 0xfd, 0x6e, 0x29, 0x58, 0x1c, 0xf5, 0xb2, 0xb4, + 0x29, 0x81, 0x6a, 0x97, 0xbc, 0x46, 0x54, 0xf0, 0xd2, 0x6e, 0x09, + 0xf4, 0x1a, 0x52, 0x29, 0x95, 0x0c, 0xe1, 0x75, 0xd5, 0xff, 0xbb, + 0xff, 0x4b, 0xa0, 0x87, 0x36, 0x20, 0x94, 0x4b, 0xb9, 0x09, 0x91, + 0x4b, 0x62, 0xcf, 0xab, 0x7e, 0x27, 0x94, 0xf7, 0x5a, 0x6b, 0xd1, + 0x13, 0x30, 0xd4, 0x9e, 0x1d, 0x20, 0xb3, 0xaf, 0x54, 0x91, 0x50, + 0xc9, 0x0b, 0x41, 0x67, 0x39, 0x4e, 0xaa, 0x29, 0xd0, 0xd1, 0xa5, + 0x54, 0xb0, 0x6f, 0xfe, 0xb4, 0x8b, 0x63, 0x9c, 0x10, 0x09, 0xe9, + 0xdb, 0x2b, 0xd0, 0x55, 0xe1, 0x89, 0x03, 0x41, 0x6b, 0x97, 0x7b, + 0xd0, 0x09, 0xfc, 0x59, 0xcc, 0x6b, 0x58, 0xca, 0xdb, 0x33, 0xe1, + 0x5a, 0x28, 0x4f, 0x32, 0x80, 0x71, 0x12, 0x73, 0xeb, 0x27, 0x2b, + 0x27, 0x59, 0x3f, 0x38, 0x0f, 0x70, 0x63, 0x45, 0x1e, 0xb3, 0x26, + 0xfc, 0x0f, 0x1f, 0xf1, 0xcd, 0xc9, 0xff, 0xd9, 0xb3, 0xb8, 0xe0, + 0x3c, 0x35, 0x2e, 0xbf, 0x74, 0x87, 0xf2, 0x48, 0xa6, 0x19, 0x1d, + 0xa0, 0x77, 0x86, 0x07, 0xa7, 0x3b, 0x3b, 0x6b, 0x5f, 0x31, 0x2d, + 0x84, 0x24, 0x05, 0xca, 0x7b, 0x3a, 0x70, 0xce, 0xf3, 0x51, 0x6a, + 0x7b, 0xf5, 0x00, 0x67, 0x07, 0xee, 0xdf, 0xce, 0x52, 0xd7, 0x71, + 0x86, 0xdf, 0x90, 0x30, 0xf6, 0x6c, 0xdd, 0x1b, 0x37, 0xc3, 0x71, + 0x01, 0x28, 0x5f, 0x32, 0xa2, 0x5e, 0x44, 0x86, 0xd7, 0x06, 0xc4, + 0x8b, 0xf1, 0x29, 0x75, 0x74, 0x42, 0x87, 0x7f, 0x5f, 0x09, 0x36, + 0xfe, 0xcc, 0x4c, 0x24, 0xc1, 0xf4, 0x95, 0x3a, 0xd7, 0x01, 0x76, + 0x8a, 0xfa, 0xac, 0x2c, 0x55, 0x31, 0x18, 0xfe, 0x41, 0xfc, 0xbf, + 0xd8, 0x07, 0x0f}}; + std::array const rsa36Sig{ + {0xa4, 0xff, 0xce, 0xb9, 0x6c, 0x51, 0x05, 0xd5, 0x4a, 0x8e, 0x9e, + 0x6b, 0xbe, 0x6c, 0x31, 0x56, 0xd5, 0xa5, 0x1e, 0xa7, 0x60, 0xba, + 0x98, 0xb6, 0x45, 0xac, 0xf0, 0xe7, 0x02, 0x8e, 0xb0, 0xdf, 0x93, + 0xc0, 0x5b, 0x13, 0x59, 0xda, 0x38, 0x79, 0x5f, 0x56, 0xdd, 0xe6, + 0x9a, 0x58, 0x65, 0x57, 0x11, 0xe3, 0xdc, 0x82, 0x94, 0xef, 0xe0, + 0xf5, 0x1b, 0xc6, 0x27, 0x22, 0x84, 0x73, 0xfb, 0xfa, 0xe3, 0x08, + 0x3f, 0x70, 0xe3, 0xce, 0x07, 0xd1, 0xaa, 0x57, 0x99, 0x37, 0x63, + 0xca, 0xca, 0xee, 0x96, 0x2b, 0x41, 0x55, 0x91, 0x29, 0xf4, 0x2d, + 0xe1, 0x15, 0x23, 0xcc, 0x6f, 0xf7, 0x4e, 0xa2, 0xb2, 0x41, 0x50, + 0x2b, 0x1a, 0x95, 0x52, 0x26, 0x98, 0x3f, 0xc5, 0xbf, 0xdf, 0x7c, + 0xbd, 0x62, 0xb5, 0x9d, 0x45, 0xc4, 0xa8, 0x46, 0xf3, 0xa3, 0x8c, + 0x97, 0x58, 0x84, 0x50, 0x8f, 0xc7, 0xea, 0xfb, 0xc9, 0xc1, 0x91, + 0x23, 0xd4, 0x74, 0xe8, 0x2c, 0xc2, 0x16, 0xcf, 0xe6, 0x86, 0xcf, + 0x92, 0x47, 0xd9, 0xc3, 0xe9, 0xb7, 0xbb, 0xdb, 0x4b, 0xf3, 0x18, + 0xf5, 0x54, 0xbb, 0xc6, 0x67, 0xde, 0x7b, 0x44, 0xdf, 0x40, 0x29, + 0xe0, 0x7f, 0x8b, 0x27, 0xea, 0x8b, 0xde, 0x07, 0x46, 0xd0, 0x5a, + 0x4c, 0x6b, 0x44, 0x60, 0x57, 0x9e, 0xe8, 0xcf, 0x23, 0x6b, 0x01, + 0x3a, 0x4a, 0xba, 0x0d, 0x6c, 0x26, 0x7f, 0x3a, 0xaf, 0x63, 0x4a, + 0xdd, 0xac, 0x92, 0x36, 0x50, 0x74, 0xb3, 0x91, 0xec, 0x6e, 0x5b, + 0xe8, 0x89, 0xc5, 0xb7, 0xa5, 0x87, 0x14, 0xe6, 0x22, 0xee, 0xd1, + 0x8e, 0xd3, 0xd8, 0x92, 0xcf, 0x59, 0x40, 0x10, 0x9b, 0x5a, 0x12, + 0x29, 0xae, 0x6f, 0x35, 0xac, 0x92, 0xdd, 0x99, 0x07, 0x66, 0x77, + 0x09, 0x06, 0xc2, 0xda, 0x2a, 0xbc, 0x1e, 0x9a, 0x35, 0x98, 0x66, + 0xa2, 0xab, 0x84}}; + auto const thresh35Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim37CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim37Cond{Type::preimageSha256, + 9, + Preim37CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa38CondConditionFingerprint = { + {0x13, 0xb3, 0xe0, 0x2d, 0xea, 0x58, 0x68, 0x9a, 0xa7, 0x10, 0x7e, + 0xb2, 0x1a, 0x12, 0x55, 0x79, 0xd6, 0xfe, 0xde, 0x57, 0x0f, 0x6c, + 0x6b, 0xde, 0xd7, 0xfd, 0x12, 0xeb, 0xa6, 0x1d, 0xad, 0x43}}; + Condition const Rsa38Cond{Type::rsaSha256, + 65536, + Rsa38CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed39CondConditionFingerprint = { + {0xbe, 0x9b, 0x3b, 0xe3, 0x70, 0xfc, 0xc2, 0x29, 0xaa, 0xe9, 0x72, + 0x91, 0x42, 0x6b, 0xd7, 0x1f, 0x1a, 0x25, 0x7d, 0xde, 0xa8, 0x39, + 0xfb, 0xce, 0x5c, 0xaa, 0x63, 0xde, 0xfd, 0x1d, 0x23, 0xcf}}; + Condition const Ed39Cond{Type::ed25519Sha256, + 131072, + Ed39CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim40CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim40Cond{Type::preimageSha256, + 9, + Preim40CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa41CondConditionFingerprint = { + {0xf3, 0xe3, 0x0d, 0x35, 0x45, 0x3f, 0x9f, 0x57, 0x07, 0x0b, 0x13, + 0x04, 0x4d, 0x62, 0x56, 0x30, 0x18, 0x34, 0x88, 0x02, 0x22, 0xa6, + 0x94, 0x6e, 0xba, 0x97, 0xa4, 0x4a, 0x64, 0x5d, 0x05, 0xd1}}; + Condition const Rsa41Cond{Type::rsaSha256, + 65536, + Rsa41CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed42CondConditionFingerprint = { + {0xe3, 0x9a, 0x66, 0x70, 0xcd, 0x9b, 0x26, 0x4a, 0x79, 0xac, 0x64, + 0xbe, 0x92, 0xbb, 0xfb, 0x70, 0x0b, 0xdc, 0x9c, 0xbd, 0x13, 0x61, + 0xb7, 0x00, 0x22, 0xaa, 0x2f, 0xdc, 0x96, 0xc9, 0x45, 0x44}}; + Condition const Ed42Cond{Type::ed25519Sha256, + 131072, + Ed42CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(rsa6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond, Thresh13Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto rsa21 = std::make_unique( + makeSlice(rsa21PublicKey), makeSlice(rsa21Sig)); + auto rsa23 = std::make_unique( + makeSlice(rsa23PublicKey), makeSlice(rsa23Sig)); + std::vector> thresh22Subfulfillments; + thresh22Subfulfillments.emplace_back(std::move(rsa23)); + std::vector thresh22Subconditions{ + {Preim24Cond, Rsa25Cond, Ed26Cond}}; + auto thresh22 = std::make_unique( + std::move(thresh22Subfulfillments), + std::move(thresh22Subconditions)); + std::vector> thresh20Subfulfillments; + thresh20Subfulfillments.emplace_back(std::move(rsa21)); + thresh20Subfulfillments.emplace_back(std::move(thresh22)); + std::vector thresh20Subconditions{ + {Preim27Cond, Rsa28Cond, Ed29Cond, Thresh30Cond}}; + auto thresh20 = std::make_unique( + std::move(thresh20Subfulfillments), + std::move(thresh20Subconditions)); + auto prefix19 = std::make_unique( + makeSlice(prefix19Prefix), + prefix19MaxMsgLength, + std::move(thresh20)); + auto prefix18 = std::make_unique( + makeSlice(prefix18Prefix), + prefix18MaxMsgLength, + std::move(prefix19)); + auto rsa36 = std::make_unique( + makeSlice(rsa36PublicKey), makeSlice(rsa36Sig)); + std::vector> thresh35Subfulfillments; + thresh35Subfulfillments.emplace_back(std::move(rsa36)); + std::vector thresh35Subconditions{ + {Preim37Cond, Rsa38Cond, Ed39Cond}}; + auto thresh35 = std::make_unique( + std::move(thresh35Subfulfillments), + std::move(thresh35Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix18)); + thresh0Subfulfillments.emplace_back(std::move(thresh35)); + std::vector thresh0Subconditions{ + {Preim40Cond, Rsa41Cond, Ed42Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x0d\xe4\xa0\x82\x0d\x65\xa1\x82\x05\x66\x80\x02\x50" + "\x31\x81\x01\x1a\xa2\x82\x05\x5b\xa1\x82\x05\x57\x80\x02\x50" + "\x32\x81\x01\x1c\xa2\x82\x05\x4c\xa2\x82\x05\x48\xa0\x82\x04" + "\x9b\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80\x82" + "\x01\x00\xd0\x07\xfc\x9d\xb0\xa1\xa6\x40\xe4\x52\x30\x42\x74" + "\xfd\x35\x04\xde\x45\x68\xb3\x22\xdd\xff\x41\x43\x69\x33\xc0" + "\xff\x35\xb6\x6d\x15\xe9\x54\x15\xeb\x1d\x07\xe2\x25\x2b\xdb" + "\xaa\x16\x8d\x0d\x7f\x05\xf0\xd2\x7d\xb4\x9b\x51\x19\x20\x1e" + "\x3d\xba\x50\x9e\x51\x13\x81\x43\x55\x96\xca\xdb\x88\x1f\xef" + "\x2d\x38\x3f\xae\x8d\xac\xc8\x6f\x2b\xd5\xf0\x34\x1a\x99\x00" + "\x7c\x6d\xb3\x1b\x1d\x68\xdb\xf8\x1c\x59\x3a\x63\x38\x7c\x1c" + "\x14\xbc\x22\xcf\xc8\x9a\xc6\x96\x6f\x3d\x03\x0b\x61\x6b\x7d" + "\x75\x97\xe8\x25\xb8\x2f\xfa\xf4\x07\x44\xdf\x00\x3d\xff\x0d" + "\xd5\x7f\x7f\xf3\x0c\x13\xac\x8d\xf8\x8c\x79\xc5\xf3\x29\xdc" + "\x23\x65\xd3\xd1\x1c\xa6\x14\x78\x6a\x1a\xe3\x15\x8d\x8b\xdc" + "\xa0\x5a\xc7\x82\xb0\x03\x6c\x71\x43\x59\x24\xc7\x50\x64\xb2" + "\xa7\x69\xf5\xbd\xe6\x5e\xaa\x77\x59\x60\x36\xc0\xe3\x42\x7f" + "\x05\x3b\x4c\x02\x0e\x70\x5a\x70\xc5\x2a\xeb\x94\x4d\x15\x09" + "\xef\xbb\x58\x42\x68\x05\x59\x70\xa0\x17\xb2\x8e\xdf\x7b\x40" + "\x5d\x21\x1e\xfe\x62\x58\xde\xfb\x14\x91\x18\xf3\x4f\x9b\x36" + "\x55\xcf\xb3\x5e\xec\x4f\xcc\x6d\x13\x58\xc8\xa3\xa3\xee\x23" + "\x8a\xc2\xbf\x81\x82\x01\x00\xc8\x04\x6c\x89\x2b\x18\x92\x6f" + "\x2b\xbf\xd9\x66\x00\x88\x38\xe6\x0c\xed\xe2\x49\x01\x3d\x2c" + "\x40\xaa\x49\xf7\xc2\x63\x0b\x35\x18\xbc\xe1\x33\xf6\x38\xb6" + "\xc5\xf7\x99\x5a\x63\x72\xfa\x48\xe9\x88\x84\x7b\xf5\x2c\x41" + "\x03\xcb\x4d\xc1\x8f\xb5\xf8\x74\x1e\x9c\x5e\xae\xe6\xc7\xf0" + "\x5c\xb3\xd7\x82\x8d\x9b\xa3\x88\x91\x4d\x54\x53\x64\x22\x59" + "\x53\xe4\x3e\xf5\xf1\x15\xff\xb5\x0b\x5f\xf5\x68\x34\x64\xef" + "\x28\xc0\x2e\x25\xc1\x17\x47\x9c\xaa\x97\xf6\x5e\x35\xda\x64" + "\x37\xc1\x82\x25\xbc\x0b\x4b\xda\x53\xa2\xb4\xa8\xcd\x91\x85" + "\x09\xaa\xae\x2f\x16\x94\x6c\xe9\x61\x24\x26\xec\x39\x41\x9b" + "\x0c\x44\x7b\xe9\x95\x2d\xd7\x86\xec\x5d\x64\x00\x25\xea\xbd" + "\x74\x06\x32\x5a\xbe\x62\x2d\xfe\xc0\x7a\xd8\xbb\x46\x4a\xae" + "\x7c\x17\xa5\x0e\xce\xdd\x30\xb4\xd6\x0c\x7a\xe5\xf6\xbc\x7d" + "\x63\x9d\xc1\x1c\x99\x24\x0b\x72\x13\xf9\x0a\xd6\x47\xd4\x1d" + "\x50\x07\xcc\x79\xf8\x31\x79\x02\x3a\xeb\xe3\x61\x03\x4b\x52" + "\xaa\x1f\xca\xcc\x84\x99\x99\x25\x11\xac\x8b\xea\x18\x9d\x71" + "\x6e\x4c\x7c\x3e\x7b\x92\xd0\x3d\x19\xa7\xf8\x71\x2b\x7c\xb9" + "\xb1\x6d\x55\xcb\xff\x50\x9d\x33\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4" + "\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57" + "\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4" + "\x46\xab\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4" + "\x00\xd5\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00\xa3\x82\x02\x08" + "\x80\x82\x01\x00\xbe\x09\xc5\xa4\x27\x29\xdf\xd4\x67\x76\xbe" + "\xbf\x2c\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67\x20\xfb\x7a\x27" + "\x93\xc0\x78\x47\x78\xd7\x15\x32\xee\x38\x81\x0d\x36\xa2\xc4" + "\x65\x44\xe6\x62\x26\xb9\x58\x13\xa4\x15\x82\xab\xb1\x16\x61" + "\xfc\x01\x98\xc6\x1a\x69\xc6\xba\x39\x3f\x01\x55\x3d\xd7\x8e" + "\x14\x42\x6d\x78\x74\x9b\x28\xcb\x31\x39\x98\x5a\x11\xdc\xc1" + "\x18\x9d\x8d\xb0\xcd\x1b\x4c\x10\xab\x14\x64\x19\xf1\x33\x15" + "\x45\xc8\x92\x82\x03\x82\x8a\xaa\xad\x94\xfc\x24\x11\x96\x99" + "\x7e\x94\x5a\x82\x57\x68\x61\x9f\x7b\x45\xe0\x99\x9e\x4f\x32" + "\x50\x5f\x05\xc8\x11\xae\xc4\x0c\x63\x18\x0e\x02\x59\x36\x25" + "\x92\x06\x32\xc7\x71\x47\x99\xcc\x0a\x6e\x0a\x58\x71\x3f\x5e" + "\xb7\x78\xf7\x98\x79\xdf\x74\xa4\xeb\xa9\x00\xfd\x81\xb3\xcf" + "\x04\x8c\x5d\x7d\xe7\xb2\x82\x90\x49\xbd\x69\xf3\x08\xe9\x92" + "\xc6\x9e\x41\xba\x74\xd8\x8d\x81\x97\x6f\x86\xab\xc9\xf1\x02" + "\x31\xb4\xce\x47\xb0\x39\xc8\xba\x51\xa7\x39\xf3\x71\xa2\x25" + "\x27\x37\x6e\x09\x6f\x19\x59\xbc\x65\xd9\xcd\x12\xd3\x2c\xa2" + "\x78\xfa\x23\x15\x1a\x82\x41\x91\x1b\xbe\x8a\xe7\xfe\x3c\x3c" + "\x30\x32\xaa\xe9\xf3\x81\x82\x01\x00\x4b\xb1\x58\xca\xac\x8e" + "\x5c\x70\xde\x76\xb9\x25\x14\x94\xac\x94\xa3\x50\xca\x85\xca" + "\xb8\x2f\x8b\x0e\x8e\x38\x94\x4d\x36\xfc\x53\x24\x60\xdb\x40" + "\x7f\xba\xd2\xe7\x40\x55\x5f\x55\xfb\xcb\x04\xa2\x37\x7f\x3c" + "\xcb\x9a\xf2\x18\x9b\x6f\x4e\x48\x57\x85\xda\x25\xed\xf1\x4a" + "\xfd\xf6\x2b\xaf\x70\x9d\x44\x2a\xed\xa1\xcb\xf2\x88\xeb\x31" + "\x9d\x14\x0b\xd5\xa3\xc9\xc8\x09\xea\x92\x17\x3f\xa7\xbd\x4f" + "\xbf\x57\x06\x8f\x6e\x99\xb6\xc7\xdd\xfa\x9a\xa2\x29\x3b\xed" + "\x1e\x4f\xbf\xb2\x06\x98\xa0\x7e\x3f\xae\xa0\xe0\x3d\xef\xce" + "\x40\xde\x44\xe6\x2e\x3c\x0a\x22\x91\xfe\xe1\xf9\x16\xbd\x60" + "\x0b\x4a\xdc\xcf\xb4\x67\x94\xf6\x6c\x70\x35\xbe\xbd\xa6\xcd" + "\x45\x6c\x93\x58\x06\xe2\x54\xdf\x75\x06\xc3\x95\x97\x23\x68" + "\xbd\xd6\x47\x6d\x13\xab\xf5\x15\xb3\xd6\xa8\xd7\xd5\xee\xdc" + "\xb9\x23\x26\x32\xb0\x20\x70\x66\x70\x88\xbf\xcb\x87\x12\x5b" + "\x4b\xa5\x95\xdf\x5a\xe0\xf6\x53\x5c\xb3\xf7\x45\xb8\xef\x54" + "\x7b\x4b\x43\xaf\xac\x81\x74\xa8\x70\x73\x7f\xbc\x90\x63\x31" + "\xa6\x76\x4e\xab\x9d\xcd\x05\x72\xac\x57\x28\x62\x56\xa3\x31" + "\xe6\x97\xec\xb9\x90\x12\xa2\xb7\x14\xa4\xa1\x81\xa6\xa0\x25" + "\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54" + "\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee" + "\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\xd9\x95\x6e\x6e" + "\x8b\x3b\x8b\x3b\xd7\x11\x4b\x11\x21\x26\x48\xbd\x92\x55\x47" + "\x42\x66\x8f\xc1\x5f\xb4\x03\x78\x32\x05\xc5\x0e\x82\x81\x03" + "\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xaf\x93\xfd\x22" + "\x45\xc2\x08\xab\x43\xf7\x45\x56\x63\xec\xaf\x15\x33\xa0\x2a" + "\xb4\x9e\x15\xb4\x6e\xda\x87\x35\xde\x09\x4b\x06\x31\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x55\xcc\xd1\xa2\x2c\x90\x8d\xe3" + "\x2e\x42\xd4\xe0\x65\xb2\xf7\xda\xc0\x07\x1e\xd3\x23\x0f\xfe" + "\x78\x13\xa2\x86\x61\xc4\x34\x28\x50\x81\x03\x02\x00\x00\xa1" + "\x82\x05\x68\x80\x03\x50\x31\x38\x81\x01\x1a\xa2\x82\x05\x5c" + "\xa1\x82\x05\x58\x80\x03\x50\x31\x39\x81\x01\x1d\xa2\x82\x05" + "\x4c\xa2\x82\x05\x48\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82" + "\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xd7\x79\x96\xb4\xf5" + "\x56\xa2\xdf\x83\xa7\x6e\x70\xe7\xc9\xfb\x04\xba\x4b\x39\x10" + "\xe2\xe7\x8a\xc6\x59\x85\x88\xde\x26\x73\xfb\x5e\x7f\x66\x34" + "\xab\x29\x2d\xf1\x46\xf5\xbd\x4c\x4d\x52\x5e\x4e\xf8\xd0\xdb" + "\x85\x7a\xce\xa4\xb0\x7e\xf0\x0f\x04\x58\x4c\x61\x75\x64\x81" + "\x8e\xb0\xeb\x49\x3e\xc2\x30\x28\x03\xf9\x70\x4d\x47\xc0\x11" + "\x7f\xb1\x25\x71\x0f\x13\x5d\x52\x46\x38\x3b\x9f\xf6\x61\x57" + "\xc3\xfc\x98\xfb\x4c\xa2\xed\x0c\xaa\xa9\x5c\x53\x7e\xc0\xd3" + "\x1f\x9f\xe3\xea\x40\x24\x1a\x4f\x0d\x50\x5e\x6f\xe8\xe5\xea" + "\x12\xe5\xfc\x49\xb6\xb6\x6d\xdd\xc9\x83\x68\x29\x26\x39\xc7" + "\x76\xf7\xfa\x70\xb3\xac\xe0\xf6\xfe\xf3\x9a\xdd\xc5\x2b\x1c" + "\x97\x7b\x6e\xa4\x49\xb9\xa4\x22\x16\xcb\xe0\x5b\x47\xc9\x40" + "\x07\x20\xbe\x3c\xf9\x80\x47\xf5\x8f\x65\x94\x57\x61\x4a\x73" + "\x8c\x2f\x3c\x5e\x31\xae\xff\x45\xd7\x8f\x39\xce\x94\x04\x79" + "\xec\xaa\x71\x08\x9e\x34\xa1\x71\x35\x66\xe9\x54\xee\xff\x90" + "\xce\x8f\x51\x96\xa6\x14\x66\x35\xa4\x62\xbf\x99\xe7\xab\x6e" + "\x1e\x29\x14\x6e\x84\x87\xad\x99\xad\x35\xc4\xfe\xb9\x38\x08" + "\x1b\xc3\x8c\x69\x99\x8a\x32\x90\x69\xa4\x5f\x81\x82\x01\x00" + "\x99\x20\x75\xb7\xc7\x30\x66\x13\xa1\x4e\x32\xfe\xde\x53\xa2" + "\xc3\x50\x19\x2b\xa7\x0b\x13\x1d\x78\xaf\x1d\xcd\x78\x50\xd9" + "\x3e\x8b\x59\xe8\x37\xbb\x0b\xd9\x58\xe7\x8b\x60\x7e\x07\xbf" + "\x46\x94\x2e\x3b\xe0\xfb\x70\x6b\xc2\xbd\x7d\x21\x23\x79\x2a" + "\x40\xf5\xb1\x39\xc5\xa9\x64\x52\x4f\xed\xa1\x50\x3f\xa4\x07" + "\x9a\xa1\x2d\x50\x9f\xcd\xeb\x9a\x32\xd4\x24\x49\x00\x7f\x7e" + "\xbd\xdb\xce\x37\x19\xbe\xd7\x36\xe8\xd9\x34\xdc\x61\xbb\x4c" + "\xc1\x2b\xef\x16\x19\x53\xea\x85\x61\x36\xeb\x95\xa2\xd4\xa9" + "\x34\xd8\xf0\xe5\xf4\x72\xee\x01\x88\xed\x2f\xc2\x56\x51\x4c" + "\x02\xae\x2b\xcd\x89\x62\xd9\xa1\xe6\x53\x47\xc9\xe6\xe0\x05" + "\x7e\xcb\x21\x6a\x00\xdb\x2b\x43\x2a\xdf\x58\x93\x16\x28\x08" + "\x0a\x09\x96\xf0\xba\x0f\x01\x7b\x2a\x80\xb5\x15\x5f\x59\x69" + "\xe2\x10\x51\x88\x98\x93\xdb\xf2\x7b\x0d\xf6\x93\x0e\x03\x06" + "\xc6\xfa\xb4\x4c\x9b\x15\xdf\x7f\x46\x10\x22\xcf\xb0\xc3\xca" + "\x8e\xe0\xae\x08\x4d\xaf\x65\x03\xc6\x20\x64\x0e\x4d\x1b\x03" + "\x1e\xa0\x6b\xdf\x1c\x69\x2a\x8b\xad\xea\xd2\x4c\x1b\x93\x41" + "\xc4\xbc\x55\x0c\x35\xda\xaf\xac\xed\x6b\xdc\xe5\x3d\x23\x86" + "\xbc\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xb2\x7f\x94\xe3\xdf\x0c\x9a\x71\x3a\xd2\xeb\x71\x91\x72" + "\x40\xb9\xcb\xb7\xac\xbc\x77\x0a\x08\x85\x07\xa3\x85\x4e\x7e" + "\xc9\x50\x96\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xd6\x2f\x07" + "\xbd\x56\xfe\x9a\x02\x8c\x98\x1a\x72\x17\xb6\x26\x90\x51\xaf" + "\xe4\xea\x51\x64\xe0\x58\x3e\x85\xc9\x29\x22\x94\xa1\xbf\x81" + "\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xde\x0b\xb1" + "\x46\x39\xfb\xd2\xb8\x93\x21\x77\x88\xa7\x0a\x28\x65\x39\x85" + "\xe3\xf0\x3f\xd4\x20\xd4\x55\x63\x43\xcf\x85\x3e\x08\xa5\xd3" + "\xf3\x5b\xa9\x47\xaf\x21\x49\xfa\x99\x3c\x97\x49\x2e\x3b\xd7" + "\x22\x7c\xb6\x70\xe0\x82\x9d\xd2\x09\x7c\xc2\xc2\x03\x2b\xb2" + "\x9e\x55\x3c\xc9\xb5\x48\x91\xdc\xfd\x86\x68\x2c\x0e\x5b\xba" + "\x03\xaa\x7c\xa6\x18\x02\x10\x59\x1b\x7a\x4a\x5c\xda\xe7\x2f" + "\x3c\xa6\xff\x58\x23\x7b\x3e\x80\x69\x54\x68\xb5\x4c\x13\xb6" + "\x71\xa4\x68\xc6\xc2\xa3\xd1\xe6\x00\xff\x2a\xc4\x2d\x39\xa1" + "\xe7\xae\xd5\xe2\xb4\x0a\x1c\x98\xd1\x20\x13\xfa\xd2\xb4\xcd" + "\x27\xb2\x1a\x89\xd9\xc2\x2d\x69\x87\x81\x0b\x99\x4b\x5a\xc8" + "\xa4\x09\x5f\x04\xe7\xf2\xa6\x2b\x75\xcd\x02\x20\x8f\x71\xb7" + "\x1b\x7a\x2f\xe0\xf0\x7b\x19\x51\xa9\x27\xea\xaa\x1c\xba\xa9" + "\xf8\x96\x74\xb7\x08\x27\x2d\xc5\x48\x0d\x81\x3d\x9a\xdb\x4d" + "\x29\x82\x22\x56\x19\x63\xac\x94\x55\xd4\x56\x7e\x5a\x2f\x75" + "\x82\xcb\xb5\x95\x9a\x35\x10\x74\xc6\xa9\x10\x8a\xdb\x72\xfe" + "\x57\x6a\x34\x46\xc8\x45\x7c\xb0\xc8\x19\xc9\x0e\x22\xd2\x6f" + "\xa5\x8f\x99\x55\x4f\xc9\x4c\xa0\xd3\xf0\x94\x07\x69\x81\x82" + "\x01\x00\xaa\x0a\xe7\x8b\x70\xd3\x51\xff\x74\xf4\xd0\x7d\xf0" + "\x83\x44\x43\x7d\x20\xc2\xf1\x71\xa3\x93\xe0\x26\xe3\x2c\x73" + "\xab\x00\xa4\x34\xde\xce\x52\xa0\x26\xa8\xe1\xcb\xae\x81\x51" + "\x47\xd5\xf4\x42\xd7\xd8\xcc\x6c\xe4\x72\x29\xbf\xfd\xf7\x0d" + "\xce\xd9\xea\x1f\xbe\x2e\xbc\xf6\x7c\x58\x89\x0c\xab\x1b\x11" + "\xfe\x79\x1d\x2f\x0a\x6f\x80\x13\x1d\x7c\xe3\x56\x4b\xd0\x6a" + "\x9f\xed\xff\xcb\x68\x4b\xaf\xd4\x84\xba\xfd\xa1\xcb\xd4\xe3" + "\x8e\x08\xc5\x8e\x6b\xfd\x50\xf5\xa1\x97\xfe\x12\xf8\x11\x07" + "\x88\xa1\xa6\xc2\xbc\x92\x80\x40\x2c\xd3\x7c\xfc\xce\xed\xad" + "\x90\x3e\x58\xd6\x23\x71\x64\x7c\x77\x67\x8d\x80\xd9\x77\x3c" + "\xe2\x30\x3c\x99\xfb\xbf\xc3\x99\xcd\xa3\x64\xcf\xf0\x5e\x00" + "\x27\xa6\xdc\xe1\x58\x17\x73\x79\x80\x68\x8a\xa5\xb1\x5d\x31" + "\x9e\xb2\x8e\x1b\x01\xb9\x65\x05\x7f\xd0\xd5\x9f\x13\x81\x35" + "\x6b\xe2\x01\x0d\xce\xfa\x21\x31\x20\x98\xb1\x89\xc5\x3b\xfd" + "\x6d\xf4\xf7\x44\xd6\xea\xed\x77\xa6\xe9\xa2\x74\xad\xef\x39" + "\xc7\x68\xca\x14\x68\x61\xb6\xc3\x95\x78\xc3\x96\xc4\xc7\xe2" + "\x80\x82\xe5\x3a\xf8\x7b\x7d\x9d\x7a\x9a\xe5\x32\x8e\x64\xe7" + "\xbc\x3c\xd7\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa2\x2b\x80\x20\x55\x54\x55\x25\x4a\x1e\xf0\x5c\x22\x0f\xc2" + "\x46\xc5\x9b\x13\x25\x51\x61\xdf\x62\x52\x25\x82\x17\xe4\xd6" + "\xdf\x1f\xfd\x8c\x68\x15\x81\x03\x02\x10\x00\x82\x02\x03\x98" + "\xa3\x27\x80\x20\x58\xac\x94\x55\x27\x79\x7a\x0c\xac\x84\x2d" + "\x5c\x13\x32\xee\x84\x25\xb8\xb8\xec\x25\x0d\x40\xee\xc0\xd4" + "\x79\x18\x3f\xc6\xbc\xd7\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\xc5\x39\xb2\xc7\xc4\x92\x8a\x29\xf3\x72\xb4\x6c\xa5\x0d\x8c" + "\xbe\x43\xda\xc9\xac\x6c\x26\x7c\x44\xb9\x3f\xee\x40\xcc\x8e" + "\x41\x3c\x81\x03\x02\x00\x00\xa2\x82\x02\x8b\xa0\x82\x02\x0c" + "\xa3\x82\x02\x08\x80\x82\x01\x00\xad\xe5\x0b\x45\xd6\x59\x1f" + "\x85\xec\x50\x5f\x4a\x96\x9d\xfd\x6e\x29\x58\x1c\xf5\xb2\xb4" + "\x29\x81\x6a\x97\xbc\x46\x54\xf0\xd2\x6e\x09\xf4\x1a\x52\x29" + "\x95\x0c\xe1\x75\xd5\xff\xbb\xff\x4b\xa0\x87\x36\x20\x94\x4b" + "\xb9\x09\x91\x4b\x62\xcf\xab\x7e\x27\x94\xf7\x5a\x6b\xd1\x13" + "\x30\xd4\x9e\x1d\x20\xb3\xaf\x54\x91\x50\xc9\x0b\x41\x67\x39" + "\x4e\xaa\x29\xd0\xd1\xa5\x54\xb0\x6f\xfe\xb4\x8b\x63\x9c\x10" + "\x09\xe9\xdb\x2b\xd0\x55\xe1\x89\x03\x41\x6b\x97\x7b\xd0\x09" + "\xfc\x59\xcc\x6b\x58\xca\xdb\x33\xe1\x5a\x28\x4f\x32\x80\x71" + "\x12\x73\xeb\x27\x2b\x27\x59\x3f\x38\x0f\x70\x63\x45\x1e\xb3" + "\x26\xfc\x0f\x1f\xf1\xcd\xc9\xff\xd9\xb3\xb8\xe0\x3c\x35\x2e" + "\xbf\x74\x87\xf2\x48\xa6\x19\x1d\xa0\x77\x86\x07\xa7\x3b\x3b" + "\x6b\x5f\x31\x2d\x84\x24\x05\xca\x7b\x3a\x70\xce\xf3\x51\x6a" + "\x7b\xf5\x00\x67\x07\xee\xdf\xce\x52\xd7\x71\x86\xdf\x90\x30" + "\xf6\x6c\xdd\x1b\x37\xc3\x71\x01\x28\x5f\x32\xa2\x5e\x44\x86" + "\xd7\x06\xc4\x8b\xf1\x29\x75\x74\x42\x87\x7f\x5f\x09\x36\xfe" + "\xcc\x4c\x24\xc1\xf4\x95\x3a\xd7\x01\x76\x8a\xfa\xac\x2c\x55" + "\x31\x18\xfe\x41\xfc\xbf\xd8\x07\x0f\x81\x82\x01\x00\xa4\xff" + "\xce\xb9\x6c\x51\x05\xd5\x4a\x8e\x9e\x6b\xbe\x6c\x31\x56\xd5" + "\xa5\x1e\xa7\x60\xba\x98\xb6\x45\xac\xf0\xe7\x02\x8e\xb0\xdf" + "\x93\xc0\x5b\x13\x59\xda\x38\x79\x5f\x56\xdd\xe6\x9a\x58\x65" + "\x57\x11\xe3\xdc\x82\x94\xef\xe0\xf5\x1b\xc6\x27\x22\x84\x73" + "\xfb\xfa\xe3\x08\x3f\x70\xe3\xce\x07\xd1\xaa\x57\x99\x37\x63" + "\xca\xca\xee\x96\x2b\x41\x55\x91\x29\xf4\x2d\xe1\x15\x23\xcc" + "\x6f\xf7\x4e\xa2\xb2\x41\x50\x2b\x1a\x95\x52\x26\x98\x3f\xc5" + "\xbf\xdf\x7c\xbd\x62\xb5\x9d\x45\xc4\xa8\x46\xf3\xa3\x8c\x97" + "\x58\x84\x50\x8f\xc7\xea\xfb\xc9\xc1\x91\x23\xd4\x74\xe8\x2c" + "\xc2\x16\xcf\xe6\x86\xcf\x92\x47\xd9\xc3\xe9\xb7\xbb\xdb\x4b" + "\xf3\x18\xf5\x54\xbb\xc6\x67\xde\x7b\x44\xdf\x40\x29\xe0\x7f" + "\x8b\x27\xea\x8b\xde\x07\x46\xd0\x5a\x4c\x6b\x44\x60\x57\x9e" + "\xe8\xcf\x23\x6b\x01\x3a\x4a\xba\x0d\x6c\x26\x7f\x3a\xaf\x63" + "\x4a\xdd\xac\x92\x36\x50\x74\xb3\x91\xec\x6e\x5b\xe8\x89\xc5" + "\xb7\xa5\x87\x14\xe6\x22\xee\xd1\x8e\xd3\xd8\x92\xcf\x59\x40" + "\x10\x9b\x5a\x12\x29\xae\x6f\x35\xac\x92\xdd\x99\x07\x66\x77" + "\x09\x06\xc2\xda\x2a\xbc\x1e\x9a\x35\x98\x66\xa2\xab\x84\xa1" + "\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x13" + "\xb3\xe0\x2d\xea\x58\x68\x9a\xa7\x10\x7e\xb2\x1a\x12\x55\x79" + "\xd6\xfe\xde\x57\x0f\x6c\x6b\xde\xd7\xfd\x12\xeb\xa6\x1d\xad" + "\x43\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xbe\x9b\x3b\xe3\x70" + "\xfc\xc2\x29\xaa\xe9\x72\x91\x42\x6b\xd7\x1f\x1a\x25\x7d\xde" + "\xa8\x39\xfb\xce\x5c\xaa\x63\xde\xfd\x1d\x23\xcf\x81\x03\x02" + "\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27" + "\x80\x20\xf3\xe3\x0d\x35\x45\x3f\x9f\x57\x07\x0b\x13\x04\x4d" + "\x62\x56\x30\x18\x34\x88\x02\x22\xa6\x94\x6e\xba\x97\xa4\x4a" + "\x64\x5d\x05\xd1\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xe3\x9a" + "\x66\x70\xcd\x9b\x26\x4a\x79\xac\x64\xbe\x92\xbb\xfb\x70\x0b" + "\xdc\x9c\xbd\x13\x61\xb7\x00\x22\xaa\x2f\xdc\x96\xc9\x45\x44" + "\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x9f\x89\x28\x6f\x1a\xeb\x99\xb2\x87\xd1\x52" + "\x05\xf0\x96\xad\x3f\x35\x16\x54\xe1\x8c\x4b\xc8\xa0\x28\xc2" + "\x4f\x1b\x38\x25\x2a\x59\x81\x03\x0a\xa8\x77\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x13\x71\xe9\xb6\x7f\xa0" + "\x8f\x72\xae\xff\x73\x01\x38\x2b\xad\x0d\x30\xe3\x29\x1c\x92" + "\x34\xa1\xad\xa4\x3e\x2a\xf7\x1d\xc9\x0a\xf9\x81\x03\x04\x40" + "\x3d\x82\x02\x03\xb8\xa1\x2b\x80\x20\xd8\x05\x83\xb1\x05\x4c" + "\xac\xc8\xb1\x78\x3b\x62\x2d\x5e\x75\xa2\x3a\xda\xf8\x81\x91" + "\x31\x86\xe5\xbc\x3c\x54\x1d\xad\x83\xe2\x5e\x81\x03\x04\x40" + "\x3a\x82\x02\x03\xb8\xa2\x2b\x80\x20\xa0\x48\x99\x88\x6d\x79" + "\x6d\x2e\xc7\x98\xbd\xf5\x15\xe7\x3d\xcc\x0f\xc1\x39\x0b\x11" + "\xeb\x31\xad\x86\x45\x30\x56\xb4\x61\xb8\x82\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xf3\xe3\x0d\x35\x45\x3f" + "\x9f\x57\x07\x0b\x13\x04\x4d\x62\x56\x30\x18\x34\x88\x02\x22" + "\xa6\x94\x6e\xba\x97\xa4\x4a\x64\x5d\x05\xd1\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe3\x9a\x66\x70\xcd\x9b\x26\x4a\x79\xac" + "\x64\xbe\x92\xbb\xfb\x70\x0b\xdc\x9c\xbd\x13\x61\xb7\x00\x22" + "\xaa\x2f\xdc\x96\xc9\x45\x44\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh39() + { + testcase("Thresh39"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim21Cond + // ** Rsa22Cond + // ** Ed23Cond + // ** Prefix24Cond + // ** Thresh41Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** Thresh13Cond + // ***** rsa4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** rsa6 + // ** preim18 + // ** rsa19 + // ** ed20 + + auto const rsa4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x6c, 0x9d, 0xff, 0xbe, 0xc3, 0xb6, 0x20, 0x82, 0xb0, 0x23, 0x4c, + 0xb6, 0x9b, 0x35, 0x19, 0x87, 0x39, 0x07, 0xc5, 0x97, 0xda, 0x27, + 0x03, 0xf3, 0xd5, 0x41, 0xf5, 0x79, 0x9c, 0xf4, 0x73, 0xde, 0x39, + 0x72, 0xa7, 0x21, 0xfd, 0x01, 0x95, 0xca, 0xd6, 0x6d, 0x02, 0x57, + 0xa2, 0x38, 0x52, 0xb5, 0xee, 0x23, 0x99, 0xfc, 0xf9, 0xc1, 0x6f, + 0xab, 0xc4, 0xc9, 0x9c, 0xa8, 0x46, 0x79, 0x41, 0x68, 0x1b, 0xda, + 0x3b, 0xdd, 0xb6, 0xcc, 0x44, 0x86, 0x55, 0x7c, 0x64, 0x7c, 0x98, + 0xda, 0x94, 0x89, 0x0c, 0x15, 0x74, 0x42, 0xa2, 0x04, 0x40, 0xc5, + 0x93, 0xa1, 0xab, 0x47, 0x31, 0x60, 0xff, 0x07, 0x70, 0x99, 0x2d, + 0xbc, 0x9c, 0xbb, 0xbf, 0x03, 0xe0, 0xfd, 0xa6, 0xcf, 0xb8, 0x48, + 0x69, 0x7e, 0xee, 0xc8, 0xae, 0xfa, 0xf8, 0x52, 0x39, 0x9f, 0x3a, + 0x6a, 0x07, 0x5b, 0xcc, 0x17, 0x47, 0x41, 0xd3, 0x7f, 0x32, 0x2a, + 0x2b, 0xad, 0x1f, 0x3e, 0xe8, 0xa3, 0x77, 0x62, 0x84, 0xe7, 0x36, + 0x0e, 0x43, 0x4d, 0x4b, 0x8a, 0x7e, 0x09, 0x51, 0x41, 0x4e, 0x2f, + 0x6d, 0xfb, 0x63, 0x4c, 0xc8, 0x13, 0x30, 0x95, 0x9b, 0xba, 0x94, + 0xa8, 0x43, 0xc4, 0xe0, 0x63, 0x95, 0xc2, 0x9a, 0xff, 0x70, 0x45, + 0x3a, 0xed, 0x69, 0xd8, 0x88, 0xaf, 0x49, 0x4e, 0xe1, 0x14, 0x25, + 0xc2, 0x05, 0x10, 0x7d, 0x95, 0x9b, 0x75, 0x94, 0x6e, 0xd9, 0xb7, + 0x2f, 0x27, 0x69, 0xb9, 0xd4, 0xa9, 0x69, 0x01, 0x3b, 0x40, 0xa2, + 0x88, 0x4e, 0x3d, 0xa7, 0x83, 0x38, 0xc4, 0xc6, 0xbf, 0xd3, 0x93, + 0x0f, 0x94, 0xc6, 0x77, 0x17, 0xe3, 0xf7, 0xf8, 0x85, 0xf8, 0xdd, + 0xbb, 0x99, 0x6f, 0xab, 0x1f, 0xb3, 0xb6, 0xa7, 0x8b, 0x74, 0xe7, + 0xed, 0xc9, 0x81, 0xa3, 0xc9, 0x37, 0xba, 0x2d, 0x94, 0x10, 0xb5, + 0x38, 0xbe, 0x4e}}; + auto const rsa6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 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, 0xc0, 0xe3, 0x42, 0x7f, 0x05, 0x3b, 0x4c, 0x02, 0x0e, + 0x70, 0x5a, 0x70, 0xc5, 0x2a, 0xeb, 0x94, 0x4d, 0x15, 0x09, 0xef, + 0xbb, 0x58, 0x42, 0x68, 0x05, 0x59, 0x70, 0xa0, 0x17, 0xb2, 0x8e, + 0xdf, 0x7b, 0x40, 0x5d, 0x21, 0x1e, 0xfe, 0x62, 0x58, 0xde, 0xfb, + 0x14, 0x91, 0x18, 0xf3, 0x4f, 0x9b, 0x36, 0x55, 0xcf, 0xb3, 0x5e, + 0xec, 0x4f, 0xcc, 0x6d, 0x13, 0x58, 0xc8, 0xa3, 0xa3, 0xee, 0x23, + 0x8a, 0xc2, 0xbf}}; + std::array const rsa6Sig{ + {0x7c, 0xe7, 0xdb, 0x72, 0x98, 0x2b, 0x9d, 0x36, 0x6e, 0xa0, 0x4f, + 0x1c, 0xad, 0xe4, 0x21, 0xb9, 0xce, 0x79, 0x31, 0x30, 0x1d, 0x52, + 0x3b, 0x19, 0xa6, 0x7b, 0xc1, 0x1d, 0x27, 0xf5, 0x98, 0x76, 0xe8, + 0x70, 0x21, 0xdd, 0x1c, 0xf6, 0xb5, 0x5f, 0x6e, 0x1b, 0x3a, 0x28, + 0x21, 0x42, 0x96, 0x33, 0xcd, 0x9c, 0xa7, 0x5c, 0x77, 0xf5, 0x7f, + 0xb2, 0xa7, 0x8f, 0x30, 0x04, 0xc6, 0xa1, 0xb5, 0x26, 0xa8, 0x73, + 0xd9, 0x83, 0x1c, 0xd0, 0xfb, 0xc7, 0xaf, 0x16, 0xb4, 0xdc, 0x0d, + 0xb6, 0x3a, 0xd5, 0x99, 0x16, 0xa1, 0x32, 0xc5, 0x9a, 0x18, 0x56, + 0x48, 0x51, 0x89, 0xdd, 0x63, 0xdf, 0x0c, 0x21, 0x7a, 0x0b, 0x5a, + 0xfb, 0x51, 0x00, 0x52, 0xf0, 0xb4, 0xe1, 0xe2, 0xe6, 0x74, 0x9b, + 0x39, 0x78, 0xe5, 0x2a, 0x38, 0xfd, 0x72, 0x80, 0x3d, 0x4f, 0xce, + 0x45, 0x80, 0x88, 0x35, 0xa2, 0xa2, 0x12, 0x84, 0xeb, 0x5e, 0x4f, + 0xe5, 0xa1, 0x5d, 0x14, 0xc2, 0x86, 0x53, 0x69, 0x60, 0x71, 0x63, + 0x98, 0xc3, 0x08, 0xf9, 0xbf, 0x14, 0xdb, 0xb7, 0xa9, 0xf4, 0x8f, + 0x83, 0xb8, 0x41, 0x7e, 0x45, 0xb3, 0xef, 0xc3, 0x82, 0xa6, 0x43, + 0x7f, 0xc0, 0xeb, 0x24, 0xdd, 0x3e, 0x2a, 0x25, 0xaf, 0x50, 0x5f, + 0x6c, 0x06, 0x61, 0x86, 0x61, 0xbb, 0x00, 0x80, 0x18, 0xb4, 0x21, + 0x72, 0x8f, 0xbe, 0xd1, 0x43, 0x03, 0x65, 0xaa, 0xe5, 0x16, 0x80, + 0xa2, 0xb0, 0x4b, 0x25, 0x8d, 0x8d, 0xf7, 0xf0, 0x5c, 0xb0, 0xc3, + 0xd4, 0xb8, 0xfd, 0xa5, 0xb7, 0x66, 0x97, 0x06, 0x46, 0x39, 0xed, + 0x07, 0xb1, 0x58, 0x59, 0xe5, 0xce, 0x62, 0x53, 0xa9, 0xc4, 0x21, + 0xfa, 0x62, 0xb9, 0xcc, 0x2a, 0x63, 0xb4, 0xaf, 0x8f, 0x40, 0x35, + 0x9f, 0x01, 0x8a, 0x97, 0xcb, 0x35, 0x2d, 0x64, 0xc2, 0x49, 0x82, + 0x5d, 0xae, 0xb1}}; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh13CondConditionFingerprint = { + {0xd9, 0x95, 0x6e, 0x6e, 0x8b, 0x3b, 0x8b, 0x3b, 0xd7, 0x11, 0x4b, + 0x11, 0x21, 0x26, 0x48, 0xbd, 0x92, 0x55, 0x47, 0x42, 0x66, 0x8f, + 0xc1, 0x5f, 0xb4, 0x03, 0x78, 0x32, 0x05, 0xc5, 0x0e, 0x82}}; + Condition const Thresh13Cond{Type::thresholdSha256, + 135168, + Thresh13CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim18Preimage = "I am root"s; + auto const preim18Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa19Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa19PublicKey{ + {0xc0, 0x81, 0x79, 0x3f, 0x26, 0x8f, 0xe8, 0x48, 0xf1, 0x9c, 0xd2, + 0x09,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0x0d, 0x54, 0x32, 0x46, + 0x93, 0xd7, 0x96, 0xce, 0x33, 0x06, 0xe9, 0x7a, 0x7b, 0x6d, 0xe9, + 0x54, 0xe4, 0xbe, 0x56, 0x37, 0xa7, 0x7c, 0xc8, 0xba, 0x17, 0xb1, + 0xba, 0x76, 0xd7, 0x7f, 0xca, 0x7f, 0xfe, 0x60, 0x7d, 0x60, 0x27, + 0xd0, 0x80, 0x65, 0x74, 0xdc, 0xd6, 0xc8, 0x58, 0x4d, 0xcd, 0x8e, + 0xc9, 0x4e, 0xb2, 0x3e, 0x6e, 0x4f, 0xfa, 0x22, 0xfa, 0x9f, 0x3a, + 0x9f, 0x14, 0xeb}}; + std::array const rsa19Sig{ + {0x47, 0xe4, 0xbe, 0xcd, 0x1c, 0xac, 0x2f, 0x67, 0x4c, 0xfd, 0xc7, + 0x38, 0x9a, 0x05, 0xeb, 0x3a, 0x3b, 0x91, 0xa0, 0x67, 0xbc, 0x1d, + 0x2b, 0x85, 0x00, 0x87, 0xc3, 0xb1, 0x90, 0x90, 0x60, 0x39, 0x2b, + 0x11, 0x2a, 0x8f, 0x44, 0xe0, 0x5a, 0xad, 0x02, 0x47, 0x49, 0x50, + 0x26, 0x06, 0x6b, 0xa5, 0xf7, 0x87, 0x16, 0xf6, 0x02, 0xf5, 0xb3, + 0xa2, 0xcd, 0x16, 0x58, 0xb9, 0xbd, 0xd2, 0x55, 0x06, 0x85, 0xd9, + 0xd9, 0x58, 0x46, 0x1d, 0xd1, 0x64, 0xe8, 0x11, 0x53, 0x07, 0xed, + 0xa9, 0x50, 0xbe, 0x86, 0xd5, 0x7c, 0x40, 0xe1, 0x7b, 0xb0, 0x96, + 0x58, 0xf7, 0xfa, 0x29, 0x41, 0xb5, 0x66, 0xc3, 0x1f, 0xef, 0x3d, + 0xaf, 0x1d, 0xc1, 0xbe, 0x67, 0x3f, 0x1b, 0x5e, 0xa2, 0x6a, 0x10, + 0xfb, 0xeb, 0xe9, 0xa2, 0x55, 0x0e, 0x2c, 0xd4, 0xc8, 0x90, 0x18, + 0x6e, 0x10, 0x84, 0xd1, 0xa6, 0x5b, 0x4c, 0x37, 0x9a, 0x5c, 0xe4, + 0xb3, 0x08, 0x70, 0x5c, 0xf9, 0x80, 0xbb, 0xd1, 0x4e, 0xaa, 0xf7, + 0xfc, 0xb7, 0x5b, 0x0a, 0x77, 0x90, 0x05, 0xd7, 0x4f, 0xe9, 0xa9, + 0xdd, 0x71, 0xe7, 0x23, 0xa6, 0x37, 0x8d, 0x65, 0xa3, 0xcb, 0x38, + 0x3a, 0x09, 0x84, 0x1c, 0xbf, 0x8d, 0x8f, 0xb0, 0xae, 0x2c, 0xa0, + 0x4e, 0x51, 0x0e, 0x4a, 0x02, 0x92, 0xf6, 0x3f, 0x12, 0xb7, 0x2f, + 0x99, 0x73, 0xa5, 0xc0, 0x72, 0x9d, 0x03, 0x01, 0xac, 0xae, 0x94, + 0xae, 0xb6, 0x9b, 0x4a, 0xf0, 0xbf, 0x2c, 0xed, 0x23, 0xd6, 0x10, + 0xa4, 0x59, 0x3d, 0xf0, 0xbb, 0x7b, 0x91, 0x23, 0x38, 0x6f, 0x93, + 0x48, 0x27, 0x21, 0x87, 0x87, 0x7a, 0x51, 0x72, 0x9d, 0x4d, 0x33, + 0x5b, 0x09, 0x90, 0x93, 0x79, 0xbf, 0xc6, 0x0b, 0x66, 0x99, 0xde, + 0x5e, 0x37, 0x03, 0xc0, 0x8a, 0x90, 0xc0, 0xab, 0x8c, 0xee, 0x4d, + 0x28, 0x7d, 0x3c}}; + auto const ed20Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed20PublicKey{ + {0x63, 0x87, 0xe7, 0xfd, 0x5e, 0x93, 0x76, 0x3e, 0x74, 0x42, 0x8e, + 0xd5, 0xc9, 0x79, 0xa6, 0xa9, 0xc4, 0x3d, 0x61, 0x14, 0x7b, 0x49, + 0xf3, 0xda, 0x52, 0xc2, 0x74, 0x9b, 0x62, 0xae, 0x8c, 0x90}}; + std::array const ed20Sig{ + {0x4f, 0x9d, 0xaf, 0x7e, 0x00, 0x50, 0x3d, 0xdc, 0xb2, 0xd9, 0x56, + 0x79, 0x61, 0xb7, 0xcb, 0xe6, 0x2d, 0xf3, 0xc8, 0xce, 0x6f, 0x7a, + 0xde, 0x9a, 0x85, 0xf8, 0xc5, 0xc7, 0x93, 0x7d, 0xf8, 0xdc, 0xdb, + 0xbc, 0x12, 0x87, 0x0d, 0x42, 0x62, 0xc8, 0xc8, 0xd0, 0xbd, 0xb7, + 0xa9, 0x05, 0x0c, 0x57, 0x2a, 0xf5, 0x59, 0x83, 0x81, 0x69, 0xc8, + 0xbc, 0xec, 0x4b, 0xf8, 0xf6, 0xbd, 0xc7, 0x70, 0x0f}}; + std::array const ed20SigningKey{ + {0x15, 0xe5, 0xd2, 0xb8, 0x15, 0x1f, 0xe1, 0x89, 0x7e, 0x3f, 0x33, + 0x3b, 0x27, 0xed, 0x94, 0xb6, 0xe4, 0x47, 0x82, 0xa0, 0xa8, 0x40, + 0xb9, 0x4d, 0xa8, 0x65, 0xb8, 0x79, 0x2b, 0x0f, 0x1b, 0x4c}}; + (void)ed20SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim21CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim21Cond{Type::preimageSha256, + 9, + Preim21CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa22CondConditionFingerprint = { + {0x1a, 0x59, 0xf0, 0xd9, 0x99, 0xe2, 0xac, 0x9a, 0xc7, 0x84, 0xc3, + 0xe7, 0x21, 0x3d, 0x86, 0x3b, 0x18, 0xfd, 0x67, 0xc1, 0x70, 0x5f, + 0x36, 0x60, 0xc3, 0x4d, 0xb6, 0x1c, 0x84, 0x53, 0x7e, 0xda}}; + Condition const Rsa22Cond{Type::rsaSha256, + 65536, + Rsa22CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed23CondConditionFingerprint = { + {0x1a, 0x18, 0x47, 0x1f, 0xd0, 0x23, 0xc4, 0x4d, 0x07, 0x5b, 0x1e, + 0x43, 0xa6, 0x28, 0x54, 0xce, 0xec, 0x02, 0x4d, 0xc1, 0x00, 0x3c, + 0x0c, 0x55, 0x02, 0xa3, 0xa3, 0x28, 0x38, 0x88, 0x5c, 0x84}}; + Condition const Ed23Cond{Type::ed25519Sha256, + 131072, + Ed23CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix24CondConditionFingerprint = { + {0xdd, 0xc0, 0xf0, 0xf5, 0x50, 0x88, 0x7e, 0x56, 0xab, 0x65, 0xc0, + 0x5c, 0xbf, 0x3b, 0x8c, 0xdd, 0x98, 0x48, 0xdf, 0xd0, 0x8a, 0x64, + 0xf0, 0x65, 0x4c, 0x57, 0xd7, 0x44, 0x23, 0x35, 0xb6, 0x9f}}; + Condition const Prefix24Cond{Type::prefixSha256, + 278563, + Prefix24CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh41CondConditionFingerprint = { + {0x2d, 0x8d, 0x98, 0x48, 0x0b, 0x95, 0xae, 0xf0, 0x08, 0xb6, 0x83, + 0xab, 0xce, 0x39, 0x57, 0x9d, 0xda, 0x0f, 0x1e, 0xdb, 0x17, 0x71, + 0x7b, 0x9e, 0xf9, 0x9f, 0xd5, 0x29, 0x40, 0xf0, 0x39, 0x83}}; + Condition const Thresh41Cond{Type::thresholdSha256, + 135168, + Thresh41CondConditionFingerprint, + std::bitset<5>{25}}; + + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(rsa6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond, Thresh13Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim18 = + std::make_unique(makeSlice(preim18Preimage)); + auto rsa19 = std::make_unique( + makeSlice(rsa19PublicKey), makeSlice(rsa19Sig)); + auto ed20 = std::make_unique(ed20PublicKey, ed20Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim18)); + thresh0Subfulfillments.emplace_back(std::move(rsa19)); + thresh0Subfulfillments.emplace_back(std::move(ed20)); + std::vector thresh0Subconditions{ + {Preim21Cond, Rsa22Cond, Ed23Cond, Prefix24Cond, Thresh41Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x08\xc3\xa0\x82\x07\xe9\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x82\x05\x66\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x82\x05\x5b\xa1\x82\x05\x57\x80\x02\x50\x32\x81" + "\x01\x1c\xa2\x82\x05\x4c\xa2\x82\x05\x48\xa0\x82\x04\x9b\xa2" + "\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00" + "\xd0\x07\xfc\x9d\xb0\xa1\xa6\x40\xe4\x52\x30\x42\x74\xfd\x35" + "\x04\xde\x45\x68\xb3\x22\xdd\xff\x41\x43\x69\x33\xc0\xff\x35" + "\xb6\x6d\x15\xe9\x54\x15\xeb\x1d\x07\xe2\x25\x2b\xdb\xaa\x16" + "\x8d\x0d\x7f\x05\xf0\xd2\x7d\xb4\x9b\x51\x19\x20\x1e\x3d\xba" + "\x50\x9e\x51\x13\x81\x43\x55\x96\xca\xdb\x88\x1f\xef\x2d\x38" + "\x3f\xae\x8d\xac\xc8\x6f\x2b\xd5\xf0\x34\x1a\x99\x00\x7c\x6d" + "\xb3\x1b\x1d\x68\xdb\xf8\x1c\x59\x3a\x63\x38\x7c\x1c\x14\xbc" + "\x22\xcf\xc8\x9a\xc6\x96\x6f\x3d\x03\x0b\x61\x6b\x7d\x75\x97" + "\xe8\x25\xb8\x2f\xfa\xf4\x07\x44\xdf\x00\x3d\xff\x0d\xd5\x7f" + "\x7f\xf3\x0c\x13\xac\x8d\xf8\x8c\x79\xc5\xf3\x29\xdc\x23\x65" + "\xd3\xd1\x1c\xa6\x14\x78\x6a\x1a\xe3\x15\x8d\x8b\xdc\xa0\x5a" + "\xc7\x82\xb0\x03\x6c\x71\x43\x59\x24\xc7\x50\x64\xb2\xa7\x69" + "\xf5\xbd\xe6\x5e\xaa\x77\x59\x60\x36\xc0\xe3\x42\x7f\x05\x3b" + "\x4c\x02\x0e\x70\x5a\x70\xc5\x2a\xeb\x94\x4d\x15\x09\xef\xbb" + "\x58\x42\x68\x05\x59\x70\xa0\x17\xb2\x8e\xdf\x7b\x40\x5d\x21" + "\x1e\xfe\x62\x58\xde\xfb\x14\x91\x18\xf3\x4f\x9b\x36\x55\xcf" + "\xb3\x5e\xec\x4f\xcc\x6d\x13\x58\xc8\xa3\xa3\xee\x23\x8a\xc2" + "\xbf\x81\x82\x01\x00\x7c\xe7\xdb\x72\x98\x2b\x9d\x36\x6e\xa0" + "\x4f\x1c\xad\xe4\x21\xb9\xce\x79\x31\x30\x1d\x52\x3b\x19\xa6" + "\x7b\xc1\x1d\x27\xf5\x98\x76\xe8\x70\x21\xdd\x1c\xf6\xb5\x5f" + "\x6e\x1b\x3a\x28\x21\x42\x96\x33\xcd\x9c\xa7\x5c\x77\xf5\x7f" + "\xb2\xa7\x8f\x30\x04\xc6\xa1\xb5\x26\xa8\x73\xd9\x83\x1c\xd0" + "\xfb\xc7\xaf\x16\xb4\xdc\x0d\xb6\x3a\xd5\x99\x16\xa1\x32\xc5" + "\x9a\x18\x56\x48\x51\x89\xdd\x63\xdf\x0c\x21\x7a\x0b\x5a\xfb" + "\x51\x00\x52\xf0\xb4\xe1\xe2\xe6\x74\x9b\x39\x78\xe5\x2a\x38" + "\xfd\x72\x80\x3d\x4f\xce\x45\x80\x88\x35\xa2\xa2\x12\x84\xeb" + "\x5e\x4f\xe5\xa1\x5d\x14\xc2\x86\x53\x69\x60\x71\x63\x98\xc3" + "\x08\xf9\xbf\x14\xdb\xb7\xa9\xf4\x8f\x83\xb8\x41\x7e\x45\xb3" + "\xef\xc3\x82\xa6\x43\x7f\xc0\xeb\x24\xdd\x3e\x2a\x25\xaf\x50" + "\x5f\x6c\x06\x61\x86\x61\xbb\x00\x80\x18\xb4\x21\x72\x8f\xbe" + "\xd1\x43\x03\x65\xaa\xe5\x16\x80\xa2\xb0\x4b\x25\x8d\x8d\xf7" + "\xf0\x5c\xb0\xc3\xd4\xb8\xfd\xa5\xb7\x66\x97\x06\x46\x39\xed" + "\x07\xb1\x58\x59\xe5\xce\x62\x53\xa9\xc4\x21\xfa\x62\xb9\xcc" + "\x2a\x63\xb4\xaf\x8f\x40\x35\x9f\x01\x8a\x97\xcb\x35\x2d\x64" + "\xc2\x49\x82\x5d\xae\xb1\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30" + "\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c" + "\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81" + "\x01\x09\xa3\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa" + "\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf" + "\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab" + "\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5" + "\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82" + "\x01\x00\xbe\x09\xc5\xa4\x27\x29\xdf\xd4\x67\x76\xbe\xbf\x2c" + "\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67\x20\xfb\x7a\x27\x93\xc0" + "\x78\x47\x78\xd7\x15\x32\xee\x38\x81\x0d\x36\xa2\xc4\x65\x44" + "\xe6\x62\x26\xb9\x58\x13\xa4\x15\x82\xab\xb1\x16\x61\xfc\x01" + "\x98\xc6\x1a\x69\xc6\xba\x39\x3f\x01\x55\x3d\xd7\x8e\x14\x42" + "\x6d\x78\x74\x9b\x28\xcb\x31\x39\x98\x5a\x11\xdc\xc1\x18\x9d" + "\x8d\xb0\xcd\x1b\x4c\x10\xab\x14\x64\x19\xf1\x33\x15\x45\xc8" + "\x92\x82\x03\x82\x8a\xaa\xad\x94\xfc\x24\x11\x96\x99\x7e\x94" + "\x5a\x82\x57\x68\x61\x9f\x7b\x45\xe0\x99\x9e\x4f\x32\x50\x5f" + "\x05\xc8\x11\xae\xc4\x0c\x63\x18\x0e\x02\x59\x36\x25\x92\x06" + "\x32\xc7\x71\x47\x99\xcc\x0a\x6e\x0a\x58\x71\x3f\x5e\xb7\x78" + "\xf7\x98\x79\xdf\x74\xa4\xeb\xa9\x00\xfd\x81\xb3\xcf\x04\x8c" + "\x5d\x7d\xe7\xb2\x82\x90\x49\xbd\x69\xf3\x08\xe9\x92\xc6\x9e" + "\x41\xba\x74\xd8\x8d\x81\x97\x6f\x86\xab\xc9\xf1\x02\x31\xb4" + "\xce\x47\xb0\x39\xc8\xba\x51\xa7\x39\xf3\x71\xa2\x25\x27\x37" + "\x6e\x09\x6f\x19\x59\xbc\x65\xd9\xcd\x12\xd3\x2c\xa2\x78\xfa" + "\x23\x15\x1a\x82\x41\x91\x1b\xbe\x8a\xe7\xfe\x3c\x3c\x30\x32" + "\xaa\xe9\xf3\x81\x82\x01\x00\x6c\x9d\xff\xbe\xc3\xb6\x20\x82" + "\xb0\x23\x4c\xb6\x9b\x35\x19\x87\x39\x07\xc5\x97\xda\x27\x03" + "\xf3\xd5\x41\xf5\x79\x9c\xf4\x73\xde\x39\x72\xa7\x21\xfd\x01" + "\x95\xca\xd6\x6d\x02\x57\xa2\x38\x52\xb5\xee\x23\x99\xfc\xf9" + "\xc1\x6f\xab\xc4\xc9\x9c\xa8\x46\x79\x41\x68\x1b\xda\x3b\xdd" + "\xb6\xcc\x44\x86\x55\x7c\x64\x7c\x98\xda\x94\x89\x0c\x15\x74" + "\x42\xa2\x04\x40\xc5\x93\xa1\xab\x47\x31\x60\xff\x07\x70\x99" + "\x2d\xbc\x9c\xbb\xbf\x03\xe0\xfd\xa6\xcf\xb8\x48\x69\x7e\xee" + "\xc8\xae\xfa\xf8\x52\x39\x9f\x3a\x6a\x07\x5b\xcc\x17\x47\x41" + "\xd3\x7f\x32\x2a\x2b\xad\x1f\x3e\xe8\xa3\x77\x62\x84\xe7\x36" + "\x0e\x43\x4d\x4b\x8a\x7e\x09\x51\x41\x4e\x2f\x6d\xfb\x63\x4c" + "\xc8\x13\x30\x95\x9b\xba\x94\xa8\x43\xc4\xe0\x63\x95\xc2\x9a" + "\xff\x70\x45\x3a\xed\x69\xd8\x88\xaf\x49\x4e\xe1\x14\x25\xc2" + "\x05\x10\x7d\x95\x9b\x75\x94\x6e\xd9\xb7\x2f\x27\x69\xb9\xd4" + "\xa9\x69\x01\x3b\x40\xa2\x88\x4e\x3d\xa7\x83\x38\xc4\xc6\xbf" + "\xd3\x93\x0f\x94\xc6\x77\x17\xe3\xf7\xf8\x85\xf8\xdd\xbb\x99" + "\x6f\xab\x1f\xb3\xb6\xa7\x8b\x74\xe7\xed\xc9\x81\xa3\xc9\x37" + "\xba\x2d\x94\x10\xb5\x38\xbe\x4e\xa1\x81\xa6\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\xd9\x95\x6e\x6e\x8b\x3b" + "\x8b\x3b\xd7\x11\x4b\x11\x21\x26\x48\xbd\x92\x55\x47\x42\x66" + "\x8f\xc1\x5f\xb4\x03\x78\x32\x05\xc5\x0e\x82\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xaf\x93\xfd\x22\x45\xc2" + "\x08\xab\x43\xf7\x45\x56\x63\xec\xaf\x15\x33\xa0\x2a\xb4\x9e" + "\x15\xb4\x6e\xda\x87\x35\xde\x09\x4b\x06\x31\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x55\xcc\xd1\xa2\x2c\x90\x8d\xe3\x2e\x42" + "\xd4\xe0\x65\xb2\xf7\xda\xc0\x07\x1e\xd3\x23\x0f\xfe\x78\x13" + "\xa2\x86\x61\xc4\x34\x28\x50\x81\x03\x02\x00\x00\xa3\x82\x02" + "\x08\x80\x82\x01\x00\xc0\x81\x79\x3f\x26\x8f\xe8\x48\xf1\x9c" + "\xd2\x09\x7c\x96\x0d\x3c\xbb\x85\xdb\x1f\xab\xbe\x97\x7d\xc0" + "\x31\x07\xb0\x2e\xb9\x5c\x2c\xae\x82\xf5\x3e\xb6\x91\xb8\x88" + "\x2a\xa4\xa7\x81\x97\xa5\x71\xad\x09\x4d\xfc\x25\x41\x3e\xe0" + "\xa3\xa6\x19\xba\x8f\x02\x41\x8d\x05\x51\xcd\xf8\x22\xb3\x7a" + "\x6e\x94\x7e\xaa\x58\xda\x02\xae\x73\x00\x94\x1c\xb5\xb5\x26" + "\x9f\xc5\x8b\x04\xe0\xe0\x73\x96\x4b\xaf\x6d\x0a\xe4\x25\x90" + "\x2d\x13\x3c\xbe\x0e\x68\x7d\xfe\xa6\x12\x6b\xb6\xec\xa0\xda" + "\x2b\x22\x31\xe6\x05\x76\xf5\x98\x8e\x76\x86\xbe\xc6\x07\x73" + "\x52\x20\x13\x8f\x93\x1f\xd9\x73\xfa\xb3\xed\x50\x1b\xf7\x68" + "\xf6\x60\xa3\x12\x73\x10\xda\x06\x70\x69\xcb\xb5\x6c\x85\x29" + "\xe8\x9e\x29\xb1\x4d\x7e\x7e\xce\x15\xf5\x25\x55\xc5\x89\x7e" + "\x34\x48\x34\x43\x30\x2b\x6a\x8a\x6d\x1b\x55\x2a\x2c\xf4\xcd" + "\xc1\x72\x78\xda\x0d\x54\x32\x46\x93\xd7\x96\xce\x33\x06\xe9" + "\x7a\x7b\x6d\xe9\x54\xe4\xbe\x56\x37\xa7\x7c\xc8\xba\x17\xb1" + "\xba\x76\xd7\x7f\xca\x7f\xfe\x60\x7d\x60\x27\xd0\x80\x65\x74" + "\xdc\xd6\xc8\x58\x4d\xcd\x8e\xc9\x4e\xb2\x3e\x6e\x4f\xfa\x22" + "\xfa\x9f\x3a\x9f\x14\xeb\x81\x82\x01\x00\x47\xe4\xbe\xcd\x1c" + "\xac\x2f\x67\x4c\xfd\xc7\x38\x9a\x05\xeb\x3a\x3b\x91\xa0\x67" + "\xbc\x1d\x2b\x85\x00\x87\xc3\xb1\x90\x90\x60\x39\x2b\x11\x2a" + "\x8f\x44\xe0\x5a\xad\x02\x47\x49\x50\x26\x06\x6b\xa5\xf7\x87" + "\x16\xf6\x02\xf5\xb3\xa2\xcd\x16\x58\xb9\xbd\xd2\x55\x06\x85" + "\xd9\xd9\x58\x46\x1d\xd1\x64\xe8\x11\x53\x07\xed\xa9\x50\xbe" + "\x86\xd5\x7c\x40\xe1\x7b\xb0\x96\x58\xf7\xfa\x29\x41\xb5\x66" + "\xc3\x1f\xef\x3d\xaf\x1d\xc1\xbe\x67\x3f\x1b\x5e\xa2\x6a\x10" + "\xfb\xeb\xe9\xa2\x55\x0e\x2c\xd4\xc8\x90\x18\x6e\x10\x84\xd1" + "\xa6\x5b\x4c\x37\x9a\x5c\xe4\xb3\x08\x70\x5c\xf9\x80\xbb\xd1" + "\x4e\xaa\xf7\xfc\xb7\x5b\x0a\x77\x90\x05\xd7\x4f\xe9\xa9\xdd" + "\x71\xe7\x23\xa6\x37\x8d\x65\xa3\xcb\x38\x3a\x09\x84\x1c\xbf" + "\x8d\x8f\xb0\xae\x2c\xa0\x4e\x51\x0e\x4a\x02\x92\xf6\x3f\x12" + "\xb7\x2f\x99\x73\xa5\xc0\x72\x9d\x03\x01\xac\xae\x94\xae\xb6" + "\x9b\x4a\xf0\xbf\x2c\xed\x23\xd6\x10\xa4\x59\x3d\xf0\xbb\x7b" + "\x91\x23\x38\x6f\x93\x48\x27\x21\x87\x87\x7a\x51\x72\x9d\x4d" + "\x33\x5b\x09\x90\x93\x79\xbf\xc6\x0b\x66\x99\xde\x5e\x37\x03" + "\xc0\x8a\x90\xc0\xab\x8c\xee\x4d\x28\x7d\x3c\xa4\x64\x80\x20" + "\x63\x87\xe7\xfd\x5e\x93\x76\x3e\x74\x42\x8e\xd5\xc9\x79\xa6" + "\xa9\xc4\x3d\x61\x14\x7b\x49\xf3\xda\x52\xc2\x74\x9b\x62\xae" + "\x8c\x90\x81\x40\x4f\x9d\xaf\x7e\x00\x50\x3d\xdc\xb2\xd9\x56" + "\x79\x61\xb7\xcb\xe6\x2d\xf3\xc8\xce\x6f\x7a\xde\x9a\x85\xf8" + "\xc5\xc7\x93\x7d\xf8\xdc\xdb\xbc\x12\x87\x0d\x42\x62\xc8\xc8" + "\xd0\xbd\xb7\xa9\x05\x0c\x57\x2a\xf5\x59\x83\x81\x69\xc8\xbc" + "\xec\x4b\xf8\xf6\xbd\xc7\x70\x0f\xa1\x81\xd3\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\xdd\xc0\xf0\xf5\x50\x88" + "\x7e\x56\xab\x65\xc0\x5c\xbf\x3b\x8c\xdd\x98\x48\xdf\xd0\x8a" + "\x64\xf0\x65\x4c\x57\xd7\x44\x23\x35\xb6\x9f\x81\x03\x04\x40" + "\x23\x82\x02\x03\xb8\xa2\x2b\x80\x20\x2d\x8d\x98\x48\x0b\x95" + "\xae\xf0\x08\xb6\x83\xab\xce\x39\x57\x9d\xda\x0f\x1e\xdb\x17" + "\x71\x7b\x9e\xf9\x9f\xd5\x29\x40\xf0\x39\x83\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x1a\x59\xf0\xd9\x99\xe2" + "\xac\x9a\xc7\x84\xc3\xe7\x21\x3d\x86\x3b\x18\xfd\x67\xc1\x70" + "\x5f\x36\x60\xc3\x4d\xb6\x1c\x84\x53\x7e\xda\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x1a\x18\x47\x1f\xd0\x23\xc4\x4d\x07\x5b" + "\x1e\x43\xa6\x28\x54\xce\xec\x02\x4d\xc1\x00\x3c\x0c\x55\x02" + "\xa3\xa3\x28\x38\x88\x5c\x84\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x91\x9a\xf3\x38\x58\xc6\x9e\x5e\x00\xd8\x22" + "\x3c\xa2\x51\x77\x26\x62\xaf\x1e\xae\x29\x0d\x4d\xf9\x7f\x70" + "\x02\xb5\xa8\xc1\xfa\x6b\x81\x03\x0c\xb4\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\xd8\x05\x83\xb1\x05\x4c\xac\xc8\xb1\x78\x3b\x62" + "\x2d\x5e\x75\xa2\x3a\xda\xf8\x81\x91\x31\x86\xe5\xbc\x3c\x54" + "\x1d\xad\x83\xe2\x5e\x81\x03\x04\x40\x3a\x82\x02\x03\xb8\xa1" + "\x2b\x80\x20\xdd\xc0\xf0\xf5\x50\x88\x7e\x56\xab\x65\xc0\x5c" + "\xbf\x3b\x8c\xdd\x98\x48\xdf\xd0\x8a\x64\xf0\x65\x4c\x57\xd7" + "\x44\x23\x35\xb6\x9f\x81\x03\x04\x40\x23\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\x2d\x8d\x98\x48\x0b\x95\xae\xf0\x08\xb6\x83\xab" + "\xce\x39\x57\x9d\xda\x0f\x1e\xdb\x17\x71\x7b\x9e\xf9\x9f\xd5" + "\x29\x40\xf0\x39\x83\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x19\x8c\xcc\x4c\x02\x17\xf3\xb7\xc0\x65\x68\xae" + "\xf6\xd8\x1a\x44\xd5\x39\x52\x93\x1c\xb2\x4f\x8f\xb3\x6f\x21" + "\xfc\x18\x2c\x58\x10\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x1a" + "\x59\xf0\xd9\x99\xe2\xac\x9a\xc7\x84\xc3\xe7\x21\x3d\x86\x3b" + "\x18\xfd\x67\xc1\x70\x5f\x36\x60\xc3\x4d\xb6\x1c\x84\x53\x7e" + "\xda\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1a\x18\x47\x1f\xd0" + "\x23\xc4\x4d\x07\x5b\x1e\x43\xa6\x28\x54\xce\xec\x02\x4d\xc1" + "\x00\x3c\x0c\x55\x02\xa3\xa3\x28\x38\x88\x5c\x84\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\xa1\xa0\xd1\xf4\xea\x8d\x9a\x14\x25" + "\xca\x52\x3a\x77\x7e\xf4\x0d\x86\x56\xc7\x22\x12\xd3\xa3\xc2" + "\x32\xa3\x2b\x80\x96\xf3\xd4\x23\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh40() + { + testcase("Thresh40"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim16Cond + // ** Rsa17Cond + // ** Ed18Cond + // ** thresh1 + // *** rsa2 + // ** prefix3 + // *** prefix4 + // **** rsa5 + // ** thresh6 + // *** Preim13Cond + // *** Rsa14Cond + // *** Ed15Cond + // *** rsa7 + // *** thresh8 + // **** Preim10Cond + // **** Rsa11Cond + // **** Ed12Cond + // **** rsa9 + + auto const rsa2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa2PublicKey{ + {0xba, 0x2c, 0x3b, 0x50, 0xb6, 0xbf, 0xf9, 0x0f, 0x1d, 0xd7, 0x32, + 0x4c, 0x01, 0x5f, 0xff, 0x2f, 0x2a, 0xf6, 0x33, 0xd0, 0xfb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, 0x30, 0xa1, 0x92, 0x93, 0xe8, 0xd8, 0x34, 0x9e, + 0xac, 0xd6, 0x23, 0xfc, 0x7f, 0xcb, 0xe7, 0xfe, 0xa7, 0xe6, 0x42, + 0xac, 0x77, 0x11, 0xc0, 0x67, 0x77, 0xd1, 0xaa, 0x5e, 0xed, 0x3b, + 0xd5, 0xa5, 0x8d, 0x34, 0x7c, 0xd9, 0x57, 0x44, 0xa7, 0xc5, 0x44, + 0x2e, 0x1e, 0xe7, 0x63, 0xd8, 0x53, 0x1b, 0x9a, 0xd9, 0x67, 0x02, + 0x13, 0x32, 0x61}}; + std::array const rsa2Sig{ + {0x0d, 0xf2, 0x29, 0x5b, 0x1f, 0x63, 0xa6, 0x76, 0x56, 0xe1, 0x47, + 0xac, 0x65, 0x04, 0x79, 0xad, 0x69, 0x1e, 0xd5, 0x24, 0xe9, 0x84, + 0x64, 0x3c, 0xd5, 0x9c, 0xf4, 0x16, 0x78, 0x57, 0x32, 0xcb, 0x52, + 0xcd, 0xe5, 0x62, 0xab, 0x37, 0x1c, 0x6e, 0x39, 0x2d, 0xaf, 0x9b, + 0xef, 0xaa, 0x30, 0xc7, 0x6d, 0x47, 0x9f, 0x37, 0xb8, 0x88, 0xf6, + 0x3f, 0x5a, 0x92, 0x64, 0xf6, 0xf4, 0x93, 0xb6, 0xe6, 0xd2, 0x7a, + 0xb2, 0x4a, 0xc3, 0xc1, 0xf6, 0x37, 0x7a, 0xc0, 0x41, 0xf0, 0x91, + 0x0b, 0x76, 0x51, 0x81, 0x25, 0x3a, 0x2b, 0x45, 0x8b, 0x73, 0xa0, + 0x4c, 0x57, 0x56, 0x6f, 0xc5, 0x50, 0x24, 0xed, 0x31, 0x15, 0x4c, + 0xd6, 0x9d, 0x41, 0xb5, 0x98, 0x46, 0xdf, 0x7b, 0x56, 0x9e, 0xe5, + 0xc4, 0xa8, 0xce, 0x86, 0x3a, 0x61, 0xed, 0xac, 0xf5, 0xe7, 0x68, + 0xed, 0x99, 0xf3, 0x0b, 0x54, 0x05, 0xc5, 0x9d, 0x75, 0x03, 0x8b, + 0x72, 0xb7, 0x03, 0xb9, 0x03, 0x25, 0x62, 0x20, 0x83, 0x05, 0x31, + 0x71, 0x0c, 0x07, 0x4a, 0x0a, 0x67, 0x20, 0xb9, 0x2d, 0x30, 0x13, + 0xda, 0x53, 0xe7, 0xd3, 0xf1, 0xc8, 0x85, 0x8e, 0x59, 0x87, 0xba, + 0x35, 0xd5, 0xca, 0xc2, 0x03, 0xd0, 0x9d, 0x5b, 0x9d, 0xbb, 0x09, + 0x79, 0x02, 0x00, 0x65, 0xeb, 0x5e, 0x8c, 0xb3, 0xe0, 0x16, 0x70, + 0xa8, 0x5c, 0xd5, 0x3b, 0x66, 0x1e, 0x10, 0x80, 0x52, 0xfc, 0x04, + 0x05, 0x43, 0xf4, 0xea, 0xae, 0x6f, 0xcc, 0x0b, 0xc6, 0x9d, 0x05, + 0x6a, 0x53, 0x50, 0xc1, 0x78, 0x4c, 0xe4, 0xdd, 0xab, 0xb3, 0x36, + 0xa4, 0x4e, 0xf7, 0x63, 0x6e, 0x50, 0x02, 0x56, 0xc3, 0x37, 0xc5, + 0x3c, 0x8a, 0x5a, 0x39, 0x65, 0x93, 0x40, 0xf0, 0x99, 0xa9, 0x63, + 0x64, 0xa5, 0x9a, 0x56, 0x63, 0xcc, 0x3a, 0x9b, 0xb8, 0xb2, 0x8e, + 0x51, 0x5a, 0xd7}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa5Msg = "P4P3abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa5PublicKey{ + {0xc0, 0x00, 0xef, 0x8f, 0x4b, 0x81, 0x10, 0x1e, 0x52, 0xe0, 0x07, + 0x9f, 0x68, 0xe7, 0x2f, 0x92, 0xd4, 0x77, 0x3c, 0x1f, 0xa3, 0xff, + 0x72, 0x64, 0x5b, 0x37, 0xf1, 0xf3, 0xa3, 0xc5, 0xfb, 0xcd, 0xfb, + 0xda, 0xcc, 0x8b, 0x52, 0xe1, 0xde, 0xbc, 0x28, 0x8d, 0xe5, 0xad, + 0xab, 0x86, 0x61, 0x45, 0x97, 0x65, 0x37, 0x68, 0x26, 0x21, 0x92, + 0x17, 0xa3, 0xb0, 0x74, 0x5c, 0x8a, 0x45, 0x8d, 0x87, 0x5b, 0x9b, + 0xd1, 0x7b, 0x07, 0xc4, 0x8c, 0x67, 0xa0, 0xe9, 0x82, 0x0c, 0xe0, + 0x6b, 0xea, 0x91, 0x5c, 0xba, 0xe3, 0xd9, 0x9d, 0x39, 0xfd, 0x77, + 0xac, 0xcb, 0x33, 0x9b, 0x28, 0x51, 0x8d, 0xbf, 0x3e, 0xe4, 0x94, + 0x1c, 0x9a, 0x60, 0x71, 0x4b, 0x34, 0x07, 0x30, 0xda, 0x42, 0x46, + 0x0e, 0xb8, 0xb7, 0x2c, 0xf5, 0x2f, 0x4b, 0x9e, 0xe7, 0x64, 0x81, + 0xa1, 0xa2, 0x05, 0x66, 0x92, 0xe6, 0x75, 0x9f, 0x37, 0xae, 0x40, + 0xa9, 0x16, 0x08, 0x19, 0xe8, 0xdc, 0x47, 0xd6, 0x03, 0x29, 0xab, + 0xcc, 0x58, 0xa2, 0x37, 0x2a, 0x32, 0xb8, 0x15, 0xc7, 0x51, 0x91, + 0x73, 0xb9, 0x1d, 0xc6, 0xd0, 0x4f, 0x85, 0x86, 0xd5, 0xb3, 0x21, + 0x1a, 0x2a, 0x6c, 0xeb, 0x7f, 0xfe, 0x84, 0x17, 0x10, 0x2d, 0x0e, + 0xb4, 0xe1, 0xc2, 0x48, 0x4c, 0x3f, 0x61, 0xc7, 0x59, 0x75, 0xa7, + 0xc1, 0x75, 0xce, 0x67, 0x17, 0x42, 0x2a, 0x2f, 0x96, 0xef, 0x8a, + 0x2d, 0x74, 0xd2, 0x13, 0x68, 0xe1, 0xe9, 0xea, 0xfb, 0x73, 0x68, + 0xed, 0x8d, 0xd3, 0xac, 0x49, 0x09, 0xf9, 0xec, 0x62, 0xdf, 0x53, + 0xab, 0xfe, 0x90, 0x64, 0x4b, 0x92, 0x60, 0x0d, 0xdd, 0x00, 0xfe, + 0x02, 0xe6, 0xf3, 0x9b, 0x2b, 0xac, 0x4f, 0x70, 0xe8, 0x5b, 0x69, + 0x9c, 0x40, 0xd3, 0xeb, 0x37, 0xad, 0x6f, 0x37, 0xab, 0xf3, 0x79, + 0x8e, 0xcb, 0x1d}}; + std::array const rsa5Sig{ + {0x92, 0xfd, 0x66, 0x5a, 0x4d, 0xd4, 0x8b, 0xbe, 0xb0, 0x59, 0xea, + 0x29, 0xfe, 0xfb, 0xfa, 0xc6, 0x55, 0x69, 0xdd, 0x6a, 0xee, 0xff, + 0x2e, 0xf7, 0x0a, 0x04, 0x2d, 0x9e, 0xf0, 0xc6, 0xd9, 0x59, 0xdd, + 0x23, 0x1c, 0xd6, 0x03, 0x10, 0x43, 0x39, 0xc4, 0x7c, 0x79, 0x5f, + 0x68, 0x5c, 0xf4, 0xb1, 0xc9, 0x08, 0x97, 0x41, 0x7a, 0x1c, 0x95, + 0xbb, 0x97, 0x31, 0x65, 0x74, 0x7d, 0x4a, 0x7c, 0xf5, 0xe9, 0xfc, + 0xfb, 0x89, 0x2b, 0x45, 0xf8, 0x1c, 0xd7, 0x00, 0xaa, 0xad, 0xaf, + 0x9c, 0x2c, 0xe3, 0x35, 0x59, 0x71, 0xd7, 0x16, 0xe0, 0xac, 0x9a, + 0x1a, 0x1d, 0xd5, 0x9d, 0x00, 0x0b, 0xc6, 0x47, 0xf1, 0x06, 0x4a, + 0x0f, 0x9a, 0x09, 0xe3, 0x44, 0xf6, 0xdc, 0x22, 0x56, 0xa7, 0x53, + 0x02, 0x29, 0x64, 0x5d, 0x7a, 0x5d, 0xdf, 0x3f, 0x16, 0x71, 0xec, + 0x4e, 0x78, 0x48, 0xbe, 0x1c, 0xe9, 0xf7, 0xe4, 0x69, 0x8c, 0x25, + 0x16, 0x6e, 0x85, 0xe5, 0x89, 0x3b, 0xf1, 0x58, 0x3c, 0x1b, 0xa5, + 0x10, 0xba, 0x98, 0x21, 0x94, 0x81, 0x05, 0xe6, 0xbc, 0xc0, 0xef, + 0x09, 0xa0, 0xe2, 0xf3, 0xb1, 0x7e, 0xd2, 0x18, 0x8c, 0x30, 0x0f, + 0x3f, 0xf7, 0xbd, 0x36, 0xef, 0x16, 0x65, 0x7a, 0x93, 0xe1, 0x10, + 0x71, 0x10, 0x4d, 0x52, 0xe1, 0x8b, 0xcf, 0xc2, 0xf1, 0x8c, 0xbc, + 0x70, 0x67, 0xb7, 0x85, 0x8c, 0xde, 0x98, 0x74, 0xd5, 0x09, 0x0a, + 0x8f, 0xce, 0xd2, 0x91, 0xcd, 0xd6, 0xc9, 0xb5, 0x14, 0xc8, 0x36, + 0x41, 0x4d, 0x88, 0x87, 0xcf, 0x02, 0x16, 0xb3, 0x8d, 0xa8, 0x8f, + 0x1b, 0xb8, 0x9b, 0x0e, 0x5b, 0x40, 0xe9, 0xe6, 0x77, 0x38, 0x51, + 0xd3, 0x12, 0xdf, 0x1c, 0xbc, 0x70, 0xe2, 0xeb, 0x6b, 0x9e, 0xaa, + 0xc8, 0xc2, 0x1c, 0x07, 0x93, 0x48, 0x6c, 0xd4, 0xba, 0xfb, 0x1c, + 0xc6, 0x57, 0xaf}}; + auto const prefix4Prefix = "P4"s; + auto const prefix4Msg = "P3abcdefghijklmnopqrstuvwxyz"s; + auto const prefix4MaxMsgLength = 28; + auto const prefix3Prefix = "P3"s; + auto const prefix3Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3MaxMsgLength = 26; + auto const rsa7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa7PublicKey{ + {0xb5, 0x8b, 0xa2, 0xa1, 0xc0, 0x5b, 0xc3, 0xa3, 0x64, 0xe9, 0x88, + 0xe3, 0x25, 0x89, 0xa0, 0x6d, 0x73, 0x8a, 0x46, 0x09, 0x58, 0xb4, + 0x85, 0x66, 0x87, 0x56, 0x85,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d9, 0xe3, + 0x21, 0x1b, 0x88, 0x41, 0x3d, 0x2d, 0x32, 0xff, 0xd3, 0xfe, 0x4d, + 0x40, 0x85, 0x1b, 0x0f, 0xd6, 0xab, 0x4e, 0xb7, 0x38, 0x68, 0xe9, + 0x67, 0xc7, 0xb5, 0xd1, 0x38, 0xdb, 0x85, 0x2e, 0x2f, 0x76, 0xea, + 0x4a, 0xce, 0xff, 0x08, 0x5e, 0x93, 0x87, 0x98, 0xf7, 0x95, 0xeb, + 0x49, 0xf6, 0x8d}}; + std::array const rsa7Sig{ + {0x55, 0x1f, 0x52, 0x51, 0xba, 0x3e, 0x3e, 0x57, 0x23, 0x69, 0x73, + 0x99, 0x3a, 0x9d, 0x1f, 0x75, 0x23, 0x59, 0xac, 0x29, 0xdc, 0x0a, + 0xb9, 0x04, 0x9f, 0x45, 0x57, 0xb7, 0x73, 0x5f, 0xef, 0x33, 0x22, + 0xfb, 0x69, 0x04, 0x02, 0x5e, 0x4a, 0x32, 0xee, 0xd5, 0x46, 0xf1, + 0xd5, 0xf3, 0xca, 0x49, 0x3b, 0x82, 0x47, 0x3f, 0x36, 0x6d, 0x9f, + 0xe1, 0x7d, 0xaa, 0x5c, 0x2b, 0x46, 0x32, 0x43, 0x26, 0xff, 0xa7, + 0x50, 0x52, 0x4f, 0xff, 0x8f, 0xfd, 0xf9, 0x4f, 0xb7, 0x33, 0xc1, + 0x52, 0x43, 0x0d, 0x6d, 0xd5, 0x5c, 0x5e, 0x2c, 0x24, 0xc1, 0x07, + 0xd4, 0x47, 0x4b, 0xdc, 0x11, 0x7f, 0xf3, 0x48, 0x1a, 0xa3, 0x4d, + 0x35, 0xfe, 0x19, 0x41, 0xd9, 0xfe, 0x63, 0x83, 0x1d, 0x77, 0xf0, + 0x24, 0xfd, 0xed, 0x84, 0xd7, 0x3d, 0xc2, 0x58, 0x64, 0xa5, 0xdd, + 0xea, 0xf3, 0x46, 0x2e, 0x0d, 0xcc, 0x2d, 0xbd, 0xe0, 0xdf, 0x92, + 0x4f, 0x81, 0xac, 0x80, 0x82, 0xcd, 0xf7, 0x5c, 0xc7, 0x03, 0x49, + 0x18, 0x16, 0x8e, 0xc2, 0x90, 0xc4, 0x09, 0xee, 0xf6, 0x5c, 0x82, + 0x2a, 0x45, 0xd7, 0xfb, 0x82, 0x93, 0x20, 0x63, 0x70, 0x82, 0x36, + 0x59, 0x64, 0x21, 0xdb, 0xdf, 0xfa, 0x66, 0xdb, 0x02, 0xee, 0xeb, + 0x55, 0xcb, 0xed, 0x01, 0x53, 0x83, 0x0c, 0x1a, 0x9a, 0x28, 0xe4, + 0x0a, 0xd7, 0x2b, 0xc2, 0xe6, 0xb8, 0x1d, 0x0d, 0x91, 0x8a, 0xc8, + 0x66, 0x4d, 0xae, 0x93, 0x03, 0x11, 0xa8, 0xdf, 0x0b, 0x27, 0x16, + 0x11, 0x7a, 0x0d, 0x1e, 0x92, 0x62, 0x56, 0xc7, 0x6e, 0x5a, 0xf9, + 0x80, 0x75, 0x96, 0x46, 0x93, 0x05, 0x62, 0xad, 0xf7, 0xfc, 0x5e, + 0xd1, 0x96, 0x1e, 0x91, 0x74, 0xdd, 0x0d, 0xcf, 0x90, 0xf9, 0x75, + 0xaa, 0xc8, 0xd8, 0x2a, 0xbc, 0x10, 0x90, 0x26, 0x71, 0xe8, 0xc1, + 0xf8, 0x92, 0x2f}}; + auto const rsa9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa9PublicKey{ + {0xb6, 0x7b, 0xe2, 0x98, 0x9f, 0xff, 0x6c, 0x37, 0xd0, 0xb6, 0x64, + 0x19, 0xfb, 0xa0, 0x21, 0x18, 0xe2, 0xc0, 0xd1, 0x92, 0xbd, 0x04, + 0xa6, 0xd2, 0xb4, 0x7e, 0xc6, 0x6a, 0x1a, 0x34, 0x20, 0x7b, 0xfe, + 0x84, 0xeb, 0xe8, 0xc1, 0x6f, 0xfd, 0xdc, 0x0a, 0xfe, 0x60, 0x55, + 0xb6, 0xfc, 0x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xb8, 0xad, 0xb2, 0xfe, 0xa9, + 0x14, 0xe7, 0xc2, 0xec, 0x12, 0xbf, 0x29, 0x5a, 0x65, 0x91, 0x74, + 0x82, 0xd3, 0x77, 0x1f, 0x14, 0xbf, 0x5f, 0x41, 0x11, 0x6c, 0x7c, + 0x22, 0x70, 0x65}}; + std::array const rsa9Sig{ + {0x14, 0x8e, 0x1e, 0x6c, 0xaa, 0x0a, 0x03, 0x32, 0x62, 0xee, 0xb4, + 0xb2, 0x3f, 0xa9, 0x02, 0xda, 0x95, 0xcc, 0x90, 0x0f, 0xf0, 0xd1, + 0x97, 0x21, 0x8e, 0xa2, 0xe2, 0x53, 0xd0, 0x10, 0x15, 0x76, 0xbb, + 0x1d, 0x41, 0x6b, 0x75, 0x81, 0x3f, 0x96, 0x09, 0x05, 0x35, 0x86, + 0xd2, 0x0f, 0x4b, 0xec, 0x70, 0xe0, 0x1e, 0x2e, 0xbc, 0x6c, 0xaa, + 0xd7, 0xf1, 0xb0, 0x06, 0xcc, 0x88, 0x21, 0xf4, 0xf4, 0xc2, 0x5e, + 0x09, 0x25, 0x91, 0xd7, 0x06, 0x99, 0xe4, 0x9c, 0x9f, 0x5b, 0x0d, + 0x19, 0xfc, 0xa2, 0xe6, 0xc4, 0xf3, 0x35, 0x68, 0x22, 0x64, 0x3d, + 0x09, 0x78, 0xe9, 0xca, 0x4f, 0xbb, 0xe0, 0xdc, 0x6d, 0x3e, 0xf9, + 0x69, 0xca, 0xdd, 0x7e, 0x46, 0x32, 0x8d, 0xd9, 0x25, 0xfd, 0xf8, + 0xea, 0x79, 0x0b, 0x76, 0x78, 0x08, 0xb4, 0xda, 0x61, 0x0e, 0xdf, + 0xcc, 0x1c, 0xcf, 0x25, 0xf6, 0x44, 0x70, 0x7d, 0xcf, 0x02, 0x42, + 0x1a, 0xfb, 0x82, 0xda, 0x6f, 0xe8, 0x26, 0xf8, 0x69, 0xd0, 0x51, + 0xb6, 0xa1, 0x37, 0x57, 0x48, 0x2d, 0x7d, 0xe6, 0x77, 0x43, 0x5e, + 0xe9, 0x1b, 0xe0, 0xa8, 0x81, 0x56, 0x22, 0xfa, 0xa1, 0x4c, 0xb6, + 0x42, 0xef, 0x1b, 0x81, 0x13, 0x18, 0x73, 0xf8, 0x3f, 0x2b, 0x70, + 0xf8, 0x4c, 0xa6, 0xd2, 0xf2, 0x33, 0x43, 0x0c, 0x54, 0x92, 0x91, + 0xcb, 0x9a, 0x6d, 0xbe, 0xb1, 0xe2, 0xbc, 0x2d, 0x8d, 0x93, 0x56, + 0x14, 0x55, 0xe2, 0x01, 0x39, 0x16, 0xbf, 0x32, 0x66, 0xe3, 0xa7, + 0xf1, 0x95, 0x76, 0xe3, 0x78, 0x64, 0xbf, 0xdb, 0x74, 0x25, 0xe8, + 0x45, 0x4a, 0x65, 0xa7, 0x57, 0xce, 0x82, 0x38, 0x00, 0x7a, 0xdf, + 0xad, 0xb9, 0x9c, 0x1e, 0xa0, 0x95, 0xcd, 0xc9, 0x81, 0xd0, 0x73, + 0x4d, 0x23, 0x21, 0x2c, 0x05, 0xe5, 0x4a, 0x45, 0x4d, 0x66, 0x06, + 0x6c, 0x4a, 0x9e}}; + auto const thresh8Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim13CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim13Cond{Type::preimageSha256, + 9, + Preim13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa14CondConditionFingerprint = { + {0x32, 0xec, 0xaa, 0x5e, 0xa6, 0x88, 0xdc, 0xe4, 0x81, 0x0f, 0x93, + 0x0f, 0x65, 0xde, 0x87, 0xfd, 0x54, 0x8c, 0x79, 0x04, 0x81, 0xe3, + 0x63, 0x3f, 0x3d, 0x08, 0xa1, 0xba, 0x0a, 0x24, 0x2b, 0x46}}; + Condition const Rsa14Cond{Type::rsaSha256, + 65536, + Rsa14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed15CondConditionFingerprint = { + {0x40, 0xd1, 0x9a, 0x63, 0x62, 0x9b, 0xc0, 0x76, 0xab, 0x11, 0x73, + 0x42, 0x86, 0xb3, 0x20, 0x9d, 0x23, 0xe8, 0x5e, 0xee, 0xb9, 0x82, + 0x5d, 0x93, 0xe3, 0xac, 0xad, 0xa0, 0x40, 0x41, 0x51, 0x1b}}; + Condition const Ed15Cond{Type::ed25519Sha256, + 131072, + Ed15CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim16CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim16Cond{Type::preimageSha256, + 9, + Preim16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa17CondConditionFingerprint = { + {0x78, 0xe3, 0x04, 0xf4, 0xa6, 0x16, 0x68, 0x4c, 0x1b, 0xcf, 0x3a, + 0x32, 0xff, 0xbc, 0x75, 0x1a, 0xe6, 0x08, 0x9b, 0xff, 0xba, 0x79, + 0xf4, 0x39, 0x7a, 0xfc, 0xe1, 0x6f, 0xff, 0x3e, 0xb3, 0x75}}; + Condition const Rsa17Cond{Type::rsaSha256, + 65536, + Rsa17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed18CondConditionFingerprint = { + {0x0d, 0xea, 0xc5, 0x16, 0x5c, 0x62, 0xb8, 0xd1, 0xa4, 0xe7, 0x5a, + 0x07, 0x58, 0x00, 0x79, 0x51, 0x88, 0x21, 0xe9, 0x4d, 0xba, 0x73, + 0x7b, 0xad, 0x60, 0x9c, 0x5c, 0x26, 0x00, 0x2e, 0xd1, 0x51}}; + Condition const Ed18Cond{Type::ed25519Sha256, + 131072, + Ed18CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa2 = std::make_unique( + makeSlice(rsa2PublicKey), makeSlice(rsa2Sig)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(rsa2)); + std::vector thresh1Subconditions{}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto rsa5 = std::make_unique( + makeSlice(rsa5PublicKey), makeSlice(rsa5Sig)); + auto prefix4 = std::make_unique( + makeSlice(prefix4Prefix), prefix4MaxMsgLength, std::move(rsa5)); + auto prefix3 = std::make_unique( + makeSlice(prefix3Prefix), prefix3MaxMsgLength, std::move(prefix4)); + auto rsa7 = std::make_unique( + makeSlice(rsa7PublicKey), makeSlice(rsa7Sig)); + auto rsa9 = std::make_unique( + makeSlice(rsa9PublicKey), makeSlice(rsa9Sig)); + std::vector> thresh8Subfulfillments; + thresh8Subfulfillments.emplace_back(std::move(rsa9)); + std::vector thresh8Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond}}; + auto thresh8 = std::make_unique( + std::move(thresh8Subfulfillments), std::move(thresh8Subconditions)); + std::vector> thresh6Subfulfillments; + thresh6Subfulfillments.emplace_back(std::move(rsa7)); + thresh6Subfulfillments.emplace_back(std::move(thresh8)); + std::vector thresh6Subconditions{ + {Preim13Cond, Rsa14Cond, Ed15Cond}}; + auto thresh6 = std::make_unique( + std::move(thresh6Subfulfillments), std::move(thresh6Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix3)); + thresh0Subfulfillments.emplace_back(std::move(thresh6)); + std::vector thresh0Subconditions{ + {Preim16Cond, Rsa17Cond, Ed18Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x09\xdd\xa0\x82\x09\x5e\xa1\x82\x02\x26\x80\x02\x50" + "\x33\x81\x01\x1a\xa2\x82\x02\x1b\xa1\x82\x02\x17\x80\x02\x50" + "\x34\x81\x01\x1c\xa2\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01" + "\x00\xc0\x00\xef\x8f\x4b\x81\x10\x1e\x52\xe0\x07\x9f\x68\xe7" + "\x2f\x92\xd4\x77\x3c\x1f\xa3\xff\x72\x64\x5b\x37\xf1\xf3\xa3" + "\xc5\xfb\xcd\xfb\xda\xcc\x8b\x52\xe1\xde\xbc\x28\x8d\xe5\xad" + "\xab\x86\x61\x45\x97\x65\x37\x68\x26\x21\x92\x17\xa3\xb0\x74" + "\x5c\x8a\x45\x8d\x87\x5b\x9b\xd1\x7b\x07\xc4\x8c\x67\xa0\xe9" + "\x82\x0c\xe0\x6b\xea\x91\x5c\xba\xe3\xd9\x9d\x39\xfd\x77\xac" + "\xcb\x33\x9b\x28\x51\x8d\xbf\x3e\xe4\x94\x1c\x9a\x60\x71\x4b" + "\x34\x07\x30\xda\x42\x46\x0e\xb8\xb7\x2c\xf5\x2f\x4b\x9e\xe7" + "\x64\x81\xa1\xa2\x05\x66\x92\xe6\x75\x9f\x37\xae\x40\xa9\x16" + "\x08\x19\xe8\xdc\x47\xd6\x03\x29\xab\xcc\x58\xa2\x37\x2a\x32" + "\xb8\x15\xc7\x51\x91\x73\xb9\x1d\xc6\xd0\x4f\x85\x86\xd5\xb3" + "\x21\x1a\x2a\x6c\xeb\x7f\xfe\x84\x17\x10\x2d\x0e\xb4\xe1\xc2" + "\x48\x4c\x3f\x61\xc7\x59\x75\xa7\xc1\x75\xce\x67\x17\x42\x2a" + "\x2f\x96\xef\x8a\x2d\x74\xd2\x13\x68\xe1\xe9\xea\xfb\x73\x68" + "\xed\x8d\xd3\xac\x49\x09\xf9\xec\x62\xdf\x53\xab\xfe\x90\x64" + "\x4b\x92\x60\x0d\xdd\x00\xfe\x02\xe6\xf3\x9b\x2b\xac\x4f\x70" + "\xe8\x5b\x69\x9c\x40\xd3\xeb\x37\xad\x6f\x37\xab\xf3\x79\x8e" + "\xcb\x1d\x81\x82\x01\x00\x92\xfd\x66\x5a\x4d\xd4\x8b\xbe\xb0" + "\x59\xea\x29\xfe\xfb\xfa\xc6\x55\x69\xdd\x6a\xee\xff\x2e\xf7" + "\x0a\x04\x2d\x9e\xf0\xc6\xd9\x59\xdd\x23\x1c\xd6\x03\x10\x43" + "\x39\xc4\x7c\x79\x5f\x68\x5c\xf4\xb1\xc9\x08\x97\x41\x7a\x1c" + "\x95\xbb\x97\x31\x65\x74\x7d\x4a\x7c\xf5\xe9\xfc\xfb\x89\x2b" + "\x45\xf8\x1c\xd7\x00\xaa\xad\xaf\x9c\x2c\xe3\x35\x59\x71\xd7" + "\x16\xe0\xac\x9a\x1a\x1d\xd5\x9d\x00\x0b\xc6\x47\xf1\x06\x4a" + "\x0f\x9a\x09\xe3\x44\xf6\xdc\x22\x56\xa7\x53\x02\x29\x64\x5d" + "\x7a\x5d\xdf\x3f\x16\x71\xec\x4e\x78\x48\xbe\x1c\xe9\xf7\xe4" + "\x69\x8c\x25\x16\x6e\x85\xe5\x89\x3b\xf1\x58\x3c\x1b\xa5\x10" + "\xba\x98\x21\x94\x81\x05\xe6\xbc\xc0\xef\x09\xa0\xe2\xf3\xb1" + "\x7e\xd2\x18\x8c\x30\x0f\x3f\xf7\xbd\x36\xef\x16\x65\x7a\x93" + "\xe1\x10\x71\x10\x4d\x52\xe1\x8b\xcf\xc2\xf1\x8c\xbc\x70\x67" + "\xb7\x85\x8c\xde\x98\x74\xd5\x09\x0a\x8f\xce\xd2\x91\xcd\xd6" + "\xc9\xb5\x14\xc8\x36\x41\x4d\x88\x87\xcf\x02\x16\xb3\x8d\xa8" + "\x8f\x1b\xb8\x9b\x0e\x5b\x40\xe9\xe6\x77\x38\x51\xd3\x12\xdf" + "\x1c\xbc\x70\xe2\xeb\x6b\x9e\xaa\xc8\xc2\x1c\x07\x93\x48\x6c" + "\xd4\xba\xfb\x1c\xc6\x57\xaf\xa2\x82\x02\x12\xa0\x82\x02\x0c" + "\xa3\x82\x02\x08\x80\x82\x01\x00\xba\x2c\x3b\x50\xb6\xbf\xf9" + "\x0f\x1d\xd7\x32\x4c\x01\x5f\xff\x2f\x2a\xf6\x33\xd0\xfb\xea" + "\x1f\xa4\xf2\x2d\x22\x8a\x19\x95\xa9\x17\xb7\x4f\x17\xcf\x55" + "\xcd\x1a\x3a\x5f\x07\x73\xcc\xaa\x21\x70\x64\xb3\xa0\xf4\xb7" + "\x30\xa3\x82\x37\x93\xc6\x59\xde\x1b\xa1\x16\x90\x5a\x1a\xf6" + "\x73\xab\x92\xc8\x2f\xf4\x6f\x5c\xf2\x22\x1d\x30\xf8\x03\xd8" + "\x9b\x5f\x73\x72\x8e\x5f\xd5\x37\x4b\x43\xda\xfe\x84\x21\x67" + "\xe8\xe3\xd7\x91\x3f\x24\x1d\xfb\x1f\x12\x6e\xcb\xfc\xb7\x5b" + "\x0a\x35\x73\x3b\xce\x44\x34\x8e\xcd\x53\xa4\xcf\xa7\x63\x73" + "\xcd\x31\x0f\xe0\x75\x8d\xe4\xa9\xdc\xfe\xf0\xc9\x3d\x26\xaf" + "\xbf\x7b\x0f\x0e\x17\xb9\xd0\x4a\x32\x80\x64\x6b\x54\x73\x5a" + "\x50\xc7\x31\x59\xf9\x73\x72\xa5\x79\xba\xdb\xa1\x14\x8d\x77" + "\x67\x3e\xc0\x5b\xec\x6f\x0b\xf7\xc5\xee\x5a\xa6\x8d\x49\x63" + "\x81\xbb\xd1\xf9\x9e\xbb\xed\xb2\xa9\x18\x60\xa7\xee\xeb\x30" + "\xa1\x92\x93\xe8\xd8\x34\x9e\xac\xd6\x23\xfc\x7f\xcb\xe7\xfe" + "\xa7\xe6\x42\xac\x77\x11\xc0\x67\x77\xd1\xaa\x5e\xed\x3b\xd5" + "\xa5\x8d\x34\x7c\xd9\x57\x44\xa7\xc5\x44\x2e\x1e\xe7\x63\xd8" + "\x53\x1b\x9a\xd9\x67\x02\x13\x32\x61\x81\x82\x01\x00\x0d\xf2" + "\x29\x5b\x1f\x63\xa6\x76\x56\xe1\x47\xac\x65\x04\x79\xad\x69" + "\x1e\xd5\x24\xe9\x84\x64\x3c\xd5\x9c\xf4\x16\x78\x57\x32\xcb" + "\x52\xcd\xe5\x62\xab\x37\x1c\x6e\x39\x2d\xaf\x9b\xef\xaa\x30" + "\xc7\x6d\x47\x9f\x37\xb8\x88\xf6\x3f\x5a\x92\x64\xf6\xf4\x93" + "\xb6\xe6\xd2\x7a\xb2\x4a\xc3\xc1\xf6\x37\x7a\xc0\x41\xf0\x91" + "\x0b\x76\x51\x81\x25\x3a\x2b\x45\x8b\x73\xa0\x4c\x57\x56\x6f" + "\xc5\x50\x24\xed\x31\x15\x4c\xd6\x9d\x41\xb5\x98\x46\xdf\x7b" + "\x56\x9e\xe5\xc4\xa8\xce\x86\x3a\x61\xed\xac\xf5\xe7\x68\xed" + "\x99\xf3\x0b\x54\x05\xc5\x9d\x75\x03\x8b\x72\xb7\x03\xb9\x03" + "\x25\x62\x20\x83\x05\x31\x71\x0c\x07\x4a\x0a\x67\x20\xb9\x2d" + "\x30\x13\xda\x53\xe7\xd3\xf1\xc8\x85\x8e\x59\x87\xba\x35\xd5" + "\xca\xc2\x03\xd0\x9d\x5b\x9d\xbb\x09\x79\x02\x00\x65\xeb\x5e" + "\x8c\xb3\xe0\x16\x70\xa8\x5c\xd5\x3b\x66\x1e\x10\x80\x52\xfc" + "\x04\x05\x43\xf4\xea\xae\x6f\xcc\x0b\xc6\x9d\x05\x6a\x53\x50" + "\xc1\x78\x4c\xe4\xdd\xab\xb3\x36\xa4\x4e\xf7\x63\x6e\x50\x02" + "\x56\xc3\x37\xc5\x3c\x8a\x5a\x39\x65\x93\x40\xf0\x99\xa9\x63" + "\x64\xa5\x9a\x56\x63\xcc\x3a\x9b\xb8\xb2\x8e\x51\x5a\xd7\xa1" + "\x00\xa2\x82\x05\x1a\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82" + "\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xb6\x7b\xe2\x98\x9f" + "\xff\x6c\x37\xd0\xb6\x64\x19\xfb\xa0\x21\x18\xe2\xc0\xd1\x92" + "\xbd\x04\xa6\xd2\xb4\x7e\xc6\x6a\x1a\x34\x20\x7b\xfe\x84\xeb" + "\xe8\xc1\x6f\xfd\xdc\x0a\xfe\x60\x55\xb6\xfc\x86\x5a\x21\xbf" + "\xf1\x39\xfa\xec\x42\xca\x57\xb3\x3e\x3f\xe6\x26\x5a\xb7\x4a" + "\x5f\xbb\xb1\xf5\x91\x85\x92\x3e\x6a\x18\x48\x4d\x9e\xdd\x08" + "\x25\xa3\x3b\x3d\x75\x9a\xbe\xee\x0d\x6e\xd2\x5d\xe2\xbd\xed" + "\x45\x60\xef\xa0\x37\xfd\xbb\xcf\x30\x97\xf1\x5b\xc8\x9c\x29" + "\x33\x67\x3e\x23\x33\x7f\x36\xd4\x75\x8b\xa1\xcf\x9e\xe6\xc5" + "\x63\x63\xb0\x3f\xa0\xc2\xa2\x10\xc9\xb2\x6b\xaa\x67\xc9\xf5" + "\xb8\xbf\x5b\x97\xe5\x29\xf2\xbb\xc7\x22\x0f\x1f\xc1\xf6\xca" + "\x4a\x8a\x46\x89\xa0\xca\x4e\x49\x9d\xfc\x23\xd3\xb4\xdb\xc6" + "\x84\x45\xbd\x9f\x10\x86\xe2\xf0\x47\x7b\x75\xbf\x25\x99\x02" + "\x2c\xdb\x6b\xd6\x2b\x67\x0d\xcd\x46\x63\xbd\xce\x1c\xc5\x56" + "\x63\x58\x5b\xc8\xb2\x58\x42\xf6\xaf\xce\x47\xb2\xa9\x2a\x71" + "\x8b\x82\xf4\x72\xff\xef\xe7\xc1\x70\x12\xfa\xb8\xad\xb2\xfe" + "\xa9\x14\xe7\xc2\xec\x12\xbf\x29\x5a\x65\x91\x74\x82\xd3\x77" + "\x1f\x14\xbf\x5f\x41\x11\x6c\x7c\x22\x70\x65\x81\x82\x01\x00" + "\x14\x8e\x1e\x6c\xaa\x0a\x03\x32\x62\xee\xb4\xb2\x3f\xa9\x02" + "\xda\x95\xcc\x90\x0f\xf0\xd1\x97\x21\x8e\xa2\xe2\x53\xd0\x10" + "\x15\x76\xbb\x1d\x41\x6b\x75\x81\x3f\x96\x09\x05\x35\x86\xd2" + "\x0f\x4b\xec\x70\xe0\x1e\x2e\xbc\x6c\xaa\xd7\xf1\xb0\x06\xcc" + "\x88\x21\xf4\xf4\xc2\x5e\x09\x25\x91\xd7\x06\x99\xe4\x9c\x9f" + "\x5b\x0d\x19\xfc\xa2\xe6\xc4\xf3\x35\x68\x22\x64\x3d\x09\x78" + "\xe9\xca\x4f\xbb\xe0\xdc\x6d\x3e\xf9\x69\xca\xdd\x7e\x46\x32" + "\x8d\xd9\x25\xfd\xf8\xea\x79\x0b\x76\x78\x08\xb4\xda\x61\x0e" + "\xdf\xcc\x1c\xcf\x25\xf6\x44\x70\x7d\xcf\x02\x42\x1a\xfb\x82" + "\xda\x6f\xe8\x26\xf8\x69\xd0\x51\xb6\xa1\x37\x57\x48\x2d\x7d" + "\xe6\x77\x43\x5e\xe9\x1b\xe0\xa8\x81\x56\x22\xfa\xa1\x4c\xb6" + "\x42\xef\x1b\x81\x13\x18\x73\xf8\x3f\x2b\x70\xf8\x4c\xa6\xd2" + "\xf2\x33\x43\x0c\x54\x92\x91\xcb\x9a\x6d\xbe\xb1\xe2\xbc\x2d" + "\x8d\x93\x56\x14\x55\xe2\x01\x39\x16\xbf\x32\x66\xe3\xa7\xf1" + "\x95\x76\xe3\x78\x64\xbf\xdb\x74\x25\xe8\x45\x4a\x65\xa7\x57" + "\xce\x82\x38\x00\x7a\xdf\xad\xb9\x9c\x1e\xa0\x95\xcd\xc9\x81" + "\xd0\x73\x4d\x23\x21\x2c\x05\xe5\x4a\x45\x4d\x66\x06\x6c\x4a" + "\x9e\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xaf\x93\xfd\x22\x45\xc2\x08\xab\x43\xf7\x45\x56\x63\xec" + "\xaf\x15\x33\xa0\x2a\xb4\x9e\x15\xb4\x6e\xda\x87\x35\xde\x09" + "\x4b\x06\x31\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x55\xcc\xd1" + "\xa2\x2c\x90\x8d\xe3\x2e\x42\xd4\xe0\x65\xb2\xf7\xda\xc0\x07" + "\x1e\xd3\x23\x0f\xfe\x78\x13\xa2\x86\x61\xc4\x34\x28\x50\x81" + "\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xb5\x8b\xa2" + "\xa1\xc0\x5b\xc3\xa3\x64\xe9\x88\xe3\x25\x89\xa0\x6d\x73\x8a" + "\x46\x09\x58\xb4\x85\x66\x87\x56\x85\x39\xee\x6d\x77\xbb\x99" + "\x57\x90\x0e\x9c\x9c\xd5\x40\xc4\x8b\x37\xb1\xfe\x78\xb7\xe1" + "\xe8\xb7\x74\xee\x74\x9c\xe5\xa3\xdd\xb7\x87\x77\xb7\x14\x08" + "\x71\xc4\xec\x85\xe2\xe3\xc1\x1e\x34\x14\x21\xe1\xac\xd3\x20" + "\x0f\xb8\x11\x24\x69\xa3\x7d\x98\x35\x2a\xdf\x56\x7d\x30\xf7" + "\x31\x64\x73\xcf\x0c\x9e\xa6\x3b\x7d\x93\xb1\xc4\xb6\x78\x39" + "\x52\x3b\x4d\xb6\xb2\x55\x17\x95\x27\xbd\xd6\xc1\x28\x7b\x82" + "\xbb\xeb\xea\xec\x7e\x48\x35\xb3\x4b\x78\x30\xc4\x66\x32\x39" + "\x2d\xd6\x5f\x59\xeb\x81\x64\x68\xdb\x94\xf4\x8e\x5f\x34\x4f" + "\x3b\x03\xe5\xa6\x1b\x30\x6c\xea\xe8\xc6\x36\xf8\xee\x0b\x0f" + "\xb5\xd2\xe7\xa4\x0a\xbc\xef\x80\x7e\xb1\x9b\xda\xe6\x40\x4a" + "\x3f\x6f\xd1\x5a\x64\x84\xb2\x5c\xd2\xf0\x38\x7c\xcb\xd1\xcd" + "\xdd\x37\x3f\x76\xe7\x08\x25\xe5\xd3\xd9\xe3\x21\x1b\x88\x41" + "\x3d\x2d\x32\xff\xd3\xfe\x4d\x40\x85\x1b\x0f\xd6\xab\x4e\xb7" + "\x38\x68\xe9\x67\xc7\xb5\xd1\x38\xdb\x85\x2e\x2f\x76\xea\x4a" + "\xce\xff\x08\x5e\x93\x87\x98\xf7\x95\xeb\x49\xf6\x8d\x81\x82" + "\x01\x00\x55\x1f\x52\x51\xba\x3e\x3e\x57\x23\x69\x73\x99\x3a" + "\x9d\x1f\x75\x23\x59\xac\x29\xdc\x0a\xb9\x04\x9f\x45\x57\xb7" + "\x73\x5f\xef\x33\x22\xfb\x69\x04\x02\x5e\x4a\x32\xee\xd5\x46" + "\xf1\xd5\xf3\xca\x49\x3b\x82\x47\x3f\x36\x6d\x9f\xe1\x7d\xaa" + "\x5c\x2b\x46\x32\x43\x26\xff\xa7\x50\x52\x4f\xff\x8f\xfd\xf9" + "\x4f\xb7\x33\xc1\x52\x43\x0d\x6d\xd5\x5c\x5e\x2c\x24\xc1\x07" + "\xd4\x47\x4b\xdc\x11\x7f\xf3\x48\x1a\xa3\x4d\x35\xfe\x19\x41" + "\xd9\xfe\x63\x83\x1d\x77\xf0\x24\xfd\xed\x84\xd7\x3d\xc2\x58" + "\x64\xa5\xdd\xea\xf3\x46\x2e\x0d\xcc\x2d\xbd\xe0\xdf\x92\x4f" + "\x81\xac\x80\x82\xcd\xf7\x5c\xc7\x03\x49\x18\x16\x8e\xc2\x90" + "\xc4\x09\xee\xf6\x5c\x82\x2a\x45\xd7\xfb\x82\x93\x20\x63\x70" + "\x82\x36\x59\x64\x21\xdb\xdf\xfa\x66\xdb\x02\xee\xeb\x55\xcb" + "\xed\x01\x53\x83\x0c\x1a\x9a\x28\xe4\x0a\xd7\x2b\xc2\xe6\xb8" + "\x1d\x0d\x91\x8a\xc8\x66\x4d\xae\x93\x03\x11\xa8\xdf\x0b\x27" + "\x16\x11\x7a\x0d\x1e\x92\x62\x56\xc7\x6e\x5a\xf9\x80\x75\x96" + "\x46\x93\x05\x62\xad\xf7\xfc\x5e\xd1\x96\x1e\x91\x74\xdd\x0d" + "\xcf\x90\xf9\x75\xaa\xc8\xd8\x2a\xbc\x10\x90\x26\x71\xe8\xc1" + "\xf8\x92\x2f\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\x32\xec\xaa\x5e\xa6\x88\xdc\xe4\x81\x0f\x93\x0f" + "\x65\xde\x87\xfd\x54\x8c\x79\x04\x81\xe3\x63\x3f\x3d\x08\xa1" + "\xba\x0a\x24\x2b\x46\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x40" + "\xd1\x9a\x63\x62\x9b\xc0\x76\xab\x11\x73\x42\x86\xb3\x20\x9d" + "\x23\xe8\x5e\xee\xb9\x82\x5d\x93\xe3\xac\xad\xa0\x40\x41\x51" + "\x1b\x81\x03\x02\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30" + "\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c" + "\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81" + "\x01\x09\xa3\x27\x80\x20\x78\xe3\x04\xf4\xa6\x16\x68\x4c\x1b" + "\xcf\x3a\x32\xff\xbc\x75\x1a\xe6\x08\x9b\xff\xba\x79\xf4\x39" + "\x7a\xfc\xe1\x6f\xff\x3e\xb3\x75\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x0d\xea\xc5\x16\x5c\x62\xb8\xd1\xa4\xe7\x5a\x07\x58" + "\x00\x79\x51\x88\x21\xe9\x4d\xba\x73\x7b\xad\x60\x9c\x5c\x26" + "\x00\x2e\xd1\x51\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xbd\xad\xe0\x0a\xb4\x7b\xee\xc7\x3b\xf0\xd4" + "\x2e\x99\xc9\x5d\x17\xb2\xbf\x67\xa8\xcb\x8b\x26\x24\xa7\x8a" + "\xef\x7d\x50\xd6\xec\x0e\x81\x03\x07\x44\x3a\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\xfa\xc8\x56\x17\x96\x6a" + "\x1d\xd7\xc6\x8e\xb3\x24\xce\x78\x66\xc2\x13\x9f\xe8\x76\xa3" + "\xd8\x40\x8c\x32\xc4\xea\x80\xbd\xdd\xd4\xc4\x81\x03\x01\x08" + "\x3a\x82\x02\x04\x10\xa2\x2b\x80\x20\x65\xf4\x40\x85\xdb\x45" + "\xe6\x70\x4f\xea\x50\xb1\x1f\x52\x95\x31\xa0\xaa\xbc\x0a\x38" + "\x50\xef\xb8\x18\x9b\x69\x80\xc2\xb0\xb1\xea\x81\x03\x04\x24" + "\x00\x82\x02\x03\x98\xa2\x2b\x80\x20\x8a\x64\x29\x50\xef\xe8" + "\x27\x2b\xb4\x67\x7a\x9c\x43\x7a\x57\x15\xf0\x1a\x03\x82\x05" + "\x69\x6d\xf5\x71\x02\xdf\x09\x48\x2b\x36\x94\x81\x03\x01\x04" + "\x00\x82\x02\x04\x10\xa3\x27\x80\x20\x78\xe3\x04\xf4\xa6\x16" + "\x68\x4c\x1b\xcf\x3a\x32\xff\xbc\x75\x1a\xe6\x08\x9b\xff\xba" + "\x79\xf4\x39\x7a\xfc\xe1\x6f\xff\x3e\xb3\x75\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c\x62\xb8\xd1\xa4\xe7" + "\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d\xba\x73\x7b\xad\x60" + "\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh41() + { + testcase("Thresh41"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim6Cond + // ** Rsa7Cond + // ** Ed8Cond + // ** Prefix9Cond + // ** Thresh12Cond + // ** thresh1 + // *** rsa2 + // ** preim3 + // ** rsa4 + // ** ed5 + + auto const rsa2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa2PublicKey{ + {0xba, 0x2c, 0x3b, 0x50, 0xb6, 0xbf, 0xf9, 0x0f, 0x1d, 0xd7, 0x32, + 0x4c, 0x01, 0x5f, 0xff, 0x2f, 0x2a, 0xf6, 0x33, 0xd0, 0xfb, 0xea, + 0x1f, 0xa4, 0xf2, 0x2d, 0x22, 0x8a, 0x19, 0x95, 0xa9, 0x17, 0xb7, + 0x4f, 0x17, 0xcf, 0x55, 0xcd, 0x1a, 0x3a, 0x5f, 0x07, 0x73, 0xcc, + 0xaa, 0x21, 0x70, 0x64, 0xb3, 0xa0, 0xf4, 0xb7, 0x30, 0xa3, 0x82, + 0x37, 0x93, 0xc6, 0x59, 0xde, 0x1b, 0xa1, 0x16, 0x90, 0x5a, 0x1a, + 0xf6, 0x73, 0xab, 0x92, 0xc8, 0x2f, 0xf4, 0x6f, 0x5c, 0xf2, 0x22, + 0x1d, 0x30, 0xf8, 0x03, 0xd8, 0x9b, 0x5f, 0x73, 0x72, 0x8e, 0x5f, + 0xd5, 0x37, 0x4b, 0x43, 0xda, 0xfe, 0x84, 0x21, 0x67, 0xe8, 0xe3, + 0xd7, 0x91, 0x3f, 0x24, 0x1d, 0xfb, 0x1f, 0x12, 0x6e, 0xcb, 0xfc, + 0xb7, 0x5b, 0x0a, 0x35, 0x73, 0x3b, 0xce, 0x44, 0x34, 0x8e, 0xcd, + 0x53, 0xa4, 0xcf, 0xa7, 0x63, 0x73, 0xcd, 0x31, 0x0f, 0xe0, 0x75, + 0x8d, 0xe4, 0xa9, 0xdc, 0xfe, 0xf0, 0xc9, 0x3d, 0x26, 0xaf, 0xbf, + 0x7b, 0x0f, 0x0e, 0x17, 0xb9, 0xd0, 0x4a, 0x32, 0x80, 0x64, 0x6b, + 0x54, 0x73, 0x5a, 0x50, 0xc7, 0x31, 0x59, 0xf9, 0x73, 0x72, 0xa5, + 0x79, 0xba, 0xdb, 0xa1, 0x14, 0x8d, 0x77, 0x67, 0x3e, 0xc0, 0x5b, + 0xec, 0x6f, 0x0b, 0xf7, 0xc5, 0xee, 0x5a, 0xa6, 0x8d, 0x49, 0x63, + 0x81, 0xbb, 0xd1, 0xf9, 0x9e, 0xbb, 0xed, 0xb2, 0xa9, 0x18, 0x60, + 0xa7, 0xee, 0xeb, 0x30, 0xa1, 0x92, 0x93, 0xe8, 0xd8, 0x34, 0x9e, + 0xac, 0xd6, 0x23, 0xfc, 0x7f, 0xcb, 0xe7, 0xfe, 0xa7, 0xe6, 0x42, + 0xac, 0x77, 0x11, 0xc0, 0x67, 0x77, 0xd1, 0xaa, 0x5e, 0xed, 0x3b, + 0xd5, 0xa5, 0x8d, 0x34, 0x7c, 0xd9, 0x57, 0x44, 0xa7, 0xc5, 0x44, + 0x2e, 0x1e, 0xe7, 0x63, 0xd8, 0x53, 0x1b, 0x9a, 0xd9, 0x67, 0x02, + 0x13, 0x32, 0x61}}; + std::array const rsa2Sig{ + {0x20,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 0x03, 0x39, 0xf2, 0x1d, 0xce, + 0x9a, 0xd8, 0xa8, 0xa3, 0x37, 0x79, 0x30, 0x1a, 0x85, 0x9f, 0x12, + 0xce, 0x7e, 0xc2, 0x0f, 0x71, 0xcd, 0xd4, 0x67, 0xb6, 0xe8, 0xd4, + 0x0b, 0xff, 0x41, 0xc6, 0x78, 0x05, 0xf7, 0x3b, 0xaa, 0x38, 0xc5, + 0x4b, 0xe4, 0xbc, 0x61, 0x1d, 0xaa, 0x39, 0x08, 0xf8, 0xd1, 0x56, + 0x04, 0x14, 0x29, 0x0b, 0xd8, 0x60, 0x02, 0x10, 0xa0, 0xb9, 0xd2, + 0xfb, 0xbc, 0xfc, 0x5f, 0xe3, 0x3a, 0x6d, 0x76, 0xbd, 0xb2, 0x41, + 0xd6, 0x4e, 0x93}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x9f, 0x9f, 0xc1, 0xfa, 0x56, 0xc7, 0x56, 0xb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, 0xef, 0xd6, 0x16, 0x4b, 0x26, 0xb0, 0x8b, 0x79, 0xc5, 0x55, + 0x45, 0x65, 0xf8, 0x37, 0x1f, 0x1e, 0x8d, 0xc8, 0xd1, 0x79, 0x1a, + 0x6c, 0x0c, 0xb6, 0x61, 0x0c, 0xe3, 0xe0, 0x91, 0xcb, 0x9d, 0xf7, + 0x18, 0x3d, 0xf5, 0x51, 0x40, 0x8e, 0xec, 0x82, 0x64, 0xc5, 0xa3, + 0xae, 0x6e, 0x16, 0x5e, 0xf2, 0xca, 0xaa, 0x4b, 0xf6, 0xf6, 0xd7, + 0xfe, 0x66, 0x17, 0x5f, 0x61, 0x40, 0x28, 0xf6, 0x95, 0xae, 0xb2, + 0xcc, 0x25, 0x1c}}; + auto const ed5Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed5PublicKey{ + {0xae, 0xbc, 0xe5, 0x4b, 0x88, 0x09, 0x8d, 0x4f, 0xc4, 0xe1, 0x22, + 0xa0, 0x7c, 0x41, 0x05, 0xd7, 0x9f, 0xbe, 0xc8, 0x3d, 0x1d, 0x7e, + 0xd6, 0x55, 0xf4, 0x01, 0x67, 0x68, 0x93, 0x55, 0x85, 0xdf}}; + std::array const ed5Sig{ + {0x30, 0xe8, 0x22, 0x9b, 0x51, 0x8c, 0xaa, 0x86, 0x9b, 0xd0, 0xb2, + 0x06, 0xe0, 0xf0, 0xf2, 0xc0, 0x87, 0x43, 0x0f, 0xb0, 0xbd, 0xe1, + 0xeb, 0x17, 0x7f, 0x85, 0xe8, 0x79, 0xc6, 0xa2, 0x9d, 0x19, 0x17, + 0x07, 0x7e, 0x56, 0x06, 0xcb, 0x5a, 0xe1, 0xca, 0x36, 0x5c, 0x0a, + 0xb5, 0x81, 0x2a, 0x42, 0xf6, 0xcc, 0x6e, 0x04, 0xe2, 0x61, 0x8b, + 0x12, 0x16, 0xc2, 0x36, 0xfc, 0xd5, 0xd8, 0xfc, 0x0c}}; + std::array const ed5SigningKey{ + {0x42, 0x67, 0x67, 0xc0, 0xba, 0xdf, 0xb4, 0xd3, 0xf5, 0xc5, 0x1f, + 0x71, 0x97, 0x8a, 0xb4, 0x8e, 0x9a, 0xea, 0x3e, 0xec, 0xaf, 0xdc, + 0xc7, 0x2b, 0x01, 0x1b, 0x06, 0x8f, 0x05, 0x56, 0x63, 0xbc}}; + (void)ed5SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim6CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim6Cond{Type::preimageSha256, + 9, + Preim6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa7CondConditionFingerprint = { + {0x6c, 0x7b, 0xea, 0x83, 0xa1, 0xf4, 0x82, 0x3d, 0x36, 0xe7, 0x6e, + 0xae, 0x1a, 0xbc, 0xa0, 0xba, 0x90, 0x3d, 0x96, 0xc1, 0xe6, 0xad, + 0x3a, 0x47, 0xa5, 0xcb, 0x88, 0xab, 0x3c, 0x5f, 0xcc, 0xd5}}; + Condition const Rsa7Cond{Type::rsaSha256, + 65536, + Rsa7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed8CondConditionFingerprint = { + {0xf1, 0x68, 0x96, 0xa6, 0x2e, 0xef, 0x7f, 0x47, 0x06, 0x51, 0x4c, + 0xc6, 0x7e, 0x24, 0xf7, 0x29, 0x84, 0x9c, 0xd6, 0xb0, 0xd9, 0x4b, + 0xd9, 0x0f, 0xc9, 0x34, 0x01, 0x9d, 0x92, 0xeb, 0xbc, 0x0a}}; + Condition const Ed8Cond{Type::ed25519Sha256, + 131072, + Ed8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix9CondConditionFingerprint = { + {0x24, 0xa5, 0x41, 0xb4, 0xf9, 0x99, 0x61, 0x68, 0x06, 0xb4, 0x3f, + 0x7a, 0xc1, 0x5d, 0xc0, 0x89, 0xa6, 0x3d, 0x3b, 0x35, 0x7f, 0xc9, + 0x9a, 0xda, 0x7f, 0xff, 0x8b, 0xf6, 0xe7, 0xed, 0xa1, 0xd2}}; + Condition const Prefix9Cond{Type::prefixSha256, + 67619, + Prefix9CondConditionFingerprint, + std::bitset<5>{8}}; + std::array const Thresh12CondConditionFingerprint = { + {0xe0, 0x26, 0x19, 0x16, 0x42, 0xd0, 0x79, 0x91, 0x2a, 0x7c, 0xc1, + 0x43, 0x2e, 0xd8, 0xed, 0xef, 0x8d, 0x7b, 0xfa, 0x68, 0x5b, 0x65, + 0x3e, 0x14, 0xb6, 0x54, 0xac, 0xe7, 0x54, 0x67, 0x5d, 0x16}}; + Condition const Thresh12Cond{Type::thresholdSha256, + 271360, + Thresh12CondConditionFingerprint, + std::bitset<5>{25}}; + + auto rsa2 = std::make_unique( + makeSlice(rsa2PublicKey), makeSlice(rsa2Sig)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(rsa2)); + std::vector thresh1Subconditions{}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + auto ed5 = std::make_unique(ed5PublicKey, ed5Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim3)); + thresh0Subfulfillments.emplace_back(std::move(rsa4)); + thresh0Subfulfillments.emplace_back(std::move(ed5)); + std::vector thresh0Subconditions{ + {Preim6Cond, Rsa7Cond, Ed8Cond, Prefix9Cond, Thresh12Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x6f\xa0\x82\x04\x95\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x82\x02\x12\xa0\x82\x02\x0c\xa3" + "\x82\x02\x08\x80\x82\x01\x00\xba\x2c\x3b\x50\xb6\xbf\xf9\x0f" + "\x1d\xd7\x32\x4c\x01\x5f\xff\x2f\x2a\xf6\x33\xd0\xfb\xea\x1f" + "\xa4\xf2\x2d\x22\x8a\x19\x95\xa9\x17\xb7\x4f\x17\xcf\x55\xcd" + "\x1a\x3a\x5f\x07\x73\xcc\xaa\x21\x70\x64\xb3\xa0\xf4\xb7\x30" + "\xa3\x82\x37\x93\xc6\x59\xde\x1b\xa1\x16\x90\x5a\x1a\xf6\x73" + "\xab\x92\xc8\x2f\xf4\x6f\x5c\xf2\x22\x1d\x30\xf8\x03\xd8\x9b" + "\x5f\x73\x72\x8e\x5f\xd5\x37\x4b\x43\xda\xfe\x84\x21\x67\xe8" + "\xe3\xd7\x91\x3f\x24\x1d\xfb\x1f\x12\x6e\xcb\xfc\xb7\x5b\x0a" + "\x35\x73\x3b\xce\x44\x34\x8e\xcd\x53\xa4\xcf\xa7\x63\x73\xcd" + "\x31\x0f\xe0\x75\x8d\xe4\xa9\xdc\xfe\xf0\xc9\x3d\x26\xaf\xbf" + "\x7b\x0f\x0e\x17\xb9\xd0\x4a\x32\x80\x64\x6b\x54\x73\x5a\x50" + "\xc7\x31\x59\xf9\x73\x72\xa5\x79\xba\xdb\xa1\x14\x8d\x77\x67" + "\x3e\xc0\x5b\xec\x6f\x0b\xf7\xc5\xee\x5a\xa6\x8d\x49\x63\x81" + "\xbb\xd1\xf9\x9e\xbb\xed\xb2\xa9\x18\x60\xa7\xee\xeb\x30\xa1" + "\x92\x93\xe8\xd8\x34\x9e\xac\xd6\x23\xfc\x7f\xcb\xe7\xfe\xa7" + "\xe6\x42\xac\x77\x11\xc0\x67\x77\xd1\xaa\x5e\xed\x3b\xd5\xa5" + "\x8d\x34\x7c\xd9\x57\x44\xa7\xc5\x44\x2e\x1e\xe7\x63\xd8\x53" + "\x1b\x9a\xd9\x67\x02\x13\x32\x61\x81\x82\x01\x00\x20\xf4\x70" + "\xa6\xbe\x95\xce\x6a\xc0\x41\x0c\xce\x39\x97\x85\x9c\xf8\x22" + "\xc4\x9f\x49\x86\x4a\x7e\xd9\x30\xc0\xef\xf0\x97\xa0\xa5\x43" + "\xce\x2e\x58\xb4\x5f\xb3\xac\x1e\xb2\xb7\x78\xa5\x25\xfa\xe8" + "\x09\x7f\xdf\xd3\xe9\x81\x6d\x0b\xd0\xc7\xe7\x5e\xbd\xea\x7f" + "\xae\x4b\xa2\xbf\xc1\xf2\x22\xbc\x93\x8e\x09\x25\x65\xb5\x75" + "\x4f\xe7\x13\x85\x0e\x43\x89\x5e\x06\x18\xc5\x45\xa9\x5e\xc1" + "\x13\x4e\xfe\x23\xe1\xe8\x71\x18\xc2\x98\x31\xf5\xee\x10\xf6" + "\x74\x9f\xd2\x7e\x75\x92\x1f\xe3\x0d\xb4\x00\x59\x02\x2a\x86" + "\x9f\x67\x87\x51\x60\xda\x96\x83\x28\x17\xbe\x85\xbc\xc8\xfd" + "\xcf\x28\x95\x42\x21\xbc\x2c\x2f\xae\x79\x37\x1a\xbc\xad\x0b" + "\xf6\x84\xa4\xf5\xd8\xf9\x78\x0b\x3f\x7c\x02\x9e\x83\xe8\x1f" + "\x23\xc5\x4c\xd6\x7b\x7c\xf5\x0f\x4d\x63\xd3\x91\x11\xfc\x03" + "\x39\xf2\x1d\xce\x9a\xd8\xa8\xa3\x37\x79\x30\x1a\x85\x9f\x12" + "\xce\x7e\xc2\x0f\x71\xcd\xd4\x67\xb6\xe8\xd4\x0b\xff\x41\xc6" + "\x78\x05\xf7\x3b\xaa\x38\xc5\x4b\xe4\xbc\x61\x1d\xaa\x39\x08" + "\xf8\xd1\x56\x04\x14\x29\x0b\xd8\x60\x02\x10\xa0\xb9\xd2\xfb" + "\xbc\xfc\x5f\xe3\x3a\x6d\x76\xbd\xb2\x41\xd6\x4e\x93\xa1\x00" + "\xa3\x82\x02\x08\x80\x82\x01\x00\xbe\x09\xc5\xa4\x27\x29\xdf" + "\xd4\x67\x76\xbe\xbf\x2c\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67" + "\x20\xfb\x7a\x27\x93\xc0\x78\x47\x78\xd7\x15\x32\xee\x38\x81" + "\x0d\x36\xa2\xc4\x65\x44\xe6\x62\x26\xb9\x58\x13\xa4\x15\x82" + "\xab\xb1\x16\x61\xfc\x01\x98\xc6\x1a\x69\xc6\xba\x39\x3f\x01" + "\x55\x3d\xd7\x8e\x14\x42\x6d\x78\x74\x9b\x28\xcb\x31\x39\x98" + "\x5a\x11\xdc\xc1\x18\x9d\x8d\xb0\xcd\x1b\x4c\x10\xab\x14\x64" + "\x19\xf1\x33\x15\x45\xc8\x92\x82\x03\x82\x8a\xaa\xad\x94\xfc" + "\x24\x11\x96\x99\x7e\x94\x5a\x82\x57\x68\x61\x9f\x7b\x45\xe0" + "\x99\x9e\x4f\x32\x50\x5f\x05\xc8\x11\xae\xc4\x0c\x63\x18\x0e" + "\x02\x59\x36\x25\x92\x06\x32\xc7\x71\x47\x99\xcc\x0a\x6e\x0a" + "\x58\x71\x3f\x5e\xb7\x78\xf7\x98\x79\xdf\x74\xa4\xeb\xa9\x00" + "\xfd\x81\xb3\xcf\x04\x8c\x5d\x7d\xe7\xb2\x82\x90\x49\xbd\x69" + "\xf3\x08\xe9\x92\xc6\x9e\x41\xba\x74\xd8\x8d\x81\x97\x6f\x86" + "\xab\xc9\xf1\x02\x31\xb4\xce\x47\xb0\x39\xc8\xba\x51\xa7\x39" + "\xf3\x71\xa2\x25\x27\x37\x6e\x09\x6f\x19\x59\xbc\x65\xd9\xcd" + "\x12\xd3\x2c\xa2\x78\xfa\x23\x15\x1a\x82\x41\x91\x1b\xbe\x8a" + "\xe7\xfe\x3c\x3c\x30\x32\xaa\xe9\xf3\x81\x82\x01\x00\x9f\x9f" + "\xc1\xfa\x56\xc7\x56\xbb\xe7\x2f\x9c\x2c\xb2\x69\xa7\x70\x0c" + "\x31\x4f\xf2\x54\xa3\x0e\xb4\xb9\x5c\xf0\x06\x2e\xf2\xac\x0f" + "\xdc\x15\x93\x02\x86\x5e\x46\xec\xb8\x41\x8b\x57\x72\xae\x63" + "\x3b\xa6\x4b\xf2\x99\x8c\xee\xfd\xde\x69\x3d\xc0\x18\xf7\x5a" + "\x95\xab\xdd\x05\xec\x39\x0d\xcd\x3c\x32\x6f\x7c\xd1\x6b\x58" + "\x75\x72\xdd\xb4\x28\xf5\x9b\x37\xb7\x5f\xdb\x54\x44\xbe\x9d" + "\x31\x6d\xbb\xa7\xd8\x61\x97\xd2\xf2\xda\x35\x1a\x26\x8c\x23" + "\x7b\xd9\x75\xcc\x62\xe4\xf8\x3f\xe8\xde\x15\xf8\x49\xbe\x70" + "\xd4\xa4\xfa\x67\x83\xcc\xbc\x59\x7a\xb3\xb7\x63\x30\x26\xfc" + "\x79\xa6\x12\x60\x7c\x12\xa5\xce\xb4\x2d\xa0\xa4\xcf\xe6\x45" + "\xd6\x90\xc1\x0d\x2d\xc1\xba\x1c\x57\x31\xe1\xc1\x21\xcb\x57" + "\xbd\x52\x95\xe9\x1c\x02\xa1\x1b\x67\xb2\x65\xa9\x92\x55\xe7" + "\x4f\xf6\xc1\x44\xaf\x1e\xef\xd6\x16\x4b\x26\xb0\x8b\x79\xc5" + "\x55\x45\x65\xf8\x37\x1f\x1e\x8d\xc8\xd1\x79\x1a\x6c\x0c\xb6" + "\x61\x0c\xe3\xe0\x91\xcb\x9d\xf7\x18\x3d\xf5\x51\x40\x8e\xec" + "\x82\x64\xc5\xa3\xae\x6e\x16\x5e\xf2\xca\xaa\x4b\xf6\xf6\xd7" + "\xfe\x66\x17\x5f\x61\x40\x28\xf6\x95\xae\xb2\xcc\x25\x1c\xa4" + "\x64\x80\x20\xae\xbc\xe5\x4b\x88\x09\x8d\x4f\xc4\xe1\x22\xa0" + "\x7c\x41\x05\xd7\x9f\xbe\xc8\x3d\x1d\x7e\xd6\x55\xf4\x01\x67" + "\x68\x93\x55\x85\xdf\x81\x40\x30\xe8\x22\x9b\x51\x8c\xaa\x86" + "\x9b\xd0\xb2\x06\xe0\xf0\xf2\xc0\x87\x43\x0f\xb0\xbd\xe1\xeb" + "\x17\x7f\x85\xe8\x79\xc6\xa2\x9d\x19\x17\x07\x7e\x56\x06\xcb" + "\x5a\xe1\xca\x36\x5c\x0a\xb5\x81\x2a\x42\xf6\xcc\x6e\x04\xe2" + "\x61\x8b\x12\x16\xc2\x36\xfc\xd5\xd8\xfc\x0c\xa1\x81\xd3\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x24\xa5\x41" + "\xb4\xf9\x99\x61\x68\x06\xb4\x3f\x7a\xc1\x5d\xc0\x89\xa6\x3d" + "\x3b\x35\x7f\xc9\x9a\xda\x7f\xff\x8b\xf6\xe7\xed\xa1\xd2\x81" + "\x03\x01\x08\x23\x82\x02\x04\x10\xa2\x2b\x80\x20\xe0\x26\x19" + "\x16\x42\xd0\x79\x91\x2a\x7c\xc1\x43\x2e\xd8\xed\xef\x8d\x7b" + "\xfa\x68\x5b\x65\x3e\x14\xb6\x54\xac\xe7\x54\x67\x5d\x16\x81" + "\x03\x04\x24\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x6c\x7b\xea" + "\x83\xa1\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba\x90\x3d" + "\x96\xc1\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc\xd5\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f" + "\x47\x06\x51\x4c\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b" + "\xd9\x0f\xc9\x34\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x70\x3d\x21\xea\x4a\x87\xa7\x69\x49\xd3\x48" + "\x9b\x4a\x2d\xa8\xd6\x76\xa2\x93\x50\xbe\x59\x36\x46\x00\x42" + "\x0b\x7d\xb6\x98\x0e\x4a\x81\x03\x09\x50\x23\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x24\xa5\x41\xb4\xf9\x99\x61\x68\x06\xb4\x3f\x7a" + "\xc1\x5d\xc0\x89\xa6\x3d\x3b\x35\x7f\xc9\x9a\xda\x7f\xff\x8b" + "\xf6\xe7\xed\xa1\xd2\x81\x03\x01\x08\x23\x82\x02\x04\x10\xa2" + "\x2b\x80\x20\x8a\x64\x29\x50\xef\xe8\x27\x2b\xb4\x67\x7a\x9c" + "\x43\x7a\x57\x15\xf0\x1a\x03\x82\x05\x69\x6d\xf5\x71\x02\xdf" + "\x09\x48\x2b\x36\x94\x81\x03\x01\x04\x00\x82\x02\x04\x10\xa2" + "\x2b\x80\x20\xe0\x26\x19\x16\x42\xd0\x79\x91\x2a\x7c\xc1\x43" + "\x2e\xd8\xed\xef\x8d\x7b\xfa\x68\x5b\x65\x3e\x14\xb6\x54\xac" + "\xe7\x54\x67\x5d\x16\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x3a\x82\x3b\x32\x38\xb1\x3c\x17\x87\x60\x62\xec" + "\xcf\x91\xb0\xaf\xaa\xe5\x11\xe6\xfb\xe2\xb0\x3d\x70\x4d\x1d" + "\xad\xd6\x7c\xee\xa6\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x6c" + "\x7b\xea\x83\xa1\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba" + "\x90\x3d\x96\xc1\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc" + "\xd5\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x90\xce\xed\x45\x98" + "\x68\xff\x19\x2b\x27\xc1\x2a\xa2\x6e\x2e\x82\xf3\xbd\x71\x13" + "\x61\xb0\x76\x40\x4d\x48\xea\x16\xfb\x27\x57\xdc\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06" + "\x51\x4c\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f" + "\xc9\x34\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh42() + { + testcase("Thresh42"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim25Cond + // ** Rsa26Cond + // ** Ed27Cond + // ** thresh1 + // *** Preim3Cond + // *** Rsa4Cond + // *** Ed5Cond + // *** rsa2 + // ** prefix6 + // *** prefix7 + // **** prefix8 + // ***** rsa9 + // ** thresh10 + // *** Preim17Cond + // *** Rsa18Cond + // *** Ed19Cond + // *** Thresh20Cond + // *** rsa11 + // *** thresh12 + // **** Preim14Cond + // **** Rsa15Cond + // **** Ed16Cond + // **** rsa13 + + auto const rsa2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa2PublicKey{ + {0xba, 0x2c, 0x3b, 0x50, 0xb6, 0xbf, 0xf9, 0x0f, 0x1d, 0xd7, 0x32, + 0x4c, 0x01, 0x5f, 0xff, 0x2f, 0x2a, 0xf6, 0x33, 0xd0, 0xfb, 0xea, + 0x1f, 0xa4, 0xf2, 0x2d, 0x22, 0x8a, 0x19, 0x95, 0xa9, 0x17, 0xb7, + 0x4f, 0x17, 0xcf, 0x55, 0xcd, 0x1a, 0x3a, 0x5f, 0x07, 0x73, 0xcc, + 0xaa, 0x21, 0x70, 0x64, 0xb3, 0xa0, 0xf4, 0xb7, 0x30, 0xa3, 0x82, + 0x37, 0x93, 0xc6, 0x59, 0xde, 0x1b, 0xa1, 0x16, 0x90, 0x5a, 0x1a, + 0xf6, 0x73, 0xab, 0x92, 0xc8, 0x2f, 0xf4, 0x6f, 0x5c, 0xf2, 0x22, + 0x1d, 0x30, 0xf8, 0x03, 0xd8, 0x9b, 0x5f, 0x73, 0x72, 0x8e, 0x5f, + 0xd5, 0x37, 0x4b, 0x43, 0xda, 0xfe, 0x84, 0x21, 0x67, 0xe8, 0xe3, + 0xd7, 0x91, 0x3f, 0x24, 0x1d, 0xfb, 0x1f, 0x12, 0x6e, 0xcb, 0xfc, + 0xb7, 0x5b, 0x0a, 0x35, 0x73, 0x3b, 0xce, 0x44, 0x34, 0x8e, 0xcd, + 0x53, 0xa4, 0xcf, 0xa7, 0x63, 0x73, 0xcd, 0x31, 0x0f, 0xe0, 0x75, + 0x8d, 0xe4, 0xa9, 0xdc, 0xfe, 0xf0, 0xc9, 0x3d, 0x26, 0xaf, 0xbf, + 0x7b, 0x0f, 0x0e, 0x17, 0xb9, 0xd0, 0x4a, 0x32, 0x80, 0x64, 0x6b, + 0x54, 0x73, 0x5a, 0x50, 0xc7, 0x31, 0x59, 0xf9, 0x73, 0x72, 0xa5, + 0x79, 0xba, 0xdb, 0xa1, 0x14, 0x8d, 0x77, 0x67, 0x3e, 0xc0, 0x5b, + 0xec, 0x6f, 0x0b, 0xf7, 0xc5, 0xee, 0x5a, 0xa6, 0x8d, 0x49, 0x63, + 0x81, 0xbb, 0xd1, 0xf9, 0x9e, 0xbb, 0xed, 0xb2, 0xa9, 0x18, 0x60, + 0xa7, 0xee, 0xeb, 0x30, 0xa1, 0x92, 0x93, 0xe8, 0xd8, 0x34, 0x9e, + 0xac, 0xd6, 0x23, 0xfc, 0x7f, 0xcb, 0xe7, 0xfe, 0xa7, 0xe6, 0x42, + 0xac, 0x77, 0x11, 0xc0, 0x67, 0x77, 0xd1, 0xaa, 0x5e, 0xed, 0x3b, + 0xd5, 0xa5, 0x8d, 0x34, 0x7c, 0xd9, 0x57, 0x44, 0xa7, 0xc5, 0x44, + 0x2e, 0x1e, 0xe7, 0x63, 0xd8, 0x53, 0x1b, 0x9a, 0xd9, 0x67, 0x02, + 0x13, 0x32, 0x61}}; + std::array const rsa2Sig{ + {0x4f, 0x1a, 0xea, 0x70, 0xb4, 0x79, 0xb0, 0x82, 0xcb, 0x4f, 0x2a, + 0xa1, 0x6b, 0x73, 0xc5, 0x7c, 0xdc, 0x42, 0x53, 0x6b, 0x30, 0xa0, + 0x88, 0x9f, 0xdd, 0xa1, 0xda, 0xf5, 0xcd, 0x82, 0x77, 0x72, 0x20, + 0xfb, 0xd7, 0x2f, 0xcd, 0x38, 0x09, 0x87, 0x11, 0x9c, 0xba, 0xa1, + 0x93, 0x91, 0xc2, 0x9e, 0x8d, 0xa6, 0xaf, 0x3f, 0x57, 0xf4, 0x9c, + 0x0f, 0xc1, 0xaf, 0x6c, 0xf3, 0xfc, 0xa0, 0x17, 0x4d, 0xec, 0x00, + 0x74, 0x37, 0xbc, 0xc6, 0x57, 0xc9, 0xe5, 0x5d, 0xca, 0x47, 0xb1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; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim3CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim3Cond{Type::preimageSha256, + 9, + Preim3CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa4CondConditionFingerprint = { + {0x3a, 0x82, 0x3b, 0x32, 0x38, 0xb1, 0x3c, 0x17, 0x87, 0x60, 0x62, + 0xec, 0xcf, 0x91, 0xb0, 0xaf, 0xaa, 0xe5, 0x11, 0xe6, 0xfb, 0xe2, + 0xb0, 0x3d, 0x70, 0x4d, 0x1d, 0xad, 0xd6, 0x7c, 0xee, 0xa6}}; + Condition const Rsa4Cond{Type::rsaSha256, + 65536, + Rsa4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed5CondConditionFingerprint = { + {0x90, 0xce, 0xed, 0x45, 0x98, 0x68, 0xff, 0x19, 0x2b, 0x27, 0xc1, + 0x2a, 0xa2, 0x6e, 0x2e, 0x82, 0xf3, 0xbd, 0x71, 0x13, 0x61, 0xb0, + 0x76, 0x40, 0x4d, 0x48, 0xea, 0x16, 0xfb, 0x27, 0x57, 0xdc}}; + Condition const Ed5Cond{Type::ed25519Sha256, + 131072, + Ed5CondConditionFingerprint, + std::bitset<5>{0}}; + auto const rsa9Msg = "P8P7P6abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa9PublicKey{ + {0xb6, 0x7b, 0xe2, 0x98, 0x9f, 0xff, 0x6c, 0x37, 0xd0, 0xb6, 0x64, + 0x19, 0xfb, 0xa0, 0x21, 0x18, 0xe2, 0xc0, 0xd1, 0x92, 0xbd, 0x04, + 0xa6, 0xd2, 0xb4, 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 0xb2, 0x58, 0x42, 0xf6, 0xaf, + 0xce, 0x47, 0xb2, 0xa9, 0x2a, 0x71, 0x8b, 0x82, 0xf4, 0x72, 0xff, + 0xef, 0xe7, 0xc1, 0x70, 0x12, 0xfa, 0xb8, 0xad, 0xb2, 0xfe, 0xa9, + 0x14, 0xe7, 0xc2, 0xec, 0x12, 0xbf, 0x29, 0x5a, 0x65, 0x91, 0x74, + 0x82, 0xd3, 0x77, 0x1f, 0x14, 0xbf, 0x5f, 0x41, 0x11, 0x6c, 0x7c, + 0x22, 0x70, 0x65}}; + std::array const rsa9Sig{ + {0x24, 0x63, 0x02, 0x0d, 0xf3, 0x41, 0x78, 0x17, 0x0d, 0xb0, 0xdc, + 0x80, 0xa0, 0x09, 0x29, 0xf9, 0x74, 0xc9, 0xcc, 0xb9, 0x70, 0x0e, + 0xc1, 0x7d, 0xe5, 0x16, 0x36, 0xe3, 0xe5, 0x5f, 0x66, 0xbb, 0x4d, + 0xea, 0x74, 0x83, 0x3d, 0x4d, 0xcc, 0x5b, 0x6a, 0xe5, 0x1c, 0xeb, + 0xc2, 0xd2, 0xf6, 0x22, 0x1a, 0x30, 0x52, 0x85, 0xd6, 0x93, 0xfd, + 0x4e, 0xba, 0xec, 0x47, 0xe3, 0x94, 0xa1, 0x91, 0x7f, 0xee, 0x5e, + 0x2e, 0xef, 0x26, 0x73, 0xf8, 0x12, 0x19, 0x96, 0x2b, 0xec, 0x60, + 0x7f, 0x1c, 0x95, 0x63, 0xf7, 0x0d, 0xed, 0x68, 0x0f, 0xea, 0x1c, + 0xe3, 0x08, 0xcb, 0xe4, 0xe7, 0x8b, 0x79, 0x31, 0x17, 0x0f, 0x04, + 0xf4, 0xaa, 0x0c, 0xcc, 0x60, 0xdc, 0x80, 0xc5, 0x2d, 0x2b, 0x6a, + 0x1a, 0x92, 0x1e, 0x82, 0xdb, 0xb8, 0x1f, 0x92, 0x78, 0xad, 0xb1, + 0xfe, 0x8b, 0xe3, 0x00, 0x2c, 0x1c, 0xf8, 0xab, 0xa0, 0xbd, 0x4c, + 0xc5, 0xc0, 0x2e, 0x45, 0x1e, 0xe3, 0x22, 0x07, 0x44, 0xd0, 0x73, + 0x94, 0x69, 0x51, 0x97, 0xa3, 0xea, 0x53, 0x38, 0x85, 0x49, 0x6e, + 0xec, 0x3a, 0x6c, 0x6c, 0x35, 0xd8, 0xa0, 0xf3, 0x92, 0x83, 0xdb, + 0xe9, 0x4e, 0x1c, 0xc0, 0xc2, 0x19, 0x73, 0x78, 0xf1, 0x13, 0x63, + 0xee, 0xed, 0xe1, 0x1d, 0xc9, 0x07, 0x24, 0x5b, 0xc4, 0x3c, 0x19, + 0x11, 0xb9, 0x42, 0xfe, 0x3a, 0x4c, 0x57, 0x30, 0x75, 0x62, 0xce, + 0x8f, 0x8e, 0x53, 0x18, 0x3a, 0x2b, 0xaf, 0x6e, 0x04, 0x22, 0xc4, + 0x22, 0x96, 0x88, 0x61, 0x77, 0x98, 0xda, 0x32, 0xe7, 0x89, 0x6f, + 0x09, 0x5d, 0x6b, 0x38, 0x89, 0xdb, 0x3d, 0xdb, 0xa6, 0x20, 0x51, + 0x74, 0xe6, 0x2f, 0x8a, 0xea, 0xa6, 0x73, 0x0e, 0x02, 0x8e, 0x7d, + 0xa4, 0x2d, 0x0e, 0x1a, 0x61, 0xa8, 0x20, 0x0c, 0x9a, 0x79, 0x95, + 0x0f, 0x63, 0x36}}; + auto const prefix8Prefix = "P8"s; + auto const prefix8Msg = "P7P6abcdefghijklmnopqrstuvwxyz"s; + auto const prefix8MaxMsgLength = 30; + auto const prefix7Prefix = "P7"s; + auto const prefix7Msg = "P6abcdefghijklmnopqrstuvwxyz"s; + auto const prefix7MaxMsgLength = 28; + auto const prefix6Prefix = "P6"s; + auto const prefix6Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6MaxMsgLength = 26; + auto const rsa11Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa11PublicKey{ + {0xa8, 0xc7, 0x5e,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x96, 0x9c, 0x3a, 0x6a, + 0x0a, 0xd8, 0x9b, 0x4f, 0xc6, 0x1a, 0xef, 0x18, 0xe9, 0x34, 0x0f, + 0x85, 0x06, 0xbc, 0xc0, 0xeb, 0x4d, 0x3b, 0x6c, 0x7e, 0xa8, 0x54, + 0x01, 0x03, 0x0c, 0x5c, 0x24, 0x58, 0x61, 0xcd, 0xf1, 0x31, 0x88, + 0x5e, 0x00, 0x15, 0x1e, 0x9a, 0x81, 0x99, 0x0b, 0x1a, 0x33, 0xc5, + 0xa6, 0x6c, 0xb4, 0xfb, 0x4e, 0x84, 0x94, 0x9c, 0x7e, 0x2b, 0x00, + 0x4d, 0x5c, 0xcf, 0xc2, 0xa6, 0xa5, 0x36, 0xc6, 0xee, 0x72, 0x8e, + 0x1e, 0x18, 0xaf}}; + std::array const rsa11Sig{ + {0x6e, 0x3a, 0xc6, 0x0b, 0xe3, 0x9f, 0xbe, 0x23, 0x93, 0x71, 0x15, + 0x4d, 0x40, 0x8d, 0x5e, 0x9a, 0xae, 0x90, 0x29, 0xa7, 0xbe, 0xa3, + 0x08, 0xbd, 0x39, 0xf0, 0xac, 0x12, 0xa8, 0x5a, 0xfd, 0x3c, 0x61, + 0x73, 0x6c, 0x85, 0xd3, 0x1a, 0x62, 0x29, 0xa9, 0x1b, 0x6c, 0xa6, + 0x3e, 0x32, 0xf7, 0x8e, 0x71, 0x3e, 0x9e, 0xad, 0xec, 0x1e, 0x02, + 0x6e, 0xd2, 0xef, 0x54, 0x24, 0xb1, 0x29, 0x41, 0x8e, 0xab, 0x90, + 0xf4, 0x94, 0xc6, 0x21, 0x75, 0x6a, 0xa5, 0xc0, 0x87, 0xc9, 0xa6, + 0x1e, 0xf9, 0x24, 0x67, 0x55, 0xfc, 0x46, 0xeb, 0x9e, 0x67, 0x82, + 0xd4, 0x22, 0xf0, 0x1a, 0x1e, 0xd1, 0x2d, 0x6e, 0xde, 0x72, 0x06, + 0x29, 0xf9, 0x2d, 0xef, 0x0a, 0x5e, 0xfe, 0x30, 0xd0, 0x24, 0xa4, + 0x02, 0x3d, 0x53, 0x46, 0x0c, 0x62, 0x40, 0xbb, 0xfc, 0xf9, 0x20, + 0xcc, 0x49, 0x83, 0x7a, 0x52, 0xeb, 0xbd, 0x9d, 0x7c, 0x02, 0xd7, + 0x4a, 0x26, 0xd5, 0x39, 0x2a, 0x5e, 0xcb, 0x18, 0x7c, 0xef, 0xd3, + 0x04, 0xf8, 0xbf, 0xa3, 0x3e, 0x98, 0x12, 0x3a, 0xd9, 0x32, 0xa9, + 0x23, 0x6b, 0xbe, 0x96, 0xdf, 0x4e, 0x23, 0x15, 0x93, 0xfd, 0xef, + 0xde, 0x8f, 0xdb, 0x71, 0x37, 0x5e, 0xc9, 0xce, 0xc9, 0xc3, 0x2c, + 0x76, 0x3f, 0x00, 0x3a, 0x09, 0xfd, 0x94, 0x84, 0x7b, 0x1d, 0xb4, + 0x4c, 0x6d, 0x9d, 0xb8, 0xcb, 0xed, 0x33, 0xe2, 0xb2, 0x09, 0x15, + 0x93, 0x20, 0x84, 0x9e, 0x9e, 0x3e, 0x3c, 0x6b, 0x1e, 0x99, 0x02, + 0xa9, 0xec, 0xdc, 0xa5, 0xe2, 0xd0, 0x49, 0xc7, 0x8b, 0xbd, 0x6f, + 0xee, 0x9e, 0x79, 0xfe, 0x47, 0xbe, 0xad, 0x26, 0x29, 0xa3, 0xe6, + 0x1f, 0xae, 0x47, 0x94, 0xe2, 0x89, 0xfd, 0xc0, 0xaa, 0xaf, 0x09, + 0x93, 0x6a, 0xd6, 0xa6, 0x60, 0x2c, 0xac, 0x1e, 0x28, 0x28, 0x38, + 0xa5, 0xa5, 0xc7}}; + auto const rsa13Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa13PublicKey{ + {0xa5, 0x6c, 0x6d, 0x89, 0xc2, 0xbd, 0x2a, 0x99, 0x3f, 0xd0, 0x75, + 0x47, 0xc8, 0xa6, 0x47, 0x1a, 0x64, 0xff, 0x2e, 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0xed, 0x62, 0x9b, 0x34, 0x82, 0xed, 0xae, 0xe5, 0x8f, 0x24, + 0xcd, 0x14, 0x33, 0x07, 0x15, 0x4a, 0x26, 0x5e, 0x03, 0x13, 0x66, + 0x8f, 0x39, 0xfb, 0xf7, 0xce, 0x9b, 0x8f, 0x58, 0x23, 0xc5, 0x9c, + 0xa7, 0x42, 0x26, 0x68, 0x3a, 0x53, 0x5e, 0x0e, 0xcf, 0xef, 0x94, + 0x1a, 0x6a, 0xf2, 0x0e, 0x66, 0x34, 0x02, 0xf1, 0x39, 0xc9, 0x9f, + 0xa7, 0x3f, 0xe3}}; + std::array const rsa13Sig{ + {0xa3, 0xfb, 0x3b, 0x00, 0xad, 0x38, 0x83, 0xc6, 0x75, 0x36, 0xa9, + 0xd4, 0x47, 0x8f, 0x6b, 0x89, 0xe6, 0x44, 0x6f, 0xf5, 0x60, 0xbd, + 0xd0, 0x6c, 0xe5, 0x99, 0x8a, 0x07, 0xf2, 0x4b, 0x05, 0xdf, 0x6e, + 0xed, 0x45, 0x81, 0xc2, 0xbc, 0xca, 0x5e, 0xc5, 0xa5, 0x6e, 0x57, + 0x73, 0xb6, 0x77, 0xb0, 0xa5, 0x23, 0xb7, 0x65, 0x1f, 0xe8, 0x57, + 0xe0, 0x5e, 0x89, 0xa9, 0xde, 0xce, 0x8b, 0x7a, 0x37, 0x67, 0xa2, + 0x71, 0x9f, 0xc5, 0x6c, 0x9a, 0x4e, 0xad, 0x44, 0xf4, 0x5c, 0xfe, + 0x51, 0x7f, 0x2f, 0xaf, 0xe2, 0x48, 0xe9, 0xbc, 0x23, 0xf3, 0x81, + 0x3f, 0xb4, 0xb7, 0xff, 0x9f, 0xce, 0x2e, 0x1a, 0x37, 0x1a, 0x83, + 0x89, 0x5a, 0x6e, 0xf1, 0x37, 0x25, 0xd3, 0x48, 0x8c, 0x96, 0xec, + 0xae, 0xd6, 0xb9, 0xd8, 0xa7, 0x35, 0xb1, 0xdc, 0xfb, 0x59, 0x70, + 0xf4, 0x55, 0x3f, 0xde, 0x83, 0xcf, 0xb5, 0xf3, 0xbf, 0x61, 0x8f, + 0x14, 0xc9, 0x88, 0x32, 0x41, 0xcc, 0x43, 0x13, 0xb6, 0x2f, 0xd9, + 0x0c, 0xf2, 0x5d, 0xe3, 0x04, 0x60, 0x70, 0x2c, 0xae, 0xca, 0x0a, + 0x6a, 0xec, 0x5c, 0x27, 0xd2, 0x46, 0xef, 0xf8, 0x53, 0x70, 0xbd, + 0x65, 0x7c, 0x6d, 0xcf, 0x50, 0x37, 0x89, 0xd4, 0x34, 0x4c, 0x81, + 0x34, 0x0c, 0x23, 0xb2, 0x93, 0xa0, 0xde, 0x16, 0x12, 0xb1, 0x63, + 0xaa, 0x93, 0x26, 0xb1, 0x2b, 0x71, 0x63, 0x2b, 0x3b, 0xc9, 0xdb, + 0x09, 0x31, 0x82, 0xa2, 0xd8, 0x7e, 0x33, 0x2b, 0x4a, 0x3f, 0x0a, + 0x2f, 0xc3, 0x4e, 0xbc, 0x4b, 0x55, 0xfd, 0xe6, 0xc4, 0x3d, 0xa2, + 0x3c, 0x57, 0xc4, 0xee, 0xde, 0xa0, 0x0a, 0x6b, 0x04, 0x6b, 0xe8, + 0x4a, 0xf6, 0x01, 0xe6, 0x4f, 0x92, 0x39, 0x9a, 0xd9, 0x20, 0x17, + 0xa5, 0x45, 0xc0, 0xf4, 0xac, 0x15, 0x73, 0x41, 0x51, 0x8d, 0x73, + 0x2d, 0x8f, 0xd2}}; + auto const thresh12Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim14CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim14Cond{Type::preimageSha256, + 9, + Preim14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa15CondConditionFingerprint = { + {0x55, 0x6b, 0x6d, 0xe3, 0x00, 0xd4, 0xf3, 0x7e, 0x75, 0x3a, 0x68, + 0xfc, 0x25, 0xdf, 0xf2, 0xf7, 0x18, 0x54, 0xa5, 0x55, 0x0c, 0xa5, + 0xa9, 0x65, 0xbf, 0x66, 0x9e, 0x4e, 0x49, 0x56, 0x1e, 0xf1}}; + Condition const Rsa15Cond{Type::rsaSha256, + 65536, + Rsa15CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed16CondConditionFingerprint = { + {0xe4, 0x66, 0x69, 0x86, 0x87, 0x57, 0x0e, 0xac, 0xf1, 0xfd, 0x06, + 0x81, 0x48, 0x90, 0x82, 0x42, 0x48, 0x50, 0x75, 0x8e, 0xd4, 0x2d, + 0xf3, 0x02, 0x37, 0x89, 0x28, 0xc5, 0x68, 0xd7, 0xa0, 0x11}}; + Condition const Ed16Cond{Type::ed25519Sha256, + 131072, + Ed16CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh10Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim17CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim17Cond{Type::preimageSha256, + 9, + Preim17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa18CondConditionFingerprint = { + {0x9d, 0xbe, 0x65, 0xf4, 0xae, 0x81, 0x90, 0x79, 0x09, 0x18, 0xa2, + 0x66, 0x12, 0x9c, 0x10, 0x94, 0x66, 0x21, 0x94, 0x70, 0x60, 0x20, + 0x4a, 0x3d, 0x5f, 0xb3, 0x62, 0xb6, 0x06, 0x46, 0x37, 0xfe}}; + Condition const Rsa18Cond{Type::rsaSha256, + 65536, + Rsa18CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed19CondConditionFingerprint = { + {0xe5, 0x88, 0xb7, 0x6e, 0xec, 0x2d, 0xaf, 0x47, 0xc7, 0xa2, 0xf4, + 0x6e, 0xbf, 0x7f, 0x5e, 0x46, 0xd7, 0xfa, 0x33, 0x2c, 0x0a, 0x7e, + 0x86, 0x1d, 0x8c, 0x38, 0xa8, 0x93, 0x52, 0xe8, 0x97, 0xe9}}; + Condition const Ed19Cond{Type::ed25519Sha256, + 131072, + Ed19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh20CondConditionFingerprint = { + {0x26, 0x8c, 0x0c, 0x19, 0xbd, 0x11, 0x1f, 0x7a, 0xc4, 0x25, 0xcb, + 0x7b, 0xa3, 0x1c, 0xa9, 0x3e, 0xc0, 0x93, 0x28, 0xab, 0x94, 0x04, + 0x5f, 0xee, 0x7e, 0x53, 0xb3, 0xcd, 0xda, 0x51, 0x06, 0x40}}; + Condition const Thresh20Cond{Type::thresholdSha256, + 135168, + Thresh20CondConditionFingerprint, + std::bitset<5>{25}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim25CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim25Cond{Type::preimageSha256, + 9, + Preim25CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa26CondConditionFingerprint = { + {0xd6, 0x40, 0x0d, 0x21, 0x44, 0x8a, 0xd4, 0x5a, 0xe6, 0x10, 0x3f, + 0xd4, 0x3a, 0x14, 0x5a, 0x5b, 0x87, 0x86, 0x20, 0x3c, 0x43, 0x20, + 0x9d, 0x9d, 0x0c, 0x75, 0x57, 0x80, 0x7d, 0xda, 0x9d, 0x06}}; + Condition const Rsa26Cond{Type::rsaSha256, + 65536, + Rsa26CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed27CondConditionFingerprint = { + {0x6a, 0x26, 0x73, 0x6f, 0xc3, 0xbf, 0x25, 0x73, 0x8e, 0x3b, 0x27, + 0x79, 0x47, 0xa5, 0x37, 0x7c, 0x78, 0xa0, 0x72, 0xd8, 0x77, 0x91, + 0xfc, 0x45, 0x87, 0x7f, 0x11, 0x57, 0xfe, 0x94, 0x57, 0x45}}; + Condition const Ed27Cond{Type::ed25519Sha256, + 131072, + Ed27CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa2 = std::make_unique( + makeSlice(rsa2PublicKey), makeSlice(rsa2Sig)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(rsa2)); + std::vector thresh1Subconditions{ + {Preim3Cond, Rsa4Cond, Ed5Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto rsa9 = std::make_unique( + makeSlice(rsa9PublicKey), makeSlice(rsa9Sig)); + auto prefix8 = std::make_unique( + makeSlice(prefix8Prefix), prefix8MaxMsgLength, std::move(rsa9)); + auto prefix7 = std::make_unique( + makeSlice(prefix7Prefix), prefix7MaxMsgLength, std::move(prefix8)); + auto prefix6 = std::make_unique( + makeSlice(prefix6Prefix), prefix6MaxMsgLength, std::move(prefix7)); + auto rsa11 = std::make_unique( + makeSlice(rsa11PublicKey), makeSlice(rsa11Sig)); + auto rsa13 = std::make_unique( + makeSlice(rsa13PublicKey), makeSlice(rsa13Sig)); + std::vector> thresh12Subfulfillments; + thresh12Subfulfillments.emplace_back(std::move(rsa13)); + std::vector thresh12Subconditions{ + {Preim14Cond, Rsa15Cond, Ed16Cond}}; + auto thresh12 = std::make_unique( + std::move(thresh12Subfulfillments), + std::move(thresh12Subconditions)); + std::vector> thresh10Subfulfillments; + thresh10Subfulfillments.emplace_back(std::move(rsa11)); + thresh10Subfulfillments.emplace_back(std::move(thresh12)); + std::vector thresh10Subconditions{ + {Preim17Cond, Rsa18Cond, Ed19Cond, Thresh20Cond}}; + auto thresh10 = std::make_unique( + std::move(thresh10Subfulfillments), + std::move(thresh10Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix6)); + thresh0Subfulfillments.emplace_back(std::move(thresh10)); + std::vector thresh0Subconditions{ + {Preim25Cond, Rsa26Cond, Ed27Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x0a\x93\xa0\x82\x0a\x14\xa1\x82\x02\x35\x80\x02\x50" + "\x36\x81\x01\x1a\xa2\x82\x02\x2a\xa1\x82\x02\x26\x80\x02\x50" + "\x37\x81\x01\x1c\xa2\x82\x02\x1b\xa1\x82\x02\x17\x80\x02\x50" + "\x38\x81\x01\x1e\xa2\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01" + "\x00\xb6\x7b\xe2\x98\x9f\xff\x6c\x37\xd0\xb6\x64\x19\xfb\xa0" + "\x21\x18\xe2\xc0\xd1\x92\xbd\x04\xa6\xd2\xb4\x7e\xc6\x6a\x1a" + "\x34\x20\x7b\xfe\x84\xeb\xe8\xc1\x6f\xfd\xdc\x0a\xfe\x60\x55" + "\xb6\xfc\x86\x5a\x21\xbf\xf1\x39\xfa\xec\x42\xca\x57\xb3\x3e" + "\x3f\xe6\x26\x5a\xb7\x4a\x5f\xbb\xb1\xf5\x91\x85\x92\x3e\x6a" + "\x18\x48\x4d\x9e\xdd\x08\x25\xa3\x3b\x3d\x75\x9a\xbe\xee\x0d" + "\x6e\xd2\x5d\xe2\xbd\xed\x45\x60\xef\xa0\x37\xfd\xbb\xcf\x30" + "\x97\xf1\x5b\xc8\x9c\x29\x33\x67\x3e\x23\x33\x7f\x36\xd4\x75" + "\x8b\xa1\xcf\x9e\xe6\xc5\x63\x63\xb0\x3f\xa0\xc2\xa2\x10\xc9" + "\xb2\x6b\xaa\x67\xc9\xf5\xb8\xbf\x5b\x97\xe5\x29\xf2\xbb\xc7" + "\x22\x0f\x1f\xc1\xf6\xca\x4a\x8a\x46\x89\xa0\xca\x4e\x49\x9d" + "\xfc\x23\xd3\xb4\xdb\xc6\x84\x45\xbd\x9f\x10\x86\xe2\xf0\x47" + "\x7b\x75\xbf\x25\x99\x02\x2c\xdb\x6b\xd6\x2b\x67\x0d\xcd\x46" + "\x63\xbd\xce\x1c\xc5\x56\x63\x58\x5b\xc8\xb2\x58\x42\xf6\xaf" + "\xce\x47\xb2\xa9\x2a\x71\x8b\x82\xf4\x72\xff\xef\xe7\xc1\x70" + "\x12\xfa\xb8\xad\xb2\xfe\xa9\x14\xe7\xc2\xec\x12\xbf\x29\x5a" + "\x65\x91\x74\x82\xd3\x77\x1f\x14\xbf\x5f\x41\x11\x6c\x7c\x22" + "\x70\x65\x81\x82\x01\x00\x24\x63\x02\x0d\xf3\x41\x78\x17\x0d" + "\xb0\xdc\x80\xa0\x09\x29\xf9\x74\xc9\xcc\xb9\x70\x0e\xc1\x7d" + "\xe5\x16\x36\xe3\xe5\x5f\x66\xbb\x4d\xea\x74\x83\x3d\x4d\xcc" + "\x5b\x6a\xe5\x1c\xeb\xc2\xd2\xf6\x22\x1a\x30\x52\x85\xd6\x93" + "\xfd\x4e\xba\xec\x47\xe3\x94\xa1\x91\x7f\xee\x5e\x2e\xef\x26" + "\x73\xf8\x12\x19\x96\x2b\xec\x60\x7f\x1c\x95\x63\xf7\x0d\xed" + "\x68\x0f\xea\x1c\xe3\x08\xcb\xe4\xe7\x8b\x79\x31\x17\x0f\x04" + "\xf4\xaa\x0c\xcc\x60\xdc\x80\xc5\x2d\x2b\x6a\x1a\x92\x1e\x82" + "\xdb\xb8\x1f\x92\x78\xad\xb1\xfe\x8b\xe3\x00\x2c\x1c\xf8\xab" + "\xa0\xbd\x4c\xc5\xc0\x2e\x45\x1e\xe3\x22\x07\x44\xd0\x73\x94" + "\x69\x51\x97\xa3\xea\x53\x38\x85\x49\x6e\xec\x3a\x6c\x6c\x35" + "\xd8\xa0\xf3\x92\x83\xdb\xe9\x4e\x1c\xc0\xc2\x19\x73\x78\xf1" + "\x13\x63\xee\xed\xe1\x1d\xc9\x07\x24\x5b\xc4\x3c\x19\x11\xb9" + "\x42\xfe\x3a\x4c\x57\x30\x75\x62\xce\x8f\x8e\x53\x18\x3a\x2b" + "\xaf\x6e\x04\x22\xc4\x22\x96\x88\x61\x77\x98\xda\x32\xe7\x89" + "\x6f\x09\x5d\x6b\x38\x89\xdb\x3d\xdb\xa6\x20\x51\x74\xe6\x2f" + "\x8a\xea\xa6\x73\x0e\x02\x8e\x7d\xa4\x2d\x0e\x1a\x61\xa8\x20" + "\x0c\x9a\x79\x95\x0f\x63\x36\xa2\x82\x02\x8b\xa0\x82\x02\x0c" + "\xa3\x82\x02\x08\x80\x82\x01\x00\xba\x2c\x3b\x50\xb6\xbf\xf9" + "\x0f\x1d\xd7\x32\x4c\x01\x5f\xff\x2f\x2a\xf6\x33\xd0\xfb\xea" + "\x1f\xa4\xf2\x2d\x22\x8a\x19\x95\xa9\x17\xb7\x4f\x17\xcf\x55" + "\xcd\x1a\x3a\x5f\x07\x73\xcc\xaa\x21\x70\x64\xb3\xa0\xf4\xb7" + "\x30\xa3\x82\x37\x93\xc6\x59\xde\x1b\xa1\x16\x90\x5a\x1a\xf6" + "\x73\xab\x92\xc8\x2f\xf4\x6f\x5c\xf2\x22\x1d\x30\xf8\x03\xd8" + "\x9b\x5f\x73\x72\x8e\x5f\xd5\x37\x4b\x43\xda\xfe\x84\x21\x67" + "\xe8\xe3\xd7\x91\x3f\x24\x1d\xfb\x1f\x12\x6e\xcb\xfc\xb7\x5b" + "\x0a\x35\x73\x3b\xce\x44\x34\x8e\xcd\x53\xa4\xcf\xa7\x63\x73" + "\xcd\x31\x0f\xe0\x75\x8d\xe4\xa9\xdc\xfe\xf0\xc9\x3d\x26\xaf" + "\xbf\x7b\x0f\x0e\x17\xb9\xd0\x4a\x32\x80\x64\x6b\x54\x73\x5a" + "\x50\xc7\x31\x59\xf9\x73\x72\xa5\x79\xba\xdb\xa1\x14\x8d\x77" + "\x67\x3e\xc0\x5b\xec\x6f\x0b\xf7\xc5\xee\x5a\xa6\x8d\x49\x63" + "\x81\xbb\xd1\xf9\x9e\xbb\xed\xb2\xa9\x18\x60\xa7\xee\xeb\x30" + "\xa1\x92\x93\xe8\xd8\x34\x9e\xac\xd6\x23\xfc\x7f\xcb\xe7\xfe" + "\xa7\xe6\x42\xac\x77\x11\xc0\x67\x77\xd1\xaa\x5e\xed\x3b\xd5" + "\xa5\x8d\x34\x7c\xd9\x57\x44\xa7\xc5\x44\x2e\x1e\xe7\x63\xd8" + "\x53\x1b\x9a\xd9\x67\x02\x13\x32\x61\x81\x82\x01\x00\x4f\x1a" + "\xea\x70\xb4\x79\xb0\x82\xcb\x4f\x2a\xa1\x6b\x73\xc5\x7c\xdc" + "\x42\x53\x6b\x30\xa0\x88\x9f\xdd\xa1\xda\xf5\xcd\x82\x77\x72" + "\x20\xfb\xd7\x2f\xcd\x38\x09\x87\x11\x9c\xba\xa1\x93\x91\xc2" + "\x9e\x8d\xa6\xaf\x3f\x57\xf4\x9c\x0f\xc1\xaf\x6c\xf3\xfc\xa0" + "\x17\x4d\xec\x00\x74\x37\xbc\xc6\x57\xc9\xe5\x5d\xca\x47\xb1" + "\xac\x17\x6e\xee\xcb\x81\xda\x9a\x2d\x88\xb4\xcc\x6b\x81\xd0" + "\xd7\xdb\xe9\x1c\x96\x69\x75\x1c\xc3\xe3\xd0\xfd\xf1\x16\x05" + "\x84\x55\x9f\xf2\x0b\x21\x0c\x71\xe5\xe1\xd5\x48\x34\xc4\x61" + "\x4c\x4a\x6b\xa5\x83\x59\x0b\x3b\x64\xa0\xfd\x3a\x8f\x1b\x5b" + "\xa5\xae\x4f\x24\x7a\x2c\xe8\xd7\x65\xb4\xb4\xb0\x9f\xf7\x2d" + "\xfd\xb6\x45\x6b\xde\xd2\xf7\x4c\x76\xa3\x47\x24\xdc\x11\xe0" + "\x52\xc7\xfd\xb0\x39\xb2\x4e\x04\x87\xe5\x43\xb1\x5b\xa2\x5d" + "\x7d\x5a\xe2\xa0\x98\x1e\x46\x0f\xa1\xb0\xcc\xea\x91\x12\x30" + "\x53\x33\xee\xc2\x0f\x71\x55\x01\x9c\x15\x3a\x1b\x67\x19\x89" + "\x20\xc2\xd8\xc6\x58\x4e\x45\x7e\x94\x2b\x51\x69\xc4\xb2\xdf" + "\x12\x42\x3e\xe0\x57\x75\x0b\x7c\x59\xb6\xeb\x10\x9c\x54\xa7" + "\x0e\x94\xb2\x66\xb3\x51\xbf\x1c\x32\xe5\x3a\x3c\x6a\xe7\xa1" + "\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x3a" + "\x82\x3b\x32\x38\xb1\x3c\x17\x87\x60\x62\xec\xcf\x91\xb0\xaf" + "\xaa\xe5\x11\xe6\xfb\xe2\xb0\x3d\x70\x4d\x1d\xad\xd6\x7c\xee" + "\xa6\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x90\xce\xed\x45\x98" + "\x68\xff\x19\x2b\x27\xc1\x2a\xa2\x6e\x2e\x82\xf3\xbd\x71\x13" + "\x61\xb0\x76\x40\x4d\x48\xea\x16\xfb\x27\x57\xdc\x81\x03\x02" + "\x00\x00\xa2\x82\x05\x48\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0" + "\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xa5\x6c\x6d\x89" + "\xc2\xbd\x2a\x99\x3f\xd0\x75\x47\xc8\xa6\x47\x1a\x64\xff\x2e" + "\x22\x3a\x4d\xfb\x10\x3c\x24\xdb\x1d\x2b\x62\x0e\xf0\xf1\x37" + "\x5e\x1a\x3d\x5c\x78\xe7\x4e\x6b\x1e\xf8\xf8\x3d\x42\x6b\xf0" + "\xb8\x34\xcb\x15\x43\x86\xe6\xaf\x86\x90\x9c\xd2\x73\x65\x27" + "\xed\x8e\xf6\xa0\xb8\xcc\xc6\x03\xf9\xab\x6c\xd0\x8c\x6e\xfc" + "\xa4\x05\x78\x82\x2f\x80\xcc\x8e\xb8\x1a\x95\x5d\x1b\xf8\xc9" + "\x4f\x62\x93\x55\x03\x1b\x77\xc6\x87\x1d\x00\xf6\x94\x3e\x0c" + "\x1b\x93\x67\x80\x98\x7e\x5f\x96\xda\x65\xef\x2f\xa6\x7f\xdf" + "\xa9\x03\xfa\x57\x7c\xe8\xeb\xb9\x81\xd1\x66\x00\x0e\x62\xbd" + "\x65\xc5\x75\x3a\xf2\x2c\x05\x71\x67\x68\x18\xbe\xe5\xcb\xf1" + "\xbc\x26\x92\xb3\x8a\x63\x1e\x4b\x41\x30\xbb\x6c\x9e\x30\x29" + "\xc7\x3a\xe4\x2b\x8a\x6c\xd6\xac\x0b\x80\x83\x9c\x27\x28\xd5" + "\x1a\x05\xa8\x2e\x0c\x12\x09\xac\x4d\x45\x39\x55\xf0\x04\xf3" + "\xed\x62\x9b\x34\x82\xed\xae\xe5\x8f\x24\xcd\x14\x33\x07\x15" + "\x4a\x26\x5e\x03\x13\x66\x8f\x39\xfb\xf7\xce\x9b\x8f\x58\x23" + "\xc5\x9c\xa7\x42\x26\x68\x3a\x53\x5e\x0e\xcf\xef\x94\x1a\x6a" + "\xf2\x0e\x66\x34\x02\xf1\x39\xc9\x9f\xa7\x3f\xe3\x81\x82\x01" + "\x00\xa3\xfb\x3b\x00\xad\x38\x83\xc6\x75\x36\xa9\xd4\x47\x8f" + "\x6b\x89\xe6\x44\x6f\xf5\x60\xbd\xd0\x6c\xe5\x99\x8a\x07\xf2" + "\x4b\x05\xdf\x6e\xed\x45\x81\xc2\xbc\xca\x5e\xc5\xa5\x6e\x57" + "\x73\xb6\x77\xb0\xa5\x23\xb7\x65\x1f\xe8\x57\xe0\x5e\x89\xa9" + "\xde\xce\x8b\x7a\x37\x67\xa2\x71\x9f\xc5\x6c\x9a\x4e\xad\x44" + "\xf4\x5c\xfe\x51\x7f\x2f\xaf\xe2\x48\xe9\xbc\x23\xf3\x81\x3f" + "\xb4\xb7\xff\x9f\xce\x2e\x1a\x37\x1a\x83\x89\x5a\x6e\xf1\x37" + "\x25\xd3\x48\x8c\x96\xec\xae\xd6\xb9\xd8\xa7\x35\xb1\xdc\xfb" + "\x59\x70\xf4\x55\x3f\xde\x83\xcf\xb5\xf3\xbf\x61\x8f\x14\xc9" + "\x88\x32\x41\xcc\x43\x13\xb6\x2f\xd9\x0c\xf2\x5d\xe3\x04\x60" + "\x70\x2c\xae\xca\x0a\x6a\xec\x5c\x27\xd2\x46\xef\xf8\x53\x70" + "\xbd\x65\x7c\x6d\xcf\x50\x37\x89\xd4\x34\x4c\x81\x34\x0c\x23" + "\xb2\x93\xa0\xde\x16\x12\xb1\x63\xaa\x93\x26\xb1\x2b\x71\x63" + "\x2b\x3b\xc9\xdb\x09\x31\x82\xa2\xd8\x7e\x33\x2b\x4a\x3f\x0a" + "\x2f\xc3\x4e\xbc\x4b\x55\xfd\xe6\xc4\x3d\xa2\x3c\x57\xc4\xee" + "\xde\xa0\x0a\x6b\x04\x6b\xe8\x4a\xf6\x01\xe6\x4f\x92\x39\x9a" + "\xd9\x20\x17\xa5\x45\xc0\xf4\xac\x15\x73\x41\x51\x8d\x73\x2d" + "\x8f\xd2\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27" + "\x80\x20\x55\x6b\x6d\xe3\x00\xd4\xf3\x7e\x75\x3a\x68\xfc\x25" + "\xdf\xf2\xf7\x18\x54\xa5\x55\x0c\xa5\xa9\x65\xbf\x66\x9e\x4e" + "\x49\x56\x1e\xf1\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xe4\x66" + "\x69\x86\x87\x57\x0e\xac\xf1\xfd\x06\x81\x48\x90\x82\x42\x48" + "\x50\x75\x8e\xd4\x2d\xf3\x02\x37\x89\x28\xc5\x68\xd7\xa0\x11" + "\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xa8\xc7" + "\x5e\x5a\xe9\xc7\xcb\xbc\x9c\x92\xb7\xb8\x76\x67\x90\xc2\x53" + "\xa9\x3a\x4b\x2c\xab\xdb\x80\x6e\xec\x50\xbe\x9e\x5e\x96\x64" + "\x8f\xdf\x93\xb2\xb0\xc0\xb9\x7d\xc6\xc9\x75\x6b\x73\xb1\xd6" + "\x0b\xe5\xbb\x2a\xf5\xdc\xc0\xd5\x09\x95\xd3\xf5\xcf\x82\xb9" + "\x43\x93\xdf\x5a\xd4\x4f\xa0\x60\x20\x41\x01\xb0\x8f\x2a\x58" + "\xd5\x05\xa1\x71\x14\x29\x91\xd6\x79\x5a\xb3\x3b\xbe\x29\x3c" + "\x68\x87\x48\x94\xb7\xb3\x29\xd9\xff\xeb\x06\xfd\x1d\xcf\x3e" + "\x7c\x14\x95\xfa\xa3\xc0\x25\x46\xa4\xd3\x2d\xb5\x5f\x6b\x86" + "\x18\xb4\x2f\x7b\x07\x76\xf9\xf8\x6d\x57\x62\x41\x79\x30\x3c" + "\x81\x6e\x8a\xda\x87\x6e\x1d\x64\x6d\x39\x40\xd5\x5a\xb2\x2d" + "\xba\xb8\x7a\x3b\x60\xd6\x96\x55\xfe\x1e\x71\x09\x33\xad\x05" + "\xb2\x73\xd2\x2b\xf1\x26\x06\xd9\x15\xfc\x48\x36\xa4\xa2\x25" + "\x90\x96\x9c\x3a\x6a\x0a\xd8\x9b\x4f\xc6\x1a\xef\x18\xe9\x34" + "\x0f\x85\x06\xbc\xc0\xeb\x4d\x3b\x6c\x7e\xa8\x54\x01\x03\x0c" + "\x5c\x24\x58\x61\xcd\xf1\x31\x88\x5e\x00\x15\x1e\x9a\x81\x99" + "\x0b\x1a\x33\xc5\xa6\x6c\xb4\xfb\x4e\x84\x94\x9c\x7e\x2b\x00" + "\x4d\x5c\xcf\xc2\xa6\xa5\x36\xc6\xee\x72\x8e\x1e\x18\xaf\x81" + "\x82\x01\x00\x6e\x3a\xc6\x0b\xe3\x9f\xbe\x23\x93\x71\x15\x4d" + "\x40\x8d\x5e\x9a\xae\x90\x29\xa7\xbe\xa3\x08\xbd\x39\xf0\xac" + "\x12\xa8\x5a\xfd\x3c\x61\x73\x6c\x85\xd3\x1a\x62\x29\xa9\x1b" + "\x6c\xa6\x3e\x32\xf7\x8e\x71\x3e\x9e\xad\xec\x1e\x02\x6e\xd2" + "\xef\x54\x24\xb1\x29\x41\x8e\xab\x90\xf4\x94\xc6\x21\x75\x6a" + "\xa5\xc0\x87\xc9\xa6\x1e\xf9\x24\x67\x55\xfc\x46\xeb\x9e\x67" + "\x82\xd4\x22\xf0\x1a\x1e\xd1\x2d\x6e\xde\x72\x06\x29\xf9\x2d" + "\xef\x0a\x5e\xfe\x30\xd0\x24\xa4\x02\x3d\x53\x46\x0c\x62\x40" + "\xbb\xfc\xf9\x20\xcc\x49\x83\x7a\x52\xeb\xbd\x9d\x7c\x02\xd7" + "\x4a\x26\xd5\x39\x2a\x5e\xcb\x18\x7c\xef\xd3\x04\xf8\xbf\xa3" + "\x3e\x98\x12\x3a\xd9\x32\xa9\x23\x6b\xbe\x96\xdf\x4e\x23\x15" + "\x93\xfd\xef\xde\x8f\xdb\x71\x37\x5e\xc9\xce\xc9\xc3\x2c\x76" + "\x3f\x00\x3a\x09\xfd\x94\x84\x7b\x1d\xb4\x4c\x6d\x9d\xb8\xcb" + "\xed\x33\xe2\xb2\x09\x15\x93\x20\x84\x9e\x9e\x3e\x3c\x6b\x1e" + "\x99\x02\xa9\xec\xdc\xa5\xe2\xd0\x49\xc7\x8b\xbd\x6f\xee\x9e" + "\x79\xfe\x47\xbe\xad\x26\x29\xa3\xe6\x1f\xae\x47\x94\xe2\x89" + "\xfd\xc0\xaa\xaf\x09\x93\x6a\xd6\xa6\x60\x2c\xac\x1e\x28\x28" + "\x38\xa5\xa5\xc7\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef" + "\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9" + "\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01" + "\x09\xa2\x2b\x80\x20\x26\x8c\x0c\x19\xbd\x11\x1f\x7a\xc4\x25" + "\xcb\x7b\xa3\x1c\xa9\x3e\xc0\x93\x28\xab\x94\x04\x5f\xee\x7e" + "\x53\xb3\xcd\xda\x51\x06\x40\x81\x03\x02\x10\x00\x82\x02\x03" + "\x98\xa3\x27\x80\x20\x9d\xbe\x65\xf4\xae\x81\x90\x79\x09\x18" + "\xa2\x66\x12\x9c\x10\x94\x66\x21\x94\x70\x60\x20\x4a\x3d\x5f" + "\xb3\x62\xb6\x06\x46\x37\xfe\x81\x03\x01\x00\x00\xa4\x27\x80" + "\x20\xe5\x88\xb7\x6e\xec\x2d\xaf\x47\xc7\xa2\xf4\x6e\xbf\x7f" + "\x5e\x46\xd7\xfa\x33\x2c\x0a\x7e\x86\x1d\x8c\x38\xa8\x93\x52" + "\xe8\x97\xe9\x81\x03\x02\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\xd6\x40\x0d\x21\x44\x8a\xd4" + "\x5a\xe6\x10\x3f\xd4\x3a\x14\x5a\x5b\x87\x86\x20\x3c\x43\x20" + "\x9d\x9d\x0c\x75\x57\x80\x7d\xda\x9d\x06\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x6a\x26\x73\x6f\xc3\xbf\x25\x73\x8e\x3b\x27" + "\x79\x47\xa5\x37\x7c\x78\xa0\x72\xd8\x77\x91\xfc\x45\x87\x7f" + "\x11\x57\xfe\x94\x57\x45\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x83\x4f\xd2\x79\x5b\x48\xd0\x14\x00\x4d\xf6" + "\xcc\xef\x23\x32\xb7\x15\x58\x03\x52\x43\xff\xda\x40\xea\xcc" + "\xf1\x4d\x09\x99\xd6\xe7\x81\x03\x08\x60\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x98\x1e\x5d\x35\x2c\x93" + "\x72\xa7\x1c\x04\x91\x2e\x3a\x46\xcd\xee\xb9\x33\x28\xcc\x11" + "\xd5\x88\xb8\xd4\xed\xe9\xe1\xc5\x10\xb2\x58\x81\x03\x01\x0c" + "\x5a\x82\x02\x04\x10\xa2\x2b\x80\x20\x85\x86\xac\x0e\x50\x6e" + "\xd6\xba\xa1\xe6\xb1\xaf\x03\x54\x64\x55\x8f\x25\x49\xa1\xe4" + "\xb2\x8a\x6d\xf8\x06\x3b\x83\x26\xa2\xb7\x2d\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa2\x2b\x80\x20\x8c\x16\x0a\x5e\xce\x86" + "\x05\xcf\x08\xc5\x5e\x9b\x23\x37\x7b\xf4\x42\xf2\x78\xfc\xf0" + "\xbb\xb9\xc2\xb0\x2d\xbb\xbf\x9b\x6d\x63\x04\x81\x03\x04\x38" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xd6\x40\x0d\x21\x44\x8a" + "\xd4\x5a\xe6\x10\x3f\xd4\x3a\x14\x5a\x5b\x87\x86\x20\x3c\x43" + "\x20\x9d\x9d\x0c\x75\x57\x80\x7d\xda\x9d\x06\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x6a\x26\x73\x6f\xc3\xbf\x25\x73\x8e\x3b" + "\x27\x79\x47\xa5\x37\x7c\x78\xa0\x72\xd8\x77\x91\xfc\x45\x87" + "\x7f\x11\x57\xfe\x94\x57\x45\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh43() + { + testcase("Thresh43"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim9Cond + // ** Rsa10Cond + // ** Ed11Cond + // ** Prefix12Cond + // ** Thresh16Cond + // ** thresh1 + // *** Preim3Cond + // *** Rsa4Cond + // *** Ed5Cond + // *** rsa2 + // ** preim6 + // ** rsa7 + // ** ed8 + + auto const rsa2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa2PublicKey{ + {0xba, 0x2c, 0x3b, 0x50, 0xb6, 0xbf, 0xf9, 0x0f, 0x1d, 0xd7, 0x32, + 0x4c, 0x01, 0x5f, 0xff, 0x2f, 0x2a, 0xf6, 0x33, 0xd0, 0xfb, 0xea, + 0x1f, 0xa4, 0xf2, 0x2d, 0x22, 0x8a, 0x19, 0x95, 0xa9, 0x17, 0xb7, + 0x4f, 0x17, 0xc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, 0xfe, 0xa7, 0xe6, 0x42, + 0xac, 0x77, 0x11, 0xc0, 0x67, 0x77, 0xd1, 0xaa, 0x5e, 0xed, 0x3b, + 0xd5, 0xa5, 0x8d, 0x34, 0x7c, 0xd9, 0x57, 0x44, 0xa7, 0xc5, 0x44, + 0x2e, 0x1e, 0xe7, 0x63, 0xd8, 0x53, 0x1b, 0x9a, 0xd9, 0x67, 0x02, + 0x13, 0x32, 0x61}}; + std::array const rsa2Sig{ + {0x4f, 0x97, 0x46, 0xb1, 0x1f, 0x49, 0x93, 0x4b, 0x8a, 0x68, 0x02, + 0x30, 0xd4, 0x3b, 0x3b, 0x51, 0xb8, 0x0c, 0x81, 0x69, 0xc5, 0x16, + 0x0e, 0x26, 0x32, 0x69, 0x42, 0xa6, 0x0b, 0xc0, 0x03, 0x01, 0x24, + 0xbc, 0xf1, 0x2c, 0xac, 0xf3, 0x1f, 0xd7, 0x29, 0x52, 0x9b, 0xbb, + 0xdb, 0x16, 0x66, 0x54, 0x75, 0x58, 0xf6, 0x7c, 0x2f, 0xdd, 0x2e, + 0x4e, 0xce, 0x1f, 0xcd, 0x48, 0x08, 0xab, 0x34, 0x04, 0x5c, 0x01, + 0x62, 0x88, 0x71, 0xe9, 0x98, 0x7a, 0x73, 0x22, 0x4b, 0x0b, 0xd9, + 0x54, 0x22, 0x16, 0xcc, 0x6a, 0x56, 0x40, 0xaf, 0x1d, 0x37, 0xd3, + 0x77, 0xb4, 0x23, 0xf6, 0x9f, 0xba, 0x85, 0x44, 0x43, 0x6a, 0xcf, + 0x8b, 0x8a, 0x61, 0x38, 0xa5, 0x4d, 0x0b, 0x92, 0xfa, 0x8e, 0x0a, + 0x21, 0xd1, 0x07, 0xb6, 0x82, 0xbf, 0x4f, 0xd5, 0x54, 0x76, 0xc8, + 0x70, 0x3e, 0xb8, 0xff, 0xe2, 0xa7, 0x3e, 0xb1, 0x58, 0xba, 0xc9, + 0xd8, 0x63, 0xc2, 0xb7, 0x20, 0x65, 0x34, 0x9d, 0x37, 0xae, 0x1d, + 0x23, 0x9a, 0x4f, 0xe7, 0x72, 0x26, 0x56, 0xe8, 0x17, 0x9a, 0x40, + 0x2b, 0x04, 0x60, 0x7d, 0x66, 0xb1, 0x27, 0xb4, 0xcc, 0x74, 0x8e, + 0x4d, 0x5c, 0x28, 0x2e, 0x51, 0x16, 0x17, 0x9c, 0x8e, 0xd0, 0xf9, + 0x36, 0x5c, 0x11, 0xbe, 0x6a, 0xe6, 0x53, 0x32, 0x9d, 0xae, 0x3c, + 0x43, 0x1d, 0x1b, 0x97, 0x97, 0xdf, 0x87, 0xdc, 0x0d, 0xb8, 0xd0, + 0x8e, 0x8c, 0xe8, 0xdc, 0x2a, 0x42, 0xd3, 0xa5, 0x5c, 0x46, 0x75, + 0x4f, 0x76, 0xd6, 0xa9, 0xbc, 0x60, 0xc4, 0xc3, 0xf9, 0x10, 0xb5, + 0x1f, 0x94, 0xaf, 0x57, 0xd7, 0xcc, 0x72, 0xd5, 0x56, 0x43, 0xf5, + 0x2a, 0x75, 0xb7, 0xbb, 0xca, 0xc8, 0x0d, 0xd9, 0x1a, 0x38, 0x68, + 0x3c, 0x08, 0x8f, 0x96, 0x4f, 0x06, 0xbc, 0x3f, 0xbd, 0xd6, 0x37, + 0xed, 0x09, 0x48}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim3CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim3Cond{Type::preimageSha256, + 9, + Preim3CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa4CondConditionFingerprint = { + {0x3a, 0x82, 0x3b, 0x32, 0x38, 0xb1, 0x3c, 0x17, 0x87, 0x60, 0x62, + 0xec, 0xcf, 0x91, 0xb0, 0xaf, 0xaa, 0xe5, 0x11, 0xe6, 0xfb, 0xe2, + 0xb0, 0x3d, 0x70, 0x4d, 0x1d, 0xad, 0xd6, 0x7c, 0xee, 0xa6}}; + Condition const Rsa4Cond{Type::rsaSha256, + 65536, + Rsa4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed5CondConditionFingerprint = { + {0x90, 0xce, 0xed, 0x45, 0x98, 0x68, 0xff, 0x19, 0x2b, 0x27, 0xc1, + 0x2a, 0xa2, 0x6e, 0x2e, 0x82, 0xf3, 0xbd, 0x71, 0x13, 0x61, 0xb0, + 0x76, 0x40, 0x4d, 0x48, 0xea, 0x16, 0xfb, 0x27, 0x57, 0xdc}}; + Condition const Ed5Cond{Type::ed25519Sha256, + 131072, + Ed5CondConditionFingerprint, + std::bitset<5>{0}}; + auto const preim6Preimage = "I am root"s; + auto const preim6Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa7PublicKey{ + {0xb5, 0x8b, 0xa2, 0xa1, 0xc0, 0x5b, 0xc3, 0xa3, 0x64, 0xe9, 0x88, + 0xe3, 0x25, 0x89, 0xa0, 0x6d, 0x73, 0x8a, 0x46, 0x09, 0x58, 0xb4, + 0x85, 0x66, 0x87, 0x56, 0x85, 0x39, 0xee, 0x6d, 0x77, 0xbb, 0x99, + 0x57, 0x90, 0x0e, 0x9c, 0x9c, 0xd5, 0x40, 0xc4, 0x8b, 0x37, 0xb1, + 0xfe, 0x78, 0xb7, 0xe1, 0xe8, 0xb7, 0x74, 0xee, 0x74, 0x9c, 0xe5, + 0xa3, 0xdd, 0xb7, 0x87, 0x77, 0xb7, 0x14, 0x08, 0x71, 0xc4, 0xec, + 0x85, 0xe2, 0xe3, 0xc1, 0x1e, 0x34, 0x14, 0x21, 0xe1, 0xac, 0xd3, + 0x20, 0x0f, 0xb8, 0x11, 0x24, 0x69, 0xa3, 0x7d, 0x98, 0x35, 0x2a, + 0xdf, 0x56, 0x7d, 0x30, 0xf7, 0x31, 0x64, 0x73, 0xcf, 0x0c, 0x9e, + 0xa6, 0x3b, 0x7d, 0x93, 0xb1, 0xc4, 0xb6, 0x78, 0x39, 0x52, 0x3b, + 0x4d, 0xb6, 0xb2, 0x55, 0x17, 0x95, 0x27, 0xbd, 0xd6, 0xc1, 0x28, + 0x7b, 0x82, 0xbb, 0xeb, 0xea, 0xec, 0x7e, 0x48, 0x35, 0xb3, 0x4b, + 0x78, 0x30, 0xc4, 0x66, 0x32, 0x39, 0x2d, 0xd6, 0x5f, 0x59, 0xeb, + 0x81, 0x64, 0x68, 0xdb, 0x94, 0xf4, 0x8e, 0x5f, 0x34, 0x4f, 0x3b, + 0x03, 0xe5, 0xa6, 0x1b, 0x30, 0x6c, 0xea, 0xe8, 0xc6, 0x36, 0xf8, + 0xee, 0x0b, 0x0f, 0xb5, 0xd2, 0xe7, 0xa4, 0x0a, 0xbc, 0xef, 0x80, + 0x7e, 0xb1, 0x9b, 0xda, 0xe6, 0x40, 0x4a, 0x3f, 0x6f, 0xd1, 0x5a, + 0x64, 0x84, 0xb2, 0x5c, 0xd2, 0xf0, 0x38, 0x7c, 0xcb, 0xd1, 0xcd, + 0xdd, 0x37, 0x3f, 0x76, 0xe7, 0x08, 0x25, 0xe5, 0xd3, 0xd9, 0xe3, + 0x21, 0x1b, 0x88, 0x41, 0x3d, 0x2d, 0x32, 0xff, 0xd3, 0xfe, 0x4d, + 0x40, 0x85, 0x1b, 0x0f, 0xd6, 0xab, 0x4e, 0xb7, 0x38, 0x68, 0xe9, + 0x67, 0xc7, 0xb5, 0xd1, 0x38, 0xdb, 0x85, 0x2e, 0x2f, 0x76, 0xea, + 0x4a, 0xce, 0xff, 0x08, 0x5e, 0x93, 0x87, 0x98, 0xf7, 0x95, 0xeb, + 0x49, 0xf6, 0x8d}}; + std::array const rsa7Sig{ + {0x66, 0x76, 0x0f, 0x57, 0xb1, 0x60, 0xc0, 0xf1, 0xa3, 0x7a, 0xca, + 0x3c, 0x77, 0x39, 0x37, 0x4e, 0xa6, 0x88, 0x77, 0xd7, 0xb2, 0x58, + 0x84, 0x47, 0x54, 0xc4, 0x46, 0xc7, 0xc6, 0xfc, 0x23, 0xc8, 0x79, + 0xe0, 0x94, 0x7a, 0x4d, 0x3f, 0x13, 0x77, 0x56, 0x93, 0x96, 0x5f, + 0x42, 0x13, 0xeb, 0xbf, 0xec, 0x73, 0x3b, 0x75, 0xff, 0xd0, 0x4e, + 0xf4, 0x23, 0x52, 0xce, 0x12, 0x5f, 0xef, 0x48, 0x71, 0xed, 0x40, + 0x15, 0x7b, 0x96, 0x76, 0xc8, 0xac, 0xba, 0x85, 0x3a, 0x06, 0x1e, + 0x5b, 0x04, 0x29, 0x31, 0x6a, 0x20, 0xdb, 0x8b, 0x0a, 0x36, 0x04, + 0x14, 0xe9, 0x8f, 0x43, 0xb9, 0x95, 0x5e, 0xdc, 0xe6, 0x64, 0xf0, + 0xe6, 0xd3, 0xf6, 0x85, 0x9f, 0x62, 0xcf, 0xd0, 0x59, 0x46, 0xcd, + 0x98, 0x05, 0x6f, 0xc7, 0xa5, 0x12, 0xb0, 0x40, 0x04, 0x22, 0x18, + 0x99, 0x03, 0x86, 0x98, 0x3e, 0x83, 0x40, 0x36, 0xab, 0x05, 0x8b, + 0xd3, 0x2d, 0x56, 0x3e, 0x36, 0x57, 0x6e, 0x98, 0x09, 0x8c, 0x8a, + 0xfe, 0xff, 0x0e, 0xb3, 0x45, 0x23, 0xbf, 0x80, 0x2e, 0x29, 0xa4, + 0x1c, 0xc0, 0xc3, 0xd8, 0x76, 0x12, 0xf8, 0xa7, 0x9e, 0xd9, 0x35, + 0x22, 0xf3, 0x17, 0x5d, 0x6b, 0x6c, 0xec, 0x60, 0x3e, 0xb2, 0xb5, + 0x30, 0x3d, 0xa9, 0x27, 0xc8, 0x72, 0xc0, 0xbc, 0xce, 0xe3, 0xc7, + 0x66, 0x4f, 0xb9, 0x9b, 0x20, 0xcf, 0xea, 0xc1, 0x8c, 0xe7, 0xff, + 0xf6, 0x5f, 0xa2, 0x9e, 0xe9, 0x30, 0x3a, 0x36, 0x98, 0x58, 0x80, + 0x95, 0x05, 0x94, 0x7a, 0x05, 0xfa, 0x34, 0xa6, 0x8e, 0x9d, 0xde, + 0x9f, 0x62, 0xec, 0x09, 0xdd, 0xd4, 0x3a, 0x21, 0x6d, 0x16, 0x13, + 0x35, 0x25, 0x7b, 0x97, 0x19, 0x02, 0x34, 0xb7, 0x9a, 0xc8, 0x7d, + 0xa1, 0x84, 0xf9, 0x9a, 0x93, 0x7c, 0x09, 0x75, 0xdd, 0x02, 0x4d, + 0xb9, 0xd7, 0x19}}; + auto const ed8Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed8PublicKey{ + {0xb6, 0x55, 0xc8, 0xa4, 0x14, 0x20, 0x73, 0x44, 0x12, 0x06, 0xf6, + 0xf7, 0xd0, 0x03, 0x74, 0x53, 0xaa, 0x74, 0x6c, 0xf1, 0x84, 0x0e, + 0x86, 0x1d, 0xb1, 0x97, 0x1a, 0x04, 0x91, 0x83, 0x3b, 0x49}}; + std::array const ed8Sig{ + {0x4d, 0xf6, 0x5a, 0x0e, 0xa4, 0x6f, 0x3d, 0xa0, 0x76, 0xe4, 0x3a, + 0xea, 0x69, 0x1e, 0x3f, 0xe4, 0x45, 0x51, 0x97, 0xc8, 0x7e, 0x3c, + 0xd6, 0x34, 0xc8, 0x7f, 0xa3, 0xf9, 0xd7, 0xfe, 0x0a, 0xf4, 0x86, + 0x18, 0xc5, 0xfa, 0x1c, 0x73, 0x88, 0x37, 0x33, 0x3d, 0xd4, 0x8c, + 0x08, 0xf9, 0xa5, 0xf0, 0x83, 0x37, 0x06, 0x5b, 0xd3, 0xfc, 0x20, + 0x12, 0x42, 0x7a, 0x7a, 0xd7, 0x60, 0xc5, 0xd1, 0x0b}}; + std::array const ed8SigningKey{ + {0xc2, 0x00, 0xc6, 0x2e, 0x45, 0xde, 0xf2, 0x39, 0x81, 0x0a, 0xf8, + 0x6d, 0x53, 0x29, 0xe3, 0x1b, 0x8e, 0x57, 0xad, 0xfa, 0x29, 0x1b, + 0x07, 0x1a, 0xee, 0x34, 0xe6, 0x57, 0x5a, 0xeb, 0xf2, 0x1c}}; + (void)ed8SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix12CondConditionFingerprint = { + {0x62, 0x19, 0xb5, 0xb2, 0x02, 0x0a, 0x42, 0x6c, 0x9a, 0xc2, 0x0c, + 0x27, 0xf5, 0xe1, 0x01, 0x2a, 0x88, 0x37, 0x8a, 0xa4, 0x73, 0x3b, + 0x30, 0x29, 0xd4, 0xb8, 0xf4, 0x88, 0xd7, 0x2f, 0xf1, 0x3f}}; + Condition const Prefix12Cond{Type::prefixSha256, + 68671, + Prefix12CondConditionFingerprint, + std::bitset<5>{8}}; + std::array const Thresh16CondConditionFingerprint = { + {0xd0, 0x45, 0x11, 0x62, 0xbb, 0x46, 0xc2, 0xd2, 0xb6, 0x39, 0xc9, + 0xd0, 0x0d, 0x59, 0x42, 0x06, 0xa7, 0x7b, 0x38, 0x7d, 0xf3, 0x8f, + 0x33, 0x0b, 0x94, 0x2d, 0x18, 0xee, 0xdc, 0x0e, 0xb2, 0xa6}}; + Condition const Thresh16Cond{Type::thresholdSha256, + 276480, + Thresh16CondConditionFingerprint, + std::bitset<5>{25}}; + + auto rsa2 = std::make_unique( + makeSlice(rsa2PublicKey), makeSlice(rsa2Sig)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(rsa2)); + std::vector thresh1Subconditions{ + {Preim3Cond, Rsa4Cond, Ed5Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim6 = + std::make_unique(makeSlice(preim6Preimage)); + auto rsa7 = std::make_unique( + makeSlice(rsa7PublicKey), makeSlice(rsa7Sig)); + auto ed8 = std::make_unique(ed8PublicKey, ed8Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim6)); + thresh0Subfulfillments.emplace_back(std::move(rsa7)); + thresh0Subfulfillments.emplace_back(std::move(ed8)); + std::vector thresh0Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond, Prefix12Cond, Thresh16Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\xe8\xa0\x82\x05\x0e\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3" + "\x82\x02\x08\x80\x82\x01\x00\xba\x2c\x3b\x50\xb6\xbf\xf9\x0f" + "\x1d\xd7\x32\x4c\x01\x5f\xff\x2f\x2a\xf6\x33\xd0\xfb\xea\x1f" + "\xa4\xf2\x2d\x22\x8a\x19\x95\xa9\x17\xb7\x4f\x17\xcf\x55\xcd" + "\x1a\x3a\x5f\x07\x73\xcc\xaa\x21\x70\x64\xb3\xa0\xf4\xb7\x30" + "\xa3\x82\x37\x93\xc6\x59\xde\x1b\xa1\x16\x90\x5a\x1a\xf6\x73" + "\xab\x92\xc8\x2f\xf4\x6f\x5c\xf2\x22\x1d\x30\xf8\x03\xd8\x9b" + "\x5f\x73\x72\x8e\x5f\xd5\x37\x4b\x43\xda\xfe\x84\x21\x67\xe8" + "\xe3\xd7\x91\x3f\x24\x1d\xfb\x1f\x12\x6e\xcb\xfc\xb7\x5b\x0a" + "\x35\x73\x3b\xce\x44\x34\x8e\xcd\x53\xa4\xcf\xa7\x63\x73\xcd" + "\x31\x0f\xe0\x75\x8d\xe4\xa9\xdc\xfe\xf0\xc9\x3d\x26\xaf\xbf" + "\x7b\x0f\x0e\x17\xb9\xd0\x4a\x32\x80\x64\x6b\x54\x73\x5a\x50" + "\xc7\x31\x59\xf9\x73\x72\xa5\x79\xba\xdb\xa1\x14\x8d\x77\x67" + "\x3e\xc0\x5b\xec\x6f\x0b\xf7\xc5\xee\x5a\xa6\x8d\x49\x63\x81" + "\xbb\xd1\xf9\x9e\xbb\xed\xb2\xa9\x18\x60\xa7\xee\xeb\x30\xa1" + "\x92\x93\xe8\xd8\x34\x9e\xac\xd6\x23\xfc\x7f\xcb\xe7\xfe\xa7" + "\xe6\x42\xac\x77\x11\xc0\x67\x77\xd1\xaa\x5e\xed\x3b\xd5\xa5" + "\x8d\x34\x7c\xd9\x57\x44\xa7\xc5\x44\x2e\x1e\xe7\x63\xd8\x53" + "\x1b\x9a\xd9\x67\x02\x13\x32\x61\x81\x82\x01\x00\x4f\x97\x46" + "\xb1\x1f\x49\x93\x4b\x8a\x68\x02\x30\xd4\x3b\x3b\x51\xb8\x0c" + "\x81\x69\xc5\x16\x0e\x26\x32\x69\x42\xa6\x0b\xc0\x03\x01\x24" + "\xbc\xf1\x2c\xac\xf3\x1f\xd7\x29\x52\x9b\xbb\xdb\x16\x66\x54" + "\x75\x58\xf6\x7c\x2f\xdd\x2e\x4e\xce\x1f\xcd\x48\x08\xab\x34" + "\x04\x5c\x01\x62\x88\x71\xe9\x98\x7a\x73\x22\x4b\x0b\xd9\x54" + "\x22\x16\xcc\x6a\x56\x40\xaf\x1d\x37\xd3\x77\xb4\x23\xf6\x9f" + "\xba\x85\x44\x43\x6a\xcf\x8b\x8a\x61\x38\xa5\x4d\x0b\x92\xfa" + "\x8e\x0a\x21\xd1\x07\xb6\x82\xbf\x4f\xd5\x54\x76\xc8\x70\x3e" + "\xb8\xff\xe2\xa7\x3e\xb1\x58\xba\xc9\xd8\x63\xc2\xb7\x20\x65" + "\x34\x9d\x37\xae\x1d\x23\x9a\x4f\xe7\x72\x26\x56\xe8\x17\x9a" + "\x40\x2b\x04\x60\x7d\x66\xb1\x27\xb4\xcc\x74\x8e\x4d\x5c\x28" + "\x2e\x51\x16\x17\x9c\x8e\xd0\xf9\x36\x5c\x11\xbe\x6a\xe6\x53" + "\x32\x9d\xae\x3c\x43\x1d\x1b\x97\x97\xdf\x87\xdc\x0d\xb8\xd0" + "\x8e\x8c\xe8\xdc\x2a\x42\xd3\xa5\x5c\x46\x75\x4f\x76\xd6\xa9" + "\xbc\x60\xc4\xc3\xf9\x10\xb5\x1f\x94\xaf\x57\xd7\xcc\x72\xd5" + "\x56\x43\xf5\x2a\x75\xb7\xbb\xca\xc8\x0d\xd9\x1a\x38\x68\x3c" + "\x08\x8f\x96\x4f\x06\xbc\x3f\xbd\xd6\x37\xed\x09\x48\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x3a\x82" + "\x3b\x32\x38\xb1\x3c\x17\x87\x60\x62\xec\xcf\x91\xb0\xaf\xaa" + "\xe5\x11\xe6\xfb\xe2\xb0\x3d\x70\x4d\x1d\xad\xd6\x7c\xee\xa6" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x90\xce\xed\x45\x98\x68" + "\xff\x19\x2b\x27\xc1\x2a\xa2\x6e\x2e\x82\xf3\xbd\x71\x13\x61" + "\xb0\x76\x40\x4d\x48\xea\x16\xfb\x27\x57\xdc\x81\x03\x02\x00" + "\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xb5\x8b\xa2\xa1\xc0\x5b" + "\xc3\xa3\x64\xe9\x88\xe3\x25\x89\xa0\x6d\x73\x8a\x46\x09\x58" + "\xb4\x85\x66\x87\x56\x85\x39\xee\x6d\x77\xbb\x99\x57\x90\x0e" + "\x9c\x9c\xd5\x40\xc4\x8b\x37\xb1\xfe\x78\xb7\xe1\xe8\xb7\x74" + "\xee\x74\x9c\xe5\xa3\xdd\xb7\x87\x77\xb7\x14\x08\x71\xc4\xec" + "\x85\xe2\xe3\xc1\x1e\x34\x14\x21\xe1\xac\xd3\x20\x0f\xb8\x11" + "\x24\x69\xa3\x7d\x98\x35\x2a\xdf\x56\x7d\x30\xf7\x31\x64\x73" + "\xcf\x0c\x9e\xa6\x3b\x7d\x93\xb1\xc4\xb6\x78\x39\x52\x3b\x4d" + "\xb6\xb2\x55\x17\x95\x27\xbd\xd6\xc1\x28\x7b\x82\xbb\xeb\xea" + "\xec\x7e\x48\x35\xb3\x4b\x78\x30\xc4\x66\x32\x39\x2d\xd6\x5f" + "\x59\xeb\x81\x64\x68\xdb\x94\xf4\x8e\x5f\x34\x4f\x3b\x03\xe5" + "\xa6\x1b\x30\x6c\xea\xe8\xc6\x36\xf8\xee\x0b\x0f\xb5\xd2\xe7" + "\xa4\x0a\xbc\xef\x80\x7e\xb1\x9b\xda\xe6\x40\x4a\x3f\x6f\xd1" + "\x5a\x64\x84\xb2\x5c\xd2\xf0\x38\x7c\xcb\xd1\xcd\xdd\x37\x3f" + "\x76\xe7\x08\x25\xe5\xd3\xd9\xe3\x21\x1b\x88\x41\x3d\x2d\x32" + "\xff\xd3\xfe\x4d\x40\x85\x1b\x0f\xd6\xab\x4e\xb7\x38\x68\xe9" + "\x67\xc7\xb5\xd1\x38\xdb\x85\x2e\x2f\x76\xea\x4a\xce\xff\x08" + "\x5e\x93\x87\x98\xf7\x95\xeb\x49\xf6\x8d\x81\x82\x01\x00\x66" + "\x76\x0f\x57\xb1\x60\xc0\xf1\xa3\x7a\xca\x3c\x77\x39\x37\x4e" + "\xa6\x88\x77\xd7\xb2\x58\x84\x47\x54\xc4\x46\xc7\xc6\xfc\x23" + "\xc8\x79\xe0\x94\x7a\x4d\x3f\x13\x77\x56\x93\x96\x5f\x42\x13" + "\xeb\xbf\xec\x73\x3b\x75\xff\xd0\x4e\xf4\x23\x52\xce\x12\x5f" + "\xef\x48\x71\xed\x40\x15\x7b\x96\x76\xc8\xac\xba\x85\x3a\x06" + "\x1e\x5b\x04\x29\x31\x6a\x20\xdb\x8b\x0a\x36\x04\x14\xe9\x8f" + "\x43\xb9\x95\x5e\xdc\xe6\x64\xf0\xe6\xd3\xf6\x85\x9f\x62\xcf" + "\xd0\x59\x46\xcd\x98\x05\x6f\xc7\xa5\x12\xb0\x40\x04\x22\x18" + "\x99\x03\x86\x98\x3e\x83\x40\x36\xab\x05\x8b\xd3\x2d\x56\x3e" + "\x36\x57\x6e\x98\x09\x8c\x8a\xfe\xff\x0e\xb3\x45\x23\xbf\x80" + "\x2e\x29\xa4\x1c\xc0\xc3\xd8\x76\x12\xf8\xa7\x9e\xd9\x35\x22" + "\xf3\x17\x5d\x6b\x6c\xec\x60\x3e\xb2\xb5\x30\x3d\xa9\x27\xc8" + "\x72\xc0\xbc\xce\xe3\xc7\x66\x4f\xb9\x9b\x20\xcf\xea\xc1\x8c" + "\xe7\xff\xf6\x5f\xa2\x9e\xe9\x30\x3a\x36\x98\x58\x80\x95\x05" + "\x94\x7a\x05\xfa\x34\xa6\x8e\x9d\xde\x9f\x62\xec\x09\xdd\xd4" + "\x3a\x21\x6d\x16\x13\x35\x25\x7b\x97\x19\x02\x34\xb7\x9a\xc8" + "\x7d\xa1\x84\xf9\x9a\x93\x7c\x09\x75\xdd\x02\x4d\xb9\xd7\x19" + "\xa4\x64\x80\x20\xb6\x55\xc8\xa4\x14\x20\x73\x44\x12\x06\xf6" + "\xf7\xd0\x03\x74\x53\xaa\x74\x6c\xf1\x84\x0e\x86\x1d\xb1\x97" + "\x1a\x04\x91\x83\x3b\x49\x81\x40\x4d\xf6\x5a\x0e\xa4\x6f\x3d" + "\xa0\x76\xe4\x3a\xea\x69\x1e\x3f\xe4\x45\x51\x97\xc8\x7e\x3c" + "\xd6\x34\xc8\x7f\xa3\xf9\xd7\xfe\x0a\xf4\x86\x18\xc5\xfa\x1c" + "\x73\x88\x37\x33\x3d\xd4\x8c\x08\xf9\xa5\xf0\x83\x37\x06\x5b" + "\xd3\xfc\x20\x12\x42\x7a\x7a\xd7\x60\xc5\xd1\x0b\xa1\x81\xd3" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x62\x19" + "\xb5\xb2\x02\x0a\x42\x6c\x9a\xc2\x0c\x27\xf5\xe1\x01\x2a\x88" + "\x37\x8a\xa4\x73\x3b\x30\x29\xd4\xb8\xf4\x88\xd7\x2f\xf1\x3f" + "\x81\x03\x01\x0c\x3f\x82\x02\x04\x10\xa2\x2b\x80\x20\xd0\x45" + "\x11\x62\xbb\x46\xc2\xd2\xb6\x39\xc9\xd0\x0d\x59\x42\x06\xa7" + "\x7b\x38\x7d\xf3\x8f\x33\x0b\x94\x2d\x18\xee\xdc\x0e\xb2\xa6" + "\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x3c\x73" + "\x38\xcf\x23\xc6\x31\x53\x28\xc4\x27\xf8\x95\x87\x99\x83\x2d" + "\x35\x3c\x03\x9b\xd1\xff\xff\x2e\x53\x20\xe9\x5e\x62\xb9\xb7" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x41\x80\x08\xb2\x60\x74" + "\x57\x6d\xac\xed\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95\xa1" + "\x49\x17\xc7\x65\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02\x00" + "\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xeb\xe2\x93\xb6\x70\xe4\xdf\x40\x88\x1a\xc6" + "\xd1\x51\x0c\x58\xef\x90\x1c\xa6\xad\xfa\xd5\x87\x30\xd5\x11" + "\x36\x84\xa6\x98\xed\x83\x81\x03\x0a\x6c\x00\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x62\x19\xb5\xb2\x02\x0a\x42\x6c\x9a\xc2\x0c\x27" + "\xf5\xe1\x01\x2a\x88\x37\x8a\xa4\x73\x3b\x30\x29\xd4\xb8\xf4" + "\x88\xd7\x2f\xf1\x3f\x81\x03\x01\x0c\x3f\x82\x02\x04\x10\xa2" + "\x2b\x80\x20\x85\x86\xac\x0e\x50\x6e\xd6\xba\xa1\xe6\xb1\xaf" + "\x03\x54\x64\x55\x8f\x25\x49\xa1\xe4\xb2\x8a\x6d\xf8\x06\x3b" + "\x83\x26\xa2\xb7\x2d\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa2" + "\x2b\x80\x20\xd0\x45\x11\x62\xbb\x46\xc2\xd2\xb6\x39\xc9\xd0" + "\x0d\x59\x42\x06\xa7\x7b\x38\x7d\xf3\x8f\x33\x0b\x94\x2d\x18" + "\xee\xdc\x0e\xb2\xa6\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x3c\x73\x38\xcf\x23\xc6\x31\x53\x28\xc4\x27\xf8" + "\x95\x87\x99\x83\x2d\x35\x3c\x03\x9b\xd1\xff\xff\x2e\x53\x20" + "\xe9\x5e\x62\xb9\xb7\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x6c" + "\x7b\xea\x83\xa1\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba" + "\x90\x3d\x96\xc1\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc" + "\xd5\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x41\x80\x08\xb2\x60" + "\x74\x57\x6d\xac\xed\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95" + "\xa1\x49\x17\xc7\x65\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06" + "\x51\x4c\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f" + "\xc9\x34\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh44() + { + testcase("Thresh44"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim17Cond + // ** Rsa18Cond + // ** Ed19Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** rsa2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** rsa4 + // ** prefix11 + // *** prefix12 + // **** thresh13 + // ***** rsa14 + // ** thresh15 + // *** rsa16 + + auto const rsa2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa2PublicKey{ + {0xba, 0x2c, 0x3b, 0x50, 0xb6, 0xbf, 0xf9, 0x0f, 0x1d, 0xd7, 0x32, + 0x4c, 0x01, 0x5f, 0xff, 0x2f, 0x2a, 0xf6, 0x33, 0xd0, 0xfb, 0xea, + 0x1f, 0xa4, 0xf2, 0x2d, 0x22, 0x8a, 0x19, 0x95, 0xa9, 0x17, 0xb7, + 0x4f, 0x17, 0xcf, 0x55, 0xcd, 0x1a, 0x3a, 0x5f, 0x07, 0x73, 0xcc, + 0xaa, 0x21, 0x70, 0x64, 0xb3, 0xa0, 0xf4, 0xb7, 0x30, 0xa3, 0x82, + 0x37, 0x93, 0xc6, 0x59, 0xde, 0x1b, 0xa1, 0x16, 0x90, 0x5a, 0x1a, + 0xf6, 0x73, 0xab, 0x92, 0xc8, 0x2f, 0xf4, 0x6f, 0x5c, 0xf2, 0x22, + 0x1d, 0x30, 0xf8, 0x03, 0xd8, 0x9b, 0x5f, 0x73, 0x72, 0x8e, 0x5f, + 0xd5, 0x37, 0x4b, 0x43, 0xda, 0xfe, 0x84, 0x21, 0x67, 0xe8, 0xe3, + 0xd7, 0x91, 0x3f, 0x24, 0x1d, 0xfb, 0x1f, 0x12, 0x6e, 0xcb, 0xfc, + 0xb7, 0x5b, 0x0a, 0x35, 0x73, 0x3b, 0xce, 0x44, 0x34, 0x8e, 0xcd, + 0x53, 0xa4, 0xcf, 0xa7, 0x63, 0x73, 0xcd, 0x31, 0x0f, 0xe0, 0x75, + 0x8d, 0xe4, 0xa9, 0xdc, 0xfe, 0xf0, 0xc9, 0x3d, 0x26, 0xaf, 0xbf, + 0x7b, 0x0f, 0x0e, 0x17, 0xb9, 0xd0, 0x4a, 0x32, 0x80, 0x64, 0x6b, + 0x54, 0x73, 0x5a, 0x50, 0xc7, 0x31, 0x59, 0xf9, 0x73, 0x72, 0xa5, + 0x79, 0xba, 0xdb, 0xa1, 0x14, 0x8d, 0x77, 0x67, 0x3e, 0xc0, 0x5b, + 0xec, 0x6f, 0x0b, 0xf7, 0xc5, 0xee, 0x5a, 0xa6, 0x8d, 0x49, 0x63, + 0x81, 0xbb, 0xd1, 0xf9, 0x9e, 0xbb, 0xed, 0xb2, 0xa9, 0x18, 0x60, + 0xa7, 0xee, 0xeb, 0x30, 0xa1, 0x92, 0x93, 0xe8, 0xd8, 0x34, 0x9e, + 0xac, 0xd6, 0x23, 0xfc, 0x7f, 0xcb, 0xe7, 0xfe, 0xa7, 0xe6, 0x42, + 0xac, 0x77, 0x11, 0xc0, 0x67, 0x77, 0xd1, 0xaa, 0x5e, 0xed, 0x3b, + 0xd5, 0xa5, 0x8d, 0x34, 0x7c, 0xd9, 0x57, 0x44, 0xa7, 0xc5, 0x44, + 0x2e, 0x1e, 0xe7, 0x63, 0xd8, 0x53, 0x1b, 0x9a, 0xd9, 0x67, 0x02, + 0x13, 0x32, 0x61}}; + std::array const rsa2Sig{ + {0x57, 0x5a, 0x61, 0x3f, 0x7c, 0x36, 0xca, 0xd7, 0x03, 0x26, 0x52, + 0x3d, 0xdd, 0x72, 0x2b, 0x9c, 0xd0, 0xa3, 0x23, 0x6d, 0x35, 0x3d, + 0xbd, 0xe6, 0xd7, 0x57, 0x94, 0xe9, 0xfb, 0x2a, 0xa9, 0x42, 0x52, + 0x36, 0xd6, 0x17, 0xf7, 0x61, 0x50, 0x32, 0xd4, 0x49, 0xb6, 0xf0, + 0x04, 0x1e, 0xcb, 0x34, 0x42, 0xb4, 0x4b, 0xcb, 0x83, 0xff, 0xf5, + 0xe7, 0x59, 0xbc, 0x75, 0x37, 0x6b, 0x4a, 0x0a, 0xb7, 0x34, 0x71, + 0xf5, 0xa6, 0xc7, 0xfc, 0xb6, 0x38, 0xaf, 0x11, 0xfb, 0x9d, 0x15, + 0xfa, 0xae, 0x01, 0xe1, 0xab, 0x8e, 0x6e, 0xa6, 0xe7, 0x95, 0x10, + 0xab, 0x64, 0xb7, 0x74, 0x3a, 0x0f, 0x9b, 0x60, 0x43, 0xfa, 0x62, + 0x0c, 0x9c, 0xf0, 0xce, 0x01, 0x38, 0x5f, 0xdb, 0xba, 0x07, 0xc3, + 0x68, 0xf2, 0xd5, 0xe8, 0x53, 0xfc, 0xf1, 0xc4, 0x0c, 0x25, 0x68, + 0xf8, 0x4d, 0x59, 0xf4, 0x79, 0x3a, 0x93, 0x65, 0x01, 0xa2, 0x9b, + 0x44, 0x1f, 0xec, 0xca, 0x21, 0xf5, 0x8f, 0x1b, 0xe3, 0x57, 0x40, + 0xa1, 0xff, 0x3f, 0x1d, 0x50, 0xac, 0x30, 0x8d, 0xef, 0xfd, 0x0f, + 0x15, 0x52, 0x5c, 0x58, 0x48, 0x52, 0x71, 0x0f, 0x49, 0xd9, 0x61, + 0x76, 0x1f, 0x1b, 0xa8, 0x60, 0x48, 0x3b, 0x35, 0x64, 0x42, 0x72, + 0xbe, 0x84, 0xd8, 0x64, 0x43, 0x30, 0x46, 0x99, 0x54, 0xda, 0xdc, + 0xd7, 0xc3, 0x59, 0x4f, 0x8a, 0x97, 0x4d, 0x4f, 0x8c, 0xfe, 0xa7, + 0x92, 0xeb, 0xe0, 0xc1, 0xc0, 0xf0, 0xde, 0x9c, 0x6f, 0x2f, 0xee, + 0x4d, 0x20, 0xa2, 0xde, 0xcc, 0xf3, 0x78, 0xb3, 0x4b, 0x44, 0x83, + 0xbf, 0xbc, 0xd9, 0xea, 0x8e, 0xe7, 0x74, 0x44, 0x36, 0xdd, 0x27, + 0xea, 0x53, 0x6b, 0xfe, 0x30, 0xc2, 0x79, 0x23, 0x61, 0x7e, 0x2b, + 0xdc, 0x14, 0xdb, 0x21, 0xd6, 0x24, 0x38, 0x78, 0xbd, 0xc5, 0xd2, + 0x9b, 0x9c, 0x92}}; + auto const rsa4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x33, 0x93, 0xd7, 0x94, 0x50, 0x66, 0xe6, 0x92, 0x0e, 0x66, 0x8b, + 0x91, 0x19, 0x00, 0x07, 0xfa, 0x8f, 0xc8, 0x7a, 0xb4, 0x79, 0xc8, + 0xab, 0x76, 0x39, 0xdd, 0xe0, 0x37, 0xe2, 0xcd, 0xb2, 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b0, 0xfd, 0x30, 0xa4, 0xd1, 0xfc, 0x17, 0x25, 0xae, + 0xac, 0x2f, 0xab, 0x17, 0x50, 0x0e, 0x96, 0xef, 0x8d, 0x9a, 0xd0, + 0xbd, 0xa6, 0xa9, 0xaf, 0x66, 0x6b, 0xbb, 0x98, 0xb2, 0xa0, 0xae, + 0x82, 0x3e, 0x94, 0xda, 0x08, 0xce, 0x28, 0xba, 0x25, 0x70, 0x81, + 0x91, 0x02, 0x22}}; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + auto const rsa14Msg = "P12P11abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa14PublicKey{ + {0xbd, 0x63, 0x74, 0xd9, 0xc0, 0x3e, 0x0c, 0x57, 0x55, 0x99, 0x00, + 0xf3, 0xa8, 0x03, 0xdc, 0x9a, 0x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x30, 0x50, + 0x4a, 0x6b, 0x93, 0xab, 0xcf, 0x69, 0x5a, 0x09, 0xd2, 0x5a, 0x87, + 0x31, 0x80, 0xa7, 0x5b, 0xe4, 0x34, 0x42, 0x13, 0x44, 0x1d, 0xe6, + 0xf9, 0x27, 0x21, 0xa7, 0x03, 0x74, 0x64, 0x18, 0xfa, 0xd0, 0x68, + 0x28, 0x73, 0x37, 0x3c, 0xf6, 0x63, 0x10, 0x56, 0xcc, 0x25, 0x08, + 0xb9, 0xad, 0xc8, 0x25, 0x64, 0xd1, 0x9c, 0x7c, 0xe7, 0x6c, 0xa6, + 0x12, 0x2c, 0x7d}}; + std::array const rsa14Sig{ + {0x55, 0xb2, 0xf2, 0x72, 0x2a, 0x3d, 0xf3, 0x7d, 0xdb, 0x90, 0xed, + 0x6e, 0x9e, 0x24, 0xb8, 0xc0, 0xd8, 0x69, 0x5a, 0xa7, 0x82, 0x7f, + 0xf5, 0x4b, 0x15, 0x8f, 0x50, 0xb2, 0x8e, 0xc1, 0x77, 0x26, 0x4f, + 0x05, 0xd4, 0x8e, 0x97, 0x64, 0x35, 0xa1, 0xa6, 0x69, 0x75, 0xc6, + 0x12, 0x3d, 0x4b, 0x70, 0x3f, 0xee, 0xc8, 0xdd, 0xe8, 0x28, 0x9d, + 0xf2, 0xdd, 0x1e, 0x51, 0x20, 0x94, 0x07, 0xc3, 0x05, 0x0c, 0x81, + 0xcd, 0x2b, 0xef, 0xd1, 0x38, 0xa2, 0x46, 0x70, 0x2c, 0x92, 0x94, + 0x73, 0xe7, 0x39, 0x36, 0x7c, 0xbe, 0xc0, 0xf8, 0x17, 0x58, 0x4a, + 0xa1, 0x57, 0x5f, 0x99, 0x13, 0x9e, 0x4c, 0x51, 0xcf, 0xe8, 0x42, + 0x66, 0x1c, 0x6f, 0xd9, 0x94, 0xa4, 0x2d, 0x81, 0xb1, 0x7d, 0xf8, + 0xe8, 0xbb, 0x4f, 0xbe, 0x30, 0x03, 0x7a, 0xbc, 0x65, 0xf4, 0xe9, + 0xd9, 0x13, 0xe5, 0xbd, 0x4f, 0xcd, 0xc5, 0x44, 0xd2, 0x83, 0x25, + 0x6f, 0x02, 0xe5, 0x16, 0x7d, 0xf0, 0x2c, 0x62, 0x76, 0x40, 0x8a, + 0x89, 0x7a, 0xa4, 0xc8, 0x39, 0x4d, 0xf3, 0xa6, 0x36, 0x85, 0x2e, + 0x88, 0x06, 0x31, 0xf8, 0xd7, 0xc0, 0x02, 0xa6, 0x1d, 0x6d, 0xdc, + 0x85, 0x4b, 0x77, 0xd5, 0xbb, 0xed, 0xc7, 0x09, 0x57, 0x42, 0xea, + 0x65, 0x9e, 0x5f, 0x4a, 0xb1, 0x79, 0x2d, 0x28, 0x93, 0xf4, 0xe4, + 0xa7, 0x66, 0xf6, 0x3e, 0xa7, 0x23, 0x9a, 0x29, 0xf2, 0xa9, 0xca, + 0xeb, 0x96, 0x60, 0x82, 0xbb, 0x57, 0x3e, 0x82, 0x50, 0xa6, 0x74, + 0xf7, 0x60, 0xa9, 0xf7, 0x6b, 0x77, 0x4d, 0x4d, 0x8e, 0xbc, 0xf9, + 0x13, 0x44, 0x7e, 0x8e, 0xa5, 0x9f, 0x6c, 0x33, 0x83, 0x26, 0x3e, + 0x6c, 0xe5, 0xd8, 0xe4, 0x00, 0xd5, 0x80, 0x0d, 0x75, 0xff, 0x03, + 0xc9, 0x02, 0xeb, 0xe0, 0x5a, 0x3b, 0x37, 0x74, 0xa4, 0x80, 0x79, + 0x16, 0x39, 0xb1}}; + auto const thresh13Msg = "P12P11abcdefghijklmnopqrstuvwxyz"s; + auto const prefix12Prefix = "P12"s; + auto const prefix12Msg = "P11abcdefghijklmnopqrstuvwxyz"s; + auto const prefix12MaxMsgLength = 29; + auto const prefix11Prefix = "P11"s; + auto const prefix11Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix11MaxMsgLength = 26; + auto const rsa16Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa16PublicKey{ + {0xe8, 0x03, 0x7c, 0xff, 0x40, 0x68, 0x5d, 0xc7, 0xb8, 0xd0, 0x9f, + 0x9a, 0x83, 0xf9, 0x02, 0xe6, 0xfe, 0xa5, 0xb9, 0x0e, 0x9f, 0xdc, + 0x44, 0x74, 0x59, 0x3e, 0xef, 0x61, 0xdc, 0xb6, 0x4b, 0x49, 0xfe, + 0x1a, 0x67, 0x73, 0x38, 0x7b, 0x1c, 0xb4, 0xfa, 0x24, 0x39, 0xe4, + 0xbb, 0x74, 0x1b, 0xe4, 0x66, 0xfd, 0x85, 0x6f, 0x8d, 0x92, 0x3e, + 0x04, 0x70, 0xb4, 0x21, 0x01, 0xcf, 0x07, 0xf2, 0xeb, 0x11, 0x2c, + 0xaa, 0x9d, 0x37, 0xbb, 0xf3, 0x8d, 0x9b, 0xbc, 0x17, 0x60, 0xe4, + 0xe3, 0xae, 0x79, 0x92, 0x97, 0x3a, 0xe8, 0xd8, 0x74, 0xc5, 0x9d, + 0xeb, 0x15, 0x22, 0x8b, 0xae, 0x51, 0x13, 0x78, 0x21, 0xca, 0xbd, + 0x6a, 0xa6, 0x24, 0x93, 0x8f, 0xe6, 0x23, 0x12, 0x52, 0xe1, 0x75, + 0xda, 0x55, 0x26, 0xcc, 0x95, 0xa0, 0x75, 0x31, 0x0a, 0x6e, 0x27, + 0x14, 0x63, 0x70, 0x04, 0xd7, 0xe4, 0x36, 0x21, 0x3a, 0x9e, 0xff, + 0xe3, 0x16, 0x21, 0xc1, 0xfc, 0x6d, 0xc5, 0xe2, 0x80, 0xb9, 0x26, + 0xc6, 0x4f, 0x3c, 0xc2, 0xd5, 0x25, 0xf1, 0xb9, 0x88, 0xac, 0xc7, + 0xfe, 0xde, 0xd6, 0x7e, 0x60, 0x41, 0x82, 0xde, 0x25, 0x28, 0x1f, + 0x09, 0xda, 0x10, 0x01, 0x27, 0xf4, 0x63, 0x10, 0xa2, 0x4e, 0x1d, + 0xc2, 0x19, 0x32, 0xb3, 0x87, 0xc2, 0xcf, 0xac, 0x3c, 0x2b, 0xcd, + 0x5e, 0x79, 0x1f, 0x19, 0xea, 0x70, 0x56, 0x31, 0x59, 0x0e, 0x13, + 0x95, 0x05, 0xb7, 0xf9, 0xff, 0xd9, 0x0b, 0x49, 0xce, 0xd0, 0x6f, + 0xae, 0x90, 0x44, 0xb3, 0x6b, 0x60, 0xc9, 0x72, 0xf7, 0x83, 0x24, + 0x5e, 0x15, 0x25, 0x1c, 0xb8, 0x76, 0x71, 0x84, 0x33, 0x14, 0xf1, + 0xf0, 0x07, 0x7f, 0x2f, 0x95, 0xee, 0x3c, 0x36, 0x67, 0x36, 0xb4, + 0xae, 0x1c, 0xb5, 0x02, 0xa2, 0xdc, 0x0e, 0xed, 0xf2, 0x63, 0x0d, + 0x52, 0x61, 0xe3}}; + std::array const rsa16Sig{ + {0x9f, 0x6a, 0x85, 0x4f, 0x72, 0x52, 0x6b, 0xf3, 0x85, 0xe0, 0x66, + 0x36, 0x46, 0x29, 0xa2, 0x6f, 0x9d, 0xda, 0xa3, 0xaa, 0xaa, 0x79, + 0x74, 0x7b, 0x73, 0x4a, 0x02, 0xb1, 0x77, 0xb4, 0x70, 0x13, 0xa9, + 0x42, 0x04, 0x93, 0x06, 0x32, 0x3c, 0x73, 0x50, 0xbf, 0x3b, 0x73, + 0x69, 0xb1, 0xe5, 0xb6, 0x99, 0xbf, 0xd9, 0xbd, 0x43, 0x90, 0x6f, + 0x03, 0x85, 0x5c, 0x9a, 0x6d, 0x0c, 0x81, 0x0b, 0xa9, 0x0e, 0xc8, + 0xe7, 0x41, 0xe1, 0xea, 0x9a, 0x0f, 0x70, 0x94, 0xac, 0x90, 0xa4, + 0xce, 0x8d, 0x50, 0xed, 0x20, 0xdc, 0x2b, 0x9e, 0xc9, 0xc4, 0x90, + 0x85, 0xa3, 0xcb, 0x24, 0xbb, 0x64, 0xd7, 0x61, 0x29, 0x4a, 0xc8, + 0x9a, 0x10, 0xef, 0x31, 0xd8, 0x25, 0x00, 0xba, 0x69, 0x95, 0x45, + 0x78, 0x6d, 0x00, 0x46, 0xae, 0xf2, 0x26, 0x19, 0x0f, 0xd3, 0x3d, + 0x06, 0x3a, 0x68, 0x8c, 0x87, 0x12, 0x91, 0x44, 0x65, 0xaf, 0xf7, + 0x70, 0x70, 0x28, 0x5e, 0x86, 0x8c, 0xfb, 0x3b, 0xe8, 0x8f, 0x7e, + 0x87, 0xec, 0xa3, 0x99, 0xe6, 0xe2, 0x42, 0x5b, 0xf7, 0xce, 0xf9, + 0x7a, 0x33, 0x85, 0xa4, 0x99, 0x87, 0x2c, 0x7c, 0xfa, 0xce, 0xaa, + 0xc5, 0xb4, 0x29, 0x21, 0x8f, 0xce, 0x0e, 0x6b, 0x84, 0xe0, 0x22, + 0x87, 0xea, 0xac, 0x81, 0x7d, 0x7a, 0xdb, 0x05, 0xcb, 0xcd, 0xa4, + 0xa9, 0x47, 0x89, 0xb3, 0xef, 0x0c, 0x9b, 0x0e, 0xbc, 0x29, 0xd8, + 0x58, 0x76, 0x2e, 0x22, 0x19, 0xe3, 0x26, 0x3d, 0x5d, 0xa3, 0x84, + 0xc3, 0x2c, 0x0b, 0x54, 0x65, 0xc8, 0x0e, 0xd3, 0xd5, 0xd0, 0x15, + 0xe6, 0x8b, 0x2e, 0x88, 0x19, 0x62, 0x04, 0x7d, 0x33, 0xaf, 0xcb, + 0xef, 0xb7, 0xb6, 0x1d, 0x6e, 0xf8, 0x14, 0x9c, 0xe9, 0xb1, 0xb5, + 0xd1, 0xd6, 0xff, 0xe7, 0x92, 0xf6, 0x00, 0x09, 0xe7, 0x6d, 0xf6, + 0x0a, 0x5f, 0x71}}; + auto const thresh15Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim17CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim17Cond{Type::preimageSha256, + 9, + Preim17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa18CondConditionFingerprint = { + {0x9d, 0xbe, 0x65, 0xf4, 0xae, 0x81, 0x90, 0x79, 0x09, 0x18, 0xa2, + 0x66, 0x12, 0x9c, 0x10, 0x94, 0x66, 0x21, 0x94, 0x70, 0x60, 0x20, + 0x4a, 0x3d, 0x5f, 0xb3, 0x62, 0xb6, 0x06, 0x46, 0x37, 0xfe}}; + Condition const Rsa18Cond{Type::rsaSha256, + 65536, + Rsa18CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed19CondConditionFingerprint = { + {0xe5, 0x88, 0xb7, 0x6e, 0xec, 0x2d, 0xaf, 0x47, 0xc7, 0xa2, 0xf4, + 0x6e, 0xbf, 0x7f, 0x5e, 0x46, 0xd7, 0xfa, 0x33, 0x2c, 0x0a, 0x7e, + 0x86, 0x1d, 0x8c, 0x38, 0xa8, 0x93, 0x52, 0xe8, 0x97, 0xe9}}; + Condition const Ed19Cond{Type::ed25519Sha256, + 131072, + Ed19CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa2 = std::make_unique( + makeSlice(rsa2PublicKey), makeSlice(rsa2Sig)); + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(rsa2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto rsa14 = std::make_unique( + makeSlice(rsa14PublicKey), makeSlice(rsa14Sig)); + std::vector> thresh13Subfulfillments; + thresh13Subfulfillments.emplace_back(std::move(rsa14)); + std::vector thresh13Subconditions{}; + auto thresh13 = std::make_unique( + std::move(thresh13Subfulfillments), + std::move(thresh13Subconditions)); + auto prefix12 = std::make_unique( + makeSlice(prefix12Prefix), + prefix12MaxMsgLength, + std::move(thresh13)); + auto prefix11 = std::make_unique( + makeSlice(prefix11Prefix), + prefix11MaxMsgLength, + std::move(prefix12)); + auto rsa16 = std::make_unique( + makeSlice(rsa16PublicKey), makeSlice(rsa16Sig)); + std::vector> thresh15Subfulfillments; + thresh15Subfulfillments.emplace_back(std::move(rsa16)); + std::vector thresh15Subconditions{}; + auto thresh15 = std::make_unique( + std::move(thresh15Subfulfillments), + std::move(thresh15Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix11)); + thresh0Subfulfillments.emplace_back(std::move(thresh15)); + std::vector thresh0Subconditions{ + {Preim17Cond, Rsa18Cond, Ed19Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x09\xe9\xa0\x82\x09\x6a\xa1\x82\x02\x32\x80\x03\x50" + "\x31\x31\x81\x01\x1a\xa2\x82\x02\x26\xa1\x82\x02\x22\x80\x03" + "\x50\x31\x32\x81\x01\x1d\xa2\x82\x02\x16\xa2\x82\x02\x12\xa0" + "\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xbd\x63\x74\xd9" + "\xc0\x3e\x0c\x57\x55\x99\x00\xf3\xa8\x03\xdc\x9a\x6c\x14\xfc" + "\x83\x33\x63\x87\x35\x9c\xfe\xc3\x00\xb4\x8b\x03\xc7\x5f\x0a" + "\xe2\x94\xaa\x3f\x76\x15\xb1\xb9\xf6\x5f\x0a\x87\x0c\x5c\x35" + "\xbc\x2f\x0f\x04\xdd\x9d\x12\x8d\x94\xeb\x8b\x93\xb4\x4e\x96" + "\x20\xb7\x17\xa0\x8e\xff\x9e\x1f\x43\xbf\xd6\x6a\x1e\xb6\x0d" + "\x7f\x2c\x08\x67\xa5\xe7\xa3\xb6\xd2\x63\x6a\xf2\xeb\xd1\x21" + "\x83\x8f\xa0\x25\x4a\xc6\xcb\x4e\x66\xc3\x5f\x37\xdf\x5c\x12" + "\xb7\xb8\xfa\x7a\x57\x91\x9d\x55\xa6\x96\x91\xee\x94\xb0\xcc" + "\x45\xd3\x76\x70\x6f\x12\xbd\x81\x9d\x08\x1b\x6d\x55\x3c\x19" + "\x56\x9c\xcf\xc4\xb4\x63\x8a\x87\x35\x2b\x4c\xc6\xe1\x0d\x74" + "\x31\xaa\xc6\x25\x0d\x90\x55\x14\xf1\x73\x09\x93\xba\xc6\xda" + "\x52\x7f\xc2\xdd\x9d\xb2\x4f\x92\x43\xa6\xc9\x2c\x22\xc4\x5a" + "\x22\xc2\x56\xac\xfa\x6a\x37\x6a\x0c\x22\x72\x5d\x30\x50\x4a" + "\x6b\x93\xab\xcf\x69\x5a\x09\xd2\x5a\x87\x31\x80\xa7\x5b\xe4" + "\x34\x42\x13\x44\x1d\xe6\xf9\x27\x21\xa7\x03\x74\x64\x18\xfa" + "\xd0\x68\x28\x73\x37\x3c\xf6\x63\x10\x56\xcc\x25\x08\xb9\xad" + "\xc8\x25\x64\xd1\x9c\x7c\xe7\x6c\xa6\x12\x2c\x7d\x81\x82\x01" + "\x00\x55\xb2\xf2\x72\x2a\x3d\xf3\x7d\xdb\x90\xed\x6e\x9e\x24" + "\xb8\xc0\xd8\x69\x5a\xa7\x82\x7f\xf5\x4b\x15\x8f\x50\xb2\x8e" + "\xc1\x77\x26\x4f\x05\xd4\x8e\x97\x64\x35\xa1\xa6\x69\x75\xc6" + "\x12\x3d\x4b\x70\x3f\xee\xc8\xdd\xe8\x28\x9d\xf2\xdd\x1e\x51" + "\x20\x94\x07\xc3\x05\x0c\x81\xcd\x2b\xef\xd1\x38\xa2\x46\x70" + "\x2c\x92\x94\x73\xe7\x39\x36\x7c\xbe\xc0\xf8\x17\x58\x4a\xa1" + "\x57\x5f\x99\x13\x9e\x4c\x51\xcf\xe8\x42\x66\x1c\x6f\xd9\x94" + "\xa4\x2d\x81\xb1\x7d\xf8\xe8\xbb\x4f\xbe\x30\x03\x7a\xbc\x65" + "\xf4\xe9\xd9\x13\xe5\xbd\x4f\xcd\xc5\x44\xd2\x83\x25\x6f\x02" + "\xe5\x16\x7d\xf0\x2c\x62\x76\x40\x8a\x89\x7a\xa4\xc8\x39\x4d" + "\xf3\xa6\x36\x85\x2e\x88\x06\x31\xf8\xd7\xc0\x02\xa6\x1d\x6d" + "\xdc\x85\x4b\x77\xd5\xbb\xed\xc7\x09\x57\x42\xea\x65\x9e\x5f" + "\x4a\xb1\x79\x2d\x28\x93\xf4\xe4\xa7\x66\xf6\x3e\xa7\x23\x9a" + "\x29\xf2\xa9\xca\xeb\x96\x60\x82\xbb\x57\x3e\x82\x50\xa6\x74" + "\xf7\x60\xa9\xf7\x6b\x77\x4d\x4d\x8e\xbc\xf9\x13\x44\x7e\x8e" + "\xa5\x9f\x6c\x33\x83\x26\x3e\x6c\xe5\xd8\xe4\x00\xd5\x80\x0d" + "\x75\xff\x03\xc9\x02\xeb\xe0\x5a\x3b\x37\x74\xa4\x80\x79\x16" + "\x39\xb1\xa1\x00\xa2\x82\x02\x12\xa0\x82\x02\x0c\xa3\x82\x02" + "\x08\x80\x82\x01\x00\xe8\x03\x7c\xff\x40\x68\x5d\xc7\xb8\xd0" + "\x9f\x9a\x83\xf9\x02\xe6\xfe\xa5\xb9\x0e\x9f\xdc\x44\x74\x59" + "\x3e\xef\x61\xdc\xb6\x4b\x49\xfe\x1a\x67\x73\x38\x7b\x1c\xb4" + "\xfa\x24\x39\xe4\xbb\x74\x1b\xe4\x66\xfd\x85\x6f\x8d\x92\x3e" + "\x04\x70\xb4\x21\x01\xcf\x07\xf2\xeb\x11\x2c\xaa\x9d\x37\xbb" + "\xf3\x8d\x9b\xbc\x17\x60\xe4\xe3\xae\x79\x92\x97\x3a\xe8\xd8" + "\x74\xc5\x9d\xeb\x15\x22\x8b\xae\x51\x13\x78\x21\xca\xbd\x6a" + "\xa6\x24\x93\x8f\xe6\x23\x12\x52\xe1\x75\xda\x55\x26\xcc\x95" + "\xa0\x75\x31\x0a\x6e\x27\x14\x63\x70\x04\xd7\xe4\x36\x21\x3a" + "\x9e\xff\xe3\x16\x21\xc1\xfc\x6d\xc5\xe2\x80\xb9\x26\xc6\x4f" + "\x3c\xc2\xd5\x25\xf1\xb9\x88\xac\xc7\xfe\xde\xd6\x7e\x60\x41" + "\x82\xde\x25\x28\x1f\x09\xda\x10\x01\x27\xf4\x63\x10\xa2\x4e" + "\x1d\xc2\x19\x32\xb3\x87\xc2\xcf\xac\x3c\x2b\xcd\x5e\x79\x1f" + "\x19\xea\x70\x56\x31\x59\x0e\x13\x95\x05\xb7\xf9\xff\xd9\x0b" + "\x49\xce\xd0\x6f\xae\x90\x44\xb3\x6b\x60\xc9\x72\xf7\x83\x24" + "\x5e\x15\x25\x1c\xb8\x76\x71\x84\x33\x14\xf1\xf0\x07\x7f\x2f" + "\x95\xee\x3c\x36\x67\x36\xb4\xae\x1c\xb5\x02\xa2\xdc\x0e\xed" + "\xf2\x63\x0d\x52\x61\xe3\x81\x82\x01\x00\x9f\x6a\x85\x4f\x72" + "\x52\x6b\xf3\x85\xe0\x66\x36\x46\x29\xa2\x6f\x9d\xda\xa3\xaa" + "\xaa\x79\x74\x7b\x73\x4a\x02\xb1\x77\xb4\x70\x13\xa9\x42\x04" + "\x93\x06\x32\x3c\x73\x50\xbf\x3b\x73\x69\xb1\xe5\xb6\x99\xbf" + "\xd9\xbd\x43\x90\x6f\x03\x85\x5c\x9a\x6d\x0c\x81\x0b\xa9\x0e" + "\xc8\xe7\x41\xe1\xea\x9a\x0f\x70\x94\xac\x90\xa4\xce\x8d\x50" + "\xed\x20\xdc\x2b\x9e\xc9\xc4\x90\x85\xa3\xcb\x24\xbb\x64\xd7" + "\x61\x29\x4a\xc8\x9a\x10\xef\x31\xd8\x25\x00\xba\x69\x95\x45" + "\x78\x6d\x00\x46\xae\xf2\x26\x19\x0f\xd3\x3d\x06\x3a\x68\x8c" + "\x87\x12\x91\x44\x65\xaf\xf7\x70\x70\x28\x5e\x86\x8c\xfb\x3b" + "\xe8\x8f\x7e\x87\xec\xa3\x99\xe6\xe2\x42\x5b\xf7\xce\xf9\x7a" + "\x33\x85\xa4\x99\x87\x2c\x7c\xfa\xce\xaa\xc5\xb4\x29\x21\x8f" + "\xce\x0e\x6b\x84\xe0\x22\x87\xea\xac\x81\x7d\x7a\xdb\x05\xcb" + "\xcd\xa4\xa9\x47\x89\xb3\xef\x0c\x9b\x0e\xbc\x29\xd8\x58\x76" + "\x2e\x22\x19\xe3\x26\x3d\x5d\xa3\x84\xc3\x2c\x0b\x54\x65\xc8" + "\x0e\xd3\xd5\xd0\x15\xe6\x8b\x2e\x88\x19\x62\x04\x7d\x33\xaf" + "\xcb\xef\xb7\xb6\x1d\x6e\xf8\x14\x9c\xe9\xb1\xb5\xd1\xd6\xff" + "\xe7\x92\xf6\x00\x09\xe7\x6d\xf6\x0a\x5f\x71\xa1\x00\xa2\x82" + "\x05\x1a\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3" + "\x82\x02\x08\x80\x82\x01\x00\xbe\x09\xc5\xa4\x27\x29\xdf\xd4" + "\x67\x76\xbe\xbf\x2c\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67\x20" + "\xfb\x7a\x27\x93\xc0\x78\x47\x78\xd7\x15\x32\xee\x38\x81\x0d" + "\x36\xa2\xc4\x65\x44\xe6\x62\x26\xb9\x58\x13\xa4\x15\x82\xab" + "\xb1\x16\x61\xfc\x01\x98\xc6\x1a\x69\xc6\xba\x39\x3f\x01\x55" + "\x3d\xd7\x8e\x14\x42\x6d\x78\x74\x9b\x28\xcb\x31\x39\x98\x5a" + "\x11\xdc\xc1\x18\x9d\x8d\xb0\xcd\x1b\x4c\x10\xab\x14\x64\x19" + "\xf1\x33\x15\x45\xc8\x92\x82\x03\x82\x8a\xaa\xad\x94\xfc\x24" + "\x11\x96\x99\x7e\x94\x5a\x82\x57\x68\x61\x9f\x7b\x45\xe0\x99" + "\x9e\x4f\x32\x50\x5f\x05\xc8\x11\xae\xc4\x0c\x63\x18\x0e\x02" + "\x59\x36\x25\x92\x06\x32\xc7\x71\x47\x99\xcc\x0a\x6e\x0a\x58" + "\x71\x3f\x5e\xb7\x78\xf7\x98\x79\xdf\x74\xa4\xeb\xa9\x00\xfd" + "\x81\xb3\xcf\x04\x8c\x5d\x7d\xe7\xb2\x82\x90\x49\xbd\x69\xf3" + "\x08\xe9\x92\xc6\x9e\x41\xba\x74\xd8\x8d\x81\x97\x6f\x86\xab" + "\xc9\xf1\x02\x31\xb4\xce\x47\xb0\x39\xc8\xba\x51\xa7\x39\xf3" + "\x71\xa2\x25\x27\x37\x6e\x09\x6f\x19\x59\xbc\x65\xd9\xcd\x12" + "\xd3\x2c\xa2\x78\xfa\x23\x15\x1a\x82\x41\x91\x1b\xbe\x8a\xe7" + "\xfe\x3c\x3c\x30\x32\xaa\xe9\xf3\x81\x82\x01\x00\x33\x93\xd7" + "\x94\x50\x66\xe6\x92\x0e\x66\x8b\x91\x19\x00\x07\xfa\x8f\xc8" + "\x7a\xb4\x79\xc8\xab\x76\x39\xdd\xe0\x37\xe2\xcd\xb2\x6b\xa3" + "\x55\xfb\x08\x03\x31\x38\xa9\x6b\x42\x72\xdb\x11\xad\x6f\x62" + "\x9d\x2d\x16\x6f\xf4\xf8\xad\x95\x05\x3e\xe5\x82\x21\x64\xa3" + "\xd2\x84\x17\xd3\xa8\xef\x83\xf8\xd1\x9c\xf5\xa0\x32\xda\x1f" + "\xca\xa7\x46\x7c\x13\x8f\xee\x2c\x87\xbc\xc9\x04\x2f\x2d\x06" + "\x7d\x14\xaf\xd9\xc0\x98\xa4\xd2\x39\xc1\x4e\x11\x85\xe4\xf2" + "\x21\xbc\x41\x1b\x64\x42\x72\x35\x92\x88\x7d\x3f\x89\xa3\x03" + "\x0e\xdb\xd1\xf5\x2a\x81\xf3\x31\x69\x22\xf4\x5a\x3a\xc3\x67" + "\xec\x20\x4f\x63\x19\xa9\xa5\x2b\xdc\x09\x12\xf1\xe7\x5c\xf7" + "\x1f\x12\xb9\xee\x02\x73\x6e\xe7\x34\x17\x53\x48\x1a\xdf\x8d" + "\xfe\xf6\x7a\x6e\x12\xc4\x0c\x37\x80\xb3\xdd\x3b\xa1\xf6\x6a" + "\xa4\xf4\x0f\x84\x09\xf1\x9f\x55\x5f\x0a\x2a\x0e\xd6\xa3\x47" + "\x4a\x22\x10\xfa\xf5\x7e\x9e\x52\x15\x5a\x5a\xcc\xa8\xb0\xfd" + "\x30\xa4\xd1\xfc\x17\x25\xae\xac\x2f\xab\x17\x50\x0e\x96\xef" + "\x8d\x9a\xd0\xbd\xa6\xa9\xaf\x66\x6b\xbb\x98\xb2\xa0\xae\x82" + "\x3e\x94\xda\x08\xce\x28\xba\x25\x70\x81\x91\x02\x22\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xee\x75" + "\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c\x70" + "\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2\xa0" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6" + "\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2" + "\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00" + "\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xba\x2c\x3b\x50\xb6\xbf" + "\xf9\x0f\x1d\xd7\x32\x4c\x01\x5f\xff\x2f\x2a\xf6\x33\xd0\xfb" + "\xea\x1f\xa4\xf2\x2d\x22\x8a\x19\x95\xa9\x17\xb7\x4f\x17\xcf" + "\x55\xcd\x1a\x3a\x5f\x07\x73\xcc\xaa\x21\x70\x64\xb3\xa0\xf4" + "\xb7\x30\xa3\x82\x37\x93\xc6\x59\xde\x1b\xa1\x16\x90\x5a\x1a" + "\xf6\x73\xab\x92\xc8\x2f\xf4\x6f\x5c\xf2\x22\x1d\x30\xf8\x03" + "\xd8\x9b\x5f\x73\x72\x8e\x5f\xd5\x37\x4b\x43\xda\xfe\x84\x21" + "\x67\xe8\xe3\xd7\x91\x3f\x24\x1d\xfb\x1f\x12\x6e\xcb\xfc\xb7" + "\x5b\x0a\x35\x73\x3b\xce\x44\x34\x8e\xcd\x53\xa4\xcf\xa7\x63" + "\x73\xcd\x31\x0f\xe0\x75\x8d\xe4\xa9\xdc\xfe\xf0\xc9\x3d\x26" + "\xaf\xbf\x7b\x0f\x0e\x17\xb9\xd0\x4a\x32\x80\x64\x6b\x54\x73" + "\x5a\x50\xc7\x31\x59\xf9\x73\x72\xa5\x79\xba\xdb\xa1\x14\x8d" + "\x77\x67\x3e\xc0\x5b\xec\x6f\x0b\xf7\xc5\xee\x5a\xa6\x8d\x49" + "\x63\x81\xbb\xd1\xf9\x9e\xbb\xed\xb2\xa9\x18\x60\xa7\xee\xeb" + "\x30\xa1\x92\x93\xe8\xd8\x34\x9e\xac\xd6\x23\xfc\x7f\xcb\xe7" + "\xfe\xa7\xe6\x42\xac\x77\x11\xc0\x67\x77\xd1\xaa\x5e\xed\x3b" + "\xd5\xa5\x8d\x34\x7c\xd9\x57\x44\xa7\xc5\x44\x2e\x1e\xe7\x63" + "\xd8\x53\x1b\x9a\xd9\x67\x02\x13\x32\x61\x81\x82\x01\x00\x57" + "\x5a\x61\x3f\x7c\x36\xca\xd7\x03\x26\x52\x3d\xdd\x72\x2b\x9c" + "\xd0\xa3\x23\x6d\x35\x3d\xbd\xe6\xd7\x57\x94\xe9\xfb\x2a\xa9" + "\x42\x52\x36\xd6\x17\xf7\x61\x50\x32\xd4\x49\xb6\xf0\x04\x1e" + "\xcb\x34\x42\xb4\x4b\xcb\x83\xff\xf5\xe7\x59\xbc\x75\x37\x6b" + "\x4a\x0a\xb7\x34\x71\xf5\xa6\xc7\xfc\xb6\x38\xaf\x11\xfb\x9d" + "\x15\xfa\xae\x01\xe1\xab\x8e\x6e\xa6\xe7\x95\x10\xab\x64\xb7" + "\x74\x3a\x0f\x9b\x60\x43\xfa\x62\x0c\x9c\xf0\xce\x01\x38\x5f" + "\xdb\xba\x07\xc3\x68\xf2\xd5\xe8\x53\xfc\xf1\xc4\x0c\x25\x68" + "\xf8\x4d\x59\xf4\x79\x3a\x93\x65\x01\xa2\x9b\x44\x1f\xec\xca" + "\x21\xf5\x8f\x1b\xe3\x57\x40\xa1\xff\x3f\x1d\x50\xac\x30\x8d" + "\xef\xfd\x0f\x15\x52\x5c\x58\x48\x52\x71\x0f\x49\xd9\x61\x76" + "\x1f\x1b\xa8\x60\x48\x3b\x35\x64\x42\x72\xbe\x84\xd8\x64\x43" + "\x30\x46\x99\x54\xda\xdc\xd7\xc3\x59\x4f\x8a\x97\x4d\x4f\x8c" + "\xfe\xa7\x92\xeb\xe0\xc1\xc0\xf0\xde\x9c\x6f\x2f\xee\x4d\x20" + "\xa2\xde\xcc\xf3\x78\xb3\x4b\x44\x83\xbf\xbc\xd9\xea\x8e\xe7" + "\x74\x44\x36\xdd\x27\xea\x53\x6b\xfe\x30\xc2\x79\x23\x61\x7e" + "\x2b\xdc\x14\xdb\x21\xd6\x24\x38\x78\xbd\xc5\xd2\x9b\x9c\x92" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70\x64" + "\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7" + "\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62" + "\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe" + "\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03" + "\x02\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\x9d\xbe\x65\xf4\xae\x81\x90\x79\x09\x18\xa2\x66" + "\x12\x9c\x10\x94\x66\x21\x94\x70\x60\x20\x4a\x3d\x5f\xb3\x62" + "\xb6\x06\x46\x37\xfe\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xe5" + "\x88\xb7\x6e\xec\x2d\xaf\x47\xc7\xa2\xf4\x6e\xbf\x7f\x5e\x46" + "\xd7\xfa\x33\x2c\x0a\x7e\x86\x1d\x8c\x38\xa8\x93\x52\xe8\x97" + "\xe9\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xbc\x11\xc0\xae\xed\x63\x92\xf5\xcc\xf5\xa9" + "\x5f\xc3\xd5\xc9\xc2\x4c\xe9\xc3\x86\x05\x9a\xff\x51\x20\x1d" + "\x76\xae\x89\xe9\x03\x85\x81\x03\x07\x48\x3d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\xec\x65\x60\x6d\xc1\x73" + "\xac\x14\xf5\xef\xe8\xd4\x28\x26\x58\x22\xab\xb3\x22\x2c\x77" + "\x94\x74\x13\x07\x16\x62\x75\x37\x6c\xd6\x32\x81\x03\x01\x0c" + "\x3d\x82\x02\x04\x30\xa2\x2b\x80\x20\xbe\x10\xee\x08\x7d\x74" + "\x44\xfb\x4f\xdc\xe2\x5c\x17\x3d\x7f\xe5\xff\x0f\xf1\xd4\xe8" + "\x16\x07\x06\x35\xcf\x34\xee\x9c\xbf\x91\xf6\x81\x03\x01\x04" + "\x00\x82\x02\x04\x10\xa2\x2b\x80\x20\xd4\xde\x10\x1e\x61\xfe" + "\x8c\xab\x21\xe0\x2b\x9f\xf2\x46\x62\xc2\x16\xcc\xd2\x77\xaf" + "\x75\xb1\x85\x47\xaa\x76\xfd\xcb\xfb\xf4\x57\x81\x03\x04\x24" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x9d\xbe\x65\xf4\xae\x81" + "\x90\x79\x09\x18\xa2\x66\x12\x9c\x10\x94\x66\x21\x94\x70\x60" + "\x20\x4a\x3d\x5f\xb3\x62\xb6\x06\x46\x37\xfe\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe5\x88\xb7\x6e\xec\x2d\xaf\x47\xc7\xa2" + "\xf4\x6e\xbf\x7f\x5e\x46\xd7\xfa\x33\x2c\x0a\x7e\x86\x1d\x8c" + "\x38\xa8\x93\x52\xe8\x97\xe9\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh45() + { + testcase("Thresh45"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim14Cond + // ** Rsa15Cond + // ** Ed16Cond + // ** Prefix17Cond + // ** Thresh21Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** rsa2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** rsa4 + // ** preim11 + // ** rsa12 + // ** ed13 + + auto const rsa2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa2PublicKey{ + {0xba, 0x2c, 0x3b, 0x50, 0xb6, 0xbf, 0xf9, 0x0f, 0x1d, 0xd7, 0x32, + 0x4c, 0x01, 0x5f, 0xff, 0x2f, 0x2a, 0xf6, 0x33, 0xd0, 0xfb, 0xea, + 0x1f, 0xa4, 0xf2, 0x2d, 0x22, 0x8a, 0x19, 0x95, 0xa9, 0x17, 0xb7, + 0x4f, 0x17, 0xcf, 0x55, 0xcd, 0x1a, 0x3a, 0x5f, 0x07, 0x73, 0xcc, + 0xaa, 0x21, 0x70, 0x64, 0xb3, 0xa0, 0xf4, 0xb7, 0x30, 0xa3, 0x82, + 0x37, 0x93, 0xc6, 0x59, 0xde, 0x1b, 0xa1, 0x16, 0x90, 0x5a, 0x1a, + 0xf6, 0x73, 0xab, 0x92, 0xc8, 0x2f, 0xf4, 0x6f, 0x5c, 0xf2, 0x22, + 0x1d, 0x30, 0xf8, 0x03, 0xd8, 0x9b, 0x5f, 0x73, 0x72, 0x8e, 0x5f, + 0xd5, 0x37, 0x4b, 0x43, 0xda, 0xfe, 0x84, 0x21, 0x67, 0xe8, 0xe3, + 0xd7, 0x91, 0x3f, 0x24, 0x1d, 0xfb, 0x1f, 0x12, 0x6e, 0xcb, 0xfc, + 0xb7, 0x5b, 0x0a, 0x35, 0x73, 0x3b, 0xce, 0x44, 0x34, 0x8e, 0xcd, + 0x53, 0xa4, 0xcf, 0xa7, 0x63, 0x73, 0xcd, 0x31, 0x0f, 0xe0, 0x75, + 0x8d, 0xe4, 0xa9, 0xdc, 0xfe, 0xf0, 0xc9, 0x3d, 0x26, 0xaf, 0xbf, + 0x7b, 0x0f, 0x0e, 0x17, 0xb9, 0xd0, 0x4a, 0x32, 0x80, 0x64, 0x6b, + 0x54, 0x73, 0x5a, 0x50, 0xc7, 0x31, 0x59, 0xf9, 0x73, 0x72, 0xa5, + 0x79, 0xba, 0xdb, 0xa1, 0x14, 0x8d, 0x77, 0x67, 0x3e, 0xc0, 0x5b, + 0xec, 0x6f, 0x0b, 0xf7, 0xc5, 0xee, 0x5a, 0xa6, 0x8d, 0x49, 0x63, + 0x81, 0xbb, 0xd1, 0xf9, 0x9e, 0xbb, 0xed, 0xb2, 0xa9, 0x18, 0x60, + 0xa7, 0xee, 0xeb, 0x30, 0xa1, 0x92, 0x93, 0xe8, 0xd8, 0x34, 0x9e, + 0xac, 0xd6, 0x23, 0xfc, 0x7f, 0xcb, 0xe7, 0xfe, 0xa7, 0xe6, 0x42, + 0xac, 0x77, 0x11, 0xc0, 0x67, 0x77, 0xd1, 0xaa, 0x5e, 0xed, 0x3b, + 0xd5, 0xa5, 0x8d, 0x34, 0x7c, 0xd9, 0x57, 0x44, 0xa7, 0xc5, 0x44, + 0x2e, 0x1e, 0xe7, 0x63, 0xd8, 0x53, 0x1b, 0x9a, 0xd9, 0x67, 0x02, + 0x13, 0x32, 0x61}}; + std::array const rsa2Sig{ + {0x67, 0x25, 0xad, 0xe4, 0x61, 0x65, 0x3a, 0xe6, 0x60, 0x1b, 0x53, + 0xc0, 0x03, 0x0b, 0x49, 0xf7, 0xe0, 0xe2, 0x51, 0x70, 0x3a, 0x4c, + 0x64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92, 0x4c, 0x0f, 0xdf, 0x9b, + 0x7a, 0x47, 0x80, 0x51, 0x94, 0xe0, 0x29, 0xe5, 0x54, 0xc2, 0xbf, + 0x6f, 0xba, 0xf3, 0xde, 0x2c, 0x68, 0xd3, 0xa8, 0x16, 0xdb, 0x3f, + 0x24, 0xc9, 0x59, 0xf5, 0xaa, 0x2d, 0x6b, 0x61, 0x1d, 0x4c, 0x69, + 0x05, 0x1b, 0x49, 0x1b, 0x66, 0x1a, 0x97, 0xcd, 0x16, 0x65, 0x15, + 0xdd, 0xd5, 0x03}}; + auto const rsa4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0xb6, 0xef, 0x7c, 0xba, 0xf0, 0x07, 0x11, 0x0e, 0x25, 0xa7, 0x91, + 0xed, 0x68, 0x61, 0xfb, 0x09, 0x9e, 0xcf, 0x73, 0xf9, 0x76, 0x34, + 0x3f, 0xe7, 0xe1, 0x74, 0x65, 0xc1, 0x31, 0x6e, 0xf3, 0x28, 0xaa, + 0xd0, 0x24, 0x84, 0x01, 0x4a, 0x1e, 0x0c, 0x91, 0xec, 0xe0, 0x17, + 0xe9, 0x0f, 0xff, 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 0xb1, 0x38, 0xae, 0x1b, 0x3d, + 0xfb, 0x85, 0xed, 0xb1, 0x84, 0xf0, 0x60, 0x15, 0x3e, 0x57, 0x86, + 0x19, 0x65, 0xe7, 0x2d, 0x8c, 0xd4, 0x8b, 0x14, 0x6f, 0x2a, 0x01, + 0xeb, 0x33, 0x0c}}; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + auto const preim11Preimage = "I am root"s; + auto const preim11Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa12Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa12PublicKey{ + {0xd9, 0x25, 0xc3, 0xba, 0x0a, 0x46, 0x6e, 0xa9, 0x1d, 0x05, 0xd7, + 0x54, 0xf1, 0xff, 0xf4, 0xaf, 0xe5, 0x13, 0xcf, 0xd6, 0x74, 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, + 0x86, 0x8b, 0x09, 0xe2, 0xce, 0xb7, 0x9a, 0x3b, 0x23, 0xed, 0x99, + 0x93, 0xc5, 0x31, 0x09, 0x98, 0xb8, 0x03, 0x19, 0x4b, 0x7e, 0x0a, + 0x79, 0x6b, 0x2a, 0xfe, 0x96, 0xac, 0x54, 0xc6, 0x1e, 0x5d, 0x6d, + 0xb1, 0x37, 0x53, 0x38, 0xcb, 0x95, 0x95, 0x50, 0xce, 0xe3, 0x4e, + 0x87, 0xef, 0x5d, 0x7b, 0x31, 0xab, 0x4d, 0xce, 0xf8, 0x99, 0x49, + 0x78, 0x4b, 0xa0, 0x57, 0x2c, 0xe5, 0xd6, 0x46, 0x29, 0xdf, 0x40, + 0x1c, 0x08, 0x84, 0xdb, 0xd2, 0x85, 0xb3, 0xda, 0xfd, 0x0b, 0x10, + 0x76, 0x4c, 0x3a, 0xa6, 0xae, 0x72, 0xc4, 0xdd, 0x7e, 0x72, 0x38, + 0x2d, 0x31, 0x2c, 0x0e, 0xa9, 0x0c, 0x9d, 0x37, 0x41, 0xd5, 0xf0, + 0xa8, 0x9f, 0xae, 0x41, 0xb0, 0x4b, 0x47, 0x20, 0x4f, 0x2a, 0x0d, + 0xb2, 0xe6, 0xdc, 0x81, 0x94, 0x74, 0x29, 0x65, 0xc3, 0x46, 0x19, + 0x18, 0xe0, 0xa9, 0x07, 0x4c, 0x14, 0x6d, 0x0a, 0x7c, 0x08, 0xdf, + 0xa4, 0x56, 0x05}}; + auto const ed13Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed13PublicKey{ + {0xe8, 0xb1, 0xe9, 0x04, 0xef, 0x8f, 0x78, 0x4c, 0x54, 0xf2, 0x45, + 0x60, 0x93, 0xb4, 0xc6, 0xa4, 0xc2, 0x9a, 0xa9, 0xb7, 0x5a, 0x0b, + 0x06, 0xf1, 0x78, 0xdc, 0xa9, 0x08, 0x12, 0xb2, 0x2f, 0xf4}}; + std::array const ed13Sig{ + {0x03, 0x17, 0xa0, 0x49, 0x7b, 0xee, 0x0d, 0x84, 0x64, 0xee, 0xa8, + 0xc1, 0xe6, 0x3e, 0xc6, 0xed, 0xd6, 0x25, 0x7e, 0x7d, 0xad, 0x96, + 0xf3, 0x82, 0x4a, 0xa6, 0xb1, 0x38, 0xf1, 0x2f, 0x54, 0x6a, 0x52, + 0x39, 0x26, 0x08, 0x2d, 0xe6, 0xfd, 0xb2, 0xfa, 0x23, 0xb3, 0x91, + 0x30, 0x07, 0x9a, 0x4b, 0x63, 0xbb, 0x6f, 0x55, 0xcb, 0x0a, 0xe9, + 0xb1, 0xfb, 0x40, 0x9e, 0x1f, 0x87, 0x70, 0x5a, 0x07}}; + std::array const ed13SigningKey{ + {0x0c, 0x45, 0x3e, 0x20, 0xe2, 0x12, 0x63, 0x6a, 0x7c, 0x36, 0x75, + 0xad, 0x2e, 0xd7, 0xc0, 0x39, 0x27, 0x7e, 0x38, 0x9a, 0xa2, 0xd3, + 0x3b, 0x24, 0x18, 0xf8, 0x68, 0x4e, 0x7f, 0xfa, 0x5d, 0xf3}}; + (void)ed13SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim14CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim14Cond{Type::preimageSha256, + 9, + Preim14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa15CondConditionFingerprint = { + {0x55, 0x6b, 0x6d, 0xe3, 0x00, 0xd4, 0xf3, 0x7e, 0x75, 0x3a, 0x68, + 0xfc, 0x25, 0xdf, 0xf2, 0xf7, 0x18, 0x54, 0xa5, 0x55, 0x0c, 0xa5, + 0xa9, 0x65, 0xbf, 0x66, 0x9e, 0x4e, 0x49, 0x56, 0x1e, 0xf1}}; + Condition const Rsa15Cond{Type::rsaSha256, + 65536, + Rsa15CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed16CondConditionFingerprint = { + {0xe4, 0x66, 0x69, 0x86, 0x87, 0x57, 0x0e, 0xac, 0xf1, 0xfd, 0x06, + 0x81, 0x48, 0x90, 0x82, 0x42, 0x48, 0x50, 0x75, 0x8e, 0xd4, 0x2d, + 0xf3, 0x02, 0x37, 0x89, 0x28, 0xc5, 0x68, 0xd7, 0xa0, 0x11}}; + Condition const Ed16Cond{Type::ed25519Sha256, + 131072, + Ed16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix17CondConditionFingerprint = { + {0x6c, 0x29, 0x49, 0x90, 0x3f, 0xd3, 0xc6, 0x43, 0x2f, 0xac, 0xf6, + 0x28, 0x15, 0xf0, 0x3b, 0x03, 0x06, 0xf9, 0x2a, 0x7c, 0x3d, 0x33, + 0x40, 0xbb, 0xee, 0x38, 0x79, 0x2a, 0x3a, 0x90, 0xa0, 0xc4}}; + Condition const Prefix17Cond{Type::prefixSha256, + 68643, + Prefix17CondConditionFingerprint, + std::bitset<5>{12}}; + std::array const Thresh21CondConditionFingerprint = { + {0x2a, 0x7a, 0xb5, 0x86, 0x22, 0x51, 0xf5, 0xe7, 0x17, 0x8d, 0xc9, + 0xc4, 0xae, 0xcb, 0x91, 0xc1, 0x10, 0x61, 0x0c, 0xce, 0x6f, 0x7a, + 0xa8, 0x5f, 0x21, 0x1d, 0xd8, 0x55, 0x36, 0x51, 0x7c, 0x44}}; + Condition const Thresh21Cond{Type::thresholdSha256, + 66560, + Thresh21CondConditionFingerprint, + std::bitset<5>{8}}; + + auto rsa2 = std::make_unique( + makeSlice(rsa2PublicKey), makeSlice(rsa2Sig)); + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(rsa2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim11 = + std::make_unique(makeSlice(preim11Preimage)); + auto rsa12 = std::make_unique( + makeSlice(rsa12PublicKey), makeSlice(rsa12Sig)); + auto ed13 = std::make_unique(ed13PublicKey, ed13Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim11)); + thresh0Subfulfillments.emplace_back(std::move(rsa12)); + thresh0Subfulfillments.emplace_back(std::move(ed13)); + std::vector thresh0Subconditions{ + {Preim14Cond, Rsa15Cond, Ed16Cond, Prefix17Cond, Thresh21Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x08\x77\xa0\x82\x07\x9d\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x82\x05\x1a\xa0\x82\x04\x9b\xa2" + "\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00" + "\xbe\x09\xc5\xa4\x27\x29\xdf\xd4\x67\x76\xbe\xbf\x2c\xf3\xa2" + "\x0b\x42\xe4\xbf\xeb\xdd\x67\x20\xfb\x7a\x27\x93\xc0\x78\x47" + "\x78\xd7\x15\x32\xee\x38\x81\x0d\x36\xa2\xc4\x65\x44\xe6\x62" + "\x26\xb9\x58\x13\xa4\x15\x82\xab\xb1\x16\x61\xfc\x01\x98\xc6" + "\x1a\x69\xc6\xba\x39\x3f\x01\x55\x3d\xd7\x8e\x14\x42\x6d\x78" + "\x74\x9b\x28\xcb\x31\x39\x98\x5a\x11\xdc\xc1\x18\x9d\x8d\xb0" + "\xcd\x1b\x4c\x10\xab\x14\x64\x19\xf1\x33\x15\x45\xc8\x92\x82" + "\x03\x82\x8a\xaa\xad\x94\xfc\x24\x11\x96\x99\x7e\x94\x5a\x82" + "\x57\x68\x61\x9f\x7b\x45\xe0\x99\x9e\x4f\x32\x50\x5f\x05\xc8" + "\x11\xae\xc4\x0c\x63\x18\x0e\x02\x59\x36\x25\x92\x06\x32\xc7" + "\x71\x47\x99\xcc\x0a\x6e\x0a\x58\x71\x3f\x5e\xb7\x78\xf7\x98" + "\x79\xdf\x74\xa4\xeb\xa9\x00\xfd\x81\xb3\xcf\x04\x8c\x5d\x7d" + "\xe7\xb2\x82\x90\x49\xbd\x69\xf3\x08\xe9\x92\xc6\x9e\x41\xba" + "\x74\xd8\x8d\x81\x97\x6f\x86\xab\xc9\xf1\x02\x31\xb4\xce\x47" + "\xb0\x39\xc8\xba\x51\xa7\x39\xf3\x71\xa2\x25\x27\x37\x6e\x09" + "\x6f\x19\x59\xbc\x65\xd9\xcd\x12\xd3\x2c\xa2\x78\xfa\x23\x15" + "\x1a\x82\x41\x91\x1b\xbe\x8a\xe7\xfe\x3c\x3c\x30\x32\xaa\xe9" + "\xf3\x81\x82\x01\x00\xb6\xef\x7c\xba\xf0\x07\x11\x0e\x25\xa7" + "\x91\xed\x68\x61\xfb\x09\x9e\xcf\x73\xf9\x76\x34\x3f\xe7\xe1" + "\x74\x65\xc1\x31\x6e\xf3\x28\xaa\xd0\x24\x84\x01\x4a\x1e\x0c" + "\x91\xec\xe0\x17\xe9\x0f\xff\x11\x1b\x18\xa4\x73\x2e\xf5\x6c" + "\x50\xe4\x80\x57\xd1\xdf\xa7\x82\xdb\xd6\x82\x66\xbf\xc7\x9d" + "\x1a\x4a\xbd\xf0\x73\xe7\xe5\xbf\x0d\x78\x59\xc8\x2c\xfa\x11" + "\x6f\x54\x9d\x48\x73\x37\x65\xa3\xe5\x8b\xdc\x51\x32\x45\xa1" + "\x18\x7c\x16\x10\x69\x39\x58\xd3\x06\x33\x38\x3e\x9e\x59\xa6" + "\x21\x20\xd0\xb0\x0e\x30\xd5\x84\x0f\xcf\x6e\x22\x9c\x5b\xc0" + "\xc4\x8a\x2e\xae\xdb\xf9\xb9\x13\x7c\xe4\xeb\x6b\x0a\x27\xc1" + "\xd3\xba\x37\xa6\x2e\x60\xda\x6e\xd9\xfb\xb5\x2b\x05\xe6\xa9" + "\x1e\x6a\xee\xb3\xf0\xee\xbc\x14\x5e\x9e\xae\x6d\xd4\xbf\xc3" + "\xb7\x5e\x02\x4b\xe3\x7e\x6c\x4e\x1d\xc2\x4d\x2c\xbd\x10\x3a" + "\xa0\xda\xb0\x8e\xca\xf2\xdd\x71\xa3\x33\x8e\x8a\x01\x84\xe4" + "\x9c\x25\x68\xb1\x31\xb9\x95\xab\x1a\xc7\xfb\x22\x8e\x02\xfa" + "\xa4\x16\xb4\xe7\xff\xa1\xb1\x38\xae\x1b\x3d\xfb\x85\xed\xb1" + "\x84\xf0\x60\x15\x3e\x57\x86\x19\x65\xe7\x2d\x8c\xd4\x8b\x14" + "\x6f\x2a\x01\xeb\x33\x0c\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30" + "\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c" + "\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81" + "\x01\x09\xa3\x27\x80\x20\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06" + "\x3f\xd9\x32\x48\x19\xe1\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c" + "\x9b\x83\xeb\x05\xa7\x59\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1" + "\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0" + "\x21\x8d\x42\xc0\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82" + "\x01\x00\xba\x2c\x3b\x50\xb6\xbf\xf9\x0f\x1d\xd7\x32\x4c\x01" + "\x5f\xff\x2f\x2a\xf6\x33\xd0\xfb\xea\x1f\xa4\xf2\x2d\x22\x8a" + "\x19\x95\xa9\x17\xb7\x4f\x17\xcf\x55\xcd\x1a\x3a\x5f\x07\x73" + "\xcc\xaa\x21\x70\x64\xb3\xa0\xf4\xb7\x30\xa3\x82\x37\x93\xc6" + "\x59\xde\x1b\xa1\x16\x90\x5a\x1a\xf6\x73\xab\x92\xc8\x2f\xf4" + "\x6f\x5c\xf2\x22\x1d\x30\xf8\x03\xd8\x9b\x5f\x73\x72\x8e\x5f" + "\xd5\x37\x4b\x43\xda\xfe\x84\x21\x67\xe8\xe3\xd7\x91\x3f\x24" + "\x1d\xfb\x1f\x12\x6e\xcb\xfc\xb7\x5b\x0a\x35\x73\x3b\xce\x44" + "\x34\x8e\xcd\x53\xa4\xcf\xa7\x63\x73\xcd\x31\x0f\xe0\x75\x8d" + "\xe4\xa9\xdc\xfe\xf0\xc9\x3d\x26\xaf\xbf\x7b\x0f\x0e\x17\xb9" + "\xd0\x4a\x32\x80\x64\x6b\x54\x73\x5a\x50\xc7\x31\x59\xf9\x73" + "\x72\xa5\x79\xba\xdb\xa1\x14\x8d\x77\x67\x3e\xc0\x5b\xec\x6f" + "\x0b\xf7\xc5\xee\x5a\xa6\x8d\x49\x63\x81\xbb\xd1\xf9\x9e\xbb" + "\xed\xb2\xa9\x18\x60\xa7\xee\xeb\x30\xa1\x92\x93\xe8\xd8\x34" + "\x9e\xac\xd6\x23\xfc\x7f\xcb\xe7\xfe\xa7\xe6\x42\xac\x77\x11" + "\xc0\x67\x77\xd1\xaa\x5e\xed\x3b\xd5\xa5\x8d\x34\x7c\xd9\x57" + "\x44\xa7\xc5\x44\x2e\x1e\xe7\x63\xd8\x53\x1b\x9a\xd9\x67\x02" + "\x13\x32\x61\x81\x82\x01\x00\x67\x25\xad\xe4\x61\x65\x3a\xe6" + "\x60\x1b\x53\xc0\x03\x0b\x49\xf7\xe0\xe2\x51\x70\x3a\x4c\x64" + "\x45\x97\x92\x73\xb6\x2c\x5a\x29\x1b\x33\x7c\x92\xec\xae\xe3" + "\x67\x35\x96\x95\xf3\x51\xd1\x7b\xc2\xc7\xa6\xf2\x7e\xc4\xca" + "\x96\xd1\xcf\x46\x8e\xa4\xd7\x79\x87\xda\xc0\x80\x14\xbd\x91" + "\xd0\xb3\xbc\x38\xe5\x2e\xbc\xa5\x98\x60\x95\x39\x73\x86\xb2" + "\x2a\xb0\x98\xc7\xc7\xa3\x03\xb5\x21\x60\xe7\x80\xfa\xaa\x83" + "\xec\x87\xfc\x36\xa8\xf6\x8a\x92\x85\x4b\x9f\xf7\x61\x8f\xd4" + "\xec\x84\x3d\xaf\x90\xfe\x6f\x6e\x89\x93\x21\x65\x93\x10\xa4" + "\xc1\xe5\xbd\x29\x6c\x2b\xb0\xfc\x24\x5b\x32\xb4\xc5\x6c\x60" + "\xb7\x33\x9b\x31\xae\xbd\xdd\xb1\x8c\x21\x60\x81\x2c\xb9\xee" + "\x5c\xfb\x7e\x9e\x04\x42\xc4\x29\x5e\x37\x6d\x09\x22\x31\xa7" + "\x2e\x7d\xa5\xd6\xc6\xd2\xee\x3c\x4f\x4e\xed\x72\x60\x7f\xed" + "\xd8\xc6\xaa\xcb\x01\x99\xc0\x8e\x38\x48\x57\x00\x13\x68\x3b" + "\xe1\x92\x4c\x0f\xdf\x9b\x7a\x47\x80\x51\x94\xe0\x29\xe5\x54" + "\xc2\xbf\x6f\xba\xf3\xde\x2c\x68\xd3\xa8\x16\xdb\x3f\x24\xc9" + "\x59\xf5\xaa\x2d\x6b\x61\x1d\x4c\x69\x05\x1b\x49\x1b\x66\x1a" + "\x97\xcd\x16\x65\x15\xdd\xd5\x03\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe" + "\xaa\x6c\x81\xf1\x88\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5" + "\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4\x30\x65\x1e\x40\xb3\x23" + "\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79\x5f\x41\xc9\x03\x93\x34" + "\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02\x00\x00\xa3\x82\x02\x08" + "\x80\x82\x01\x00\xd9\x25\xc3\xba\x0a\x46\x6e\xa9\x1d\x05\xd7" + "\x54\xf1\xff\xf4\xaf\xe5\x13\xcf\xd6\x74\xb0\xcf\xc2\x8c\x68" + "\x5c\xa9\xf3\x44\x4b\xfd\x4a\x4d\x29\x64\xbc\xa8\x98\xf5\x35" + "\x0a\x65\xe5\xcd\x5d\x08\x9f\x58\x22\xed\x21\x78\x04\x4d\x2a" + "\xce\x80\x33\x19\x5b\x7a\xbd\xa6\x89\xfa\x80\xa4\xf5\x32\xa6" + "\xb1\x34\x61\x55\x5a\xbd\x05\xaf\x4b\x4b\xdf\xe0\xa9\x3e\x1d" + "\x2f\x3e\xaf\x0c\x65\x32\xc6\xf2\xe0\x5c\x09\xc0\xa2\x41\xe6" + "\xc9\x96\x5e\x88\x62\x4a\x28\x4b\x23\x2f\xcf\xb3\xb7\x1e\x11" + "\x7f\xc4\x63\x1a\xe4\x24\x29\x46\xf4\x48\xde\x30\x45\x97\xf8" + "\x6c\x8d\x4e\x4a\xce\x5e\x41\xb2\xb7\x5a\xd5\x94\x42\x5a\x14" + "\xd1\x11\x99\xc5\xeb\x66\xbe\xb1\xc6\xc3\xdb\x2f\x8f\xa0\x6c" + "\xa9\x27\x0f\xc0\x92\x77\x0b\x8d\x66\xb8\x93\x0b\xc0\x5c\xcb" + "\x51\x4e\xa3\x83\xd2\xbd\x04\xd8\xc0\x0c\xb2\xf7\x38\x4e\x6a" + "\xec\xfe\x76\xd9\x71\x0b\x90\x21\x7c\xbf\x07\xc4\xd8\x4c\x6d" + "\xb9\x35\x48\x5d\x82\xea\x61\xc5\x14\xff\x25\x50\x47\xaf\x06" + "\x58\xa9\x95\x2c\xdd\xe5\xbd\x95\x4a\x7b\x27\xa1\x46\xe3\xf0" + "\x16\xe8\xf9\xba\x43\xb8\x77\xdc\x87\x81\x3a\xc0\xf2\xed\x3b" + "\x03\x5e\xe6\x89\x71\x81\x82\x01\x00\x3d\x08\xbb\xb6\xf4\x88" + "\xf4\xbf\x89\xb4\x56\x2b\xfe\xfc\xa2\x64\x58\xaa\x7a\xce\x0f" + "\xe8\xc7\x49\x11\x9f\x59\xa3\x60\x89\x4e\x6c\xfc\x78\x23\x1f" + "\x2c\xa3\x79\xed\xd1\x60\x94\x8d\xde\x3e\x3a\xb2\x75\xa0\x3b" + "\x00\xd3\x98\x4e\x51\x33\xff\x4e\xa8\xf2\xf9\x74\x3b\x7f\xff" + "\x27\xcf\xe2\x12\xa8\x89\x72\x9b\xa8\x82\x28\x0c\x5e\xc0\x1b" + "\xdd\x07\x83\xdd\x5c\x41\xdf\xfd\x3b\x9e\x46\xa5\xc7\x7a\xb9" + "\x86\x80\xd7\x4a\x40\xd1\x88\xfc\x0f\x1e\x6f\xf3\xfb\xc9\xbf" + "\xa9\x1b\xb0\x3d\x4e\x09\xcf\x8c\xb6\xa4\x86\x8b\x09\xe2\xce" + "\xb7\x9a\x3b\x23\xed\x99\x93\xc5\x31\x09\x98\xb8\x03\x19\x4b" + "\x7e\x0a\x79\x6b\x2a\xfe\x96\xac\x54\xc6\x1e\x5d\x6d\xb1\x37" + "\x53\x38\xcb\x95\x95\x50\xce\xe3\x4e\x87\xef\x5d\x7b\x31\xab" + "\x4d\xce\xf8\x99\x49\x78\x4b\xa0\x57\x2c\xe5\xd6\x46\x29\xdf" + "\x40\x1c\x08\x84\xdb\xd2\x85\xb3\xda\xfd\x0b\x10\x76\x4c\x3a" + "\xa6\xae\x72\xc4\xdd\x7e\x72\x38\x2d\x31\x2c\x0e\xa9\x0c\x9d" + "\x37\x41\xd5\xf0\xa8\x9f\xae\x41\xb0\x4b\x47\x20\x4f\x2a\x0d" + "\xb2\xe6\xdc\x81\x94\x74\x29\x65\xc3\x46\x19\x18\xe0\xa9\x07" + "\x4c\x14\x6d\x0a\x7c\x08\xdf\xa4\x56\x05\xa4\x64\x80\x20\xe8" + "\xb1\xe9\x04\xef\x8f\x78\x4c\x54\xf2\x45\x60\x93\xb4\xc6\xa4" + "\xc2\x9a\xa9\xb7\x5a\x0b\x06\xf1\x78\xdc\xa9\x08\x12\xb2\x2f" + "\xf4\x81\x40\x03\x17\xa0\x49\x7b\xee\x0d\x84\x64\xee\xa8\xc1" + "\xe6\x3e\xc6\xed\xd6\x25\x7e\x7d\xad\x96\xf3\x82\x4a\xa6\xb1" + "\x38\xf1\x2f\x54\x6a\x52\x39\x26\x08\x2d\xe6\xfd\xb2\xfa\x23" + "\xb3\x91\x30\x07\x9a\x4b\x63\xbb\x6f\x55\xcb\x0a\xe9\xb1\xfb" + "\x40\x9e\x1f\x87\x70\x5a\x07\xa1\x81\xd3\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2b\x80\x20\x6c\x29\x49\x90\x3f\xd3\xc6" + "\x43\x2f\xac\xf6\x28\x15\xf0\x3b\x03\x06\xf9\x2a\x7c\x3d\x33" + "\x40\xbb\xee\x38\x79\x2a\x3a\x90\xa0\xc4\x81\x03\x01\x0c\x23" + "\x82\x02\x04\x30\xa2\x2b\x80\x20\x2a\x7a\xb5\x86\x22\x51\xf5" + "\xe7\x17\x8d\xc9\xc4\xae\xcb\x91\xc1\x10\x61\x0c\xce\x6f\x7a" + "\xa8\x5f\x21\x1d\xd8\x55\x36\x51\x7c\x44\x81\x03\x01\x04\x00" + "\x82\x02\x04\x10\xa3\x27\x80\x20\x55\x6b\x6d\xe3\x00\xd4\xf3" + "\x7e\x75\x3a\x68\xfc\x25\xdf\xf2\xf7\x18\x54\xa5\x55\x0c\xa5" + "\xa9\x65\xbf\x66\x9e\x4e\x49\x56\x1e\xf1\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\xe4\x66\x69\x86\x87\x57\x0e\xac\xf1\xfd\x06" + "\x81\x48\x90\x82\x42\x48\x50\x75\x8e\xd4\x2d\xf3\x02\x37\x89" + "\x28\xc5\x68\xd7\xa0\x11\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xd4\x74\x44\x9f\xcc\xdd\x56\xfd\x38\xb6\x57" + "\x0f\xba\xcc\xd8\x28\x4e\x4a\x64\x95\x8e\xa7\x6b\x31\x08\x16" + "\x2f\x8a\x53\x27\x69\x51\x81\x03\x09\x54\x23\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x6c\x29\x49\x90\x3f\xd3\xc6\x43\x2f\xac\xf6\x28" + "\x15\xf0\x3b\x03\x06\xf9\x2a\x7c\x3d\x33\x40\xbb\xee\x38\x79" + "\x2a\x3a\x90\xa0\xc4\x81\x03\x01\x0c\x23\x82\x02\x04\x30\xa2" + "\x2b\x80\x20\x2a\x7a\xb5\x86\x22\x51\xf5\xe7\x17\x8d\xc9\xc4" + "\xae\xcb\x91\xc1\x10\x61\x0c\xce\x6f\x7a\xa8\x5f\x21\x1d\xd8" + "\x55\x36\x51\x7c\x44\x81\x03\x01\x04\x00\x82\x02\x04\x10\xa2" + "\x2b\x80\x20\xd4\xde\x10\x1e\x61\xfe\x8c\xab\x21\xe0\x2b\x9f" + "\xf2\x46\x62\xc2\x16\xcc\xd2\x77\xaf\x75\xb1\x85\x47\xaa\x76" + "\xfd\xcb\xfb\xf4\x57\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x38\xb9\xf0\xeb\x68\x8b\x9f\x55\x37\x9a\xec\x07" + "\xd4\xa2\x13\xac\x34\xa1\x67\x31\x34\xea\xc2\x2f\xef\x13\xe3" + "\x5c\xcf\x8f\x90\x1e\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x55" + "\x6b\x6d\xe3\x00\xd4\xf3\x7e\x75\x3a\x68\xfc\x25\xdf\xf2\xf7" + "\x18\x54\xa5\x55\x0c\xa5\xa9\x65\xbf\x66\x9e\x4e\x49\x56\x1e" + "\xf1\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x7c\x54\x6a\x6d\x7f" + "\x00\x52\x31\x03\xe7\xb4\x5b\x1c\x9f\x72\xeb\x3c\x18\x08\xa3" + "\x24\xb2\x63\x5f\x77\x55\x4a\x42\xdb\x1e\xff\x1e\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\xe4\x66\x69\x86\x87\x57\x0e\xac\xf1" + "\xfd\x06\x81\x48\x90\x82\x42\x48\x50\x75\x8e\xd4\x2d\xf3\x02" + "\x37\x89\x28\xc5\x68\xd7\xa0\x11\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh46() + { + testcase("Thresh46"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim28Cond + // ** Rsa29Cond + // ** Ed30Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** Thresh11Cond + // *** rsa2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** rsa4 + // ** prefix16 + // *** prefix17 + // **** thresh18 + // ***** Preim20Cond + // ***** Rsa21Cond + // ***** Ed22Cond + // ***** rsa19 + // ** thresh23 + // *** Preim25Cond + // *** Rsa26Cond + // *** Ed27Cond + // *** rsa24 + + auto const rsa2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa2PublicKey{ + {0xba, 0x2c, 0x3b, 0x50, 0xb6, 0xbf, 0xf9, 0x0f, 0x1d, 0xd7, 0x32, + 0x4c, 0x01, 0x5f, 0xff, 0x2f, 0x2a, 0xf6, 0x33, 0xd0, 0xfb, 0xea, + 0x1f, 0xa4, 0xf2, 0x2d, 0x22, 0x8a, 0x19, 0x95, 0xa9, 0x17, 0xb7, + 0x4f, 0x17, 0xcf, 0x55, 0xcd, 0x1a, 0x3a, 0x5f, 0x07, 0x73, 0xcc, + 0xaa, 0x21, 0x70, 0x64, 0xb3, 0xa0, 0xf4, 0xb7, 0x30, 0xa3, 0x82, + 0x37, 0x93, 0xc6, 0x59, 0xde, 0x1b, 0xa1, 0x16, 0x90, 0x5a, 0x1a, + 0xf6, 0x73, 0xab, 0x92, 0xc8, 0x2f, 0xf4, 0x6f, 0x5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32, 0x61}}; + std::array const rsa2Sig{ + {0x57, 0xa5, 0xb3, 0xc9, 0xfc, 0x60, 0x8b, 0xee, 0xe9, 0x3c, 0x4e, + 0x45, 0x9a, 0x6a, 0x22, 0x12, 0xd0, 0x02, 0xcd, 0x8d, 0x82, 0xe3, + 0xbf, 0x7e, 0x36, 0x7e, 0x5f, 0x4f, 0x2c, 0x6c, 0x96, 0xf6, 0x66, + 0x4d, 0xc8, 0x36, 0x9e, 0x2f, 0xde, 0x2d, 0x98, 0x1f, 0xb8, 0x69, + 0x95, 0xd7, 0xfd, 0x03, 0x95, 0x02, 0x1c, 0x65, 0xe9, 0xa8, 0x95, + 0x68, 0x9f, 0xc6, 0xde, 0x32, 0xc1, 0x4d, 0x12, 0x56, 0xba, 0x29, + 0x6b, 0xe1, 0x5a, 0xd9, 0xbb, 0xb4, 0xc2, 0xcf, 0xab, 0x96, 0x0a, + 0x6f, 0x3b, 0xc9, 0xcd, 0x25, 0xa9, 0x06, 0x75, 0x62, 0x83, 0xfd, + 0x39, 0xea, 0xf4, 0x3f, 0x36, 0x05, 0x53, 0x6b, 0x49, 0xed, 0x77, + 0x8f, 0xb2, 0x43, 0x81, 0x45, 0xb0, 0xf5, 0xf6, 0xc1, 0x7d, 0x1a, + 0xdb, 0x85, 0x96, 0x5a, 0xd5, 0x85, 0xd2, 0x92, 0x1a, 0x30, 0x0c, + 0xf1, 0xcb, 0x70, 0x7c, 0x9e, 0x27, 0x95, 0x15, 0xd4, 0xb0, 0xe2, + 0x2b, 0xc2, 0x29, 0x8a, 0x6d, 0xf8, 0xa6, 0xd4, 0x93, 0xb6, 0x92, + 0xbd, 0x75, 0x57, 0x4f, 0xf4, 0xbc, 0x0f, 0x59, 0x8d, 0xdb, 0xe5, + 0x8f, 0x9e, 0x3d, 0x27, 0x39, 0x1c, 0xa4, 0x8f, 0xff, 0xff, 0xd0, + 0xa0, 0x43, 0x50, 0xf1, 0x24, 0x19, 0x34, 0x7d, 0x92, 0x38, 0x83, + 0x28, 0x81, 0x0c, 0x21, 0xee, 0x8c, 0x99, 0xe7, 0x1d, 0x7c, 0x46, + 0xa3, 0xb9, 0x6a, 0xa8, 0xbe, 0x94, 0x60, 0xf6, 0x44, 0x7b, 0x0c, + 0xe1, 0xe1, 0x6f, 0x0d, 0x96, 0x87, 0x93, 0x90, 0x7e, 0x9b, 0x69, + 0x44, 0xba, 0xf7, 0xe0, 0xc0, 0x72, 0x96, 0x1b, 0xec, 0xd6, 0xf2, + 0xe3, 0xf5, 0xda, 0xb2, 0x7f, 0x7d, 0x40, 0x19, 0x7e, 0x67, 0xde, + 0x21, 0xfd, 0xbf, 0xf7, 0xa9, 0x42, 0x81, 0x0b, 0x85, 0x97, 0x4d, + 0x29, 0xed, 0x58, 0x78, 0x73, 0x17, 0x10, 0x15, 0x06, 0x6f, 0xef, + 0x51, 0x0e, 0x69}}; + auto const rsa4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x42, 0x67, 0xac, 0x1b, 0x9f, 0x57, 0x77, 0x2d, 0x6d, 0x82, 0xe0, + 0x9c, 0xdd, 0xc7, 0x5f, 0x65, 0xee, 0xd3, 0x73, 0x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x27, 0x25, 0x17, 0xca, 0xf3, 0xb8, 0x0d, 0x3a, 0xd1, + 0x74, 0x34, 0x34, 0x98, 0x16, 0x33, 0xb7, 0xb7, 0xeb, 0xb2, 0x25, + 0x75, 0xd6, 0x45, 0x0d, 0x75, 0x5e, 0xad, 0x02, 0xcf, 0xeb, 0xf1, + 0x2b, 0x40, 0x5f, 0x6d, 0x97, 0x24, 0xf2, 0x97, 0x39, 0x59, 0x0a, + 0xd0, 0xe7, 0x08, 0x14, 0x29, 0x1c, 0x27, 0xf1, 0x2d, 0x0a, 0x85, + 0xd9, 0x14, 0x0a}}; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh11CondConditionFingerprint = { + {0x67, 0xf9, 0x58, 0xcd, 0x83, 0xc7, 0xe8, 0x61, 0xc5, 0xd6, 0xc6, + 0x74, 0x63, 0x5e, 0x10, 0x49, 0x97, 0x4a, 0xdc, 0x6f, 0x31, 0x30, + 0x72, 0xd7, 0x25, 0xab, 0x2c, 0xb5, 0x0e, 0xe7, 0x39, 0xe2}}; + Condition const Thresh11Cond{Type::thresholdSha256, + 135168, + Thresh11CondConditionFingerprint, + std::bitset<5>{25}}; + auto const rsa19Msg = "P17P16abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa19PublicKey{ + {0xc0, 0x81, 0x79, 0x3f, 0x26, 0x8f, 0xe8, 0x48, 0xf1, 0x9c, 0xd2, + 0x09, 0x7c, 0x96, 0x0d, 0x3c, 0xbb, 0x85, 0xdb, 0x1f, 0xab, 0xbe, + 0x97, 0x7d, 0xc0, 0x31, 0x07, 0xb0, 0x2e, 0xb9, 0x5c, 0x2c, 0xae, + 0x82, 0xf5, 0x3e, 0xb6, 0x91, 0xb8, 0x88, 0x2a, 0xa4, 0xa7, 0x81, + 0x97, 0xa5, 0x71, 0xad, 0x09, 0x4d, 0xfc, 0x25, 0x41, 0x3e, 0xe0, + 0xa3, 0xa6, 0x19, 0xba, 0x8f, 0x02, 0x41, 0x8d, 0x05, 0x51, 0xcd, + 0xf8, 0x22, 0xb3, 0x7a, 0x6e, 0x94, 0x7e, 0xaa, 0x58, 0xda, 0x02, + 0xae, 0x73, 0x00, 0x94, 0x1c, 0xb5, 0xb5, 0x26, 0x9f, 0xc5, 0x8b, + 0x04, 0xe0, 0xe0, 0x73, 0x96, 0x4b, 0xaf, 0x6d, 0x0a, 0xe4, 0x25, + 0x90, 0x2d, 0x13, 0x3c, 0xbe, 0x0e, 0x68, 0x7d, 0xfe, 0xa6, 0x12, + 0x6b, 0xb6, 0xec, 0xa0, 0xda, 0x2b, 0x22, 0x31, 0xe6, 0x05, 0x76, + 0xf5, 0x98, 0x8e, 0x76, 0x86, 0xbe, 0xc6, 0x07, 0x73, 0x52, 0x20, + 0x13, 0x8f, 0x93, 0x1f, 0xd9, 0x73, 0xfa, 0xb3, 0xed, 0x50, 0x1b, + 0xf7, 0x68, 0xf6, 0x60, 0xa3, 0x12, 0x73, 0x10, 0xda, 0x06, 0x70, + 0x69, 0xcb, 0xb5, 0x6c, 0x85, 0x29, 0xe8, 0x9e, 0x29, 0xb1, 0x4d, + 0x7e, 0x7e, 0xce, 0x15, 0xf5, 0x25, 0x55, 0xc5, 0x89, 0x7e, 0x34, + 0x48, 0x34, 0x43, 0x30, 0x2b, 0x6a, 0x8a, 0x6d, 0x1b, 0x55, 0x2a, + 0x2c, 0xf4, 0xcd, 0xc1, 0x72, 0x78, 0xda, 0x0d, 0x54, 0x32, 0x46, + 0x93, 0xd7, 0x96, 0xce, 0x33, 0x06, 0xe9, 0x7a, 0x7b, 0x6d, 0xe9, + 0x54, 0xe4, 0xbe, 0x56, 0x37, 0xa7, 0x7c, 0xc8, 0xba, 0x17, 0xb1, + 0xba, 0x76, 0xd7, 0x7f, 0xca, 0x7f, 0xfe, 0x60, 0x7d, 0x60, 0x27, + 0xd0, 0x80, 0x65, 0x74, 0xdc, 0xd6, 0xc8, 0x58, 0x4d, 0xcd, 0x8e, + 0xc9, 0x4e, 0xb2, 0x3e, 0x6e, 0x4f, 0xfa, 0x22, 0xfa, 0x9f, 0x3a, + 0x9f, 0x14, 0xeb}}; + std::array const rsa19Sig{ + {0x5b, 0xc3, 0xe8, 0x95, 0xdc, 0x90, 0x4f, 0x5c, 0xc8, 0xd4, 0x53, + 0x65, 0xb9, 0x9f, 0x0d, 0x37, 0x7e, 0x07, 0x99, 0xd1, 0x5c, 0x08, + 0x2b, 0x03, 0x8f, 0x90, 0xa5, 0xac, 0xed, 0x7b, 0x38, 0x65, 0x8f, + 0xda, 0xcb, 0xa6, 0x6d, 0x20, 0xae, 0x17, 0x5b, 0xaa, 0x40, 0xd7, + 0xa7, 0xd1, 0x3d, 0x2c, 0x95, 0x42, 0xb2, 0xe6, 0xc6, 0xbb, 0x65, + 0x64, 0x07, 0xcb, 0x87, 0x87, 0xa1, 0x6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0x81, 0xf8, 0xc3, 0x27, 0x6d, 0x32, 0xef, 0x54, 0x46, 0x78, + 0xbc, 0xf8, 0x16}}; + auto const thresh18Msg = "P17P16abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim20CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim20Cond{Type::preimageSha256, + 9, + Preim20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa21CondConditionFingerprint = { + {0x18, 0x13, 0xb3, 0x53, 0x3a, 0x10, 0x06, 0xee, 0xf9, 0x67, 0xa2, + 0xcb, 0x27, 0x5e, 0xb8, 0x79, 0x5c, 0x09, 0xd1, 0x8f, 0xa0, 0xc7, + 0xb3, 0x95, 0x59, 0x14, 0xf6, 0x24, 0x99, 0x6b, 0x1a, 0xdd}}; + Condition const Rsa21Cond{Type::rsaSha256, + 65536, + Rsa21CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed22CondConditionFingerprint = { + {0xce, 0xba, 0x65, 0x8f, 0x48, 0xe3, 0x35, 0x4b, 0x51, 0xb6, 0xfd, + 0xe9, 0x57, 0xd7, 0xb9, 0xf0, 0x9b, 0x80, 0xb3, 0x6e, 0xdf, 0x73, + 0x20, 0x22, 0x5c, 0x0a, 0xda, 0x13, 0xf8, 0xc0, 0xa7, 0x5d}}; + Condition const Ed22Cond{Type::ed25519Sha256, + 131072, + Ed22CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix17Prefix = "P17"s; + auto const prefix17Msg = "P16abcdefghijklmnopqrstuvwxyz"s; + auto const prefix17MaxMsgLength = 29; + auto const prefix16Prefix = "P16"s; + auto const prefix16Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix16MaxMsgLength = 26; + auto const rsa24Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa24PublicKey{ + {0xdc, 0xd4, 0x41, 0xf6, 0xaf, 0x90, 0x5d, 0xaf, 0xd4, 0xd9, 0x40, + 0x33, 0x15, 0x57, 0x1e, 0x3c, 0x6b, 0xbc, 0x7d, 0xa3, 0x49, 0x9d, + 0x9b, 0x3a, 0x46, 0xf6, 0x23, 0xfe, 0xfa, 0xe8, 0x31, 0x4d, 0x32, + 0xfe, 0x50, 0x1f, 0x1f, 0xe3, 0x34, 0xcb, 0xe2, 0xec, 0x84, 0x8b, + 0xc7, 0xd3, 0x7e, 0x34, 0xb9, 0x74, 0x05, 0xaf, 0xb9, 0x08, 0x09, + 0x46, 0x6a, 0x98, 0xb0, 0x95, 0xd0, 0x4d, 0xe2, 0xb7, 0x99, 0xd8, + 0x32, 0x3e, 0xdb, 0x37, 0x12, 0xfb, 0x6d, 0xcc, 0x7a, 0xca, 0x61, + 0xa3, 0xdf, 0x82, 0xfb, 0x22, 0x3b, 0x9d, 0x3a, 0x83, 0x23, 0xe2, + 0xca, 0x1f, 0xc1, 0x8b, 0x38, 0x74, 0xca, 0x03, 0x5a, 0x83, 0x0c, + 0x62, 0x33, 0x45, 0x66, 0x97, 0xa1, 0x74, 0x27, 0x40, 0x41, 0x4a, + 0xdc, 0x0c, 0xa8, 0x2d, 0x63, 0xe7, 0x0b, 0x27, 0x2f, 0x76, 0x83, + 0x10, 0x7e, 0x67, 0xf2, 0xf9, 0xce, 0x69, 0x71, 0x40, 0x20, 0x46, + 0xeb, 0x3f, 0xbf, 0x2d, 0xf6, 0x53, 0xb2, 0x9f, 0x68, 0xf1, 0x10, + 0xe3, 0x1c, 0x40, 0x1d, 0xcd, 0x9b, 0xba, 0x3a, 0xbf, 0x94, 0x42, + 0xdf, 0x69, 0xeb, 0x9c, 0xb2, 0xeb, 0xfb, 0xd7, 0xe0, 0x04, 0x21, + 0xf1, 0x09, 0x0b, 0x86, 0xfd, 0x50, 0xcc, 0x95, 0x53, 0x66, 0xd5, + 0x74, 0xd5, 0x4d, 0x99, 0x98, 0x7b, 0x9d, 0x3f, 0xb2, 0x42, 0x3c, + 0x4a, 0xa0, 0x16, 0xaa, 0x77, 0x85, 0xc6, 0xe4, 0x9f, 0x0f, 0x03, + 0xc9, 0x28, 0xfd, 0xf4, 0xdc, 0x2e, 0xfd, 0x12, 0x2e, 0x6d, 0xad, + 0x6c, 0x7d, 0x2e, 0x95, 0x10, 0xe0, 0x82, 0xdd, 0xc3, 0xed, 0xf8, + 0xf4, 0xb7, 0x00, 0xf9, 0x28, 0xf2, 0xb2, 0xe4, 0x85, 0x3a, 0xe0, + 0xda, 0x7c, 0x68, 0x45, 0x7e, 0x95, 0x96, 0x9b, 0xe0, 0xbc, 0xaf, + 0x4a, 0x87, 0x6f, 0x87, 0x7e, 0x10, 0xf7, 0xd3, 0xad, 0x29, 0xb9, + 0xa0, 0xaa, 0xd1}}; + std::array const rsa24Sig{ + {0x64, 0x1e, 0x4d, 0x43, 0x5f, 0xb0, 0xe9, 0x0b, 0x8b, 0x44, 0xe2, + 0xc7, 0xcf, 0xf3, 0x38, 0x5a, 0x81, 0x78, 0x50, 0x18, 0xc9, 0x66, + 0x50, 0x05, 0xda, 0xc1, 0xf9, 0x23, 0xe3, 0x16, 0xea, 0x21, 0xf5, + 0xbe, 0x6a, 0x76, 0x44, 0xad, 0xf6, 0xd1, 0xd1, 0x93, 0xb4, 0x04, + 0x1c, 0x02, 0x8e, 0x31, 0xd8, 0xef, 0x26, 0x75, 0x8c, 0x37, 0xf0, + 0xba, 0x6d, 0x70, 0xc8, 0xdd, 0x1e, 0x7d, 0xda, 0x0f, 0xde, 0x01, + 0xe3, 0xc0, 0x4e, 0x23, 0xc2, 0xfd, 0x20, 0xb0, 0x5c, 0x27, 0xd4, + 0x92, 0x70, 0x46, 0x91, 0x10, 0x59, 0x10, 0xc0, 0x01, 0xd0, 0x1b, + 0xf6, 0x59, 0x51, 0x57, 0x4a, 0x19, 0xb3, 0xf3, 0x69, 0x1b, 0x9c, + 0xb4, 0x40, 0x89, 0x73, 0x9a, 0xdc, 0xd8, 0xee, 0x57, 0x6b, 0xdc, + 0x59, 0xbb, 0x5e, 0x1d, 0x8b, 0x0c, 0x78, 0x99, 0x37, 0x89, 0x3b, + 0x2c, 0x4e, 0x12, 0x2e, 0x88, 0x61, 0x24, 0x02, 0x20, 0x79, 0x57, + 0x9d, 0xdf, 0x4e, 0x56, 0x60, 0xdc, 0x49, 0x9e, 0x92, 0x2e, 0xe2, + 0x45, 0x7a, 0xfb, 0xe9, 0xad, 0x51, 0xc0, 0xb4, 0x4d, 0x40, 0x7a, + 0xf4, 0xab, 0x03, 0x98, 0xab, 0xa6, 0xfb, 0xc7, 0x60, 0x3e, 0x0c, + 0xdc, 0xb9, 0xf4, 0xa5, 0x67, 0xf4, 0x5c, 0x68, 0x0f, 0xa6, 0x82, + 0xd1, 0x13, 0xf2, 0x19, 0x1b, 0x70, 0x79, 0x46, 0x1a, 0xd2, 0xdf, + 0x51, 0xf8, 0xb0, 0xf9, 0x4d, 0xff, 0xa3, 0xe3, 0x29, 0xeb, 0xde, + 0x16, 0x7d, 0x51, 0x9d, 0x90, 0xf0, 0x35, 0x11, 0xd6, 0xaf, 0xf2, + 0x82, 0xa2, 0x1f, 0x97, 0xc9, 0xc7, 0xc4, 0x5b, 0xf2, 0xe9, 0x12, + 0xae, 0xf4, 0xab, 0xe1, 0x85, 0x04, 0xca, 0x97, 0x71, 0xb5, 0x9a, + 0x39, 0x0e, 0x26, 0x15, 0x5d, 0x9c, 0xff, 0xc1, 0xb5, 0xcd, 0x49, + 0x54, 0xb2, 0x9d, 0x7e, 0xd4, 0x30, 0xa3, 0x17, 0x03, 0x9e, 0xe3, + 0xe2, 0x06, 0x73}}; + auto const thresh23Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim25CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim25Cond{Type::preimageSha256, + 9, + Preim25CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa26CondConditionFingerprint = { + {0xd6, 0x40, 0x0d, 0x21, 0x44, 0x8a, 0xd4, 0x5a, 0xe6, 0x10, 0x3f, + 0xd4, 0x3a, 0x14, 0x5a, 0x5b, 0x87, 0x86, 0x20, 0x3c, 0x43, 0x20, + 0x9d, 0x9d, 0x0c, 0x75, 0x57, 0x80, 0x7d, 0xda, 0x9d, 0x06}}; + Condition const Rsa26Cond{Type::rsaSha256, + 65536, + Rsa26CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed27CondConditionFingerprint = { + {0x6a, 0x26, 0x73, 0x6f, 0xc3, 0xbf, 0x25, 0x73, 0x8e, 0x3b, 0x27, + 0x79, 0x47, 0xa5, 0x37, 0x7c, 0x78, 0xa0, 0x72, 0xd8, 0x77, 0x91, + 0xfc, 0x45, 0x87, 0x7f, 0x11, 0x57, 0xfe, 0x94, 0x57, 0x45}}; + Condition const Ed27Cond{Type::ed25519Sha256, + 131072, + Ed27CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim28CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim28Cond{Type::preimageSha256, + 9, + Preim28CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa29CondConditionFingerprint = { + {0x5c, 0xe1, 0xef, 0x71, 0xf6, 0x96, 0x65, 0x37, 0x01, 0x15, 0x1a, + 0xdd, 0xfe, 0x28, 0x5d, 0xef, 0x33, 0x99, 0x1f, 0xe9, 0x6a, 0x51, + 0x2d, 0x22, 0x62, 0x2c, 0x2e, 0x26, 0xb8, 0xda, 0x1e, 0xfa}}; + Condition const Rsa29Cond{Type::rsaSha256, + 65536, + Rsa29CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed30CondConditionFingerprint = { + {0xcc, 0x8a, 0x65, 0x38, 0xf7, 0x7c, 0xf9, 0x28, 0xc9, 0xdd, 0xf3, + 0x0c, 0x26, 0x64, 0x02, 0xde, 0x89, 0xd0, 0x71, 0xde, 0x61, 0x3e, + 0x31, 0x4d, 0x9b, 0x4e, 0x91, 0x6f, 0xcc, 0x36, 0x5c, 0xa3}}; + Condition const Ed30Cond{Type::ed25519Sha256, + 131072, + Ed30CondConditionFingerprint, + std::bitset<5>{0}}; + + auto rsa2 = std::make_unique( + makeSlice(rsa2PublicKey), makeSlice(rsa2Sig)); + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(rsa2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Thresh11Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto rsa19 = std::make_unique( + makeSlice(rsa19PublicKey), makeSlice(rsa19Sig)); + std::vector> thresh18Subfulfillments; + thresh18Subfulfillments.emplace_back(std::move(rsa19)); + std::vector thresh18Subconditions{ + {Preim20Cond, Rsa21Cond, Ed22Cond}}; + auto thresh18 = std::make_unique( + std::move(thresh18Subfulfillments), + std::move(thresh18Subconditions)); + auto prefix17 = std::make_unique( + makeSlice(prefix17Prefix), + prefix17MaxMsgLength, + std::move(thresh18)); + auto prefix16 = std::make_unique( + makeSlice(prefix16Prefix), + prefix16MaxMsgLength, + std::move(prefix17)); + auto rsa24 = std::make_unique( + makeSlice(rsa24PublicKey), makeSlice(rsa24Sig)); + std::vector> thresh23Subfulfillments; + thresh23Subfulfillments.emplace_back(std::move(rsa24)); + std::vector thresh23Subconditions{ + {Preim25Cond, Rsa26Cond, Ed27Cond}}; + auto thresh23 = std::make_unique( + std::move(thresh23Subfulfillments), + std::move(thresh23Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix16)); + thresh0Subfulfillments.emplace_back(std::move(thresh23)); + std::vector thresh0Subconditions{ + {Preim28Cond, Rsa29Cond, Ed30Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x0b\x09\xa0\x82\x0a\x8a\xa1\x82\x02\xab\x80\x03\x50" + "\x31\x36\x81\x01\x1a\xa2\x82\x02\x9f\xa1\x82\x02\x9b\x80\x03" + "\x50\x31\x37\x81\x01\x1d\xa2\x82\x02\x8f\xa2\x82\x02\x8b\xa0" + "\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xc0\x81\x79\x3f" + "\x26\x8f\xe8\x48\xf1\x9c\xd2\x09\x7c\x96\x0d\x3c\xbb\x85\xdb" + "\x1f\xab\xbe\x97\x7d\xc0\x31\x07\xb0\x2e\xb9\x5c\x2c\xae\x82" + "\xf5\x3e\xb6\x91\xb8\x88\x2a\xa4\xa7\x81\x97\xa5\x71\xad\x09" + "\x4d\xfc\x25\x41\x3e\xe0\xa3\xa6\x19\xba\x8f\x02\x41\x8d\x05" + "\x51\xcd\xf8\x22\xb3\x7a\x6e\x94\x7e\xaa\x58\xda\x02\xae\x73" + "\x00\x94\x1c\xb5\xb5\x26\x9f\xc5\x8b\x04\xe0\xe0\x73\x96\x4b" + "\xaf\x6d\x0a\xe4\x25\x90\x2d\x13\x3c\xbe\x0e\x68\x7d\xfe\xa6" + "\x12\x6b\xb6\xec\xa0\xda\x2b\x22\x31\xe6\x05\x76\xf5\x98\x8e" + "\x76\x86\xbe\xc6\x07\x73\x52\x20\x13\x8f\x93\x1f\xd9\x73\xfa" + "\xb3\xed\x50\x1b\xf7\x68\xf6\x60\xa3\x12\x73\x10\xda\x06\x70" + "\x69\xcb\xb5\x6c\x85\x29\xe8\x9e\x29\xb1\x4d\x7e\x7e\xce\x15" + "\xf5\x25\x55\xc5\x89\x7e\x34\x48\x34\x43\x30\x2b\x6a\x8a\x6d" + "\x1b\x55\x2a\x2c\xf4\xcd\xc1\x72\x78\xda\x0d\x54\x32\x46\x93" + "\xd7\x96\xce\x33\x06\xe9\x7a\x7b\x6d\xe9\x54\xe4\xbe\x56\x37" + "\xa7\x7c\xc8\xba\x17\xb1\xba\x76\xd7\x7f\xca\x7f\xfe\x60\x7d" + "\x60\x27\xd0\x80\x65\x74\xdc\xd6\xc8\x58\x4d\xcd\x8e\xc9\x4e" + "\xb2\x3e\x6e\x4f\xfa\x22\xfa\x9f\x3a\x9f\x14\xeb\x81\x82\x01" + "\x00\x5b\xc3\xe8\x95\xdc\x90\x4f\x5c\xc8\xd4\x53\x65\xb9\x9f" + "\x0d\x37\x7e\x07\x99\xd1\x5c\x08\x2b\x03\x8f\x90\xa5\xac\xed" + "\x7b\x38\x65\x8f\xda\xcb\xa6\x6d\x20\xae\x17\x5b\xaa\x40\xd7" + "\xa7\xd1\x3d\x2c\x95\x42\xb2\xe6\xc6\xbb\x65\x64\x07\xcb\x87" + "\x87\xa1\x6e\xc9\x4f\x0d\x83\xc9\x8f\x49\xa3\xd3\xe7\x16\xb6" + "\x4b\x16\xbf\xee\x31\x56\xfe\xb4\x87\xa6\xd5\x58\x3e\x98\x0f" + "\x7b\x6a\x1a\xd0\xad\x2f\x47\x36\x18\x15\x37\x85\xe3\xf4\x4c" + "\x78\xa7\xc6\x49\x50\xf1\x62\x16\x26\x2e\xda\x5c\x77\x36\x91" + "\xbb\xaa\x0e\x74\xdb\x76\xbf\x90\x14\x81\xd4\x73\x31\xd8\x88" + "\x60\x27\xa3\xc6\x46\xeb\xee\x43\x15\x2a\x6b\x3a\x34\x49\xe9" + "\xcd\x74\xd5\xed\x9b\xea\xe6\x0e\xaa\x9f\x9b\xd3\x7b\x3d\x16" + "\x73\x70\xb8\xe3\x83\xe5\xed\xad\x12\xbf\x73\xef\x95\xec\xd8" + "\x33\x50\x7c\x69\x7d\x27\xfa\xbe\xdf\x70\x5c\x0a\xbf\x89\x22" + "\xc6\xee\x82\xc5\xc5\x66\x60\xdc\x1a\x2b\x9b\x83\x94\xcf\xa8" + "\x79\xba\x82\xd0\x9b\x3b\x82\x4a\x7a\xd5\x6b\xa4\x2a\x7e\xab" + "\x08\x95\x0c\xa9\xaa\xd3\x6e\x0e\x38\x52\x65\xe9\xf4\x2d\xe5" + "\xa5\x42\x33\xa3\x81\xf8\xc3\x27\x6d\x32\xef\x54\x46\x78\xbc" + "\xf8\x16\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27" + "\x80\x20\x18\x13\xb3\x53\x3a\x10\x06\xee\xf9\x67\xa2\xcb\x27" + "\x5e\xb8\x79\x5c\x09\xd1\x8f\xa0\xc7\xb3\x95\x59\x14\xf6\x24" + "\x99\x6b\x1a\xdd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xce\xba" + "\x65\x8f\x48\xe3\x35\x4b\x51\xb6\xfd\xe9\x57\xd7\xb9\xf0\x9b" + "\x80\xb3\x6e\xdf\x73\x20\x22\x5c\x0a\xda\x13\xf8\xc0\xa7\x5d" + "\x81\x03\x02\x00\x00\xa2\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82" + "\x02\x08\x80\x82\x01\x00\xdc\xd4\x41\xf6\xaf\x90\x5d\xaf\xd4" + "\xd9\x40\x33\x15\x57\x1e\x3c\x6b\xbc\x7d\xa3\x49\x9d\x9b\x3a" + "\x46\xf6\x23\xfe\xfa\xe8\x31\x4d\x32\xfe\x50\x1f\x1f\xe3\x34" + "\xcb\xe2\xec\x84\x8b\xc7\xd3\x7e\x34\xb9\x74\x05\xaf\xb9\x08" + "\x09\x46\x6a\x98\xb0\x95\xd0\x4d\xe2\xb7\x99\xd8\x32\x3e\xdb" + "\x37\x12\xfb\x6d\xcc\x7a\xca\x61\xa3\xdf\x82\xfb\x22\x3b\x9d" + "\x3a\x83\x23\xe2\xca\x1f\xc1\x8b\x38\x74\xca\x03\x5a\x83\x0c" + "\x62\x33\x45\x66\x97\xa1\x74\x27\x40\x41\x4a\xdc\x0c\xa8\x2d" + "\x63\xe7\x0b\x27\x2f\x76\x83\x10\x7e\x67\xf2\xf9\xce\x69\x71" + "\x40\x20\x46\xeb\x3f\xbf\x2d\xf6\x53\xb2\x9f\x68\xf1\x10\xe3" + "\x1c\x40\x1d\xcd\x9b\xba\x3a\xbf\x94\x42\xdf\x69\xeb\x9c\xb2" + "\xeb\xfb\xd7\xe0\x04\x21\xf1\x09\x0b\x86\xfd\x50\xcc\x95\x53" + "\x66\xd5\x74\xd5\x4d\x99\x98\x7b\x9d\x3f\xb2\x42\x3c\x4a\xa0" + "\x16\xaa\x77\x85\xc6\xe4\x9f\x0f\x03\xc9\x28\xfd\xf4\xdc\x2e" + "\xfd\x12\x2e\x6d\xad\x6c\x7d\x2e\x95\x10\xe0\x82\xdd\xc3\xed" + "\xf8\xf4\xb7\x00\xf9\x28\xf2\xb2\xe4\x85\x3a\xe0\xda\x7c\x68" + "\x45\x7e\x95\x96\x9b\xe0\xbc\xaf\x4a\x87\x6f\x87\x7e\x10\xf7" + "\xd3\xad\x29\xb9\xa0\xaa\xd1\x81\x82\x01\x00\x64\x1e\x4d\x43" + "\x5f\xb0\xe9\x0b\x8b\x44\xe2\xc7\xcf\xf3\x38\x5a\x81\x78\x50" + "\x18\xc9\x66\x50\x05\xda\xc1\xf9\x23\xe3\x16\xea\x21\xf5\xbe" + "\x6a\x76\x44\xad\xf6\xd1\xd1\x93\xb4\x04\x1c\x02\x8e\x31\xd8" + "\xef\x26\x75\x8c\x37\xf0\xba\x6d\x70\xc8\xdd\x1e\x7d\xda\x0f" + "\xde\x01\xe3\xc0\x4e\x23\xc2\xfd\x20\xb0\x5c\x27\xd4\x92\x70" + "\x46\x91\x10\x59\x10\xc0\x01\xd0\x1b\xf6\x59\x51\x57\x4a\x19" + "\xb3\xf3\x69\x1b\x9c\xb4\x40\x89\x73\x9a\xdc\xd8\xee\x57\x6b" + "\xdc\x59\xbb\x5e\x1d\x8b\x0c\x78\x99\x37\x89\x3b\x2c\x4e\x12" + "\x2e\x88\x61\x24\x02\x20\x79\x57\x9d\xdf\x4e\x56\x60\xdc\x49" + "\x9e\x92\x2e\xe2\x45\x7a\xfb\xe9\xad\x51\xc0\xb4\x4d\x40\x7a" + "\xf4\xab\x03\x98\xab\xa6\xfb\xc7\x60\x3e\x0c\xdc\xb9\xf4\xa5" + "\x67\xf4\x5c\x68\x0f\xa6\x82\xd1\x13\xf2\x19\x1b\x70\x79\x46" + "\x1a\xd2\xdf\x51\xf8\xb0\xf9\x4d\xff\xa3\xe3\x29\xeb\xde\x16" + "\x7d\x51\x9d\x90\xf0\x35\x11\xd6\xaf\xf2\x82\xa2\x1f\x97\xc9" + "\xc7\xc4\x5b\xf2\xe9\x12\xae\xf4\xab\xe1\x85\x04\xca\x97\x71" + "\xb5\x9a\x39\x0e\x26\x15\x5d\x9c\xff\xc1\xb5\xcd\x49\x54\xb2" + "\x9d\x7e\xd4\x30\xa3\x17\x03\x9e\xe3\xe2\x06\x73\xa1\x79\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xd6\x40\x0d" + "\x21\x44\x8a\xd4\x5a\xe6\x10\x3f\xd4\x3a\x14\x5a\x5b\x87\x86" + "\x20\x3c\x43\x20\x9d\x9d\x0c\x75\x57\x80\x7d\xda\x9d\x06\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x6a\x26\x73\x6f\xc3\xbf\x25" + "\x73\x8e\x3b\x27\x79\x47\xa5\x37\x7c\x78\xa0\x72\xd8\x77\x91" + "\xfc\x45\x87\x7f\x11\x57\xfe\x94\x57\x45\x81\x03\x02\x00\x00" + "\xa2\x82\x05\x48\xa0\x82\x04\x9b\xa2\x82\x02\x8b\xa0\x82\x02" + "\x0c\xa3\x82\x02\x08\x80\x82\x01\x00\xbe\x09\xc5\xa4\x27\x29" + "\xdf\xd4\x67\x76\xbe\xbf\x2c\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd" + "\x67\x20\xfb\x7a\x27\x93\xc0\x78\x47\x78\xd7\x15\x32\xee\x38" + "\x81\x0d\x36\xa2\xc4\x65\x44\xe6\x62\x26\xb9\x58\x13\xa4\x15" + "\x82\xab\xb1\x16\x61\xfc\x01\x98\xc6\x1a\x69\xc6\xba\x39\x3f" + "\x01\x55\x3d\xd7\x8e\x14\x42\x6d\x78\x74\x9b\x28\xcb\x31\x39" + "\x98\x5a\x11\xdc\xc1\x18\x9d\x8d\xb0\xcd\x1b\x4c\x10\xab\x14" + "\x64\x19\xf1\x33\x15\x45\xc8\x92\x82\x03\x82\x8a\xaa\xad\x94" + "\xfc\x24\x11\x96\x99\x7e\x94\x5a\x82\x57\x68\x61\x9f\x7b\x45" + "\xe0\x99\x9e\x4f\x32\x50\x5f\x05\xc8\x11\xae\xc4\x0c\x63\x18" + "\x0e\x02\x59\x36\x25\x92\x06\x32\xc7\x71\x47\x99\xcc\x0a\x6e" + "\x0a\x58\x71\x3f\x5e\xb7\x78\xf7\x98\x79\xdf\x74\xa4\xeb\xa9" + "\x00\xfd\x81\xb3\xcf\x04\x8c\x5d\x7d\xe7\xb2\x82\x90\x49\xbd" + "\x69\xf3\x08\xe9\x92\xc6\x9e\x41\xba\x74\xd8\x8d\x81\x97\x6f" + "\x86\xab\xc9\xf1\x02\x31\xb4\xce\x47\xb0\x39\xc8\xba\x51\xa7" + "\x39\xf3\x71\xa2\x25\x27\x37\x6e\x09\x6f\x19\x59\xbc\x65\xd9" + "\xcd\x12\xd3\x2c\xa2\x78\xfa\x23\x15\x1a\x82\x41\x91\x1b\xbe" + "\x8a\xe7\xfe\x3c\x3c\x30\x32\xaa\xe9\xf3\x81\x82\x01\x00\x42" + "\x67\xac\x1b\x9f\x57\x77\x2d\x6d\x82\xe0\x9c\xdd\xc7\x5f\x65" + "\xee\xd3\x73\xed\xc1\x03\x3f\x5a\x67\x26\x69\x65\x47\x61\x0f" + "\xce\xac\xd0\xc8\xb3\x42\xf8\x6f\xb9\xc7\xd4\x22\x19\x4c\xb7" + "\xa2\x20\x1c\x5d\x92\x32\xdb\x11\xa9\x24\xcd\x40\x8d\xe4\xf2" + "\xf4\x9f\xba\x24\xb8\x6a\xe4\xa4\x46\x67\xdc\xaa\x42\x82\x73" + "\xf8\xaa\xf0\x1f\x40\x7f\x9d\x9e\xe2\xbe\x00\xb4\x37\xea\x53" + "\x08\x70\xd0\x6f\x2d\x32\xd8\x76\xe1\xcf\xc1\x8f\x5a\x96\xa2" + "\xac\xd8\x0e\xb3\x4e\xeb\xa6\x07\xd6\x96\x35\x3b\xf0\x8f\xcf" + "\x89\x49\x21\xc1\xff\x9a\x2e\x1d\x14\x33\xc4\xe5\x68\x43\x81" + "\x3c\x6a\x7b\x41\xe7\x55\x4c\xd9\x28\x79\xdb\x77\x15\x31\x8f" + "\x2e\x77\xb3\xe8\xf4\x08\x97\x1e\x65\x2c\x14\x43\x24\x85\x8f" + "\x3f\xf3\x8e\xdb\xc2\xb3\x16\xc5\x87\x3f\x04\x5e\x19\x38\x23" + "\xb6\xb0\x66\x11\x16\xaf\x96\x67\xc4\x26\x0f\x04\xb8\x6d\xef" + "\xe8\x7d\x9d\xcd\x27\x25\x17\xca\xf3\xb8\x0d\x3a\xd1\x74\x34" + "\x34\x98\x16\x33\xb7\xb7\xeb\xb2\x25\x75\xd6\x45\x0d\x75\x5e" + "\xad\x02\xcf\xeb\xf1\x2b\x40\x5f\x6d\x97\x24\xf2\x97\x39\x59" + "\x0a\xd0\xe7\x08\x14\x29\x1c\x27\xf1\x2d\x0a\x85\xd9\x14\x0a" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1" + "\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59" + "\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e" + "\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91" + "\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03" + "\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xba\x2c\x3b\x50" + "\xb6\xbf\xf9\x0f\x1d\xd7\x32\x4c\x01\x5f\xff\x2f\x2a\xf6\x33" + "\xd0\xfb\xea\x1f\xa4\xf2\x2d\x22\x8a\x19\x95\xa9\x17\xb7\x4f" + "\x17\xcf\x55\xcd\x1a\x3a\x5f\x07\x73\xcc\xaa\x21\x70\x64\xb3" + "\xa0\xf4\xb7\x30\xa3\x82\x37\x93\xc6\x59\xde\x1b\xa1\x16\x90" + "\x5a\x1a\xf6\x73\xab\x92\xc8\x2f\xf4\x6f\x5c\xf2\x22\x1d\x30" + "\xf8\x03\xd8\x9b\x5f\x73\x72\x8e\x5f\xd5\x37\x4b\x43\xda\xfe" + "\x84\x21\x67\xe8\xe3\xd7\x91\x3f\x24\x1d\xfb\x1f\x12\x6e\xcb" + "\xfc\xb7\x5b\x0a\x35\x73\x3b\xce\x44\x34\x8e\xcd\x53\xa4\xcf" + "\xa7\x63\x73\xcd\x31\x0f\xe0\x75\x8d\xe4\xa9\xdc\xfe\xf0\xc9" + "\x3d\x26\xaf\xbf\x7b\x0f\x0e\x17\xb9\xd0\x4a\x32\x80\x64\x6b" + "\x54\x73\x5a\x50\xc7\x31\x59\xf9\x73\x72\xa5\x79\xba\xdb\xa1" + "\x14\x8d\x77\x67\x3e\xc0\x5b\xec\x6f\x0b\xf7\xc5\xee\x5a\xa6" + "\x8d\x49\x63\x81\xbb\xd1\xf9\x9e\xbb\xed\xb2\xa9\x18\x60\xa7" + "\xee\xeb\x30\xa1\x92\x93\xe8\xd8\x34\x9e\xac\xd6\x23\xfc\x7f" + "\xcb\xe7\xfe\xa7\xe6\x42\xac\x77\x11\xc0\x67\x77\xd1\xaa\x5e" + "\xed\x3b\xd5\xa5\x8d\x34\x7c\xd9\x57\x44\xa7\xc5\x44\x2e\x1e" + "\xe7\x63\xd8\x53\x1b\x9a\xd9\x67\x02\x13\x32\x61\x81\x82\x01" + "\x00\x57\xa5\xb3\xc9\xfc\x60\x8b\xee\xe9\x3c\x4e\x45\x9a\x6a" + "\x22\x12\xd0\x02\xcd\x8d\x82\xe3\xbf\x7e\x36\x7e\x5f\x4f\x2c" + "\x6c\x96\xf6\x66\x4d\xc8\x36\x9e\x2f\xde\x2d\x98\x1f\xb8\x69" + "\x95\xd7\xfd\x03\x95\x02\x1c\x65\xe9\xa8\x95\x68\x9f\xc6\xde" + "\x32\xc1\x4d\x12\x56\xba\x29\x6b\xe1\x5a\xd9\xbb\xb4\xc2\xcf" + "\xab\x96\x0a\x6f\x3b\xc9\xcd\x25\xa9\x06\x75\x62\x83\xfd\x39" + "\xea\xf4\x3f\x36\x05\x53\x6b\x49\xed\x77\x8f\xb2\x43\x81\x45" + "\xb0\xf5\xf6\xc1\x7d\x1a\xdb\x85\x96\x5a\xd5\x85\xd2\x92\x1a" + "\x30\x0c\xf1\xcb\x70\x7c\x9e\x27\x95\x15\xd4\xb0\xe2\x2b\xc2" + "\x29\x8a\x6d\xf8\xa6\xd4\x93\xb6\x92\xbd\x75\x57\x4f\xf4\xbc" + "\x0f\x59\x8d\xdb\xe5\x8f\x9e\x3d\x27\x39\x1c\xa4\x8f\xff\xff" + "\xd0\xa0\x43\x50\xf1\x24\x19\x34\x7d\x92\x38\x83\x28\x81\x0c" + "\x21\xee\x8c\x99\xe7\x1d\x7c\x46\xa3\xb9\x6a\xa8\xbe\x94\x60" + "\xf6\x44\x7b\x0c\xe1\xe1\x6f\x0d\x96\x87\x93\x90\x7e\x9b\x69" + "\x44\xba\xf7\xe0\xc0\x72\x96\x1b\xec\xd6\xf2\xe3\xf5\xda\xb2" + "\x7f\x7d\x40\x19\x7e\x67\xde\x21\xfd\xbf\xf7\xa9\x42\x81\x0b" + "\x85\x97\x4d\x29\xed\x58\x78\x73\x17\x10\x15\x06\x6f\xef\x51" + "\x0e\x69\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2" + "\x2b\x80\x20\x67\xf9\x58\xcd\x83\xc7\xe8\x61\xc5\xd6\xc6\x74" + "\x63\x5e\x10\x49\x97\x4a\xdc\x6f\x31\x30\x72\xd7\x25\xab\x2c" + "\xb5\x0e\xe7\x39\xe2\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88" + "\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb" + "\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00" + "\x8b\xe6\x62\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16" + "\xda\x09\xbe\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62" + "\xfa\x81\x03\x02\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30" + "\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c" + "\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81" + "\x01\x09\xa3\x27\x80\x20\x5c\xe1\xef\x71\xf6\x96\x65\x37\x01" + "\x15\x1a\xdd\xfe\x28\x5d\xef\x33\x99\x1f\xe9\x6a\x51\x2d\x22" + "\x62\x2c\x2e\x26\xb8\xda\x1e\xfa\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\xcc\x8a\x65\x38\xf7\x7c\xf9\x28\xc9\xdd\xf3\x0c\x26" + "\x64\x02\xde\x89\xd0\x71\xde\x61\x3e\x31\x4d\x9b\x4e\x91\x6f" + "\xcc\x36\x5c\xa3\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x63\x15\x8d\x31\xc8\xef\x24\x40\x86\xcb\x7c" + "\xe9\x75\x49\x26\x07\x1a\x9c\x1b\xfd\x80\x8d\x14\x00\x5d\xaa" + "\xed\xfa\x65\x85\x82\x1c\x81\x03\x08\x78\x3d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x15\x53\xa0\x80\x79\xe6" + "\x5f\x66\xe8\xa0\x6e\xed\x61\xfe\x5f\x1d\xe4\xfc\x3b\x51\x79" + "\x37\x5f\x67\xcd\x9c\x8a\x78\x03\xe8\xd5\x94\x81\x03\x02\x18" + "\x3d\x82\x02\x03\xb8\xa2\x2b\x80\x20\xee\x16\x33\x74\x2b\x8f" + "\x63\xbd\xbc\x40\xc3\x1b\x57\x5d\xa0\x9d\x1e\x49\x10\x20\xf8" + "\x92\x81\x57\x6a\xe2\xb9\xc4\x9e\xd7\x1a\x3f\x81\x03\x04\x38" + "\x00\x82\x02\x03\x98\xa2\x2b\x80\x20\xff\xb7\x7a\x11\xe2\xb8" + "\x11\x3c\xf6\xd5\x94\x24\xae\x34\x10\xaa\x15\x42\xcc\x33\x64" + "\xc3\x1b\x33\xbc\xd1\x6c\x01\xd4\x41\xfd\xb3\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x5c\xe1\xef\x71\xf6\x96" + "\x65\x37\x01\x15\x1a\xdd\xfe\x28\x5d\xef\x33\x99\x1f\xe9\x6a" + "\x51\x2d\x22\x62\x2c\x2e\x26\xb8\xda\x1e\xfa\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xcc\x8a\x65\x38\xf7\x7c\xf9\x28\xc9\xdd" + "\xf3\x0c\x26\x64\x02\xde\x89\xd0\x71\xde\x61\x3e\x31\x4d\x9b" + "\x4e\x91\x6f\xcc\x36\x5c\xa3\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh47() + { + testcase("Thresh47"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim19Cond + // ** Rsa20Cond + // ** Ed21Cond + // ** Prefix22Cond + // ** Thresh29Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** Thresh11Cond + // *** rsa2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** rsa4 + // ** preim16 + // ** rsa17 + // ** ed18 + + auto const rsa2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa2PublicKey{ + {0xba, 0x2c, 0x3b, 0x50, 0xb6, 0xbf, 0xf9, 0x0f, 0x1d, 0xd7, 0x32, + 0x4c, 0x01, 0x5f, 0xff, 0x2f, 0x2a, 0xf6, 0x33, 0xd0, 0xfb, 0xea, + 0x1f, 0xa4, 0xf2, 0x2d, 0x22, 0x8a, 0x19, 0x95, 0xa9, 0x17, 0xb7, + 0x4f, 0x17, 0xcf, 0x55, 0xcd, 0x1a, 0x3a, 0x5f, 0x07, 0x73, 0xcc, + 0xaa, 0x21, 0x70, 0x64, 0xb3, 0xa0, 0xf4, 0xb7, 0x30, 0xa3, 0x82, + 0x37, 0x93, 0xc6, 0x59, 0xde, 0x1b, 0xa1, 0x16, 0x90, 0x5a, 0x1a, + 0xf6, 0x73, 0xab, 0x92, 0xc8, 0x2f, 0xf4, 0x6f, 0x5c, 0xf2, 0x22, + 0x1d, 0x30, 0xf8, 0x03, 0xd8, 0x9b, 0x5f, 0x73, 0x72, 0x8e, 0x5f, + 0xd5, 0x37, 0x4b, 0x43, 0xda, 0xfe, 0x84, 0x21, 0x67, 0xe8, 0xe3, + 0xd7, 0x91, 0x3f, 0x24, 0x1d, 0xfb, 0x1f, 0x12, 0x6e, 0xcb, 0xfc, + 0xb7, 0x5b, 0x0a, 0x35, 0x73, 0x3b, 0xce, 0x44, 0x34, 0x8e, 0xcd, + 0x53, 0xa4, 0xcf, 0xa7, 0x63, 0x73, 0xcd, 0x31, 0x0f, 0xe0, 0x75, + 0x8d, 0xe4, 0xa9, 0xdc, 0xfe, 0xf0, 0xc9, 0x3d, 0x26, 0xaf, 0xbf, + 0x7b, 0x0f, 0x0e, 0x17, 0xb9, 0xd0, 0x4a, 0x32, 0x80, 0x64, 0x6b, + 0x54, 0x73, 0x5a, 0x50, 0xc7, 0x31, 0x59, 0xf9, 0x73, 0x72, 0xa5, + 0x79, 0xba, 0xdb, 0xa1, 0x14, 0x8d, 0x77, 0x67, 0x3e, 0xc0, 0x5b, + 0xec, 0x6f, 0x0b, 0xf7, 0xc5, 0xee, 0x5a, 0xa6, 0x8d, 0x49, 0x63, + 0x81, 0xbb, 0xd1, 0xf9, 0x9e, 0xbb, 0xed, 0xb2, 0xa9, 0x18, 0x60, + 0xa7, 0xee, 0xeb, 0x30, 0xa1, 0x92, 0x93, 0xe8, 0xd8, 0x34, 0x9e, + 0xac, 0xd6, 0x23, 0xfc, 0x7f, 0xcb, 0xe7, 0xfe, 0xa7, 0xe6, 0x42, + 0xac, 0x77, 0x11, 0xc0, 0x67, 0x77, 0xd1, 0xaa, 0x5e, 0xed, 0x3b, + 0xd5, 0xa5, 0x8d, 0x34, 0x7c, 0xd9, 0x57, 0x44, 0xa7, 0xc5, 0x44, + 0x2e, 0x1e, 0xe7, 0x63, 0xd8, 0x53, 0x1b, 0x9a, 0xd9, 0x67, 0x02, + 0x13, 0x32, 0x61}}; + std::array const rsa2Sig{ + {0x79, 0x26, 0x29, 0x11, 0xad, 0xac, 0x56, 0x71, 0xd5, 0xb2, 0x7f, + 0xdf, 0x15, 0xd7, 0xfe, 0xbc, 0x4e, 0x21, 0x39, 0x31, 0x30, 0x29, + 0x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, 0xff, 0x49, 0x38, 0xfb, 0xeb, 0x1d, + 0xeb, 0x21, 0xee, 0xe8, 0x0d, 0x47, 0x46, 0x18, 0x69, 0xa2, 0x9b, + 0x6d, 0x12, 0xa0, 0xc5, 0xcc, 0xec, 0x4f, 0x18, 0xdc, 0x0a, 0xfa, + 0x4c, 0x58, 0x2e, 0xfb, 0x01, 0x89, 0x39, 0x93, 0x6e, 0x27, 0x5d, + 0xfb, 0xe4, 0xbd, 0xc9, 0x6a, 0xbe, 0x5a, 0x70, 0x17, 0x99, 0x22, + 0x5b, 0x38, 0xe3}}; + auto const rsa4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0x1c, 0x15, 0x44, 0x80, 0xc8, 0xcb, 0x59, 0x51, 0xf8, 0x40, 0xa0, + 0xc6, 0x65, 0xc5, 0xd0, 0x17, 0x12, 0x66, 0x55, 0x42, 0xb1, 0xe0, + 0xdf, 0xb2, 0x74, 0x62, 0xda, 0x9a, 0x95, 0x73, 0x1f, 0x73, 0x84, + 0xb3, 0xcd, 0xd2, 0xfb, 0xc3, 0xc2, 0x62, 0xe7, 0xd0, 0x60, 0x14, + 0xba, 0x84, 0x69, 0xa8, 0xda, 0xd0, 0x1e, 0x5a, 0xba, 0x35, 0x5a, + 0x61, 0x29, 0xa8, 0x5f, 0x76, 0xbc, 0x04, 0x39, 0x08, 0xa4, 0x3b, + 0xd9, 0x62, 0x1a, 0xf5, 0x91, 0x84, 0x32, 0x61, 0x88, 0x42, 0xf1, + 0x1b, 0x47, 0xa2, 0xf5, 0x95, 0x26, 0x0e, 0xba, 0x51, 0x6e, 0x55, + 0x4a, 0xb6, 0xfe, 0xd9, 0xa1, 0xf5, 0xdb, 0xf6, 0x23, 0x2f, 0x8b, + 0x81, 0x16, 0x58, 0xd2, 0x9f, 0x9e, 0x4d, 0x9d, 0x86, 0xb2, 0x9e, + 0xf3, 0x72, 0x29, 0x31, 0xc5, 0x51, 0x52, 0x01, 0xb9, 0x34, 0x42, + 0x97, 0xcd, 0x77, 0x51, 0x27, 0xef, 0xd7, 0xc8, 0x15, 0x30, 0xf6, + 0x9b, 0xf7, 0xbd, 0x87, 0x2d, 0x34, 0x90, 0x45, 0x64, 0xc6, 0x71, + 0xeb, 0x41, 0x00, 0x11, 0x83, 0x49, 0x9a, 0xfe, 0x69, 0x20, 0x00, + 0xab, 0x98, 0xac, 0x56, 0x0e, 0xb4, 0xea, 0x85, 0xd3, 0xf2, 0x13, + 0x0e, 0xca, 0x42, 0xb6, 0xd7, 0xb7, 0x70, 0x11, 0x9f, 0xac, 0x0c, + 0x89, 0xbd, 0x8e, 0x30, 0x22, 0x94, 0x01, 0x58, 0xf2, 0x4a, 0x6f, + 0x86, 0x25, 0x33, 0xc5, 0x2b, 0x50, 0xd6, 0x98, 0x97, 0xaf, 0x5a, + 0x2e, 0xec, 0x43, 0xf3, 0x9f, 0xe2, 0x22, 0xf6, 0xa2, 0x05, 0x26, + 0xab, 0x4c, 0xe8, 0x6f, 0xd4, 0x64, 0x92, 0xe5, 0xf7, 0x4b, 0x41, + 0x85, 0xf8, 0xd4, 0x60, 0x05, 0xf6, 0xde, 0xe3, 0x37, 0xd7, 0xc3, + 0x69, 0x13, 0x34, 0x49, 0x9f, 0x22, 0x81, 0xb9, 0xaa, 0x4e, 0xab, + 0xe3, 0xae, 0xb9, 0xea, 0x76, 0x86, 0x1d, 0x86, 0xd9, 0xd4, 0x4c, + 0x77, 0x16, 0xbf}}; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh11CondConditionFingerprint = { + {0x67, 0xf9, 0x58, 0xcd, 0x83, 0xc7, 0xe8, 0x61, 0xc5, 0xd6, 0xc6, + 0x74, 0x63, 0x5e, 0x10, 0x49, 0x97, 0x4a, 0xdc, 0x6f, 0x31, 0x30, + 0x72, 0xd7, 0x25, 0xab, 0x2c, 0xb5, 0x0e, 0xe7, 0x39, 0xe2}}; + Condition const Thresh11Cond{Type::thresholdSha256, + 135168, + Thresh11CondConditionFingerprint, + std::bitset<5>{25}}; + auto const preim16Preimage = "I am root"s; + auto const preim16Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa17Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa17PublicKey{ + {0xb0, 0x41, 0xe9, 0x6e, 0xfe, 0x3b, 0xde, 0x46, 0x52, 0x56, 0x34, + 0x2a, 0x92, 0x83, 0x4d, 0x3a, 0x7b, 0x94, 0xe7, 0xc2, 0x06, 0x5b, + 0x8c, 0xf4, 0x9d, 0x71, 0x9d, 0x00, 0x73, 0xd9, 0x15, 0x81, 0x12, + 0x1a, 0x0c, 0x9e, 0xd8, 0xa6, 0xa6, 0xd8, 0x62, 0xbe, 0xfe, 0xa3, + 0x7c, 0xc5, 0xd0, 0x71, 0xdd, 0x83, 0xed, 0xcf, 0x71, 0xd8, 0xe5, + 0x72, 0x27, 0xcb, 0xce, 0xd7, 0x06, 0xda, 0xe8, 0x4b, 0xb8, 0x8d, + 0x45, 0xc0, 0x9c, 0xe3, 0x13, 0x27, 0xbf, 0x60, 0x50, 0x85, 0xbf, + 0xd1, 0xfc, 0x8c, 0x41, 0x75, 0x2d, 0x51, 0x83, 0x24, 0x06, 0xcb, + 0xe6, 0x98, 0x8e, 0x0d, 0x35, 0xfa, 0x58, 0x34, 0x43, 0x90, 0x55, + 0x6a, 0x40, 0xc9, 0x78, 0x31, 0xfb, 0x28, 0x8b, 0x10, 0x78, 0x46, + 0x59, 0x49, 0xf5, 0x89, 0x1c, 0x66, 0xc0, 0x6e, 0x6b, 0x73, 0x05, + 0x75, 0x83, 0x2b, 0x86, 0x78, 0x02, 0xc1, 0xb0, 0xf1, 0x2a, 0x6e, + 0x7e, 0xf6, 0x65, 0x8f, 0xe3, 0xc2, 0x02, 0x6d, 0xae, 0x03, 0xc5, + 0xef, 0x41, 0x03, 0x3a, 0x6b, 0xeb, 0xb0, 0xab, 0x6a, 0x27, 0x2e, + 0xcb, 0x13, 0xf5, 0xd3, 0xae, 0x11, 0x18, 0x33, 0x6a, 0xc3, 0x08, + 0x7a, 0xf8, 0xb9, 0xd7, 0xf3, 0x37, 0xee, 0x05, 0x32, 0xd9, 0xb5, + 0xa4, 0xb9, 0xeb, 0x67, 0xa8, 0x84, 0xeb, 0xb2, 0xc3, 0x2f, 0x8a, + 0x8f, 0xa7, 0x24, 0xac, 0x9a, 0x24, 0x91, 0x11, 0x70, 0xab, 0xc5, + 0x05, 0x25, 0xa9, 0xd3, 0x93, 0x17, 0x6d, 0x70, 0xb1, 0x67, 0x60, + 0x6b, 0x50, 0x69, 0xdd, 0x22, 0x8b, 0x6a, 0xa9, 0x11, 0x7e, 0x5e, + 0x09, 0xa8, 0xaa, 0xdc, 0x4a, 0xc8, 0x09, 0x4c, 0x1a, 0xe7, 0x4c, + 0x1e, 0x42, 0xb2, 0x27, 0x9d, 0xa9, 0x1b, 0xa3, 0x59, 0x14, 0xcb, + 0x0b, 0xca, 0xff, 0x6e, 0x8d, 0x8e, 0x38, 0xf6, 0x19, 0xb1, 0x81, + 0x5f, 0xf4, 0x7d}}; + std::array const rsa17Sig{ + {0x04, 0xfc, 0x8b, 0x73, 0x9a, 0xee, 0x28, 0x9c, 0x9d, 0xed, 0x64, + 0x44, 0x87, 0xf6, 0x8e, 0x25, 0xdd, 0x7d, 0x60, 0xb4, 0xca, 0x37, + 0x89, 0x47, 0xa9, 0x79, 0x42, 0xba, 0x89, 0x2a, 0x16, 0xd5, 0xf2, + 0x48, 0x38, 0x26, 0x03, 0x94, 0xf0, 0x5c, 0x3d, 0x0a, 0x80, 0x68, + 0x16, 0xba, 0x93, 0x64, 0x9e, 0x34, 0xe7, 0xcc, 0x7a, 0x56, 0x30, + 0xe2, 0x7a, 0x7a, 0x39, 0x63, 0x39, 0x26, 0x10, 0x54, 0x9e, 0x94, + 0xe7, 0xfb, 0x3f, 0xfc, 0x08, 0xee, 0xc8, 0x14, 0x00, 0x67, 0x1d, + 0xd4, 0x8b, 0x0e, 0x55, 0x47, 0x03, 0xfa, 0x6d, 0x14, 0xb5, 0x4b, + 0xf3, 0x07, 0x80, 0x44, 0xb5, 0x08, 0xc8, 0x75, 0xd0, 0x11, 0x3e, + 0x7b, 0x4a, 0x3f, 0x12, 0x1b, 0x50, 0x20, 0x25, 0x1c, 0x4b, 0x26, + 0xa2, 0xcd, 0x54, 0x3f, 0x13, 0xa1, 0xc4, 0x1a, 0x9b, 0xb8, 0xd9, + 0x82, 0x8f, 0x5f, 0xec, 0x12, 0x42, 0x9c, 0xcb, 0xf1, 0x60, 0x8c, + 0x8d, 0x2b, 0xb4, 0xad, 0xf6, 0x6f, 0x96, 0x41, 0xdb, 0x5e, 0x56, + 0xfc, 0xb1, 0x54, 0x17, 0x77, 0xf5, 0xc9, 0x7c, 0x77, 0xdb, 0x35, + 0xd8, 0xd4, 0x9e, 0x76, 0xb7, 0xbc, 0x33, 0x0d, 0x3f, 0x6e, 0xec, + 0x37, 0xa0, 0x00, 0xed, 0x1f, 0xa0, 0xec, 0xf2, 0xcb, 0xa5, 0x4d, + 0x57, 0xd8, 0x46, 0x3a, 0xb9, 0x99, 0x62, 0x53, 0xfa, 0xa7, 0x31, + 0x61, 0x29, 0x5c, 0x5a, 0xb3, 0xb4, 0x6f, 0x3e, 0x59, 0xbb, 0xb2, + 0xfd, 0xcc, 0x5b, 0x8f, 0x8b, 0x23, 0x3c, 0xf3, 0x91, 0xba, 0x57, + 0x0d, 0x79, 0xec, 0x41, 0x9c, 0xe5, 0xac, 0x21, 0xa4, 0xeb, 0x02, + 0x94, 0x7a, 0x98, 0xeb, 0x4f, 0xfa, 0x1f, 0x50, 0x49, 0x7f, 0xc4, + 0xfb, 0x33, 0x4c, 0x09, 0xd2, 0xbc, 0xf0, 0xef, 0xbb, 0xac, 0x7d, + 0x67, 0x4c, 0x33, 0x53, 0xfe, 0x94, 0x2e, 0xf0, 0x9e, 0xc2, 0x67, + 0xe0, 0xe7, 0x7f}}; + auto const ed18Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed18PublicKey{ + {0x3b, 0x07, 0x0f, 0xe5, 0x29, 0x34, 0xd9, 0x17, 0xf5, 0x06, 0x00, + 0xb8, 0x87, 0x2f, 0xcf, 0x89, 0x52, 0x70, 0xcc, 0x04, 0x92, 0xe1, + 0x67, 0xcb, 0xba, 0xbb, 0x10, 0xa6, 0x2d, 0x06, 0xa4, 0x6b}}; + std::array const ed18Sig{ + {0x09, 0xc4, 0x1d, 0xc3, 0x8e, 0x6c, 0xd6, 0x04, 0xb7, 0x9e, 0x8c, + 0x8b, 0x30, 0x65, 0x88, 0x43, 0xc7, 0xc6, 0xe5, 0xa0, 0xb0, 0x4c, + 0x60, 0xee, 0xb7, 0x1d, 0x69, 0x2a, 0xb7, 0x5d, 0x5f, 0x16, 0x53, + 0xd1, 0xe6, 0x6a, 0x74, 0x5d, 0x63, 0xc0, 0x41, 0x30, 0x6a, 0x58, + 0xce, 0x52, 0xf2, 0xdb, 0x41, 0x03, 0x78, 0xfd, 0x7f, 0x0e, 0xa5, + 0xc1, 0xe4, 0xd2, 0x50, 0x8d, 0x97, 0x1d, 0xf9, 0x06}}; + std::array const ed18SigningKey{ + {0x59, 0x73, 0xbb, 0x41, 0xb0, 0xe0, 0xce, 0xc2, 0xa9, 0x85, 0xaa, + 0x05, 0xa4, 0x7e, 0x3b, 0x51, 0x09, 0x8d, 0x3e, 0x47, 0xb7, 0x75, + 0xda, 0x81, 0x39, 0xa0, 0xe1, 0xd5, 0x9f, 0xb0, 0x9c, 0x5a}}; + (void)ed18SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix22CondConditionFingerprint = { + {0xcd, 0x82, 0x0a, 0xeb, 0x32, 0x02, 0x6a, 0x6c, 0x4f, 0xb8, 0x97, + 0x8d, 0x4f, 0x70, 0xf2, 0x19, 0x58, 0x60, 0x3b, 0x04, 0xfe, 0xc6, + 0xf7, 0x06, 0xec, 0xa1, 0xa3, 0xdd, 0x80, 0x4c, 0xf3, 0x35}}; + Condition const Prefix22Cond{Type::prefixSha256, + 137251, + Prefix22CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh29CondConditionFingerprint = { + {0xa5, 0x04, 0xce, 0xd0, 0xad, 0x29, 0xbb, 0x72, 0xf7, 0x4b, 0xe7, + 0x6e, 0x89, 0xf7, 0x12, 0xa7, 0xd3, 0xe9, 0xe7, 0x7d, 0x05, 0x6a, + 0x6c, 0x78, 0xd4, 0xec, 0x6e, 0x42, 0x4d, 0x9d, 0x28, 0xfd}}; + Condition const Thresh29Cond{Type::thresholdSha256, + 135168, + Thresh29CondConditionFingerprint, + std::bitset<5>{25}}; + + auto rsa2 = std::make_unique( + makeSlice(rsa2PublicKey), makeSlice(rsa2Sig)); + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(rsa4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(rsa2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Thresh11Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim16 = + std::make_unique(makeSlice(preim16Preimage)); + auto rsa17 = std::make_unique( + makeSlice(rsa17PublicKey), makeSlice(rsa17Sig)); + auto ed18 = std::make_unique(ed18PublicKey, ed18Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim16)); + thresh0Subfulfillments.emplace_back(std::move(rsa17)); + thresh0Subfulfillments.emplace_back(std::move(ed18)); + std::vector thresh0Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond, Prefix22Cond, Thresh29Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x08\xa5\xa0\x82\x07\xcb\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x82\x05\x48\xa0\x82\x04\x9b\xa2" + "\x82\x02\x8b\xa0\x82\x02\x0c\xa3\x82\x02\x08\x80\x82\x01\x00" + "\xbe\x09\xc5\xa4\x27\x29\xdf\xd4\x67\x76\xbe\xbf\x2c\xf3\xa2" + "\x0b\x42\xe4\xbf\xeb\xdd\x67\x20\xfb\x7a\x27\x93\xc0\x78\x47" + "\x78\xd7\x15\x32\xee\x38\x81\x0d\x36\xa2\xc4\x65\x44\xe6\x62" + "\x26\xb9\x58\x13\xa4\x15\x82\xab\xb1\x16\x61\xfc\x01\x98\xc6" + "\x1a\x69\xc6\xba\x39\x3f\x01\x55\x3d\xd7\x8e\x14\x42\x6d\x78" + "\x74\x9b\x28\xcb\x31\x39\x98\x5a\x11\xdc\xc1\x18\x9d\x8d\xb0" + "\xcd\x1b\x4c\x10\xab\x14\x64\x19\xf1\x33\x15\x45\xc8\x92\x82" + "\x03\x82\x8a\xaa\xad\x94\xfc\x24\x11\x96\x99\x7e\x94\x5a\x82" + "\x57\x68\x61\x9f\x7b\x45\xe0\x99\x9e\x4f\x32\x50\x5f\x05\xc8" + "\x11\xae\xc4\x0c\x63\x18\x0e\x02\x59\x36\x25\x92\x06\x32\xc7" + "\x71\x47\x99\xcc\x0a\x6e\x0a\x58\x71\x3f\x5e\xb7\x78\xf7\x98" + "\x79\xdf\x74\xa4\xeb\xa9\x00\xfd\x81\xb3\xcf\x04\x8c\x5d\x7d" + "\xe7\xb2\x82\x90\x49\xbd\x69\xf3\x08\xe9\x92\xc6\x9e\x41\xba" + "\x74\xd8\x8d\x81\x97\x6f\x86\xab\xc9\xf1\x02\x31\xb4\xce\x47" + "\xb0\x39\xc8\xba\x51\xa7\x39\xf3\x71\xa2\x25\x27\x37\x6e\x09" + "\x6f\x19\x59\xbc\x65\xd9\xcd\x12\xd3\x2c\xa2\x78\xfa\x23\x15" + "\x1a\x82\x41\x91\x1b\xbe\x8a\xe7\xfe\x3c\x3c\x30\x32\xaa\xe9" + "\xf3\x81\x82\x01\x00\x1c\x15\x44\x80\xc8\xcb\x59\x51\xf8\x40" + "\xa0\xc6\x65\xc5\xd0\x17\x12\x66\x55\x42\xb1\xe0\xdf\xb2\x74" + "\x62\xda\x9a\x95\x73\x1f\x73\x84\xb3\xcd\xd2\xfb\xc3\xc2\x62" + "\xe7\xd0\x60\x14\xba\x84\x69\xa8\xda\xd0\x1e\x5a\xba\x35\x5a" + "\x61\x29\xa8\x5f\x76\xbc\x04\x39\x08\xa4\x3b\xd9\x62\x1a\xf5" + "\x91\x84\x32\x61\x88\x42\xf1\x1b\x47\xa2\xf5\x95\x26\x0e\xba" + "\x51\x6e\x55\x4a\xb6\xfe\xd9\xa1\xf5\xdb\xf6\x23\x2f\x8b\x81" + "\x16\x58\xd2\x9f\x9e\x4d\x9d\x86\xb2\x9e\xf3\x72\x29\x31\xc5" + "\x51\x52\x01\xb9\x34\x42\x97\xcd\x77\x51\x27\xef\xd7\xc8\x15" + "\x30\xf6\x9b\xf7\xbd\x87\x2d\x34\x90\x45\x64\xc6\x71\xeb\x41" + "\x00\x11\x83\x49\x9a\xfe\x69\x20\x00\xab\x98\xac\x56\x0e\xb4" + "\xea\x85\xd3\xf2\x13\x0e\xca\x42\xb6\xd7\xb7\x70\x11\x9f\xac" + "\x0c\x89\xbd\x8e\x30\x22\x94\x01\x58\xf2\x4a\x6f\x86\x25\x33" + "\xc5\x2b\x50\xd6\x98\x97\xaf\x5a\x2e\xec\x43\xf3\x9f\xe2\x22" + "\xf6\xa2\x05\x26\xab\x4c\xe8\x6f\xd4\x64\x92\xe5\xf7\x4b\x41" + "\x85\xf8\xd4\x60\x05\xf6\xde\xe3\x37\xd7\xc3\x69\x13\x34\x49" + "\x9f\x22\x81\xb9\xaa\x4e\xab\xe3\xae\xb9\xea\x76\x86\x1d\x86" + "\xd9\xd4\x4c\x77\x16\xbf\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30" + "\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c" + "\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81" + "\x01\x09\xa3\x27\x80\x20\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06" + "\x3f\xd9\x32\x48\x19\xe1\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c" + "\x9b\x83\xeb\x05\xa7\x59\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1" + "\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0" + "\x21\x8d\x42\xc0\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82" + "\x01\x00\xba\x2c\x3b\x50\xb6\xbf\xf9\x0f\x1d\xd7\x32\x4c\x01" + "\x5f\xff\x2f\x2a\xf6\x33\xd0\xfb\xea\x1f\xa4\xf2\x2d\x22\x8a" + "\x19\x95\xa9\x17\xb7\x4f\x17\xcf\x55\xcd\x1a\x3a\x5f\x07\x73" + "\xcc\xaa\x21\x70\x64\xb3\xa0\xf4\xb7\x30\xa3\x82\x37\x93\xc6" + "\x59\xde\x1b\xa1\x16\x90\x5a\x1a\xf6\x73\xab\x92\xc8\x2f\xf4" + "\x6f\x5c\xf2\x22\x1d\x30\xf8\x03\xd8\x9b\x5f\x73\x72\x8e\x5f" + "\xd5\x37\x4b\x43\xda\xfe\x84\x21\x67\xe8\xe3\xd7\x91\x3f\x24" + "\x1d\xfb\x1f\x12\x6e\xcb\xfc\xb7\x5b\x0a\x35\x73\x3b\xce\x44" + "\x34\x8e\xcd\x53\xa4\xcf\xa7\x63\x73\xcd\x31\x0f\xe0\x75\x8d" + "\xe4\xa9\xdc\xfe\xf0\xc9\x3d\x26\xaf\xbf\x7b\x0f\x0e\x17\xb9" + "\xd0\x4a\x32\x80\x64\x6b\x54\x73\x5a\x50\xc7\x31\x59\xf9\x73" + "\x72\xa5\x79\xba\xdb\xa1\x14\x8d\x77\x67\x3e\xc0\x5b\xec\x6f" + "\x0b\xf7\xc5\xee\x5a\xa6\x8d\x49\x63\x81\xbb\xd1\xf9\x9e\xbb" + "\xed\xb2\xa9\x18\x60\xa7\xee\xeb\x30\xa1\x92\x93\xe8\xd8\x34" + "\x9e\xac\xd6\x23\xfc\x7f\xcb\xe7\xfe\xa7\xe6\x42\xac\x77\x11" + "\xc0\x67\x77\xd1\xaa\x5e\xed\x3b\xd5\xa5\x8d\x34\x7c\xd9\x57" + "\x44\xa7\xc5\x44\x2e\x1e\xe7\x63\xd8\x53\x1b\x9a\xd9\x67\x02" + "\x13\x32\x61\x81\x82\x01\x00\x79\x26\x29\x11\xad\xac\x56\x71" + "\xd5\xb2\x7f\xdf\x15\xd7\xfe\xbc\x4e\x21\x39\x31\x30\x29\xc9" + "\xe4\xde\x57\x7e\x67\x2a\xf8\x05\xbb\x25\x75\xd2\x37\x63\x5b" + "\xa3\xf0\x29\xb3\x90\x01\x26\xb4\x67\x87\xd3\xae\x03\x4e\x14" + "\x61\x0f\x8d\xfc\x80\x29\xff\x2a\x18\x37\x06\x94\xe3\x6f\x7e" + "\x2b\x2a\x87\xb6\x17\xd8\xf7\x4c\x44\xbf\x2a\xc0\x32\x03\xb5" + "\xd3\x9d\xc4\x70\x3f\x64\x58\xdd\xe4\xe1\x3e\x31\xcf\x04\xff" + "\xcc\xc7\x4d\x3c\xe3\x6e\xa3\xfd\xe8\x07\x7a\x0e\x99\x05\x5e" + "\xbf\x7b\x94\x16\xfd\x84\x8e\x4d\xd2\xc7\xca\xfd\xf5\x6c\xe9" + "\xdf\x34\xa5\xa8\x9c\xde\xe2\xdd\x18\x71\xa4\x51\x4b\x6e\x78" + "\xc5\x35\x3d\x0c\xcb\x50\xe4\x51\xf5\x87\xdf\x25\x47\x61\xd0" + "\xbc\x9c\xf0\x63\xe5\x86\xd2\x5a\x82\x48\x96\x53\xf4\x6f\xbb" + "\x80\x2c\xd2\x4b\x23\xe0\x10\xfc\x9c\xf0\x62\x51\x74\x55\xc1" + "\x75\x11\x4a\xe9\x3a\x9f\xf5\xf8\x2d\x21\xd2\x98\xa3\xbe\x14" + "\xff\x49\x38\xfb\xeb\x1d\xeb\x21\xee\xe8\x0d\x47\x46\x18\x69" + "\xa2\x9b\x6d\x12\xa0\xc5\xcc\xec\x4f\x18\xdc\x0a\xfa\x4c\x58" + "\x2e\xfb\x01\x89\x39\x93\x6e\x27\x5d\xfb\xe4\xbd\xc9\x6a\xbe" + "\x5a\x70\x17\x99\x22\x5b\x38\xe3\xa1\x81\xa6\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\x67\xf9\x58\xcd\x83\xc7" + "\xe8\x61\xc5\xd6\xc6\x74\x63\x5e\x10\x49\x97\x4a\xdc\x6f\x31" + "\x30\x72\xd7\x25\xab\x2c\xb5\x0e\xe7\x39\xe2\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06" + "\xbe\xaa\x6c\x81\xf1\x88\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd" + "\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4\x30\x65\x1e\x40\xb3" + "\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79\x5f\x41\xc9\x03\x93" + "\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02\x00\x00\xa3\x82\x02" + "\x08\x80\x82\x01\x00\xb0\x41\xe9\x6e\xfe\x3b\xde\x46\x52\x56" + "\x34\x2a\x92\x83\x4d\x3a\x7b\x94\xe7\xc2\x06\x5b\x8c\xf4\x9d" + "\x71\x9d\x00\x73\xd9\x15\x81\x12\x1a\x0c\x9e\xd8\xa6\xa6\xd8" + "\x62\xbe\xfe\xa3\x7c\xc5\xd0\x71\xdd\x83\xed\xcf\x71\xd8\xe5" + "\x72\x27\xcb\xce\xd7\x06\xda\xe8\x4b\xb8\x8d\x45\xc0\x9c\xe3" + "\x13\x27\xbf\x60\x50\x85\xbf\xd1\xfc\x8c\x41\x75\x2d\x51\x83" + "\x24\x06\xcb\xe6\x98\x8e\x0d\x35\xfa\x58\x34\x43\x90\x55\x6a" + "\x40\xc9\x78\x31\xfb\x28\x8b\x10\x78\x46\x59\x49\xf5\x89\x1c" + "\x66\xc0\x6e\x6b\x73\x05\x75\x83\x2b\x86\x78\x02\xc1\xb0\xf1" + "\x2a\x6e\x7e\xf6\x65\x8f\xe3\xc2\x02\x6d\xae\x03\xc5\xef\x41" + "\x03\x3a\x6b\xeb\xb0\xab\x6a\x27\x2e\xcb\x13\xf5\xd3\xae\x11" + "\x18\x33\x6a\xc3\x08\x7a\xf8\xb9\xd7\xf3\x37\xee\x05\x32\xd9" + "\xb5\xa4\xb9\xeb\x67\xa8\x84\xeb\xb2\xc3\x2f\x8a\x8f\xa7\x24" + "\xac\x9a\x24\x91\x11\x70\xab\xc5\x05\x25\xa9\xd3\x93\x17\x6d" + "\x70\xb1\x67\x60\x6b\x50\x69\xdd\x22\x8b\x6a\xa9\x11\x7e\x5e" + "\x09\xa8\xaa\xdc\x4a\xc8\x09\x4c\x1a\xe7\x4c\x1e\x42\xb2\x27" + "\x9d\xa9\x1b\xa3\x59\x14\xcb\x0b\xca\xff\x6e\x8d\x8e\x38\xf6" + "\x19\xb1\x81\x5f\xf4\x7d\x81\x82\x01\x00\x04\xfc\x8b\x73\x9a" + "\xee\x28\x9c\x9d\xed\x64\x44\x87\xf6\x8e\x25\xdd\x7d\x60\xb4" + "\xca\x37\x89\x47\xa9\x79\x42\xba\x89\x2a\x16\xd5\xf2\x48\x38" + "\x26\x03\x94\xf0\x5c\x3d\x0a\x80\x68\x16\xba\x93\x64\x9e\x34" + "\xe7\xcc\x7a\x56\x30\xe2\x7a\x7a\x39\x63\x39\x26\x10\x54\x9e" + "\x94\xe7\xfb\x3f\xfc\x08\xee\xc8\x14\x00\x67\x1d\xd4\x8b\x0e" + "\x55\x47\x03\xfa\x6d\x14\xb5\x4b\xf3\x07\x80\x44\xb5\x08\xc8" + "\x75\xd0\x11\x3e\x7b\x4a\x3f\x12\x1b\x50\x20\x25\x1c\x4b\x26" + "\xa2\xcd\x54\x3f\x13\xa1\xc4\x1a\x9b\xb8\xd9\x82\x8f\x5f\xec" + "\x12\x42\x9c\xcb\xf1\x60\x8c\x8d\x2b\xb4\xad\xf6\x6f\x96\x41" + "\xdb\x5e\x56\xfc\xb1\x54\x17\x77\xf5\xc9\x7c\x77\xdb\x35\xd8" + "\xd4\x9e\x76\xb7\xbc\x33\x0d\x3f\x6e\xec\x37\xa0\x00\xed\x1f" + "\xa0\xec\xf2\xcb\xa5\x4d\x57\xd8\x46\x3a\xb9\x99\x62\x53\xfa" + "\xa7\x31\x61\x29\x5c\x5a\xb3\xb4\x6f\x3e\x59\xbb\xb2\xfd\xcc" + "\x5b\x8f\x8b\x23\x3c\xf3\x91\xba\x57\x0d\x79\xec\x41\x9c\xe5" + "\xac\x21\xa4\xeb\x02\x94\x7a\x98\xeb\x4f\xfa\x1f\x50\x49\x7f" + "\xc4\xfb\x33\x4c\x09\xd2\xbc\xf0\xef\xbb\xac\x7d\x67\x4c\x33" + "\x53\xfe\x94\x2e\xf0\x9e\xc2\x67\xe0\xe7\x7f\xa4\x64\x80\x20" + "\x3b\x07\x0f\xe5\x29\x34\xd9\x17\xf5\x06\x00\xb8\x87\x2f\xcf" + "\x89\x52\x70\xcc\x04\x92\xe1\x67\xcb\xba\xbb\x10\xa6\x2d\x06" + "\xa4\x6b\x81\x40\x09\xc4\x1d\xc3\x8e\x6c\xd6\x04\xb7\x9e\x8c" + "\x8b\x30\x65\x88\x43\xc7\xc6\xe5\xa0\xb0\x4c\x60\xee\xb7\x1d" + "\x69\x2a\xb7\x5d\x5f\x16\x53\xd1\xe6\x6a\x74\x5d\x63\xc0\x41" + "\x30\x6a\x58\xce\x52\xf2\xdb\x41\x03\x78\xfd\x7f\x0e\xa5\xc1" + "\xe4\xd2\x50\x8d\x97\x1d\xf9\x06\xa1\x81\xd3\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\xcd\x82\x0a\xeb\x32\x02" + "\x6a\x6c\x4f\xb8\x97\x8d\x4f\x70\xf2\x19\x58\x60\x3b\x04\xfe" + "\xc6\xf7\x06\xec\xa1\xa3\xdd\x80\x4c\xf3\x35\x81\x03\x02\x18" + "\x23\x82\x02\x03\xb8\xa2\x2b\x80\x20\xa5\x04\xce\xd0\xad\x29" + "\xbb\x72\xf7\x4b\xe7\x6e\x89\xf7\x12\xa7\xd3\xe9\xe7\x7d\x05" + "\x6a\x6c\x78\xd4\xec\x6e\x42\x4d\x9d\x28\xfd\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x8d\xb0\x2c\xb1\x28\xc3" + "\xf4\x97\x50\x84\x64\x57\xca\xf4\x9d\x63\x08\x73\xfc\xde\x2f" + "\x90\xf0\xf2\xec\x79\xa9\xc6\xa3\xf1\x33\xfd\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x95\x3c\x86\x65\x91\x76\x69\x6b\x72\x61" + "\xaa\x76\x15\x2a\xd7\x25\x4f\x32\xb7\x73\x7a\xb2\x49\x0c\x0b" + "\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xcc\x2c\x56\x8f\x13\x37\x7f\x28\x2d\x25\x0c" + "\x8b\x02\xf5\xaf\x49\x24\xf1\x0a\x1f\x8a\xa9\x6a\x23\x8c\xa0" + "\x79\x72\xab\xe6\xcb\x3e\x81\x03\x0a\x84\x23\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\xcd\x82\x0a\xeb\x32\x02\x6a\x6c\x4f\xb8\x97\x8d" + "\x4f\x70\xf2\x19\x58\x60\x3b\x04\xfe\xc6\xf7\x06\xec\xa1\xa3" + "\xdd\x80\x4c\xf3\x35\x81\x03\x02\x18\x23\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\xa5\x04\xce\xd0\xad\x29\xbb\x72\xf7\x4b\xe7\x6e" + "\x89\xf7\x12\xa7\xd3\xe9\xe7\x7d\x05\x6a\x6c\x78\xd4\xec\x6e" + "\x42\x4d\x9d\x28\xfd\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa2" + "\x2b\x80\x20\xee\x16\x33\x74\x2b\x8f\x63\xbd\xbc\x40\xc3\x1b" + "\x57\x5d\xa0\x9d\x1e\x49\x10\x20\xf8\x92\x81\x57\x6a\xe2\xb9" + "\xc4\x9e\xd7\x1a\x3f\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x78\xe3\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32" + "\xff\xbc\x75\x1a\xe6\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1" + "\x6f\xff\x3e\xb3\x75\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x8d" + "\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57\xca\xf4\x9d\x63" + "\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9\xc6\xa3\xf1\x33" + "\xfd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c" + "\x62\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d" + "\xba\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x95\x3c\x86\x65\x91\x76\x69\x6b\x72" + "\x61\xaa\x76\x15\x2a\xd7\x25\x4f\x32\xb7\x73\x7a\xb2\x49\x0c" + "\x0b\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh48() + { + testcase("Thresh48"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** ed1 + + auto const ed1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed1PublicKey{ + {0x63, 0x99, 0x70, 0x0c, 0xa9, 0x50, 0x9c, 0xd4, 0xf5, 0x06, 0xdd, + 0x19, 0xc8, 0xa1, 0xd2, 0x9e, 0x03, 0x10, 0xb9, 0x89, 0x2e, 0x02, + 0x34, 0x62, 0x2d, 0x23, 0xca, 0xa1, 0x1d, 0xde, 0x23, 0x6a}}; + std::array const ed1Sig{ + {0x7d, 0xcb, 0x6f, 0x72, 0xbd, 0x59, 0xa6, 0xba, 0x2b, 0x69, 0x04, + 0x95, 0x4f, 0xba, 0x8a, 0x43, 0x21, 0x45, 0x8f, 0xb1, 0x40, 0x99, + 0xd8, 0xa4, 0x9e, 0x7c, 0x9a, 0xc5, 0x96, 0x07, 0xeb, 0x8d, 0xbd, + 0x80, 0x20, 0xb0, 0x70, 0xf1, 0x33, 0x55, 0x61, 0x61, 0x38, 0x21, + 0xdc, 0xea, 0x3d, 0x30, 0xaa, 0xe6, 0xf4, 0x6a, 0xba, 0xa4, 0x4c, + 0xbf, 0x2f, 0xad, 0xb5, 0x51, 0x44, 0xc8, 0x67, 0x0a}}; + std::array const ed1SigningKey{ + {0xe9, 0x20, 0xaa, 0x41, 0x73, 0x35, 0x2f, 0xae, 0xa2, 0x4b, 0x4b, + 0x19, 0x64, 0xda, 0xc0, 0xd5, 0x7b, 0xfd, 0x99, 0x06, 0x90, 0x80, + 0x48, 0xe4, 0x6a, 0xc4, 0x86, 0x30, 0x7d, 0x53, 0x37, 0xb9}}; + (void)ed1SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + + auto ed1 = std::make_unique(ed1PublicKey, ed1Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(ed1)); + std::vector thresh0Subconditions{}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x6a\xa0\x66\xa4\x64\x80\x20\x63\x99\x70\x0c\xa9\x50\x9c" + "\xd4\xf5\x06\xdd\x19\xc8\xa1\xd2\x9e\x03\x10\xb9\x89\x2e\x02" + "\x34\x62\x2d\x23\xca\xa1\x1d\xde\x23\x6a\x81\x40\x7d\xcb\x6f" + "\x72\xbd\x59\xa6\xba\x2b\x69\x04\x95\x4f\xba\x8a\x43\x21\x45" + "\x8f\xb1\x40\x99\xd8\xa4\x9e\x7c\x9a\xc5\x96\x07\xeb\x8d\xbd" + "\x80\x20\xb0\x70\xf1\x33\x55\x61\x61\x38\x21\xdc\xea\x3d\x30" + "\xaa\xe6\xf4\x6a\xba\xa4\x4c\xbf\x2f\xad\xb5\x51\x44\xc8\x67" + "\x0a\xa1\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xc3\x4b\xb5\xa1\xb5\xd1\x88\x4d\x2d\xeb\xb7" + "\x4e\x69\xe2\xd0\xdf\xa5\xd2\x89\x96\xf9\xa7\x4a\x51\x5f\x4b" + "\xed\xf9\xbb\xb7\x10\x3b\x81\x03\x02\x04\x00\x82\x02\x03\x08"s; + auto const thresh0EncodedFingerprint = + "\x30\x2e\x80\x01\x01\xa1\x29\xa4\x27\x80\x20\x42\x58\xea\xf4" + "\xb3\xac\xde\x0b\xd9\x1e\x0c\x53\xe5\xae\x63\x84\xee\xc0\xf5" + "\xcf\x88\xa7\x43\x7b\x05\x47\x87\xee\x73\x3e\xa3\x83\x81\x03" + "\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh49() + { + testcase("Thresh49"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim2Cond + // ** Rsa3Cond + // ** Ed4Cond + // ** ed1 + + auto const ed1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed1PublicKey{ + {0x63, 0x99, 0x70, 0x0c, 0xa9, 0x50, 0x9c, 0xd4, 0xf5, 0x06, 0xdd, + 0x19, 0xc8, 0xa1, 0xd2, 0x9e, 0x03, 0x10, 0xb9, 0x89, 0x2e, 0x02, + 0x34, 0x62, 0x2d, 0x23, 0xca, 0xa1, 0x1d, 0xde, 0x23, 0x6a}}; + std::array const ed1Sig{ + {0x7d, 0xcb, 0x6f, 0x72, 0xbd, 0x59, 0xa6, 0xba, 0x2b, 0x69, 0x04, + 0x95, 0x4f, 0xba, 0x8a, 0x43, 0x21, 0x45, 0x8f, 0xb1, 0x40, 0x99, + 0xd8, 0xa4, 0x9e, 0x7c, 0x9a, 0xc5, 0x96, 0x07, 0xeb, 0x8d, 0xbd, + 0x80, 0x20, 0xb0, 0x70, 0xf1, 0x33, 0x55, 0x61, 0x61, 0x38, 0x21, + 0xdc, 0xea, 0x3d, 0x30, 0xaa, 0xe6, 0xf4, 0x6a, 0xba, 0xa4, 0x4c, + 0xbf, 0x2f, 0xad, 0xb5, 0x51, 0x44, 0xc8, 0x67, 0x0a}}; + std::array const ed1SigningKey{ + {0xe9, 0x20, 0xaa, 0x41, 0x73, 0x35, 0x2f, 0xae, 0xa2, 0x4b, 0x4b, + 0x19, 0x64, 0xda, 0xc0, 0xd5, 0x7b, 0xfd, 0x99, 0x06, 0x90, 0x80, + 0x48, 0xe4, 0x6a, 0xc4, 0x86, 0x30, 0x7d, 0x53, 0x37, 0xb9}}; + (void)ed1SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim2CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim2Cond{Type::preimageSha256, + 9, + Preim2CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa3CondConditionFingerprint = { + {0xc2, 0x20, 0xd2, 0xd9, 0x00, 0x97, 0x9f, 0xb2, 0x4d, 0x72, 0x2b, + 0x28, 0x34, 0x99, 0xf6, 0xb5, 0x51, 0xee, 0x40, 0x07, 0x1b, 0x8d, + 0x96, 0x78, 0x14, 0xe2, 0x64, 0x1e, 0xea, 0x05, 0x71, 0xfb}}; + Condition const Rsa3Cond{Type::rsaSha256, + 65536, + Rsa3CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed4CondConditionFingerprint = { + {0xfa, 0xa5, 0xd8, 0x25, 0xe0, 0xb2, 0x1e, 0x1b, 0x7f, 0x79, 0xa8, + 0xfe, 0x46, 0x2d, 0xb1, 0xc0, 0x14, 0x91, 0xcb, 0x33, 0x9e, 0x03, + 0xe7, 0x48, 0x13, 0x41, 0xa9, 0xe3, 0x58, 0x0e, 0x5d, 0xdd}}; + Condition const Ed4Cond{Type::ed25519Sha256, + 131072, + Ed4CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed1 = std::make_unique(ed1PublicKey, ed1Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(ed1)); + std::vector thresh0Subconditions{ + {Preim2Cond, Rsa3Cond, Ed4Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20\x63\x99\x70\x0c\xa9\x50" + "\x9c\xd4\xf5\x06\xdd\x19\xc8\xa1\xd2\x9e\x03\x10\xb9\x89\x2e" + "\x02\x34\x62\x2d\x23\xca\xa1\x1d\xde\x23\x6a\x81\x40\x7d\xcb" + "\x6f\x72\xbd\x59\xa6\xba\x2b\x69\x04\x95\x4f\xba\x8a\x43\x21" + "\x45\x8f\xb1\x40\x99\xd8\xa4\x9e\x7c\x9a\xc5\x96\x07\xeb\x8d" + "\xbd\x80\x20\xb0\x70\xf1\x33\x55\x61\x61\x38\x21\xdc\xea\x3d" + "\x30\xaa\xe6\xf4\x6a\xba\xa4\x4c\xbf\x2f\xad\xb5\x51\x44\xc8" + "\x67\x0a\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27" + "\x80\x20\xc2\x20\xd2\xd9\x00\x97\x9f\xb2\x4d\x72\x2b\x28\x34" + "\x99\xf6\xb5\x51\xee\x40\x07\x1b\x8d\x96\x78\x14\xe2\x64\x1e" + "\xea\x05\x71\xfb\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xfa\xa5" + "\xd8\x25\xe0\xb2\x1e\x1b\x7f\x79\xa8\xfe\x46\x2d\xb1\xc0\x14" + "\x91\xcb\x33\x9e\x03\xe7\x48\x13\x41\xa9\xe3\x58\x0e\x5d\xdd" + "\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x66\xb0\x23\x7b\x90\xfe\x8c\xea\x80\x5a\xee" + "\x75\xdb\x4f\x91\x1f\xf8\xdc\xf0\x58\x52\x33\xc6\xa6\x41\x2b" + "\xdc\x5e\x7b\xe1\x3f\x74\x81\x03\x02\x10\x00\x82\x02\x03\x98"s; + auto const thresh0EncodedFingerprint = + "\x30\x81\xa8\x80\x01\x01\xa1\x81\xa2\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa3\x27\x80\x20\xc2\x20\xd2\xd9\x00\x97\x9f\xb2" + "\x4d\x72\x2b\x28\x34\x99\xf6\xb5\x51\xee\x40\x07\x1b\x8d\x96" + "\x78\x14\xe2\x64\x1e\xea\x05\x71\xfb\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\x42\x58\xea\xf4\xb3\xac\xde\x0b\xd9\x1e\x0c\x53" + "\xe5\xae\x63\x84\xee\xc0\xf5\xcf\x88\xa7\x43\x7b\x05\x47\x87" + "\xee\x73\x3e\xa3\x83\x81\x03\x02\x00\x00\xa4\x27\x80\x20\xfa" + "\xa5\xd8\x25\xe0\xb2\x1e\x1b\x7f\x79\xa8\xfe\x46\x2d\xb1\xc0" + "\x14\x91\xcb\x33\x9e\x03\xe7\x48\x13\x41\xa9\xe3\x58\x0e\x5d" + "\xdd\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh50() + { + testcase("Thresh50"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim7Cond + // ** Rsa8Cond + // ** Ed9Cond + // ** ed1 + // ** thresh2 + // *** Preim4Cond + // *** Rsa5Cond + // *** Ed6Cond + // *** ed3 + + auto const ed1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed1PublicKey{ + {0x63, 0x99, 0x70, 0x0c, 0xa9, 0x50, 0x9c, 0xd4, 0xf5, 0x06, 0xdd, + 0x19, 0xc8, 0xa1, 0xd2, 0x9e, 0x03, 0x10, 0xb9, 0x89, 0x2e, 0x02, + 0x34, 0x62, 0x2d, 0x23, 0xca, 0xa1, 0x1d, 0xde, 0x23, 0x6a}}; + std::array const ed1Sig{ + {0x7d, 0xcb, 0x6f, 0x72, 0xbd, 0x59, 0xa6, 0xba, 0x2b, 0x69, 0x04, + 0x95, 0x4f, 0xba, 0x8a, 0x43, 0x21, 0x45, 0x8f, 0xb1, 0x40, 0x99, + 0xd8, 0xa4, 0x9e, 0x7c, 0x9a, 0xc5, 0x96, 0x07, 0xeb, 0x8d, 0xbd, + 0x80, 0x20, 0xb0, 0x70, 0xf1, 0x33, 0x55, 0x61, 0x61, 0x38, 0x21, + 0xdc, 0xea, 0x3d, 0x30, 0xaa, 0xe6, 0xf4, 0x6a, 0xba, 0xa4, 0x4c, + 0xbf, 0x2f, 0xad, 0xb5, 0x51, 0x44, 0xc8, 0x67, 0x0a}}; + std::array const ed1SigningKey{ + {0xe9, 0x20, 0xaa, 0x41, 0x73, 0x35, 0x2f, 0xae, 0xa2, 0x4b, 0x4b, + 0x19, 0x64, 0xda, 0xc0, 0xd5, 0x7b, 0xfd, 0x99, 0x06, 0x90, 0x80, + 0x48, 0xe4, 0x6a, 0xc4, 0x86, 0x30, 0x7d, 0x53, 0x37, 0xb9}}; + (void)ed1SigningKey; + auto const ed3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed3PublicKey{ + {0x42, 0x0a, 0x60, 0x63, 0x9e, 0xca, 0xaa, 0x48, 0xac, 0xcb, 0x2c, + 0xd9, 0x46, 0x79, 0x69, 0x34, 0x35, 0xf3, 0x8e, 0x29, 0xd5, 0x4b, + 0x24, 0x57, 0x9d, 0xd7, 0x3b, 0x04, 0x5d, 0x9c, 0x2f, 0x32}}; + std::array const ed3Sig{ + {0x8d, 0x31, 0x70, 0x29, 0x69, 0xdd, 0x57, 0x60, 0x2c, 0x4b, 0x2e, + 0x7a, 0x0c, 0x68, 0xfc, 0x7e, 0x62, 0x64, 0x27, 0x75, 0xce, 0x69, + 0xf5, 0xc7, 0x42, 0x9b, 0x2b, 0x47, 0xc7, 0xa8, 0xcc, 0x4f, 0xed, + 0xae, 0x26, 0x54, 0x6c, 0x72, 0xb5, 0x7a, 0x24, 0xcf, 0x14, 0xc9, + 0x82, 0x0b, 0x38, 0x22, 0x8b, 0xcc, 0xa2, 0x20, 0xd7, 0x3f, 0x02, + 0x74, 0xa0, 0x2f, 0xde, 0xb9, 0x5c, 0x7f, 0x60, 0x0b}}; + std::array const ed3SigningKey{ + {0x1b, 0x90, 0xf2, 0x2c, 0xd5, 0x5d, 0xcd, 0xe5, 0x2d, 0x71, 0x84, + 0x66, 0x10, 0xf0, 0xf1, 0x91, 0xfe, 0xb5, 0xbe, 0x94, 0x85, 0xc1, + 0xc8, 0xf3, 0x61, 0x91, 0xc3, 0xa4, 0x41, 0x58, 0xcd, 0xfc}}; + (void)ed3SigningKey; + auto const thresh2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim4CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim4Cond{Type::preimageSha256, + 9, + Preim4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa5CondConditionFingerprint = { + {0x99, 0xfb, 0x0b, 0x38, 0x94, 0x4d, 0x20, 0x85, 0xc8, 0xda, 0x3a, + 0x64, 0x31, 0x44, 0x6f, 0x6c, 0x3b, 0x46, 0x25, 0x50, 0xd7, 0x7f, + 0xdf, 0xee, 0x75, 0x72, 0x71, 0xf9, 0x61, 0x40, 0x63, 0xfa}}; + Condition const Rsa5Cond{Type::rsaSha256, + 65536, + Rsa5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed6CondConditionFingerprint = { + {0x00, 0xd3, 0xc9, 0x24, 0x3f, 0x2d, 0x2e, 0x64, 0x93, 0xa8, 0x49, + 0x29, 0x82, 0x75, 0xea, 0xbf, 0xe3, 0x53, 0x7f, 0x8e, 0x45, 0x16, + 0xdb, 0x5e, 0xc6, 0xdf, 0x39, 0xd2, 0xcb, 0xea, 0x62, 0xfb}}; + Condition const Ed6Cond{Type::ed25519Sha256, + 131072, + Ed6CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed1 = std::make_unique(ed1PublicKey, ed1Sig); + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(ed3)); + std::vector thresh2Subconditions{ + {Preim4Cond, Rsa5Cond, Ed6Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(ed1)); + thresh0Subfulfillments.emplace_back(std::move(thresh2)); + std::vector thresh0Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\xcb\xa0\x82\x01\x4c\xa2\x81\xe3\xa0\x66\xa4\x64" + "\x80\x20\x42\x0a\x60\x63\x9e\xca\xaa\x48\xac\xcb\x2c\xd9\x46" + "\x79\x69\x34\x35\xf3\x8e\x29\xd5\x4b\x24\x57\x9d\xd7\x3b\x04" + "\x5d\x9c\x2f\x32\x81\x40\x8d\x31\x70\x29\x69\xdd\x57\x60\x2c" + "\x4b\x2e\x7a\x0c\x68\xfc\x7e\x62\x64\x27\x75\xce\x69\xf5\xc7" + "\x42\x9b\x2b\x47\xc7\xa8\xcc\x4f\xed\xae\x26\x54\x6c\x72\xb5" + "\x7a\x24\xcf\x14\xc9\x82\x0b\x38\x22\x8b\xcc\xa2\x20\xd7\x3f" + "\x02\x74\xa0\x2f\xde\xb9\x5c\x7f\x60\x0b\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x99\xfb\x0b\x38\x94" + "\x4d\x20\x85\xc8\xda\x3a\x64\x31\x44\x6f\x6c\x3b\x46\x25\x50" + "\xd7\x7f\xdf\xee\x75\x72\x71\xf9\x61\x40\x63\xfa\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\x00\xd3\xc9\x24\x3f\x2d\x2e\x64\x93" + "\xa8\x49\x29\x82\x75\xea\xbf\xe3\x53\x7f\x8e\x45\x16\xdb\x5e" + "\xc6\xdf\x39\xd2\xcb\xea\x62\xfb\x81\x03\x02\x00\x00\xa4\x64" + "\x80\x20\x63\x99\x70\x0c\xa9\x50\x9c\xd4\xf5\x06\xdd\x19\xc8" + "\xa1\xd2\x9e\x03\x10\xb9\x89\x2e\x02\x34\x62\x2d\x23\xca\xa1" + "\x1d\xde\x23\x6a\x81\x40\x7d\xcb\x6f\x72\xbd\x59\xa6\xba\x2b" + "\x69\x04\x95\x4f\xba\x8a\x43\x21\x45\x8f\xb1\x40\x99\xd8\xa4" + "\x9e\x7c\x9a\xc5\x96\x07\xeb\x8d\xbd\x80\x20\xb0\x70\xf1\x33" + "\x55\x61\x61\x38\x21\xdc\xea\x3d\x30\xaa\xe6\xf4\x6a\xba\xa4" + "\x4c\xbf\x2f\xad\xb5\x51\x44\xc8\x67\x0a\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xd1\xb5\x1d\x35\x99" + "\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75" + "\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25" + "\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe" + "\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x34\x1a\x0f\x66\x10\x28\xcb\x95\x22\xf8\xfc" + "\xdc\x1b\x3c\x07\xe2\xde\xeb\x86\x8e\x23\x78\xf4\x80\x9a\xc6" + "\x99\x10\x5c\x91\xc1\xeb\x81\x03\x04\x24\x00\x82\x02\x03\x98"s; + auto const thresh0EncodedFingerprint = + "\x30\x81\xd5\x80\x01\x02\xa1\x81\xcf\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa2\x2b\x80\x20\x29\x46\xc8\xd9\xa0\xe0\xb6\xb7" + "\x2e\xc5\xae\x75\xc3\xdc\x75\x39\x96\xd1\x56\xcb\x54\x3c\xdc" + "\x34\x6e\xc0\xe0\xfc\x74\x4c\x10\x5d\x81\x03\x02\x10\x00\x82" + "\x02\x03\x98\xa3\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1" + "\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b" + "\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\x42\x58\xea\xf4\xb3\xac\xde\x0b\xd9\x1e\x0c\x53" + "\xe5\xae\x63\x84\xee\xc0\xf5\xcf\x88\xa7\x43\x7b\x05\x47\x87" + "\xee\x73\x3e\xa3\x83\x81\x03\x02\x00\x00\xa4\x27\x80\x20\x92" + "\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0" + "\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6" + "\xc9\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh51() + { + testcase("Thresh51"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim7Cond + // ** Rsa8Cond + // ** Ed9Cond + // ** Thresh10Cond + // ** ed1 + // ** thresh2 + // *** Preim4Cond + // *** Rsa5Cond + // *** Ed6Cond + // *** ed3 + + auto const ed1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed1PublicKey{ + {0x63, 0x99, 0x70, 0x0c, 0xa9, 0x50, 0x9c, 0xd4, 0xf5, 0x06, 0xdd, + 0x19, 0xc8, 0xa1, 0xd2, 0x9e, 0x03, 0x10, 0xb9, 0x89, 0x2e, 0x02, + 0x34, 0x62, 0x2d, 0x23, 0xca, 0xa1, 0x1d, 0xde, 0x23, 0x6a}}; + std::array const ed1Sig{ + {0x7d, 0xcb, 0x6f, 0x72, 0xbd, 0x59, 0xa6, 0xba, 0x2b, 0x69, 0x04, + 0x95, 0x4f, 0xba, 0x8a, 0x43, 0x21, 0x45, 0x8f, 0xb1, 0x40, 0x99, + 0xd8, 0xa4, 0x9e, 0x7c, 0x9a, 0xc5, 0x96, 0x07, 0xeb, 0x8d, 0xbd, + 0x80, 0x20, 0xb0, 0x70, 0xf1, 0x33, 0x55, 0x61, 0x61, 0x38, 0x21, + 0xdc, 0xea, 0x3d, 0x30, 0xaa, 0xe6, 0xf4, 0x6a, 0xba, 0xa4, 0x4c, + 0xbf, 0x2f, 0xad, 0xb5, 0x51, 0x44, 0xc8, 0x67, 0x0a}}; + std::array const ed1SigningKey{ + {0xe9, 0x20, 0xaa, 0x41, 0x73, 0x35, 0x2f, 0xae, 0xa2, 0x4b, 0x4b, + 0x19, 0x64, 0xda, 0xc0, 0xd5, 0x7b, 0xfd, 0x99, 0x06, 0x90, 0x80, + 0x48, 0xe4, 0x6a, 0xc4, 0x86, 0x30, 0x7d, 0x53, 0x37, 0xb9}}; + (void)ed1SigningKey; + auto const ed3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed3PublicKey{ + {0x42, 0x0a, 0x60, 0x63, 0x9e, 0xca, 0xaa, 0x48, 0xac, 0xcb, 0x2c, + 0xd9, 0x46, 0x79, 0x69, 0x34, 0x35, 0xf3, 0x8e, 0x29, 0xd5, 0x4b, + 0x24, 0x57, 0x9d, 0xd7, 0x3b, 0x04, 0x5d, 0x9c, 0x2f, 0x32}}; + std::array const ed3Sig{ + {0x8d, 0x31, 0x70, 0x29, 0x69, 0xdd, 0x57, 0x60, 0x2c, 0x4b, 0x2e, + 0x7a, 0x0c, 0x68, 0xfc, 0x7e, 0x62, 0x64, 0x27, 0x75, 0xce, 0x69, + 0xf5, 0xc7, 0x42, 0x9b, 0x2b, 0x47, 0xc7, 0xa8, 0xcc, 0x4f, 0xed, + 0xae, 0x26, 0x54, 0x6c, 0x72, 0xb5, 0x7a, 0x24, 0xcf, 0x14, 0xc9, + 0x82, 0x0b, 0x38, 0x22, 0x8b, 0xcc, 0xa2, 0x20, 0xd7, 0x3f, 0x02, + 0x74, 0xa0, 0x2f, 0xde, 0xb9, 0x5c, 0x7f, 0x60, 0x0b}}; + std::array const ed3SigningKey{ + {0x1b, 0x90, 0xf2, 0x2c, 0xd5, 0x5d, 0xcd, 0xe5, 0x2d, 0x71, 0x84, + 0x66, 0x10, 0xf0, 0xf1, 0x91, 0xfe, 0xb5, 0xbe, 0x94, 0x85, 0xc1, + 0xc8, 0xf3, 0x61, 0x91, 0xc3, 0xa4, 0x41, 0x58, 0xcd, 0xfc}}; + (void)ed3SigningKey; + auto const thresh2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim4CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim4Cond{Type::preimageSha256, + 9, + Preim4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa5CondConditionFingerprint = { + {0x99, 0xfb, 0x0b, 0x38, 0x94, 0x4d, 0x20, 0x85, 0xc8, 0xda, 0x3a, + 0x64, 0x31, 0x44, 0x6f, 0x6c, 0x3b, 0x46, 0x25, 0x50, 0xd7, 0x7f, + 0xdf, 0xee, 0x75, 0x72, 0x71, 0xf9, 0x61, 0x40, 0x63, 0xfa}}; + Condition const Rsa5Cond{Type::rsaSha256, + 65536, + Rsa5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed6CondConditionFingerprint = { + {0x00, 0xd3, 0xc9, 0x24, 0x3f, 0x2d, 0x2e, 0x64, 0x93, 0xa8, 0x49, + 0x29, 0x82, 0x75, 0xea, 0xbf, 0xe3, 0x53, 0x7f, 0x8e, 0x45, 0x16, + 0xdb, 0x5e, 0xc6, 0xdf, 0x39, 0xd2, 0xcb, 0xea, 0x62, 0xfb}}; + Condition const Ed6Cond{Type::ed25519Sha256, + 131072, + Ed6CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh10CondConditionFingerprint = { + {0xe7, 0x0c, 0xd7, 0xd3, 0xd4, 0x83, 0x3d, 0x08, 0x55, 0x80, 0xaa, + 0x54, 0xa5, 0xa3, 0xaa, 0x27, 0xe2, 0x9d, 0x7e, 0xbb, 0x17, 0x14, + 0xc4, 0xdc, 0x90, 0x7c, 0x22, 0x8b, 0x78, 0x29, 0x7a, 0x03}}; + Condition const Thresh10Cond{Type::thresholdSha256, + 135168, + Thresh10CondConditionFingerprint, + std::bitset<5>{25}}; + + auto ed1 = std::make_unique(ed1PublicKey, ed1Sig); + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + std::vector> thresh2Subfulfillments; + thresh2Subfulfillments.emplace_back(std::move(ed3)); + std::vector thresh2Subconditions{ + {Preim4Cond, Rsa5Cond, Ed6Cond}}; + auto thresh2 = std::make_unique( + std::move(thresh2Subfulfillments), std::move(thresh2Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(ed1)); + thresh0Subfulfillments.emplace_back(std::move(thresh2)); + std::vector thresh0Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond, Thresh10Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\xf9\xa0\x82\x01\x4c\xa2\x81\xe3\xa0\x66\xa4\x64" + "\x80\x20\x42\x0a\x60\x63\x9e\xca\xaa\x48\xac\xcb\x2c\xd9\x46" + "\x79\x69\x34\x35\xf3\x8e\x29\xd5\x4b\x24\x57\x9d\xd7\x3b\x04" + "\x5d\x9c\x2f\x32\x81\x40\x8d\x31\x70\x29\x69\xdd\x57\x60\x2c" + "\x4b\x2e\x7a\x0c\x68\xfc\x7e\x62\x64\x27\x75\xce\x69\xf5\xc7" + "\x42\x9b\x2b\x47\xc7\xa8\xcc\x4f\xed\xae\x26\x54\x6c\x72\xb5" + "\x7a\x24\xcf\x14\xc9\x82\x0b\x38\x22\x8b\xcc\xa2\x20\xd7\x3f" + "\x02\x74\xa0\x2f\xde\xb9\x5c\x7f\x60\x0b\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x99\xfb\x0b\x38\x94" + "\x4d\x20\x85\xc8\xda\x3a\x64\x31\x44\x6f\x6c\x3b\x46\x25\x50" + "\xd7\x7f\xdf\xee\x75\x72\x71\xf9\x61\x40\x63\xfa\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\x00\xd3\xc9\x24\x3f\x2d\x2e\x64\x93" + "\xa8\x49\x29\x82\x75\xea\xbf\xe3\x53\x7f\x8e\x45\x16\xdb\x5e" + "\xc6\xdf\x39\xd2\xcb\xea\x62\xfb\x81\x03\x02\x00\x00\xa4\x64" + "\x80\x20\x63\x99\x70\x0c\xa9\x50\x9c\xd4\xf5\x06\xdd\x19\xc8" + "\xa1\xd2\x9e\x03\x10\xb9\x89\x2e\x02\x34\x62\x2d\x23\xca\xa1" + "\x1d\xde\x23\x6a\x81\x40\x7d\xcb\x6f\x72\xbd\x59\xa6\xba\x2b" + "\x69\x04\x95\x4f\xba\x8a\x43\x21\x45\x8f\xb1\x40\x99\xd8\xa4" + "\x9e\x7c\x9a\xc5\x96\x07\xeb\x8d\xbd\x80\x20\xb0\x70\xf1\x33" + "\x55\x61\x61\x38\x21\xdc\xea\x3d\x30\xaa\xe6\xf4\x6a\xba\xa4" + "\x4c\xbf\x2f\xad\xb5\x51\x44\xc8\x67\x0a\xa1\x81\xa6\xa0\x25" + "\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54" + "\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee" + "\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\xe7\x0c\xd7\xd3" + "\xd4\x83\x3d\x08\x55\x80\xaa\x54\xa5\xa3\xaa\x27\xe2\x9d\x7e" + "\xbb\x17\x14\xc4\xdc\x90\x7c\x22\x8b\x78\x29\x7a\x03\x81\x03" + "\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xd1\xb5\x1d\x35" + "\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c" + "\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d" + "\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0" + "\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x63\x8d\xa9\x20\xb9\x16\x42\x83\xf0\xbb\x9d" + "\x8f\xc6\xc5\x68\x3d\xaa\xd4\x33\x4e\x0c\x53\xb9\x21\x54\x92" + "\xd8\x9f\x9d\x92\x4f\x57\x81\x03\x04\x38\x00\x82\x02\x03\x98"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x02\x80\x01\x02\xa1\x81\xfc\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa2\x2b\x80\x20\x29\x46\xc8\xd9\xa0\xe0\xb6" + "\xb7\x2e\xc5\xae\x75\xc3\xdc\x75\x39\x96\xd1\x56\xcb\x54\x3c" + "\xdc\x34\x6e\xc0\xe0\xfc\x74\x4c\x10\x5d\x81\x03\x02\x10\x00" + "\x82\x02\x03\x98\xa2\x2b\x80\x20\xe7\x0c\xd7\xd3\xd4\x83\x3d" + "\x08\x55\x80\xaa\x54\xa5\xa3\xaa\x27\xe2\x9d\x7e\xbb\x17\x14" + "\xc4\xdc\x90\x7c\x22\x8b\x78\x29\x7a\x03\x81\x03\x02\x10\x00" + "\x82\x02\x03\x98\xa3\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4" + "\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57" + "\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x42\x58\xea\xf4\xb3\xac\xde\x0b\xd9\x1e\x0c" + "\x53\xe5\xae\x63\x84\xee\xc0\xf5\xcf\x88\xa7\x43\x7b\x05\x47" + "\x87\xee\x73\x3e\xa3\x83\x81\x03\x02\x00\x00\xa4\x27\x80\x20" + "\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82" + "\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b" + "\xf6\xc9\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh52() + { + testcase("Thresh52"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim9Cond + // ** Rsa10Cond + // ** Ed11Cond + // ** prefix1 + // *** prefix2 + // **** ed3 + // ** prefix4 + // *** prefix5 + // **** ed6 + // ** thresh7 + // *** ed8 + + auto const ed3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed3PublicKey{ + {0x42, 0x0a, 0x60, 0x63, 0x9e, 0xca, 0xaa, 0x48, 0xac, 0xcb, 0x2c, + 0xd9, 0x46, 0x79, 0x69, 0x34, 0x35, 0xf3, 0x8e, 0x29, 0xd5, 0x4b, + 0x24, 0x57, 0x9d, 0xd7, 0x3b, 0x04, 0x5d, 0x9c, 0x2f, 0x32}}; + std::array const ed3Sig{ + {0xe2, 0x0f, 0x5d, 0x3a, 0x74, 0xdc, 0x41, 0x91, 0x19, 0xbc, 0xf6, + 0x7d, 0x90, 0x21, 0xae, 0xd0, 0x5b, 0x01, 0xf9, 0x74, 0xf8, 0xb9, + 0x44, 0xc5, 0x91, 0x23, 0x92, 0xf8, 0x96, 0x26, 0x77, 0x94, 0xfc, + 0xf5, 0x59, 0xed, 0x0c, 0x19, 0xac, 0x92, 0x03, 0x54, 0xf2, 0x8f, + 0x8e, 0xc5, 0x29, 0x1d, 0x18, 0x92, 0x50, 0xaf, 0x81, 0xb6, 0x17, + 0x5c, 0xa4, 0xa5, 0xdd, 0x73, 0xf5, 0x6f, 0xa0, 0x09}}; + std::array const ed3SigningKey{ + {0x1b, 0x90, 0xf2, 0x2c, 0xd5, 0x5d, 0xcd, 0xe5, 0x2d, 0x71, 0x84, + 0x66, 0x10, 0xf0, 0xf1, 0x91, 0xfe, 0xb5, 0xbe, 0x94, 0x85, 0xc1, + 0xc8, 0xf3, 0x61, 0x91, 0xc3, 0xa4, 0x41, 0x58, 0xcd, 0xfc}}; + (void)ed3SigningKey; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const ed6Msg = "P5P4abcdefghijklmnopqrstuvwxyz"s; + std::array const ed6PublicKey{ + {0xa0, 0x45, 0x26, 0xcf, 0xee, 0x7e, 0xda, 0x68, 0xd9, 0x70, 0x23, + 0xac, 0x68, 0x48, 0x9e, 0x20, 0xa4, 0x5e, 0xf8, 0x51, 0xcb, 0xfe, + 0x72, 0xc1, 0x11, 0x5d, 0x25, 0x9c, 0xbc, 0xfd, 0xbb, 0x8b}}; + std::array const ed6Sig{ + {0x21, 0x27, 0xbc, 0x35, 0xc0, 0xf7, 0x5f, 0xd2, 0xa2, 0xff, 0x3b, + 0x12, 0xc5, 0xd6, 0x19, 0xc8, 0x07, 0x45, 0xd3, 0xa4, 0xa7, 0xdc, + 0x4c, 0x0a, 0x5a, 0xbf, 0x31, 0x24, 0xac, 0x3b, 0xb8, 0xd0, 0x42, + 0x79, 0x90, 0x1b, 0xa3, 0xf7, 0x6f, 0x21, 0x6b, 0x5c, 0x69, 0xeb, + 0x3c, 0x3f, 0xc8, 0xff, 0xba, 0xd5, 0x7a, 0xdc, 0xf5, 0xa4, 0x77, + 0xb8, 0xcd, 0x99, 0x4f, 0x8e, 0x05, 0xdc, 0xaf, 0x0f}}; + std::array const ed6SigningKey{ + {0x8f, 0xac, 0x15, 0x02, 0xce, 0xb4, 0x10, 0x27, 0x56, 0x91, 0x2b, + 0xd0, 0x57, 0xe7, 0x6c, 0xe0, 0xc5, 0x46, 0x65, 0x38, 0xf0, 0xc8, + 0x09, 0xe0, 0xb4, 0x57, 0xfb, 0x11, 0xfc, 0x00, 0xe9, 0xdf}}; + (void)ed6SigningKey; + auto const prefix5Prefix = "P5"s; + auto const prefix5Msg = "P4abcdefghijklmnopqrstuvwxyz"s; + auto const prefix5MaxMsgLength = 28; + auto const prefix4Prefix = "P4"s; + auto const prefix4Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix4MaxMsgLength = 26; + auto const ed8Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed8PublicKey{ + {0xb6, 0x55, 0xc8, 0xa4, 0x14, 0x20, 0x73, 0x44, 0x12, 0x06, 0xf6, + 0xf7, 0xd0, 0x03, 0x74, 0x53, 0xaa, 0x74, 0x6c, 0xf1, 0x84, 0x0e, + 0x86, 0x1d, 0xb1, 0x97, 0x1a, 0x04, 0x91, 0x83, 0x3b, 0x49}}; + std::array const ed8Sig{ + {0x4d, 0xf6, 0x5a, 0x0e, 0xa4, 0x6f, 0x3d, 0xa0, 0x76, 0xe4, 0x3a, + 0xea, 0x69, 0x1e, 0x3f, 0xe4, 0x45, 0x51, 0x97, 0xc8, 0x7e, 0x3c, + 0xd6, 0x34, 0xc8, 0x7f, 0xa3, 0xf9, 0xd7, 0xfe, 0x0a, 0xf4, 0x86, + 0x18, 0xc5, 0xfa, 0x1c, 0x73, 0x88, 0x37, 0x33, 0x3d, 0xd4, 0x8c, + 0x08, 0xf9, 0xa5, 0xf0, 0x83, 0x37, 0x06, 0x5b, 0xd3, 0xfc, 0x20, + 0x12, 0x42, 0x7a, 0x7a, 0xd7, 0x60, 0xc5, 0xd1, 0x0b}}; + std::array const ed8SigningKey{ + {0xc2, 0x00, 0xc6, 0x2e, 0x45, 0xde, 0xf2, 0x39, 0x81, 0x0a, 0xf8, + 0x6d, 0x53, 0x29, 0xe3, 0x1b, 0x8e, 0x57, 0xad, 0xfa, 0x29, 0x1b, + 0x07, 0x1a, 0xee, 0x34, 0xe6, 0x57, 0x5a, 0xeb, 0xf2, 0x1c}}; + (void)ed8SigningKey; + auto const thresh7Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(ed3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto ed6 = std::make_unique(ed6PublicKey, ed6Sig); + auto prefix5 = std::make_unique( + makeSlice(prefix5Prefix), prefix5MaxMsgLength, std::move(ed6)); + auto prefix4 = std::make_unique( + makeSlice(prefix4Prefix), prefix4MaxMsgLength, std::move(prefix5)); + auto ed8 = std::make_unique(ed8PublicKey, ed8Sig); + std::vector> thresh7Subfulfillments; + thresh7Subfulfillments.emplace_back(std::move(ed8)); + std::vector thresh7Subconditions{}; + auto thresh7 = std::make_unique( + std::move(thresh7Subfulfillments), std::move(thresh7Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix4)); + thresh0Subfulfillments.emplace_back(std::move(thresh7)); + std::vector thresh0Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x01\xe3\xa0\x82\x01\x64\xa1\x7a\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x71\xa1\x6f\x80\x02\x50\x32\x81\x01\x1c\xa2\x66" + "\xa4\x64\x80\x20\x42\x0a\x60\x63\x9e\xca\xaa\x48\xac\xcb\x2c" + "\xd9\x46\x79\x69\x34\x35\xf3\x8e\x29\xd5\x4b\x24\x57\x9d\xd7" + "\x3b\x04\x5d\x9c\x2f\x32\x81\x40\xe2\x0f\x5d\x3a\x74\xdc\x41" + "\x91\x19\xbc\xf6\x7d\x90\x21\xae\xd0\x5b\x01\xf9\x74\xf8\xb9" + "\x44\xc5\x91\x23\x92\xf8\x96\x26\x77\x94\xfc\xf5\x59\xed\x0c" + "\x19\xac\x92\x03\x54\xf2\x8f\x8e\xc5\x29\x1d\x18\x92\x50\xaf" + "\x81\xb6\x17\x5c\xa4\xa5\xdd\x73\xf5\x6f\xa0\x09\xa1\x7a\x80" + "\x02\x50\x34\x81\x01\x1a\xa2\x71\xa1\x6f\x80\x02\x50\x35\x81" + "\x01\x1c\xa2\x66\xa4\x64\x80\x20\xa0\x45\x26\xcf\xee\x7e\xda" + "\x68\xd9\x70\x23\xac\x68\x48\x9e\x20\xa4\x5e\xf8\x51\xcb\xfe" + "\x72\xc1\x11\x5d\x25\x9c\xbc\xfd\xbb\x8b\x81\x40\x21\x27\xbc" + "\x35\xc0\xf7\x5f\xd2\xa2\xff\x3b\x12\xc5\xd6\x19\xc8\x07\x45" + "\xd3\xa4\xa7\xdc\x4c\x0a\x5a\xbf\x31\x24\xac\x3b\xb8\xd0\x42" + "\x79\x90\x1b\xa3\xf7\x6f\x21\x6b\x5c\x69\xeb\x3c\x3f\xc8\xff" + "\xba\xd5\x7a\xdc\xf5\xa4\x77\xb8\xcd\x99\x4f\x8e\x05\xdc\xaf" + "\x0f\xa2\x6a\xa0\x66\xa4\x64\x80\x20\xb6\x55\xc8\xa4\x14\x20" + "\x73\x44\x12\x06\xf6\xf7\xd0\x03\x74\x53\xaa\x74\x6c\xf1\x84" + "\x0e\x86\x1d\xb1\x97\x1a\x04\x91\x83\x3b\x49\x81\x40\x4d\xf6" + "\x5a\x0e\xa4\x6f\x3d\xa0\x76\xe4\x3a\xea\x69\x1e\x3f\xe4\x45" + "\x51\x97\xc8\x7e\x3c\xd6\x34\xc8\x7f\xa3\xf9\xd7\xfe\x0a\xf4" + "\x86\x18\xc5\xfa\x1c\x73\x88\x37\x33\x3d\xd4\x8c\x08\xf9\xa5" + "\xf0\x83\x37\x06\x5b\xd3\xfc\x20\x12\x42\x7a\x7a\xd7\x60\xc5" + "\xd1\x0b\xa1\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa3\x27\x80\x20\x3c\x73\x38\xcf\x23\xc6\x31\x53\x28\xc4\x27" + "\xf8\x95\x87\x99\x83\x2d\x35\x3c\x03\x9b\xd1\xff\xff\x2e\x53" + "\x20\xe9\x5e\x62\xb9\xb7\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\x41\x80\x08\xb2\x60\x74\x57\x6d\xac\xed\x74\x7f\x54\xdb\x96" + "\x18\x91\x06\x0a\x95\xa1\x49\x17\xc7\x65\xe3\x94\xc8\x5e\x2c" + "\x92\x20\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x59\xb2\xa4\x01\xcb\x9a\x24\x68\x56\xd2\x06" + "\x1e\xcb\x37\xc1\xd2\x6f\x1a\x56\xf7\x3a\xd0\x2b\xcd\x96\x04" + "\x7e\x01\x79\x52\x13\x66\x81\x03\x06\x2c\x74\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x03\x71\x9b\x50\x63\x39" + "\xe5\x83\xbc\xbe\xbb\xc8\xec\x10\xe1\x49\xae\xea\x74\x8b\xae" + "\x3d\xdb\x60\xb2\x16\x5a\xd6\xce\xba\xf8\xcc\x81\x03\x02\x08" + "\x3a\x82\x02\x03\x08\xa1\x2b\x80\x20\x4a\x3d\x99\xa4\x0f\x6a" + "\xfd\xf9\x0a\xc0\x8f\xe5\xbf\xf0\x7d\x43\xc5\xe6\x43\xa1\x63" + "\x58\xe5\x5b\xf5\x77\x23\x80\xea\x68\x2b\x40\x81\x03\x02\x08" + "\x3a\x82\x02\x03\x08\xa2\x2b\x80\x20\xf4\xa5\x5f\xee\xd1\x99" + "\x9a\x7f\xbe\x4c\x87\x81\x19\x23\xf1\xb4\xf0\x93\x97\xde\x37" + "\x5e\x4f\xad\x2e\x22\xb2\x05\x1f\x12\x00\xd3\x81\x03\x02\x04" + "\x00\x82\x02\x03\x08\xa3\x27\x80\x20\x3c\x73\x38\xcf\x23\xc6" + "\x31\x53\x28\xc4\x27\xf8\x95\x87\x99\x83\x2d\x35\x3c\x03\x9b" + "\xd1\xff\xff\x2e\x53\x20\xe9\x5e\x62\xb9\xb7\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x41\x80\x08\xb2\x60\x74\x57\x6d\xac\xed" + "\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95\xa1\x49\x17\xc7\x65" + "\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh53() + { + testcase("Thresh53"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim7Cond + // ** Rsa8Cond + // ** Ed9Cond + // ** Prefix10Cond + // ** Thresh13Cond + // ** prefix1 + // *** prefix2 + // **** ed3 + // ** preim4 + // ** rsa5 + // ** ed6 + + auto const ed3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed3PublicKey{ + {0x42, 0x0a, 0x60, 0x63, 0x9e, 0xca, 0xaa, 0x48, 0xac, 0xcb, 0x2c, + 0xd9, 0x46, 0x79, 0x69, 0x34, 0x35, 0xf3, 0x8e, 0x29, 0xd5, 0x4b, + 0x24, 0x57, 0x9d, 0xd7, 0x3b, 0x04, 0x5d, 0x9c, 0x2f, 0x32}}; + std::array const ed3Sig{ + {0xe2, 0x0f, 0x5d, 0x3a, 0x74, 0xdc, 0x41, 0x91, 0x19, 0xbc, 0xf6, + 0x7d, 0x90, 0x21, 0xae, 0xd0, 0x5b, 0x01, 0xf9, 0x74, 0xf8, 0xb9, + 0x44, 0xc5, 0x91, 0x23, 0x92, 0xf8, 0x96, 0x26, 0x77, 0x94, 0xfc, + 0xf5, 0x59, 0xed, 0x0c, 0x19, 0xac, 0x92, 0x03, 0x54, 0xf2, 0x8f, + 0x8e, 0xc5, 0x29, 0x1d, 0x18, 0x92, 0x50, 0xaf, 0x81, 0xb6, 0x17, + 0x5c, 0xa4, 0xa5, 0xdd, 0x73, 0xf5, 0x6f, 0xa0, 0x09}}; + std::array const ed3SigningKey{ + {0x1b, 0x90, 0xf2, 0x2c, 0xd5, 0x5d, 0xcd, 0xe5, 0x2d, 0x71, 0x84, + 0x66, 0x10, 0xf0, 0xf1, 0x91, 0xfe, 0xb5, 0xbe, 0x94, 0x85, 0xc1, + 0xc8, 0xf3, 0x61, 0x91, 0xc3, 0xa4, 0x41, 0x58, 0xcd, 0xfc}}; + (void)ed3SigningKey; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim4Preimage = "I am root"s; + auto const preim4Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa5Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa5PublicKey{ + {0xc0, 0x00, 0xef, 0x8f, 0x4b, 0x81, 0x10, 0x1e, 0x52, 0xe0, 0x07, + 0x9f, 0x68, 0xe7, 0x2f, 0x92, 0xd4, 0x77, 0x3c, 0x1f, 0xa3, 0xff, + 0x72, 0x64, 0x5b, 0x37, 0xf1, 0xf3, 0xa3, 0xc5, 0xfb, 0xcd, 0xfb, + 0xda, 0xcc, 0x8b, 0x52, 0xe1, 0xde, 0xbc, 0x28, 0x8d, 0xe5, 0xad, + 0xab, 0x86, 0x61, 0x45, 0x97, 0x65, 0x37, 0x68, 0x26, 0x21, 0x92, + 0x17, 0xa3, 0xb0, 0x74, 0x5c, 0x8a, 0x45, 0x8d, 0x87, 0x5b, 0x9b, + 0xd1, 0x7b, 0x07, 0xc4, 0x8c, 0x67, 0xa0, 0xe9, 0x82, 0x0c, 0xe0, + 0x6b, 0xea, 0x91, 0x5c, 0xba, 0xe3, 0xd9, 0x9d, 0x39, 0xfd, 0x77, + 0xac, 0xcb, 0x33, 0x9b, 0x28, 0x51, 0x8d, 0xbf, 0x3e, 0xe4, 0x94, + 0x1c, 0x9a, 0x60, 0x71, 0x4b, 0x34, 0x07, 0x30, 0xda, 0x42, 0x46, + 0x0e, 0xb8, 0xb7, 0x2c, 0xf5, 0x2f, 0x4b, 0x9e, 0xe7, 0x64, 0x81, + 0xa1, 0xa2, 0x05, 0x66, 0x92, 0xe6, 0x75, 0x9f, 0x37, 0xae, 0x40, + 0xa9, 0x16, 0x08, 0x19, 0xe8, 0xdc, 0x47, 0xd6, 0x03, 0x29, 0xab, + 0xcc, 0x58, 0xa2, 0x37, 0x2a, 0x32, 0xb8, 0x15, 0xc7, 0x51, 0x91, + 0x73, 0xb9, 0x1d, 0xc6, 0xd0, 0x4f, 0x85, 0x86, 0xd5, 0xb3, 0x21, + 0x1a, 0x2a, 0x6c, 0xeb, 0x7f, 0xfe, 0x84, 0x17, 0x10, 0x2d, 0x0e, + 0xb4, 0xe1, 0xc2, 0x48, 0x4c, 0x3f, 0x61, 0xc7, 0x59, 0x75, 0xa7, + 0xc1, 0x75, 0xce, 0x67, 0x17, 0x42, 0x2a, 0x2f, 0x96, 0xef, 0x8a, + 0x2d, 0x74, 0xd2, 0x13, 0x68, 0xe1, 0xe9, 0xea, 0xfb, 0x73, 0x68, + 0xed, 0x8d, 0xd3, 0xac, 0x49, 0x09, 0xf9, 0xec, 0x62, 0xdf, 0x53, + 0xab, 0xfe, 0x90, 0x64, 0x4b, 0x92, 0x60, 0x0d, 0xdd, 0x00, 0xfe, + 0x02, 0xe6, 0xf3, 0x9b, 0x2b, 0xac, 0x4f, 0x70, 0xe8, 0x5b, 0x69, + 0x9c, 0x40, 0xd3, 0xeb, 0x37, 0xad, 0x6f, 0x37, 0xab, 0xf3, 0x79, + 0x8e, 0xcb, 0x1d}}; + std::array const rsa5Sig{ + {0x89, 0x83, 0xa3, 0x11, 0xe3, 0x64, 0x72, 0x8e, 0x18, 0x4b, 0x16, + 0x55, 0xf9, 0xca, 0xce, 0x87, 0x93, 0x25, 0x15, 0xbb, 0xd6, 0x88, + 0x8f, 0x36, 0xeb, 0x65, 0xe2, 0x70, 0x70, 0x0d, 0xd9, 0x92, 0xc9, + 0x7e, 0x6f, 0x41, 0x3c, 0xef, 0x58, 0xad, 0x4b, 0xb5, 0x50, 0x75, + 0xd2, 0xdd, 0xfa, 0xce, 0xae, 0x34, 0xf2, 0x36, 0x3a, 0x53, 0x3b, + 0x98, 0x21, 0x6f, 0x0f, 0x96, 0xd3, 0x5b, 0x34, 0xbf, 0x3b, 0x5f, + 0xed, 0xe9, 0xb1, 0x30, 0xe9, 0xa8, 0x2f, 0x70, 0x0d, 0xf9, 0xf1, + 0xa7, 0x00, 0x4b, 0x34, 0x61, 0xf7, 0xbb, 0xe0, 0xc6, 0xe6, 0x28, + 0x75, 0x7c, 0xfc, 0xbb, 0xf2, 0x7b, 0xf3, 0x66, 0x0a, 0x10, 0x38, + 0xd5, 0x31, 0x06, 0xf9, 0x06, 0x9d, 0x33, 0x15, 0x86, 0x80, 0x03, + 0xc1, 0x03, 0x6b, 0xf8, 0xc7, 0xe1, 0x53, 0xaa, 0x87, 0xb6, 0xc3, + 0x6e, 0x67, 0x70, 0xb4, 0x1b, 0x43, 0x12, 0x90, 0x5c, 0x94, 0xbf, + 0xf7, 0x88, 0x92, 0x43, 0x6e, 0x12, 0x12, 0x82, 0xfa, 0x66, 0xd9, + 0x86, 0x62, 0xe8, 0xd4, 0xb9, 0x0a, 0x3c, 0xc1, 0x17, 0x00, 0xc5, + 0xe8, 0x47, 0xb4, 0xab, 0xed, 0x8b, 0x75, 0x95, 0xec, 0x2d, 0xaf, + 0x34, 0x70, 0xd8, 0xa7, 0xbd, 0x63, 0x33, 0x74, 0x04, 0x11, 0x12, + 0x48, 0x85, 0x0e, 0xaa, 0x75, 0x2e, 0xb3, 0x83, 0xce, 0x25, 0xa7, + 0xa4, 0x11, 0x58, 0xfe, 0xee, 0x43, 0x85, 0x8a, 0x66, 0x8c, 0xd1, + 0xa5, 0x60, 0x51, 0xf6, 0x40, 0x36, 0x21, 0xb6, 0x85, 0x60, 0xd7, + 0x25, 0x38, 0x98, 0x30, 0xe5, 0xc5, 0xa0, 0x92, 0x80, 0x90, 0x5f, + 0xe0, 0xc1, 0x0a, 0x46, 0xce, 0x71, 0xa3, 0x14, 0xd7, 0x73, 0x91, + 0xbc, 0x75, 0xb5, 0x35, 0x0a, 0x18, 0x06, 0xff, 0x01, 0x93, 0x94, + 0x97, 0xa2, 0x41, 0x75, 0x1c, 0x6b, 0x1d, 0x70, 0x5e, 0x35, 0x40, + 0x3f, 0xe6, 0xd6}}; + auto const ed6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed6PublicKey{ + {0xa0, 0x45, 0x26, 0xcf, 0xee, 0x7e, 0xda, 0x68, 0xd9, 0x70, 0x23, + 0xac, 0x68, 0x48, 0x9e, 0x20, 0xa4, 0x5e, 0xf8, 0x51, 0xcb, 0xfe, + 0x72, 0xc1, 0x11, 0x5d, 0x25, 0x9c, 0xbc, 0xfd, 0xbb, 0x8b}}; + std::array const ed6Sig{ + {0x2a, 0x1d, 0xc0, 0x92, 0x24, 0x9a, 0x87, 0x5a, 0xc6, 0xaf, 0xa4, + 0x7f, 0xe1, 0x63, 0xc7, 0xca, 0xfd, 0x08, 0x47, 0xae, 0x2f, 0x98, + 0x07, 0xdc, 0x56, 0x9a, 0xfc, 0x2f, 0x0e, 0xa9, 0x37, 0x16, 0xe0, + 0x81, 0xff, 0x94, 0xb2, 0xab, 0x40, 0x2f, 0x9c, 0xa6, 0xc0, 0xe4, + 0xdf, 0xdf, 0xcd, 0x01, 0xf2, 0xdb, 0x9c, 0xff, 0x62, 0xe7, 0x2f, + 0x9d, 0x51, 0x6e, 0x80, 0xd1, 0x0c, 0x86, 0xd2, 0x01}}; + std::array const ed6SigningKey{ + {0x8f, 0xac, 0x15, 0x02, 0xce, 0xb4, 0x10, 0x27, 0x56, 0x91, 0x2b, + 0xd0, 0x57, 0xe7, 0x6c, 0xe0, 0xc5, 0x46, 0x65, 0x38, 0xf0, 0xc8, + 0x09, 0xe0, 0xb4, 0x57, 0xfb, 0x11, 0xfc, 0x00, 0xe9, 0xdf}}; + (void)ed6SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix10CondConditionFingerprint = { + {0x62, 0x26, 0x7f, 0x8b, 0x47, 0x1d, 0x40, 0xba, 0x59, 0xa7, 0xd0, + 0x57, 0x91, 0x3b, 0xc9, 0xd6, 0x78, 0xcf, 0x25, 0x27, 0x9c, 0xa2, + 0x25, 0x69, 0x08, 0x90, 0x42, 0x8a, 0x8b, 0x18, 0xd4, 0x4c}}; + Condition const Prefix10Cond{Type::prefixSha256, + 133155, + Prefix10CondConditionFingerprint, + std::bitset<5>{16}}; + std::array const Thresh13CondConditionFingerprint = { + {0xa6, 0xb2, 0xca, 0x44, 0xa9, 0x8d, 0xaa, 0xa2, 0x07, 0x4f, 0x0d, + 0x9d, 0x3b, 0x26, 0x42, 0xb1, 0x81, 0x2c, 0xde, 0x50, 0x49, 0x17, + 0x6c, 0x0f, 0xb5, 0xcc, 0xb9, 0x00, 0x6d, 0xa8, 0xce, 0x48}}; + Condition const Thresh13Cond{Type::thresholdSha256, + 132096, + Thresh13CondConditionFingerprint, + std::bitset<5>{16}}; + + auto ed3 = std::make_unique(ed3PublicKey, ed3Sig); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(ed3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim4 = + std::make_unique(makeSlice(preim4Preimage)); + auto rsa5 = std::make_unique( + makeSlice(rsa5PublicKey), makeSlice(rsa5Sig)); + auto ed6 = std::make_unique(ed6PublicKey, ed6Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim4)); + thresh0Subfulfillments.emplace_back(std::move(rsa5)); + thresh0Subfulfillments.emplace_back(std::move(ed6)); + std::vector thresh0Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond, Prefix10Cond, Thresh13Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\xd5\xa0\x82\x02\xfb\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x7a\x80\x02\x50\x31\x81\x01\x1a" + "\xa2\x71\xa1\x6f\x80\x02\x50\x32\x81\x01\x1c\xa2\x66\xa4\x64" + "\x80\x20\x42\x0a\x60\x63\x9e\xca\xaa\x48\xac\xcb\x2c\xd9\x46" + "\x79\x69\x34\x35\xf3\x8e\x29\xd5\x4b\x24\x57\x9d\xd7\x3b\x04" + "\x5d\x9c\x2f\x32\x81\x40\xe2\x0f\x5d\x3a\x74\xdc\x41\x91\x19" + "\xbc\xf6\x7d\x90\x21\xae\xd0\x5b\x01\xf9\x74\xf8\xb9\x44\xc5" + "\x91\x23\x92\xf8\x96\x26\x77\x94\xfc\xf5\x59\xed\x0c\x19\xac" + "\x92\x03\x54\xf2\x8f\x8e\xc5\x29\x1d\x18\x92\x50\xaf\x81\xb6" + "\x17\x5c\xa4\xa5\xdd\x73\xf5\x6f\xa0\x09\xa3\x82\x02\x08\x80" + "\x82\x01\x00\xc0\x00\xef\x8f\x4b\x81\x10\x1e\x52\xe0\x07\x9f" + "\x68\xe7\x2f\x92\xd4\x77\x3c\x1f\xa3\xff\x72\x64\x5b\x37\xf1" + "\xf3\xa3\xc5\xfb\xcd\xfb\xda\xcc\x8b\x52\xe1\xde\xbc\x28\x8d" + "\xe5\xad\xab\x86\x61\x45\x97\x65\x37\x68\x26\x21\x92\x17\xa3" + "\xb0\x74\x5c\x8a\x45\x8d\x87\x5b\x9b\xd1\x7b\x07\xc4\x8c\x67" + "\xa0\xe9\x82\x0c\xe0\x6b\xea\x91\x5c\xba\xe3\xd9\x9d\x39\xfd" + "\x77\xac\xcb\x33\x9b\x28\x51\x8d\xbf\x3e\xe4\x94\x1c\x9a\x60" + "\x71\x4b\x34\x07\x30\xda\x42\x46\x0e\xb8\xb7\x2c\xf5\x2f\x4b" + "\x9e\xe7\x64\x81\xa1\xa2\x05\x66\x92\xe6\x75\x9f\x37\xae\x40" + "\xa9\x16\x08\x19\xe8\xdc\x47\xd6\x03\x29\xab\xcc\x58\xa2\x37" + "\x2a\x32\xb8\x15\xc7\x51\x91\x73\xb9\x1d\xc6\xd0\x4f\x85\x86" + "\xd5\xb3\x21\x1a\x2a\x6c\xeb\x7f\xfe\x84\x17\x10\x2d\x0e\xb4" + "\xe1\xc2\x48\x4c\x3f\x61\xc7\x59\x75\xa7\xc1\x75\xce\x67\x17" + "\x42\x2a\x2f\x96\xef\x8a\x2d\x74\xd2\x13\x68\xe1\xe9\xea\xfb" + "\x73\x68\xed\x8d\xd3\xac\x49\x09\xf9\xec\x62\xdf\x53\xab\xfe" + "\x90\x64\x4b\x92\x60\x0d\xdd\x00\xfe\x02\xe6\xf3\x9b\x2b\xac" + "\x4f\x70\xe8\x5b\x69\x9c\x40\xd3\xeb\x37\xad\x6f\x37\xab\xf3" + "\x79\x8e\xcb\x1d\x81\x82\x01\x00\x89\x83\xa3\x11\xe3\x64\x72" + "\x8e\x18\x4b\x16\x55\xf9\xca\xce\x87\x93\x25\x15\xbb\xd6\x88" + "\x8f\x36\xeb\x65\xe2\x70\x70\x0d\xd9\x92\xc9\x7e\x6f\x41\x3c" + "\xef\x58\xad\x4b\xb5\x50\x75\xd2\xdd\xfa\xce\xae\x34\xf2\x36" + "\x3a\x53\x3b\x98\x21\x6f\x0f\x96\xd3\x5b\x34\xbf\x3b\x5f\xed" + "\xe9\xb1\x30\xe9\xa8\x2f\x70\x0d\xf9\xf1\xa7\x00\x4b\x34\x61" + "\xf7\xbb\xe0\xc6\xe6\x28\x75\x7c\xfc\xbb\xf2\x7b\xf3\x66\x0a" + "\x10\x38\xd5\x31\x06\xf9\x06\x9d\x33\x15\x86\x80\x03\xc1\x03" + "\x6b\xf8\xc7\xe1\x53\xaa\x87\xb6\xc3\x6e\x67\x70\xb4\x1b\x43" + "\x12\x90\x5c\x94\xbf\xf7\x88\x92\x43\x6e\x12\x12\x82\xfa\x66" + "\xd9\x86\x62\xe8\xd4\xb9\x0a\x3c\xc1\x17\x00\xc5\xe8\x47\xb4" + "\xab\xed\x8b\x75\x95\xec\x2d\xaf\x34\x70\xd8\xa7\xbd\x63\x33" + "\x74\x04\x11\x12\x48\x85\x0e\xaa\x75\x2e\xb3\x83\xce\x25\xa7" + "\xa4\x11\x58\xfe\xee\x43\x85\x8a\x66\x8c\xd1\xa5\x60\x51\xf6" + "\x40\x36\x21\xb6\x85\x60\xd7\x25\x38\x98\x30\xe5\xc5\xa0\x92" + "\x80\x90\x5f\xe0\xc1\x0a\x46\xce\x71\xa3\x14\xd7\x73\x91\xbc" + "\x75\xb5\x35\x0a\x18\x06\xff\x01\x93\x94\x97\xa2\x41\x75\x1c" + "\x6b\x1d\x70\x5e\x35\x40\x3f\xe6\xd6\xa4\x64\x80\x20\xa0\x45" + "\x26\xcf\xee\x7e\xda\x68\xd9\x70\x23\xac\x68\x48\x9e\x20\xa4" + "\x5e\xf8\x51\xcb\xfe\x72\xc1\x11\x5d\x25\x9c\xbc\xfd\xbb\x8b" + "\x81\x40\x2a\x1d\xc0\x92\x24\x9a\x87\x5a\xc6\xaf\xa4\x7f\xe1" + "\x63\xc7\xca\xfd\x08\x47\xae\x2f\x98\x07\xdc\x56\x9a\xfc\x2f" + "\x0e\xa9\x37\x16\xe0\x81\xff\x94\xb2\xab\x40\x2f\x9c\xa6\xc0" + "\xe4\xdf\xdf\xcd\x01\xf2\xdb\x9c\xff\x62\xe7\x2f\x9d\x51\x6e" + "\x80\xd1\x0c\x86\xd2\x01\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa1\x2b\x80\x20\x62\x26\x7f\x8b\x47\x1d\x40\xba" + "\x59\xa7\xd0\x57\x91\x3b\xc9\xd6\x78\xcf\x25\x27\x9c\xa2\x25" + "\x69\x08\x90\x42\x8a\x8b\x18\xd4\x4c\x81\x03\x02\x08\x23\x82" + "\x02\x03\x08\xa2\x2b\x80\x20\xa6\xb2\xca\x44\xa9\x8d\xaa\xa2" + "\x07\x4f\x0d\x9d\x3b\x26\x42\xb1\x81\x2c\xde\x50\x49\x17\x6c" + "\x0f\xb5\xcc\xb9\x00\x6d\xa8\xce\x48\x81\x03\x02\x04\x00\x82" + "\x02\x03\x08\xa3\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1" + "\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b" + "\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46" + "\xab\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00" + "\xd5\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xe3\x62\xe5\xa1\x01\x1c\x3a\xc9\x12\x6c\x4d" + "\xae\xda\xc2\x92\x40\xbb\x92\x39\xb3\x30\x56\xe4\x35\x82\x74" + "\xe7\xd5\x37\x82\x61\x59\x81\x03\x08\x38\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x4a\x3d\x99\xa4\x0f\x6a\xfd\xf9\x0a\xc0\x8f\xe5" + "\xbf\xf0\x7d\x43\xc5\xe6\x43\xa1\x63\x58\xe5\x5b\xf5\x77\x23" + "\x80\xea\x68\x2b\x40\x81\x03\x02\x08\x3a\x82\x02\x03\x08\xa1" + "\x2b\x80\x20\x62\x26\x7f\x8b\x47\x1d\x40\xba\x59\xa7\xd0\x57" + "\x91\x3b\xc9\xd6\x78\xcf\x25\x27\x9c\xa2\x25\x69\x08\x90\x42" + "\x8a\x8b\x18\xd4\x4c\x81\x03\x02\x08\x23\x82\x02\x03\x08\xa2" + "\x2b\x80\x20\xa6\xb2\xca\x44\xa9\x8d\xaa\xa2\x07\x4f\x0d\x9d" + "\x3b\x26\x42\xb1\x81\x2c\xde\x50\x49\x17\x6c\x0f\xb5\xcc\xb9" + "\x00\x6d\xa8\xce\x48\x81\x03\x02\x04\x00\x82\x02\x03\x08\xa3" + "\x27\x80\x20\x99\xfb\x0b\x38\x94\x4d\x20\x85\xc8\xda\x3a\x64" + "\x31\x44\x6f\x6c\x3b\x46\x25\x50\xd7\x7f\xdf\xee\x75\x72\x71" + "\xf9\x61\x40\x63\xfa\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xd1" + "\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9\x2a\x20" + "\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2\xbc\x91" + "\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\xd3\xc9\x24\x3f" + "\x2d\x2e\x64\x93\xa8\x49\x29\x82\x75\xea\xbf\xe3\x53\x7f\x8e" + "\x45\x16\xdb\x5e\xc6\xdf\x39\xd2\xcb\xea\x62\xfb\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25" + "\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe" + "\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh54() + { + testcase("Thresh54"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim14Cond + // ** Rsa15Cond + // ** Ed16Cond + // ** prefix1 + // *** prefix2 + // **** prefix3 + // ***** ed4 + // ** prefix5 + // *** prefix6 + // **** prefix7 + // ***** ed8 + // ** thresh9 + // *** Preim11Cond + // *** Rsa12Cond + // *** Ed13Cond + // *** ed10 + + auto const ed4Msg = "P3P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0xd9, 0xe8, 0x4c, 0x1d, 0x34, 0x07, 0x8a, 0x36, 0x1e, 0x02, 0x10, + 0xfe, 0xf5, 0x1c, 0x7b, 0xb4, 0x79, 0x07, 0xbd, 0xf1, 0x91, 0x03, + 0xe5, 0xd5, 0x35, 0xe6, 0xa3, 0x44, 0x22, 0x86, 0xe4, 0xbb, 0x11, + 0xbc, 0x29, 0x77, 0xba, 0x15, 0xe1, 0x72, 0x33, 0x59, 0xa7, 0x3d, + 0x12, 0x45, 0xd2, 0xa0, 0xde, 0xff, 0x54, 0x32, 0xa2, 0x1a, 0x8a, + 0x59, 0x08, 0xf6, 0x90, 0x9b, 0x63, 0x2c, 0xb8, 0x02}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const prefix3Prefix = "P3"s; + auto const prefix3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3MaxMsgLength = 30; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const ed8Msg = "P7P6P5abcdefghijklmnopqrstuvwxyz"s; + std::array const ed8PublicKey{ + {0xb6, 0x55, 0xc8, 0xa4, 0x14, 0x20, 0x73, 0x44, 0x12, 0x06, 0xf6, + 0xf7, 0xd0, 0x03, 0x74, 0x53, 0xaa, 0x74, 0x6c, 0xf1, 0x84, 0x0e, + 0x86, 0x1d, 0xb1, 0x97, 0x1a, 0x04, 0x91, 0x83, 0x3b, 0x49}}; + std::array const ed8Sig{ + {0x62, 0x59, 0xf5, 0xf7, 0x5c, 0xb2, 0x66, 0x50, 0xe8, 0x12, 0x9e, + 0x66, 0xff, 0x44, 0xfa, 0xf7, 0x23, 0x7f, 0x6d, 0xef, 0x6e, 0x58, + 0x53, 0x30, 0x1f, 0xd8, 0x21, 0x97, 0xef, 0x05, 0x1e, 0x1d, 0x12, + 0x32, 0x04, 0x7b, 0xdc, 0x47, 0x9b, 0x73, 0xdb, 0xb7, 0x5a, 0x17, + 0xfe, 0x69, 0x5e, 0x90, 0x24, 0x21, 0x20, 0x19, 0xb0, 0x0f, 0xfa, + 0x79, 0x4e, 0xf5, 0x9f, 0xc2, 0x37, 0xf0, 0x3a, 0x01}}; + std::array const ed8SigningKey{ + {0xc2, 0x00, 0xc6, 0x2e, 0x45, 0xde, 0xf2, 0x39, 0x81, 0x0a, 0xf8, + 0x6d, 0x53, 0x29, 0xe3, 0x1b, 0x8e, 0x57, 0xad, 0xfa, 0x29, 0x1b, + 0x07, 0x1a, 0xee, 0x34, 0xe6, 0x57, 0x5a, 0xeb, 0xf2, 0x1c}}; + (void)ed8SigningKey; + auto const prefix7Prefix = "P7"s; + auto const prefix7Msg = "P6P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix7MaxMsgLength = 30; + auto const prefix6Prefix = "P6"s; + auto const prefix6Msg = "P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6MaxMsgLength = 28; + auto const prefix5Prefix = "P5"s; + auto const prefix5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix5MaxMsgLength = 26; + auto const ed10Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed10PublicKey{ + {0x7a, 0xdc, 0x65, 0x52, 0x0f, 0xca, 0x06, 0x72, 0x5c, 0xe4, 0x65, + 0x57, 0x82, 0x6d, 0x3f, 0x57, 0x1f, 0xc6, 0xc6, 0xe4, 0x5d, 0xaf, + 0x08, 0xda, 0xe2, 0x07, 0x02, 0xcb, 0x42, 0x3d, 0x2a, 0xd0}}; + std::array const ed10Sig{ + {0xf2, 0x7c, 0x5f, 0x61, 0xec, 0xbc, 0xc2, 0x8c, 0xad, 0xd0, 0xd3, + 0xcb, 0x89, 0xab, 0xac, 0xe4, 0x01, 0x6f, 0x90, 0x60, 0x6f, 0x89, + 0xc0, 0xd9, 0xca, 0x2b, 0x4b, 0xfd, 0x78, 0x80, 0xae, 0xf9, 0xd0, + 0x3f, 0x45, 0x7a, 0xb2, 0x26, 0x0c, 0xee, 0xc5, 0x06, 0x0e, 0x94, + 0x6b, 0xf8, 0xfe, 0x96, 0x4f, 0x0d, 0xa0, 0x2c, 0x66, 0x78, 0xa5, + 0x60, 0xfe, 0x47, 0x1e, 0xa9, 0x88, 0x76, 0x55, 0x03}}; + std::array const ed10SigningKey{ + {0x84, 0x04, 0xdd, 0x34, 0x6a, 0x4d, 0x40, 0xef, 0x70, 0xf7, 0xef, + 0x7f, 0x25, 0xf4, 0xd0, 0xa0, 0xa8, 0xad, 0xc1, 0x51, 0x1c, 0x16, + 0x57, 0x9d, 0x5e, 0xd9, 0xa6, 0x45, 0xda, 0xff, 0x5e, 0x1e}}; + (void)ed10SigningKey; + auto const thresh9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim11CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim11Cond{Type::preimageSha256, + 9, + Preim11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa12CondConditionFingerprint = { + {0x38, 0xb9, 0xf0, 0xeb, 0x68, 0x8b, 0x9f, 0x55, 0x37, 0x9a, 0xec, + 0x07, 0xd4, 0xa2, 0x13, 0xac, 0x34, 0xa1, 0x67, 0x31, 0x34, 0xea, + 0xc2, 0x2f, 0xef, 0x13, 0xe3, 0x5c, 0xcf, 0x8f, 0x90, 0x1e}}; + Condition const Rsa12Cond{Type::rsaSha256, + 65536, + Rsa12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed13CondConditionFingerprint = { + {0x7c, 0x54, 0x6a, 0x6d, 0x7f, 0x00, 0x52, 0x31, 0x03, 0xe7, 0xb4, + 0x5b, 0x1c, 0x9f, 0x72, 0xeb, 0x3c, 0x18, 0x08, 0xa3, 0x24, 0xb2, + 0x63, 0x5f, 0x77, 0x55, 0x4a, 0x42, 0xdb, 0x1e, 0xff, 0x1e}}; + Condition const Ed13Cond{Type::ed25519Sha256, + 131072, + Ed13CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim14CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim14Cond{Type::preimageSha256, + 9, + Preim14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa15CondConditionFingerprint = { + {0x55, 0x6b, 0x6d, 0xe3, 0x00, 0xd4, 0xf3, 0x7e, 0x75, 0x3a, 0x68, + 0xfc, 0x25, 0xdf, 0xf2, 0xf7, 0x18, 0x54, 0xa5, 0x55, 0x0c, 0xa5, + 0xa9, 0x65, 0xbf, 0x66, 0x9e, 0x4e, 0x49, 0x56, 0x1e, 0xf1}}; + Condition const Rsa15Cond{Type::rsaSha256, + 65536, + Rsa15CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed16CondConditionFingerprint = { + {0xe4, 0x66, 0x69, 0x86, 0x87, 0x57, 0x0e, 0xac, 0xf1, 0xfd, 0x06, + 0x81, 0x48, 0x90, 0x82, 0x42, 0x48, 0x50, 0x75, 0x8e, 0xd4, 0x2d, + 0xf3, 0x02, 0x37, 0x89, 0x28, 0xc5, 0x68, 0xd7, 0xa0, 0x11}}; + Condition const Ed16Cond{Type::ed25519Sha256, + 131072, + Ed16CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + auto prefix3 = std::make_unique( + makeSlice(prefix3Prefix), prefix3MaxMsgLength, std::move(ed4)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(prefix3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto ed8 = std::make_unique(ed8PublicKey, ed8Sig); + auto prefix7 = std::make_unique( + makeSlice(prefix7Prefix), prefix7MaxMsgLength, std::move(ed8)); + auto prefix6 = std::make_unique( + makeSlice(prefix6Prefix), prefix6MaxMsgLength, std::move(prefix7)); + auto prefix5 = std::make_unique( + makeSlice(prefix5Prefix), prefix5MaxMsgLength, std::move(prefix6)); + auto ed10 = std::make_unique(ed10PublicKey, ed10Sig); + std::vector> thresh9Subfulfillments; + thresh9Subfulfillments.emplace_back(std::move(ed10)); + std::vector thresh9Subconditions{ + {Preim11Cond, Rsa12Cond, Ed13Cond}}; + auto thresh9 = std::make_unique( + std::move(thresh9Subfulfillments), std::move(thresh9Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix5)); + thresh0Subfulfillments.emplace_back(std::move(thresh9)); + std::vector thresh0Subconditions{ + {Preim14Cond, Rsa15Cond, Ed16Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x02\x75\xa0\x82\x01\xf6\xa1\x81\x85\x80\x02\x50\x31" + "\x81\x01\x1a\xa2\x7c\xa1\x7a\x80\x02\x50\x32\x81\x01\x1c\xa2" + "\x71\xa1\x6f\x80\x02\x50\x33\x81\x01\x1e\xa2\x66\xa4\x64\x80" + "\x20\x26\x80\x85\x71\x79\x37\x27\xbd\x85\xaf\x22\x49\x59\x42" + "\x99\x5c\x9c\x5b\x9f\x99\x54\xb6\xd4\xd1\x81\x94\x4c\x22\x53" + "\x03\xc0\xec\x81\x40\xd9\xe8\x4c\x1d\x34\x07\x8a\x36\x1e\x02" + "\x10\xfe\xf5\x1c\x7b\xb4\x79\x07\xbd\xf1\x91\x03\xe5\xd5\x35" + "\xe6\xa3\x44\x22\x86\xe4\xbb\x11\xbc\x29\x77\xba\x15\xe1\x72" + "\x33\x59\xa7\x3d\x12\x45\xd2\xa0\xde\xff\x54\x32\xa2\x1a\x8a" + "\x59\x08\xf6\x90\x9b\x63\x2c\xb8\x02\xa1\x81\x85\x80\x02\x50" + "\x35\x81\x01\x1a\xa2\x7c\xa1\x7a\x80\x02\x50\x36\x81\x01\x1c" + "\xa2\x71\xa1\x6f\x80\x02\x50\x37\x81\x01\x1e\xa2\x66\xa4\x64" + "\x80\x20\xb6\x55\xc8\xa4\x14\x20\x73\x44\x12\x06\xf6\xf7\xd0" + "\x03\x74\x53\xaa\x74\x6c\xf1\x84\x0e\x86\x1d\xb1\x97\x1a\x04" + "\x91\x83\x3b\x49\x81\x40\x62\x59\xf5\xf7\x5c\xb2\x66\x50\xe8" + "\x12\x9e\x66\xff\x44\xfa\xf7\x23\x7f\x6d\xef\x6e\x58\x53\x30" + "\x1f\xd8\x21\x97\xef\x05\x1e\x1d\x12\x32\x04\x7b\xdc\x47\x9b" + "\x73\xdb\xb7\x5a\x17\xfe\x69\x5e\x90\x24\x21\x20\x19\xb0\x0f" + "\xfa\x79\x4e\xf5\x9f\xc2\x37\xf0\x3a\x01\xa2\x81\xe3\xa0\x66" + "\xa4\x64\x80\x20\x7a\xdc\x65\x52\x0f\xca\x06\x72\x5c\xe4\x65" + "\x57\x82\x6d\x3f\x57\x1f\xc6\xc6\xe4\x5d\xaf\x08\xda\xe2\x07" + "\x02\xcb\x42\x3d\x2a\xd0\x81\x40\xf2\x7c\x5f\x61\xec\xbc\xc2" + "\x8c\xad\xd0\xd3\xcb\x89\xab\xac\xe4\x01\x6f\x90\x60\x6f\x89" + "\xc0\xd9\xca\x2b\x4b\xfd\x78\x80\xae\xf9\xd0\x3f\x45\x7a\xb2" + "\x26\x0c\xee\xc5\x06\x0e\x94\x6b\xf8\xfe\x96\x4f\x0d\xa0\x2c" + "\x66\x78\xa5\x60\xfe\x47\x1e\xa9\x88\x76\x55\x03\xa1\x79\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x38\xb9\xf0" + "\xeb\x68\x8b\x9f\x55\x37\x9a\xec\x07\xd4\xa2\x13\xac\x34\xa1" + "\x67\x31\x34\xea\xc2\x2f\xef\x13\xe3\x5c\xcf\x8f\x90\x1e\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x7c\x54\x6a\x6d\x7f\x00\x52" + "\x31\x03\xe7\xb4\x5b\x1c\x9f\x72\xeb\x3c\x18\x08\xa3\x24\xb2" + "\x63\x5f\x77\x55\x4a\x42\xdb\x1e\xff\x1e\x81\x03\x02\x00\x00" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\x55\x6b\x6d\xe3\x00\xd4\xf3\x7e\x75\x3a\x68\xfc\x25\xdf\xf2" + "\xf7\x18\x54\xa5\x55\x0c\xa5\xa9\x65\xbf\x66\x9e\x4e\x49\x56" + "\x1e\xf1\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xe4\x66\x69\x86" + "\x87\x57\x0e\xac\xf1\xfd\x06\x81\x48\x90\x82\x42\x48\x50\x75" + "\x8e\xd4\x2d\xf3\x02\x37\x89\x28\xc5\x68\xd7\xa0\x11\x81\x03" + "\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xc5\x04\x2c\x62\xef\x25\xb5\x51\xc4\xa4\xb4" + "\xfe\xc3\xe0\xd3\x2c\x6d\xa6\x5c\xb0\x46\xd8\xb1\x55\xa0\x86" + "\x8b\x60\x89\x23\xbf\xa2\x81\x03\x06\x40\xb4\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x57\x7e\xc2\x60\xa9\xc6" + "\xeb\xeb\xa8\xfa\xa9\x11\xda\x66\xdb\xd5\x9a\xbc\xe6\xd5\xb9" + "\xc2\xa2\x38\x9d\x31\xab\x66\x05\xef\xa6\x1f\x81\x03\x02\x0c" + "\x5a\x82\x02\x03\x08\xa1\x2b\x80\x20\xdc\x9d\x0f\xc2\xda\x21" + "\x67\x5e\x2d\xe9\xc8\xfe\x78\xc2\x4e\xe8\x98\x90\xa8\x91\x75" + "\x87\xc1\x5d\x75\x6a\x92\xe3\x2b\xbb\x4e\x2e\x81\x03\x02\x0c" + "\x5a\x82\x02\x03\x08\xa2\x2b\x80\x20\x23\x02\xc8\x59\x96\xc5" + "\xf2\x78\xa2\x3f\x1a\x61\x8f\x7b\x14\xaa\x3e\x23\x20\xdf\xad" + "\x5b\x91\x32\x97\xb2\xfc\xe5\x48\x5f\x2b\xdc\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x55\x6b\x6d\xe3\x00\xd4" + "\xf3\x7e\x75\x3a\x68\xfc\x25\xdf\xf2\xf7\x18\x54\xa5\x55\x0c" + "\xa5\xa9\x65\xbf\x66\x9e\x4e\x49\x56\x1e\xf1\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe4\x66\x69\x86\x87\x57\x0e\xac\xf1\xfd" + "\x06\x81\x48\x90\x82\x42\x48\x50\x75\x8e\xd4\x2d\xf3\x02\x37" + "\x89\x28\xc5\x68\xd7\xa0\x11\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh55() + { + testcase("Thresh55"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim8Cond + // ** Rsa9Cond + // ** Ed10Cond + // ** Prefix11Cond + // ** Thresh15Cond + // ** prefix1 + // *** prefix2 + // **** prefix3 + // ***** ed4 + // ** preim5 + // ** rsa6 + // ** ed7 + + auto const ed4Msg = "P3P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0xd9, 0xe8, 0x4c, 0x1d, 0x34, 0x07, 0x8a, 0x36, 0x1e, 0x02, 0x10, + 0xfe, 0xf5, 0x1c, 0x7b, 0xb4, 0x79, 0x07, 0xbd, 0xf1, 0x91, 0x03, + 0xe5, 0xd5, 0x35, 0xe6, 0xa3, 0x44, 0x22, 0x86, 0xe4, 0xbb, 0x11, + 0xbc, 0x29, 0x77, 0xba, 0x15, 0xe1, 0x72, 0x33, 0x59, 0xa7, 0x3d, + 0x12, 0x45, 0xd2, 0xa0, 0xde, 0xff, 0x54, 0x32, 0xa2, 0x1a, 0x8a, + 0x59, 0x08, 0xf6, 0x90, 0x9b, 0x63, 0x2c, 0xb8, 0x02}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const prefix3Prefix = "P3"s; + auto const prefix3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3MaxMsgLength = 30; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim5Preimage = "I am root"s; + auto const preim5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 0x40, 0xe4, 0x52, 0x30, + 0x42, 0x74, 0xfd, 0x35, 0x04, 0xde, 0x45, 0x68, 0xb3, 0x22, 0xdd, + 0xff, 0x41, 0x43, 0x69, 0x33, 0xc0, 0xff, 0x35, 0xb6, 0x6d, 0x15, + 0xe9, 0x54, 0x15, 0xeb, 0x1d, 0x07, 0xe2, 0x25, 0x2b, 0xdb, 0xaa, + 0x16, 0x8d, 0x0d, 0x7f, 0x05, 0xf0, 0xd2, 0x7d, 0xb4, 0x9b, 0x51, + 0x19, 0x20, 0x1e, 0x3d, 0xba, 0x50, 0x9e, 0x51, 0x13, 0x81, 0x43, + 0x55, 0x96, 0xca, 0xdb, 0x88, 0x1f, 0xef, 0x2d, 0x38, 0x3f, 0xae, + 0x8d, 0xac, 0xc8, 0x6f, 0x2b, 0xd5, 0xf0, 0x34, 0x1a, 0x99, 0x00, + 0x7c, 0x6d, 0xb3, 0x1b, 0x1d, 0x68, 0xdb, 0xf8, 0x1c, 0x59, 0x3a, + 0x63, 0x38, 0x7c, 0x1c, 0x14, 0xbc, 0x22, 0xcf, 0xc8, 0x9a, 0xc6, + 0x96, 0x6f, 0x3d, 0x03, 0x0b, 0x61, 0x6b, 0x7d, 0x75, 0x97, 0xe8, + 0x25, 0xb8, 0x2f, 0xfa, 0xf4, 0x07, 0x44, 0xdf, 0x00, 0x3d, 0xff, + 0x0d, 0xd5, 0x7f, 0x7f, 0xf3, 0x0c, 0x13, 0xac, 0x8d, 0xf8, 0x8c, + 0x79, 0xc5, 0xf3, 0x29, 0xdc, 0x23, 0x65, 0xd3, 0xd1, 0x1c, 0xa6, + 0x14, 0x78, 0x6a, 0x1a, 0xe3, 0x15, 0x8d, 0x8b, 0xdc, 0xa0, 0x5a, + 0xc7, 0x82, 0xb0, 0x03, 0x6c, 0x71, 0x43, 0x59, 0x24, 0xc7, 0x50, + 0x64, 0xb2, 0xa7, 0x69, 0xf5, 0xbd, 0xe6, 0x5e, 0xaa, 0x77, 0x59, + 0x60, 0x36, 0xc0, 0xe3, 0x42, 0x7f, 0x05, 0x3b, 0x4c, 0x02, 0x0e, + 0x70, 0x5a, 0x70, 0xc5, 0x2a, 0xeb, 0x94, 0x4d, 0x15, 0x09, 0xef, + 0xbb, 0x58, 0x42, 0x68, 0x05, 0x59, 0x70, 0xa0, 0x17, 0xb2, 0x8e, + 0xdf, 0x7b, 0x40, 0x5d, 0x21, 0x1e, 0xfe, 0x62, 0x58, 0xde, 0xfb, + 0x14, 0x91, 0x18, 0xf3, 0x4f, 0x9b, 0x36, 0x55, 0xcf, 0xb3, 0x5e, + 0xec, 0x4f, 0xcc, 0x6d, 0x13, 0x58, 0xc8, 0xa3, 0xa3, 0xee, 0x23, + 0x8a, 0xc2, 0xbf}}; + std::array const rsa6Sig{ + {0x88, 0x83, 0xd3, 0xef, 0x09, 0x87, 0x6b, 0xf3, 0x13, 0xf5, 0x03, + 0xd1, 0x55, 0x3c, 0x3d, 0xeb, 0x71, 0x42, 0x4e, 0xa4, 0x75, 0x40, + 0x34, 0xe5, 0xe7, 0x74, 0x07, 0xd6, 0x37, 0xe0, 0x86, 0x76, 0xf8, + 0x41, 0x8c, 0x3c, 0x43, 0x40, 0x87, 0xd2, 0x4e, 0xa8, 0xb1, 0x3a, + 0xe8, 0xd3, 0xc5, 0xab, 0x56, 0x64, 0x6d, 0x2f, 0xa5, 0xd8, 0x4e, + 0x4f, 0x5a, 0x43, 0x73, 0x17, 0x13, 0x41, 0x7e, 0xd4, 0x4f, 0x48, + 0x24, 0x14, 0x99, 0x66, 0x6c, 0x18, 0x45, 0xe6, 0x78, 0x9d, 0xad, + 0x6c, 0x45, 0x60, 0x87, 0x7f, 0xd4, 0x20, 0xdd, 0xfb, 0x7a, 0x14, + 0x1c, 0xbc, 0x44, 0x62, 0x28, 0x93, 0x3c, 0x7f, 0x95, 0x0f, 0xec, + 0x51, 0x03, 0xdd, 0xd9, 0x61, 0x88, 0xdc, 0x94, 0x4f, 0xff, 0x20, + 0x19, 0xb3, 0xf7, 0x6a, 0xb3, 0x90, 0xd5, 0xb3, 0x63, 0xcb, 0xe0, + 0xd4, 0x32, 0x44, 0x2b, 0x36, 0x54, 0xd4, 0x67, 0x17, 0xb6, 0xe3, + 0x0f, 0x08, 0xbb, 0x82, 0xd2, 0x62, 0x89, 0x46, 0x25, 0x74, 0xcf, + 0x91, 0xce, 0x39, 0xc1, 0xb7, 0xee, 0xbe, 0xa6, 0x7a, 0xfc, 0xf1, + 0x50, 0x71, 0x25, 0x0a, 0x64, 0x36, 0xc4, 0x61, 0x63, 0xc1, 0x62, + 0x0a, 0x87, 0x12, 0x9b, 0xa1, 0x6b, 0x44, 0x7d, 0x57, 0xab, 0x79, + 0x5b, 0xfc, 0xc4, 0x5d, 0xaa, 0xc9, 0xeb, 0x6c, 0xb8, 0xe3, 0xe5, + 0x0e, 0x48, 0xac, 0x95, 0x81, 0x89, 0xae, 0x6a, 0xd2, 0xcc, 0xb7, + 0x8b, 0x3d, 0x96, 0xc8, 0x02, 0x3d, 0x32, 0x64, 0x8b, 0x53, 0xc2, + 0x92, 0x6e, 0x8b, 0xb6, 0xd2, 0x68, 0x94, 0xff, 0x86, 0x2f, 0xa3, + 0xec, 0xdc, 0x7c, 0x4f, 0xff, 0xb8, 0x52, 0xef, 0xa0, 0xe6, 0x8d, + 0xdc, 0x80, 0xd7, 0x7a, 0x48, 0xd4, 0x87, 0xf6, 0x89, 0x7f, 0xca, + 0x36, 0xe5, 0xfd, 0xf4, 0x0d, 0x50, 0x3b, 0x47, 0x6a, 0x92, 0xe1, + 0x39, 0x42, 0x5c}}; + auto const ed7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed7PublicKey{ + {0x58, 0xcf, 0x4b, 0xc5, 0x59, 0xdb, 0xba, 0x62, 0x25, 0x14, 0x3a, + 0xc0, 0xad, 0xab, 0x5e, 0x35, 0xa1, 0xb4, 0x0e, 0xc1, 0xaf, 0x3c, + 0xa8, 0x2f, 0x69, 0x2c, 0xb6, 0x25, 0xd7, 0xea, 0x15, 0xb3}}; + std::array const ed7Sig{ + {0xd0, 0xd1, 0x17, 0xe2, 0xb5, 0x40, 0x14, 0x81, 0x0b, 0x12, 0xd8, + 0xbe, 0x1d, 0x1c, 0xb0, 0x88, 0x27, 0xaf, 0x6e, 0xc3, 0x13, 0x71, + 0xea, 0xac, 0xf3, 0xd8, 0x6f, 0x38, 0x21, 0xe2, 0x6d, 0x77, 0xe9, + 0xa6, 0xba, 0x03, 0x2a, 0xe3, 0x50, 0xcb, 0x38, 0xbe, 0x36, 0xba, + 0x62, 0x6e, 0x37, 0x5c, 0x8d, 0x69, 0x9f, 0xf0, 0x43, 0x64, 0x83, + 0x82, 0x8e, 0xbe, 0xf5, 0xa6, 0x96, 0x35, 0xb7, 0x03}}; + std::array const ed7SigningKey{ + {0x9c, 0x02, 0x4b, 0x5e, 0x6a, 0x83, 0x35, 0x8a, 0x2a, 0x71, 0x70, + 0x4e, 0xab, 0x74, 0x72, 0x22, 0x33, 0x5a, 0x82, 0xd9, 0x8e, 0x9c, + 0x8c, 0x41, 0x62, 0x6b, 0x02, 0x62, 0xbd, 0x59, 0x31, 0xcb}}; + (void)ed7SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix11CondConditionFingerprint = { + {0xf6, 0x1b, 0xbd, 0xcb, 0x66, 0x3f, 0x84, 0x93, 0xdd, 0x29, 0x2c, + 0xac, 0x93, 0x9c, 0x32, 0xf2, 0x35, 0x70, 0x5b, 0xef, 0xb9, 0x8d, + 0x76, 0x80, 0x5d, 0xee, 0x6a, 0x2b, 0x27, 0xcc, 0xb2, 0x60}}; + Condition const Prefix11Cond{Type::prefixSha256, + 134207, + Prefix11CondConditionFingerprint, + std::bitset<5>{16}}; + std::array const Thresh15CondConditionFingerprint = { + {0xeb, 0xa9, 0xc8, 0x49, 0x6e, 0xb4, 0x22, 0x72, 0xf9, 0x7d, 0x6c, + 0x8b, 0xcd, 0xf0, 0x8b, 0x8f, 0x5b, 0x37, 0xbf, 0x0d, 0x21, 0x58, + 0x26, 0xee, 0xc0, 0x21, 0x6d, 0xb7, 0xe8, 0xda, 0xd8, 0xbb}}; + Condition const Thresh15Cond{Type::thresholdSha256, + 135168, + Thresh15CondConditionFingerprint, + std::bitset<5>{25}}; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + auto prefix3 = std::make_unique( + makeSlice(prefix3Prefix), prefix3MaxMsgLength, std::move(ed4)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(prefix3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim5 = + std::make_unique(makeSlice(preim5Preimage)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + auto ed7 = std::make_unique(ed7PublicKey, ed7Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim5)); + thresh0Subfulfillments.emplace_back(std::move(rsa6)); + thresh0Subfulfillments.emplace_back(std::move(ed7)); + std::vector thresh0Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Prefix11Cond, Thresh15Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\xe1\xa0\x82\x03\x07\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x81\x85\x80\x02\x50\x31\x81\x01" + "\x1a\xa2\x7c\xa1\x7a\x80\x02\x50\x32\x81\x01\x1c\xa2\x71\xa1" + "\x6f\x80\x02\x50\x33\x81\x01\x1e\xa2\x66\xa4\x64\x80\x20\x26" + "\x80\x85\x71\x79\x37\x27\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c" + "\x9c\x5b\x9f\x99\x54\xb6\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0" + "\xec\x81\x40\xd9\xe8\x4c\x1d\x34\x07\x8a\x36\x1e\x02\x10\xfe" + "\xf5\x1c\x7b\xb4\x79\x07\xbd\xf1\x91\x03\xe5\xd5\x35\xe6\xa3" + "\x44\x22\x86\xe4\xbb\x11\xbc\x29\x77\xba\x15\xe1\x72\x33\x59" + "\xa7\x3d\x12\x45\xd2\xa0\xde\xff\x54\x32\xa2\x1a\x8a\x59\x08" + "\xf6\x90\x9b\x63\x2c\xb8\x02\xa3\x82\x02\x08\x80\x82\x01\x00" + "\xd0\x07\xfc\x9d\xb0\xa1\xa6\x40\xe4\x52\x30\x42\x74\xfd\x35" + "\x04\xde\x45\x68\xb3\x22\xdd\xff\x41\x43\x69\x33\xc0\xff\x35" + "\xb6\x6d\x15\xe9\x54\x15\xeb\x1d\x07\xe2\x25\x2b\xdb\xaa\x16" + "\x8d\x0d\x7f\x05\xf0\xd2\x7d\xb4\x9b\x51\x19\x20\x1e\x3d\xba" + "\x50\x9e\x51\x13\x81\x43\x55\x96\xca\xdb\x88\x1f\xef\x2d\x38" + "\x3f\xae\x8d\xac\xc8\x6f\x2b\xd5\xf0\x34\x1a\x99\x00\x7c\x6d" + "\xb3\x1b\x1d\x68\xdb\xf8\x1c\x59\x3a\x63\x38\x7c\x1c\x14\xbc" + "\x22\xcf\xc8\x9a\xc6\x96\x6f\x3d\x03\x0b\x61\x6b\x7d\x75\x97" + "\xe8\x25\xb8\x2f\xfa\xf4\x07\x44\xdf\x00\x3d\xff\x0d\xd5\x7f" + "\x7f\xf3\x0c\x13\xac\x8d\xf8\x8c\x79\xc5\xf3\x29\xdc\x23\x65" + "\xd3\xd1\x1c\xa6\x14\x78\x6a\x1a\xe3\x15\x8d\x8b\xdc\xa0\x5a" + "\xc7\x82\xb0\x03\x6c\x71\x43\x59\x24\xc7\x50\x64\xb2\xa7\x69" + "\xf5\xbd\xe6\x5e\xaa\x77\x59\x60\x36\xc0\xe3\x42\x7f\x05\x3b" + "\x4c\x02\x0e\x70\x5a\x70\xc5\x2a\xeb\x94\x4d\x15\x09\xef\xbb" + "\x58\x42\x68\x05\x59\x70\xa0\x17\xb2\x8e\xdf\x7b\x40\x5d\x21" + "\x1e\xfe\x62\x58\xde\xfb\x14\x91\x18\xf3\x4f\x9b\x36\x55\xcf" + "\xb3\x5e\xec\x4f\xcc\x6d\x13\x58\xc8\xa3\xa3\xee\x23\x8a\xc2" + "\xbf\x81\x82\x01\x00\x88\x83\xd3\xef\x09\x87\x6b\xf3\x13\xf5" + "\x03\xd1\x55\x3c\x3d\xeb\x71\x42\x4e\xa4\x75\x40\x34\xe5\xe7" + "\x74\x07\xd6\x37\xe0\x86\x76\xf8\x41\x8c\x3c\x43\x40\x87\xd2" + "\x4e\xa8\xb1\x3a\xe8\xd3\xc5\xab\x56\x64\x6d\x2f\xa5\xd8\x4e" + "\x4f\x5a\x43\x73\x17\x13\x41\x7e\xd4\x4f\x48\x24\x14\x99\x66" + "\x6c\x18\x45\xe6\x78\x9d\xad\x6c\x45\x60\x87\x7f\xd4\x20\xdd" + "\xfb\x7a\x14\x1c\xbc\x44\x62\x28\x93\x3c\x7f\x95\x0f\xec\x51" + "\x03\xdd\xd9\x61\x88\xdc\x94\x4f\xff\x20\x19\xb3\xf7\x6a\xb3" + "\x90\xd5\xb3\x63\xcb\xe0\xd4\x32\x44\x2b\x36\x54\xd4\x67\x17" + "\xb6\xe3\x0f\x08\xbb\x82\xd2\x62\x89\x46\x25\x74\xcf\x91\xce" + "\x39\xc1\xb7\xee\xbe\xa6\x7a\xfc\xf1\x50\x71\x25\x0a\x64\x36" + "\xc4\x61\x63\xc1\x62\x0a\x87\x12\x9b\xa1\x6b\x44\x7d\x57\xab" + "\x79\x5b\xfc\xc4\x5d\xaa\xc9\xeb\x6c\xb8\xe3\xe5\x0e\x48\xac" + "\x95\x81\x89\xae\x6a\xd2\xcc\xb7\x8b\x3d\x96\xc8\x02\x3d\x32" + "\x64\x8b\x53\xc2\x92\x6e\x8b\xb6\xd2\x68\x94\xff\x86\x2f\xa3" + "\xec\xdc\x7c\x4f\xff\xb8\x52\xef\xa0\xe6\x8d\xdc\x80\xd7\x7a" + "\x48\xd4\x87\xf6\x89\x7f\xca\x36\xe5\xfd\xf4\x0d\x50\x3b\x47" + "\x6a\x92\xe1\x39\x42\x5c\xa4\x64\x80\x20\x58\xcf\x4b\xc5\x59" + "\xdb\xba\x62\x25\x14\x3a\xc0\xad\xab\x5e\x35\xa1\xb4\x0e\xc1" + "\xaf\x3c\xa8\x2f\x69\x2c\xb6\x25\xd7\xea\x15\xb3\x81\x40\xd0" + "\xd1\x17\xe2\xb5\x40\x14\x81\x0b\x12\xd8\xbe\x1d\x1c\xb0\x88" + "\x27\xaf\x6e\xc3\x13\x71\xea\xac\xf3\xd8\x6f\x38\x21\xe2\x6d" + "\x77\xe9\xa6\xba\x03\x2a\xe3\x50\xcb\x38\xbe\x36\xba\x62\x6e" + "\x37\x5c\x8d\x69\x9f\xf0\x43\x64\x83\x82\x8e\xbe\xf5\xa6\x96" + "\x35\xb7\x03\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa1\x2b\x80\x20\xf6\x1b\xbd\xcb\x66\x3f\x84\x93\xdd\x29\x2c" + "\xac\x93\x9c\x32\xf2\x35\x70\x5b\xef\xb9\x8d\x76\x80\x5d\xee" + "\x6a\x2b\x27\xcc\xb2\x60\x81\x03\x02\x0c\x3f\x82\x02\x03\x08" + "\xa2\x2b\x80\x20\xeb\xa9\xc8\x49\x6e\xb4\x22\x72\xf9\x7d\x6c" + "\x8b\xcd\xf0\x8b\x8f\x5b\x37\xbf\x0d\x21\x58\x26\xee\xc0\x21" + "\x6d\xb7\xe8\xda\xd8\xbb\x81\x03\x02\x10\x00\x82\x02\x03\x98" + "\xa3\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1" + "\x88\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7" + "\xcb\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\x00\x8b\xe6\x62\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3" + "\x16\xda\x09\xbe\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87" + "\x62\xfa\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x8d\x45\xe4\x1d\x4d\xc9\x1b\xfc\xfe\x09\x68" + "\xe0\x3a\xfd\x0b\x80\x64\xd2\x23\xf6\xde\xb1\xaf\xcc\x04\x54" + "\x84\x47\x40\x96\xf9\x1b\x81\x03\x08\x4c\x99\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\xdc\x9d\x0f\xc2\xda\x21\x67\x5e\x2d\xe9\xc8\xfe" + "\x78\xc2\x4e\xe8\x98\x90\xa8\x91\x75\x87\xc1\x5d\x75\x6a\x92" + "\xe3\x2b\xbb\x4e\x2e\x81\x03\x02\x0c\x5a\x82\x02\x03\x08\xa1" + "\x2b\x80\x20\xf6\x1b\xbd\xcb\x66\x3f\x84\x93\xdd\x29\x2c\xac" + "\x93\x9c\x32\xf2\x35\x70\x5b\xef\xb9\x8d\x76\x80\x5d\xee\x6a" + "\x2b\x27\xcc\xb2\x60\x81\x03\x02\x0c\x3f\x82\x02\x03\x08\xa2" + "\x2b\x80\x20\xeb\xa9\xc8\x49\x6e\xb4\x22\x72\xf9\x7d\x6c\x8b" + "\xcd\xf0\x8b\x8f\x5b\x37\xbf\x0d\x21\x58\x26\xee\xc0\x21\x6d" + "\xb7\xe8\xda\xd8\xbb\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88" + "\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb" + "\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xee" + "\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c" + "\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2" + "\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4" + "\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79" + "\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d" + "\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0" + "\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh56() + { + testcase("Thresh56"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim19Cond + // ** Rsa20Cond + // ** Ed21Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** ed4 + // ** prefix5 + // *** prefix6 + // **** thresh7 + // ***** ed8 + // ** thresh9 + // *** Preim16Cond + // *** Rsa17Cond + // *** Ed18Cond + // *** ed10 + // *** thresh11 + // **** Preim13Cond + // **** Rsa14Cond + // **** Ed15Cond + // **** ed12 + + auto const ed4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x23, 0x8b, 0xb2, 0xc9, 0xde, 0xad, 0x1b, 0xb6, 0xce, 0x93, 0x9a, + 0x00, 0x47, 0x3d, 0x42, 0xc1, 0x30, 0x19, 0x95, 0x03, 0x55, 0x19, + 0x74, 0x85, 0xe9, 0xed, 0x92, 0xef, 0x22, 0xbd, 0x49, 0xe5, 0x44, + 0xa0, 0x7a, 0x41, 0x7d, 0xa7, 0xb0, 0x3a, 0x90, 0x1b, 0xa1, 0x2b, + 0xcc, 0x1d, 0x0a, 0x8b, 0x95, 0xc1, 0x3c, 0x05, 0x68, 0x26, 0x39, + 0xad, 0xe4, 0xd4, 0x75, 0xf0, 0xb5, 0x18, 0xbe, 0x01}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const ed8Msg = "P6P5abcdefghijklmnopqrstuvwxyz"s; + std::array const ed8PublicKey{ + {0xb6, 0x55, 0xc8, 0xa4, 0x14, 0x20, 0x73, 0x44, 0x12, 0x06, 0xf6, + 0xf7, 0xd0, 0x03, 0x74, 0x53, 0xaa, 0x74, 0x6c, 0xf1, 0x84, 0x0e, + 0x86, 0x1d, 0xb1, 0x97, 0x1a, 0x04, 0x91, 0x83, 0x3b, 0x49}}; + std::array const ed8Sig{ + {0x7b, 0x8a, 0x4e, 0xef, 0xaf, 0x36, 0xd8, 0x61, 0xd1, 0x03, 0x93, + 0xde, 0xdd, 0x97, 0xbe, 0xdc, 0x36, 0x69, 0xa4, 0x40, 0xda, 0x91, + 0x99, 0x46, 0x5c, 0x9a, 0xa3, 0x24, 0xfb, 0xca, 0xe3, 0xf5, 0x6b, + 0xae, 0x19, 0x79, 0xad, 0x51, 0x13, 0xa5, 0xb8, 0xc7, 0xe4, 0x87, + 0xe0, 0xdd, 0x95, 0x97, 0xab, 0xf5, 0x87, 0xfe, 0x72, 0x78, 0xc1, + 0x3b, 0xd4, 0xd5, 0xec, 0x01, 0x6e, 0x12, 0x2b, 0x01}}; + std::array const ed8SigningKey{ + {0xc2, 0x00, 0xc6, 0x2e, 0x45, 0xde, 0xf2, 0x39, 0x81, 0x0a, 0xf8, + 0x6d, 0x53, 0x29, 0xe3, 0x1b, 0x8e, 0x57, 0xad, 0xfa, 0x29, 0x1b, + 0x07, 0x1a, 0xee, 0x34, 0xe6, 0x57, 0x5a, 0xeb, 0xf2, 0x1c}}; + (void)ed8SigningKey; + auto const thresh7Msg = "P6P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6Prefix = "P6"s; + auto const prefix6Msg = "P5abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6MaxMsgLength = 28; + auto const prefix5Prefix = "P5"s; + auto const prefix5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix5MaxMsgLength = 26; + auto const ed10Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed10PublicKey{ + {0x7a, 0xdc, 0x65, 0x52, 0x0f, 0xca, 0x06, 0x72, 0x5c, 0xe4, 0x65, + 0x57, 0x82, 0x6d, 0x3f, 0x57, 0x1f, 0xc6, 0xc6, 0xe4, 0x5d, 0xaf, + 0x08, 0xda, 0xe2, 0x07, 0x02, 0xcb, 0x42, 0x3d, 0x2a, 0xd0}}; + std::array const ed10Sig{ + {0xf2, 0x7c, 0x5f, 0x61, 0xec, 0xbc, 0xc2, 0x8c, 0xad, 0xd0, 0xd3, + 0xcb, 0x89, 0xab, 0xac, 0xe4, 0x01, 0x6f, 0x90, 0x60, 0x6f, 0x89, + 0xc0, 0xd9, 0xca, 0x2b, 0x4b, 0xfd, 0x78, 0x80, 0xae, 0xf9, 0xd0, + 0x3f, 0x45, 0x7a, 0xb2, 0x26, 0x0c, 0xee, 0xc5, 0x06, 0x0e, 0x94, + 0x6b, 0xf8, 0xfe, 0x96, 0x4f, 0x0d, 0xa0, 0x2c, 0x66, 0x78, 0xa5, + 0x60, 0xfe, 0x47, 0x1e, 0xa9, 0x88, 0x76, 0x55, 0x03}}; + std::array const ed10SigningKey{ + {0x84, 0x04, 0xdd, 0x34, 0x6a, 0x4d, 0x40, 0xef, 0x70, 0xf7, 0xef, + 0x7f, 0x25, 0xf4, 0xd0, 0xa0, 0xa8, 0xad, 0xc1, 0x51, 0x1c, 0x16, + 0x57, 0x9d, 0x5e, 0xd9, 0xa6, 0x45, 0xda, 0xff, 0x5e, 0x1e}}; + (void)ed10SigningKey; + auto const ed12Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed12PublicKey{ + {0x38, 0x9a, 0x02, 0xbc, 0x13, 0xa9, 0x1b, 0x1f, 0x53, 0x89, 0xd0, + 0x09, 0xe8, 0x0c, 0xb1, 0xbc, 0xff, 0x16, 0x8a, 0x3f, 0xc7, 0x62, + 0xa6, 0x44, 0x6c, 0xbc, 0x37, 0x68, 0x9f, 0x74, 0x6c, 0xe0}}; + std::array const ed12Sig{ + {0xab, 0xdf, 0x10, 0x5f, 0x85, 0x43, 0xc2, 0x4a, 0x24, 0x1e, 0x89, + 0xd2, 0x9e, 0xcb, 0x86, 0x2e, 0x4b, 0x9a, 0x2f, 0x9e, 0xe2, 0x49, + 0xf3, 0x3f, 0x1e, 0x9b, 0xf1, 0xbc, 0x95, 0xc4, 0xea, 0xf7, 0xde, + 0x3e, 0x17, 0x48, 0x97, 0xcb, 0x0f, 0xc2, 0x8a, 0xf2, 0xef, 0x4f, + 0xd2, 0x49, 0x3e, 0x2d, 0x99, 0x32, 0x44, 0x1b, 0x2b, 0xa7, 0x9c, + 0x41, 0xf5, 0xc0, 0x6f, 0x23, 0x1b, 0xe6, 0x58, 0x00}}; + std::array const ed12SigningKey{ + {0xf8, 0x58, 0x72, 0x64, 0xb9, 0xfd, 0xec, 0x47, 0x17, 0x2f, 0xce, + 0xba, 0xba, 0x4a, 0xcc, 0xb9, 0xb4, 0x9b, 0xfe, 0x0b, 0xe2, 0xc7, + 0xfc, 0xe1, 0x3f, 0xc7, 0x39, 0x0f, 0x96, 0xdf, 0x3f, 0xfa}}; + (void)ed12SigningKey; + auto const thresh11Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim13CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim13Cond{Type::preimageSha256, + 9, + Preim13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa14CondConditionFingerprint = { + {0x32, 0xec, 0xaa, 0x5e, 0xa6, 0x88, 0xdc, 0xe4, 0x81, 0x0f, 0x93, + 0x0f, 0x65, 0xde, 0x87, 0xfd, 0x54, 0x8c, 0x79, 0x04, 0x81, 0xe3, + 0x63, 0x3f, 0x3d, 0x08, 0xa1, 0xba, 0x0a, 0x24, 0x2b, 0x46}}; + Condition const Rsa14Cond{Type::rsaSha256, + 65536, + Rsa14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed15CondConditionFingerprint = { + {0x40, 0xd1, 0x9a, 0x63, 0x62, 0x9b, 0xc0, 0x76, 0xab, 0x11, 0x73, + 0x42, 0x86, 0xb3, 0x20, 0x9d, 0x23, 0xe8, 0x5e, 0xee, 0xb9, 0x82, + 0x5d, 0x93, 0xe3, 0xac, 0xad, 0xa0, 0x40, 0x41, 0x51, 0x1b}}; + Condition const Ed15Cond{Type::ed25519Sha256, + 131072, + Ed15CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim16CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim16Cond{Type::preimageSha256, + 9, + Preim16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa17CondConditionFingerprint = { + {0x78, 0xe3, 0x04, 0xf4, 0xa6, 0x16, 0x68, 0x4c, 0x1b, 0xcf, 0x3a, + 0x32, 0xff, 0xbc, 0x75, 0x1a, 0xe6, 0x08, 0x9b, 0xff, 0xba, 0x79, + 0xf4, 0x39, 0x7a, 0xfc, 0xe1, 0x6f, 0xff, 0x3e, 0xb3, 0x75}}; + Condition const Rsa17Cond{Type::rsaSha256, + 65536, + Rsa17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed18CondConditionFingerprint = { + {0x0d, 0xea, 0xc5, 0x16, 0x5c, 0x62, 0xb8, 0xd1, 0xa4, 0xe7, 0x5a, + 0x07, 0x58, 0x00, 0x79, 0x51, 0x88, 0x21, 0xe9, 0x4d, 0xba, 0x73, + 0x7b, 0xad, 0x60, 0x9c, 0x5c, 0x26, 0x00, 0x2e, 0xd1, 0x51}}; + Condition const Ed18Cond{Type::ed25519Sha256, + 131072, + Ed18CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + std::vector thresh3Subconditions{}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto ed8 = std::make_unique(ed8PublicKey, ed8Sig); + std::vector> thresh7Subfulfillments; + thresh7Subfulfillments.emplace_back(std::move(ed8)); + std::vector thresh7Subconditions{}; + auto thresh7 = std::make_unique( + std::move(thresh7Subfulfillments), std::move(thresh7Subconditions)); + auto prefix6 = std::make_unique( + makeSlice(prefix6Prefix), prefix6MaxMsgLength, std::move(thresh7)); + auto prefix5 = std::make_unique( + makeSlice(prefix5Prefix), prefix5MaxMsgLength, std::move(prefix6)); + auto ed10 = std::make_unique(ed10PublicKey, ed10Sig); + auto ed12 = std::make_unique(ed12PublicKey, ed12Sig); + std::vector> thresh11Subfulfillments; + thresh11Subfulfillments.emplace_back(std::move(ed12)); + std::vector thresh11Subconditions{ + {Preim13Cond, Rsa14Cond, Ed15Cond}}; + auto thresh11 = std::make_unique( + std::move(thresh11Subfulfillments), + std::move(thresh11Subconditions)); + std::vector> thresh9Subfulfillments; + thresh9Subfulfillments.emplace_back(std::move(ed10)); + thresh9Subfulfillments.emplace_back(std::move(thresh11)); + std::vector thresh9Subconditions{ + {Preim16Cond, Rsa17Cond, Ed18Cond}}; + auto thresh9 = std::make_unique( + std::move(thresh9Subfulfillments), std::move(thresh9Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix5)); + thresh0Subfulfillments.emplace_back(std::move(thresh9)); + std::vector thresh0Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\x54\xa0\x82\x02\xd5\xa1\x81\x80\x80\x02\x50\x31" + "\x81\x01\x1a\xa2\x77\xa1\x75\x80\x02\x50\x32\x81\x01\x1c\xa2" + "\x6c\xa2\x6a\xa0\x66\xa4\x64\x80\x20\x26\x80\x85\x71\x79\x37" + "\x27\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c\x5b\x9f\x99\x54" + "\xb6\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec\x81\x40\x23\x8b" + "\xb2\xc9\xde\xad\x1b\xb6\xce\x93\x9a\x00\x47\x3d\x42\xc1\x30" + "\x19\x95\x03\x55\x19\x74\x85\xe9\xed\x92\xef\x22\xbd\x49\xe5" + "\x44\xa0\x7a\x41\x7d\xa7\xb0\x3a\x90\x1b\xa1\x2b\xcc\x1d\x0a" + "\x8b\x95\xc1\x3c\x05\x68\x26\x39\xad\xe4\xd4\x75\xf0\xb5\x18" + "\xbe\x01\xa1\x00\xa1\x81\x80\x80\x02\x50\x35\x81\x01\x1a\xa2" + "\x77\xa1\x75\x80\x02\x50\x36\x81\x01\x1c\xa2\x6c\xa2\x6a\xa0" + "\x66\xa4\x64\x80\x20\xb6\x55\xc8\xa4\x14\x20\x73\x44\x12\x06" + "\xf6\xf7\xd0\x03\x74\x53\xaa\x74\x6c\xf1\x84\x0e\x86\x1d\xb1" + "\x97\x1a\x04\x91\x83\x3b\x49\x81\x40\x7b\x8a\x4e\xef\xaf\x36" + "\xd8\x61\xd1\x03\x93\xde\xdd\x97\xbe\xdc\x36\x69\xa4\x40\xda" + "\x91\x99\x46\x5c\x9a\xa3\x24\xfb\xca\xe3\xf5\x6b\xae\x19\x79" + "\xad\x51\x13\xa5\xb8\xc7\xe4\x87\xe0\xdd\x95\x97\xab\xf5\x87" + "\xfe\x72\x78\xc1\x3b\xd4\xd5\xec\x01\x6e\x12\x2b\x01\xa1\x00" + "\xa2\x82\x01\xcb\xa0\x82\x01\x4c\xa2\x81\xe3\xa0\x66\xa4\x64" + "\x80\x20\x38\x9a\x02\xbc\x13\xa9\x1b\x1f\x53\x89\xd0\x09\xe8" + "\x0c\xb1\xbc\xff\x16\x8a\x3f\xc7\x62\xa6\x44\x6c\xbc\x37\x68" + "\x9f\x74\x6c\xe0\x81\x40\xab\xdf\x10\x5f\x85\x43\xc2\x4a\x24" + "\x1e\x89\xd2\x9e\xcb\x86\x2e\x4b\x9a\x2f\x9e\xe2\x49\xf3\x3f" + "\x1e\x9b\xf1\xbc\x95\xc4\xea\xf7\xde\x3e\x17\x48\x97\xcb\x0f" + "\xc2\x8a\xf2\xef\x4f\xd2\x49\x3e\x2d\x99\x32\x44\x1b\x2b\xa7" + "\x9c\x41\xf5\xc0\x6f\x23\x1b\xe6\x58\x00\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x32\xec\xaa\x5e\xa6" + "\x88\xdc\xe4\x81\x0f\x93\x0f\x65\xde\x87\xfd\x54\x8c\x79\x04" + "\x81\xe3\x63\x3f\x3d\x08\xa1\xba\x0a\x24\x2b\x46\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\x40\xd1\x9a\x63\x62\x9b\xc0\x76\xab" + "\x11\x73\x42\x86\xb3\x20\x9d\x23\xe8\x5e\xee\xb9\x82\x5d\x93" + "\xe3\xac\xad\xa0\x40\x41\x51\x1b\x81\x03\x02\x00\x00\xa4\x64" + "\x80\x20\x7a\xdc\x65\x52\x0f\xca\x06\x72\x5c\xe4\x65\x57\x82" + "\x6d\x3f\x57\x1f\xc6\xc6\xe4\x5d\xaf\x08\xda\xe2\x07\x02\xcb" + "\x42\x3d\x2a\xd0\x81\x40\xf2\x7c\x5f\x61\xec\xbc\xc2\x8c\xad" + "\xd0\xd3\xcb\x89\xab\xac\xe4\x01\x6f\x90\x60\x6f\x89\xc0\xd9" + "\xca\x2b\x4b\xfd\x78\x80\xae\xf9\xd0\x3f\x45\x7a\xb2\x26\x0c" + "\xee\xc5\x06\x0e\x94\x6b\xf8\xfe\x96\x4f\x0d\xa0\x2c\x66\x78" + "\xa5\x60\xfe\x47\x1e\xa9\x88\x76\x55\x03\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x78\xe3\x04\xf4\xa6" + "\x16\x68\x4c\x1b\xcf\x3a\x32\xff\xbc\x75\x1a\xe6\x08\x9b\xff" + "\xba\x79\xf4\x39\x7a\xfc\xe1\x6f\xff\x3e\xb3\x75\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c\x62\xb8\xd1\xa4" + "\xe7\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d\xba\x73\x7b\xad" + "\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02\x00\x00\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x8d\xb0" + "\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57\xca\xf4\x9d\x63\x08" + "\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9\xc6\xa3\xf1\x33\xfd" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x95\x3c\x86\x65\x91\x76" + "\x69\x6b\x72\x61\xaa\x76\x15\x2a\xd7\x25\x4f\x32\xb7\x73\x7a" + "\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81\x03\x02\x00" + "\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x15\x3a\xc7\xe1\x03\x4c\xbd\xf0\xb7\x21\x92" + "\xd9\x6a\xa8\xba\xd0\xf1\xba\x52\x70\x69\x6d\x44\x52\xe0\xd4" + "\xbc\x24\x14\x35\x40\x9a\x81\x03\x08\x54\x74\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x0a\x35\xfc\xc3\x8c\x27" + "\xc8\x0c\x06\xf5\x75\x4b\xf9\x77\x01\x55\xeb\x7d\x52\x4d\x68" + "\xe1\x6f\x5b\x2b\xdd\x3a\x53\x5d\xf3\x10\xb2\x81\x03\x02\x0c" + "\x3a\x82\x02\x03\x28\xa1\x2b\x80\x20\xfc\x9c\xc0\x37\x7c\x07" + "\x93\x29\xe6\xc0\xf2\x49\x14\xb8\x03\x7c\x1a\xa2\x49\x14\x56" + "\x44\xa4\x8d\x9d\x02\x8c\xe1\x7d\xa1\x2c\xed\x81\x03\x02\x0c" + "\x3a\x82\x02\x03\x28\xa2\x2b\x80\x20\x96\xa0\x0c\x42\x66\x42" + "\x10\x3e\xcb\x02\xa0\x12\xf7\x80\x8b\x3c\x91\x74\x7d\x67\xc3" + "\x64\x31\x60\xc5\xff\xfe\xd2\x57\x4b\xab\x23\x81\x03\x04\x24" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x8d\xb0\x2c\xb1\x28\xc3" + "\xf4\x97\x50\x84\x64\x57\xca\xf4\x9d\x63\x08\x73\xfc\xde\x2f" + "\x90\xf0\xf2\xec\x79\xa9\xc6\xa3\xf1\x33\xfd\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x95\x3c\x86\x65\x91\x76\x69\x6b\x72\x61" + "\xaa\x76\x15\x2a\xd7\x25\x4f\x32\xb7\x73\x7a\xb2\x49\x0c\x0b" + "\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh57() + { + testcase("Thresh57"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim8Cond + // ** Rsa9Cond + // ** Ed10Cond + // ** Prefix11Cond + // ** Thresh15Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** ed4 + // ** preim5 + // ** rsa6 + // ** ed7 + + auto const ed4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x23, 0x8b, 0xb2, 0xc9, 0xde, 0xad, 0x1b, 0xb6, 0xce, 0x93, 0x9a, + 0x00, 0x47, 0x3d, 0x42, 0xc1, 0x30, 0x19, 0x95, 0x03, 0x55, 0x19, + 0x74, 0x85, 0xe9, 0xed, 0x92, 0xef, 0x22, 0xbd, 0x49, 0xe5, 0x44, + 0xa0, 0x7a, 0x41, 0x7d, 0xa7, 0xb0, 0x3a, 0x90, 0x1b, 0xa1, 0x2b, + 0xcc, 0x1d, 0x0a, 0x8b, 0x95, 0xc1, 0x3c, 0x05, 0x68, 0x26, 0x39, + 0xad, 0xe4, 0xd4, 0x75, 0xf0, 0xb5, 0x18, 0xbe, 0x01}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim5Preimage = "I am root"s; + auto const preim5Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa6PublicKey{ + {0xd0, 0x07, 0xfc, 0x9d, 0xb0, 0xa1, 0xa6, 0x40, 0xe4, 0x52, 0x30, + 0x42, 0x74, 0xfd, 0x35, 0x04, 0xde, 0x45, 0x68, 0xb3, 0x22, 0xdd, + 0xff, 0x41, 0x43, 0x69, 0x33, 0xc0, 0xff, 0x35, 0xb6, 0x6d, 0x15, + 0xe9, 0x54, 0x15, 0xeb, 0x1d, 0x07, 0xe2, 0x25, 0x2b, 0xdb, 0xaa, + 0x16, 0x8d, 0x0d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, 0x58, 0xde, 0xfb, + 0x14, 0x91, 0x18, 0xf3, 0x4f, 0x9b, 0x36, 0x55, 0xcf, 0xb3, 0x5e, + 0xec, 0x4f, 0xcc, 0x6d, 0x13, 0x58, 0xc8, 0xa3, 0xa3, 0xee, 0x23, + 0x8a, 0xc2, 0xbf}}; + std::array const rsa6Sig{ + {0x1f, 0x21, 0xa5, 0x34, 0xf1, 0x4e, 0xe9, 0x78, 0xe6, 0x4c, 0xe9, + 0x4a, 0xdc, 0xde, 0x49, 0x6e, 0xb4, 0x62, 0xc3, 0x12, 0xe3, 0x09, + 0xb5, 0x21, 0xe3, 0xc9, 0x19, 0xe1, 0x16, 0xc9, 0xc6, 0x1d, 0xa9, + 0x9f, 0xdc, 0x55, 0x26, 0x92, 0xd3, 0x77, 0x25, 0x03, 0x08, 0xba, + 0x11, 0xc2, 0xba, 0x24, 0xd8, 0x41, 0xf2, 0x60, 0xa3, 0x72, 0x94, + 0x61, 0x8b, 0xe8, 0x3a, 0xd0, 0xee, 0xba, 0x88, 0x7d, 0xd3, 0x1b, + 0x70, 0xef, 0x5f, 0xaf, 0xbc, 0xb1, 0xa5, 0x9e, 0x7f, 0x12, 0xf4, + 0x34, 0xb9, 0x15, 0x18, 0xa2, 0x0a, 0x66, 0x7f, 0x2b, 0x2c, 0xfb, + 0x3b, 0x77, 0x8e, 0x39, 0x1e, 0x33, 0x00, 0xf9, 0x16, 0x82, 0x5a, + 0xa9, 0xde, 0xfd, 0x48, 0xbe, 0xde, 0xff, 0x2e, 0x5c, 0xfc, 0x2c, + 0xb3, 0x3d, 0x92, 0xbd, 0xe8, 0x4d, 0xac, 0x3f, 0x98, 0xaa, 0xa3, + 0x7b, 0xf9, 0xb2, 0x60, 0xe7, 0x3e, 0x10, 0xe4, 0x9f, 0x21, 0x29, + 0x7e, 0xa2, 0x76, 0x6d, 0x19, 0x49, 0xc1, 0x6b, 0x6d, 0x80, 0xcc, + 0x77, 0xfc, 0x6f, 0x82, 0x5f, 0xc6, 0xd8, 0x8a, 0x39, 0x20, 0x32, + 0x1b, 0x1c, 0xd1, 0x95, 0xdb, 0x72, 0xc1, 0xf1, 0x20, 0x10, 0xc3, + 0xa5, 0x39, 0xb4, 0x30, 0xeb, 0xc9, 0xe9, 0x22, 0xfb, 0x8b, 0x8c, + 0x04, 0x46, 0x64, 0x14, 0xb7, 0x34, 0x23, 0xb4, 0xd2, 0x5e, 0xf5, + 0x11, 0xd5, 0xa1, 0x3f, 0x7c, 0x96, 0x80, 0xb7, 0x71, 0xd5, 0x4d, + 0x71, 0x8a, 0x03, 0xf8, 0x32, 0x0c, 0x61, 0x3b, 0x1a, 0x5a, 0x24, + 0x06, 0x79, 0xad, 0x4d, 0x25, 0x4b, 0x7b, 0x78, 0x1b, 0x17, 0x1f, + 0x5f, 0x7b, 0xa5, 0xd2, 0xb8, 0x3b, 0x30, 0x1c, 0x66, 0xe4, 0xd3, + 0xa8, 0x4f, 0x6c, 0x88, 0xaf, 0xe3, 0x3c, 0x62, 0x6c, 0x35, 0x02, + 0xb8, 0x9a, 0x4b, 0xd8, 0x0a, 0x9d, 0x9a, 0xe8, 0x18, 0x6d, 0x67, + 0x3c, 0x4f, 0x59}}; + auto const ed7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed7PublicKey{ + {0x58, 0xcf, 0x4b, 0xc5, 0x59, 0xdb, 0xba, 0x62, 0x25, 0x14, 0x3a, + 0xc0, 0xad, 0xab, 0x5e, 0x35, 0xa1, 0xb4, 0x0e, 0xc1, 0xaf, 0x3c, + 0xa8, 0x2f, 0x69, 0x2c, 0xb6, 0x25, 0xd7, 0xea, 0x15, 0xb3}}; + std::array const ed7Sig{ + {0xd0, 0xd1, 0x17, 0xe2, 0xb5, 0x40, 0x14, 0x81, 0x0b, 0x12, 0xd8, + 0xbe, 0x1d, 0x1c, 0xb0, 0x88, 0x27, 0xaf, 0x6e, 0xc3, 0x13, 0x71, + 0xea, 0xac, 0xf3, 0xd8, 0x6f, 0x38, 0x21, 0xe2, 0x6d, 0x77, 0xe9, + 0xa6, 0xba, 0x03, 0x2a, 0xe3, 0x50, 0xcb, 0x38, 0xbe, 0x36, 0xba, + 0x62, 0x6e, 0x37, 0x5c, 0x8d, 0x69, 0x9f, 0xf0, 0x43, 0x64, 0x83, + 0x82, 0x8e, 0xbe, 0xf5, 0xa6, 0x96, 0x35, 0xb7, 0x03}}; + std::array const ed7SigningKey{ + {0x9c, 0x02, 0x4b, 0x5e, 0x6a, 0x83, 0x35, 0x8a, 0x2a, 0x71, 0x70, + 0x4e, 0xab, 0x74, 0x72, 0x22, 0x33, 0x5a, 0x82, 0xd9, 0x8e, 0x9c, + 0x8c, 0x41, 0x62, 0x6b, 0x02, 0x62, 0xbd, 0x59, 0x31, 0xcb}}; + (void)ed7SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix11CondConditionFingerprint = { + {0xa0, 0x3e, 0x37, 0x69, 0xf1, 0x15, 0x84, 0xf2, 0xb7, 0x3b, 0xeb, + 0x87, 0x0c, 0xb7, 0x3d, 0x17, 0xcd, 0x78, 0xd0, 0xca, 0x80, 0x97, + 0xa5, 0x67, 0xc8, 0x4b, 0xac, 0xe5, 0xb2, 0xbb, 0xef, 0x28}}; + Condition const Prefix11Cond{Type::prefixSha256, + 134179, + Prefix11CondConditionFingerprint, + std::bitset<5>{20}}; + std::array const Thresh15CondConditionFingerprint = { + {0x2e, 0x79, 0x72, 0x9d, 0x3a, 0x6b, 0x9b, 0x45, 0x71, 0x24, 0x65, + 0xf2, 0x20, 0x29, 0x61, 0x6c, 0x8a, 0x27, 0xad, 0x0c, 0xc2, 0x40, + 0x60, 0xe2, 0xf4, 0x27, 0x2c, 0x0c, 0x17, 0xfb, 0x00, 0x48}}; + Condition const Thresh15Cond{Type::thresholdSha256, + 271360, + Thresh15CondConditionFingerprint, + std::bitset<5>{25}}; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + std::vector thresh3Subconditions{}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim5 = + std::make_unique(makeSlice(preim5Preimage)); + auto rsa6 = std::make_unique( + makeSlice(rsa6PublicKey), makeSlice(rsa6Sig)); + auto ed7 = std::make_unique(ed7PublicKey, ed7Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim5)); + thresh0Subfulfillments.emplace_back(std::move(rsa6)); + thresh0Subfulfillments.emplace_back(std::move(ed7)); + std::vector thresh0Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Prefix11Cond, Thresh15Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\xdc\xa0\x82\x03\x02\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x81\x80\x80\x02\x50\x31\x81\x01" + "\x1a\xa2\x77\xa1\x75\x80\x02\x50\x32\x81\x01\x1c\xa2\x6c\xa2" + "\x6a\xa0\x66\xa4\x64\x80\x20\x26\x80\x85\x71\x79\x37\x27\xbd" + "\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c\x5b\x9f\x99\x54\xb6\xd4" + "\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec\x81\x40\x23\x8b\xb2\xc9" + "\xde\xad\x1b\xb6\xce\x93\x9a\x00\x47\x3d\x42\xc1\x30\x19\x95" + "\x03\x55\x19\x74\x85\xe9\xed\x92\xef\x22\xbd\x49\xe5\x44\xa0" + "\x7a\x41\x7d\xa7\xb0\x3a\x90\x1b\xa1\x2b\xcc\x1d\x0a\x8b\x95" + "\xc1\x3c\x05\x68\x26\x39\xad\xe4\xd4\x75\xf0\xb5\x18\xbe\x01" + "\xa1\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xd0\x07\xfc\x9d\xb0" + "\xa1\xa6\x40\xe4\x52\x30\x42\x74\xfd\x35\x04\xde\x45\x68\xb3" + "\x22\xdd\xff\x41\x43\x69\x33\xc0\xff\x35\xb6\x6d\x15\xe9\x54" + "\x15\xeb\x1d\x07\xe2\x25\x2b\xdb\xaa\x16\x8d\x0d\x7f\x05\xf0" + "\xd2\x7d\xb4\x9b\x51\x19\x20\x1e\x3d\xba\x50\x9e\x51\x13\x81" + "\x43\x55\x96\xca\xdb\x88\x1f\xef\x2d\x38\x3f\xae\x8d\xac\xc8" + "\x6f\x2b\xd5\xf0\x34\x1a\x99\x00\x7c\x6d\xb3\x1b\x1d\x68\xdb" + "\xf8\x1c\x59\x3a\x63\x38\x7c\x1c\x14\xbc\x22\xcf\xc8\x9a\xc6" + "\x96\x6f\x3d\x03\x0b\x61\x6b\x7d\x75\x97\xe8\x25\xb8\x2f\xfa" + "\xf4\x07\x44\xdf\x00\x3d\xff\x0d\xd5\x7f\x7f\xf3\x0c\x13\xac" + "\x8d\xf8\x8c\x79\xc5\xf3\x29\xdc\x23\x65\xd3\xd1\x1c\xa6\x14" + "\x78\x6a\x1a\xe3\x15\x8d\x8b\xdc\xa0\x5a\xc7\x82\xb0\x03\x6c" + "\x71\x43\x59\x24\xc7\x50\x64\xb2\xa7\x69\xf5\xbd\xe6\x5e\xaa" + "\x77\x59\x60\x36\xc0\xe3\x42\x7f\x05\x3b\x4c\x02\x0e\x70\x5a" + "\x70\xc5\x2a\xeb\x94\x4d\x15\x09\xef\xbb\x58\x42\x68\x05\x59" + "\x70\xa0\x17\xb2\x8e\xdf\x7b\x40\x5d\x21\x1e\xfe\x62\x58\xde" + "\xfb\x14\x91\x18\xf3\x4f\x9b\x36\x55\xcf\xb3\x5e\xec\x4f\xcc" + "\x6d\x13\x58\xc8\xa3\xa3\xee\x23\x8a\xc2\xbf\x81\x82\x01\x00" + "\x1f\x21\xa5\x34\xf1\x4e\xe9\x78\xe6\x4c\xe9\x4a\xdc\xde\x49" + "\x6e\xb4\x62\xc3\x12\xe3\x09\xb5\x21\xe3\xc9\x19\xe1\x16\xc9" + "\xc6\x1d\xa9\x9f\xdc\x55\x26\x92\xd3\x77\x25\x03\x08\xba\x11" + "\xc2\xba\x24\xd8\x41\xf2\x60\xa3\x72\x94\x61\x8b\xe8\x3a\xd0" + "\xee\xba\x88\x7d\xd3\x1b\x70\xef\x5f\xaf\xbc\xb1\xa5\x9e\x7f" + "\x12\xf4\x34\xb9\x15\x18\xa2\x0a\x66\x7f\x2b\x2c\xfb\x3b\x77" + "\x8e\x39\x1e\x33\x00\xf9\x16\x82\x5a\xa9\xde\xfd\x48\xbe\xde" + "\xff\x2e\x5c\xfc\x2c\xb3\x3d\x92\xbd\xe8\x4d\xac\x3f\x98\xaa" + "\xa3\x7b\xf9\xb2\x60\xe7\x3e\x10\xe4\x9f\x21\x29\x7e\xa2\x76" + "\x6d\x19\x49\xc1\x6b\x6d\x80\xcc\x77\xfc\x6f\x82\x5f\xc6\xd8" + "\x8a\x39\x20\x32\x1b\x1c\xd1\x95\xdb\x72\xc1\xf1\x20\x10\xc3" + "\xa5\x39\xb4\x30\xeb\xc9\xe9\x22\xfb\x8b\x8c\x04\x46\x64\x14" + "\xb7\x34\x23\xb4\xd2\x5e\xf5\x11\xd5\xa1\x3f\x7c\x96\x80\xb7" + "\x71\xd5\x4d\x71\x8a\x03\xf8\x32\x0c\x61\x3b\x1a\x5a\x24\x06" + "\x79\xad\x4d\x25\x4b\x7b\x78\x1b\x17\x1f\x5f\x7b\xa5\xd2\xb8" + "\x3b\x30\x1c\x66\xe4\xd3\xa8\x4f\x6c\x88\xaf\xe3\x3c\x62\x6c" + "\x35\x02\xb8\x9a\x4b\xd8\x0a\x9d\x9a\xe8\x18\x6d\x67\x3c\x4f" + "\x59\xa4\x64\x80\x20\x58\xcf\x4b\xc5\x59\xdb\xba\x62\x25\x14" + "\x3a\xc0\xad\xab\x5e\x35\xa1\xb4\x0e\xc1\xaf\x3c\xa8\x2f\x69" + "\x2c\xb6\x25\xd7\xea\x15\xb3\x81\x40\xd0\xd1\x17\xe2\xb5\x40" + "\x14\x81\x0b\x12\xd8\xbe\x1d\x1c\xb0\x88\x27\xaf\x6e\xc3\x13" + "\x71\xea\xac\xf3\xd8\x6f\x38\x21\xe2\x6d\x77\xe9\xa6\xba\x03" + "\x2a\xe3\x50\xcb\x38\xbe\x36\xba\x62\x6e\x37\x5c\x8d\x69\x9f" + "\xf0\x43\x64\x83\x82\x8e\xbe\xf5\xa6\x96\x35\xb7\x03\xa1\x81" + "\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8" + "\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc" + "\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\xa0" + "\x3e\x37\x69\xf1\x15\x84\xf2\xb7\x3b\xeb\x87\x0c\xb7\x3d\x17" + "\xcd\x78\xd0\xca\x80\x97\xa5\x67\xc8\x4b\xac\xe5\xb2\xbb\xef" + "\x28\x81\x03\x02\x0c\x23\x82\x02\x03\x28\xa2\x2b\x80\x20\x2e" + "\x79\x72\x9d\x3a\x6b\x9b\x45\x71\x24\x65\xf2\x20\x29\x61\x6c" + "\x8a\x27\xad\x0c\xc2\x40\x60\xe2\xf4\x27\x2c\x0c\x17\xfb\x00" + "\x48\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xe5" + "\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70\x64\x51" + "\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7\xe4" + "\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4" + "\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79" + "\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02" + "\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xd3\x3d\x35\x03\x82\x4b\x6e\x74\xcd\xf5\x3a" + "\xc7\xe4\x3d\x01\x44\xe0\xf9\xaa\x4c\x1b\x15\xc6\x74\x87\xee" + "\x95\x19\x32\x1a\x2b\xa9\x81\x03\x0a\x60\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\xa0\x3e\x37\x69\xf1\x15\x84\xf2\xb7\x3b\xeb\x87" + "\x0c\xb7\x3d\x17\xcd\x78\xd0\xca\x80\x97\xa5\x67\xc8\x4b\xac" + "\xe5\xb2\xbb\xef\x28\x81\x03\x02\x0c\x23\x82\x02\x03\x28\xa1" + "\x2b\x80\x20\xfc\x9c\xc0\x37\x7c\x07\x93\x29\xe6\xc0\xf2\x49" + "\x14\xb8\x03\x7c\x1a\xa2\x49\x14\x56\x44\xa4\x8d\x9d\x02\x8c" + "\xe1\x7d\xa1\x2c\xed\x81\x03\x02\x0c\x3a\x82\x02\x03\x28\xa2" + "\x2b\x80\x20\x2e\x79\x72\x9d\x3a\x6b\x9b\x45\x71\x24\x65\xf2" + "\x20\x29\x61\x6c\x8a\x27\xad\x0c\xc2\x40\x60\xe2\xf4\x27\x2c" + "\x0c\x17\xfb\x00\x48\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88" + "\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb" + "\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xee" + "\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c" + "\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2" + "\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4" + "\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79" + "\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d" + "\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0" + "\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh58() + { + testcase("Thresh58"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim30Cond + // ** Rsa31Cond + // ** Ed32Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim5Cond + // ***** Rsa6Cond + // ***** Ed7Cond + // ***** ed4 + // ** prefix8 + // *** prefix9 + // **** thresh10 + // ***** Preim12Cond + // ***** Rsa13Cond + // ***** Ed14Cond + // ***** ed11 + // ** thresh15 + // *** Preim22Cond + // *** Rsa23Cond + // *** Ed24Cond + // *** Thresh25Cond + // *** ed16 + // *** thresh17 + // **** Preim19Cond + // **** Rsa20Cond + // **** Ed21Cond + // **** ed18 + + auto const ed4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x23, 0x8b, 0xb2, 0xc9, 0xde, 0xad, 0x1b, 0xb6, 0xce, 0x93, 0x9a, + 0x00, 0x47, 0x3d, 0x42, 0xc1, 0x30, 0x19, 0x95, 0x03, 0x55, 0x19, + 0x74, 0x85, 0xe9, 0xed, 0x92, 0xef, 0x22, 0xbd, 0x49, 0xe5, 0x44, + 0xa0, 0x7a, 0x41, 0x7d, 0xa7, 0xb0, 0x3a, 0x90, 0x1b, 0xa1, 0x2b, + 0xcc, 0x1d, 0x0a, 0x8b, 0x95, 0xc1, 0x3c, 0x05, 0x68, 0x26, 0x39, + 0xad, 0xe4, 0xd4, 0x75, 0xf0, 0xb5, 0x18, 0xbe, 0x01}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const ed11Msg = "P9P8abcdefghijklmnopqrstuvwxyz"s; + std::array const ed11PublicKey{ + {0x89, 0x5e, 0x41, 0x5a, 0x61, 0x75, 0xf5, 0x16, 0xd7, 0x9b, 0x5c, + 0x57, 0x69, 0x5e, 0xa3, 0x22, 0x3e, 0xa5, 0x5d, 0xa3, 0xc0, 0x37, + 0x18, 0x95, 0x26, 0xe7, 0x77, 0x00, 0x5f, 0x95, 0x58, 0x20}}; + std::array const ed11Sig{ + {0x36, 0x92, 0xe4, 0xf5, 0x30, 0x17, 0x60, 0x8b, 0x86, 0xf3, 0x63, + 0xba, 0x13, 0x2d, 0x54, 0xfe, 0x4e, 0xd2, 0x73, 0x6d, 0x44, 0xd4, + 0x06, 0x2d, 0xb7, 0x71, 0xde, 0x39, 0xbd, 0x5f, 0xcd, 0x1e, 0x82, + 0x95, 0x91, 0x7e, 0x62, 0x58, 0xef, 0x27, 0x8d, 0x3d, 0xf9, 0x92, + 0xc7, 0x46, 0xc1, 0x7b, 0xba, 0x97, 0xce, 0x23, 0xd5, 0x30, 0xfa, + 0x31, 0x45, 0xa5, 0x68, 0xaa, 0xcc, 0x69, 0x59, 0x00}}; + std::array const ed11SigningKey{ + {0x56, 0x3d, 0xfd, 0x5f, 0x56, 0xef, 0x52, 0xa4, 0xbc, 0xc5, 0x20, + 0x99, 0x8b, 0xc7, 0xf1, 0xc8, 0x41, 0xcd, 0x93, 0x6e, 0x4e, 0x7f, + 0x95, 0x81, 0x2a, 0xa1, 0x6b, 0x46, 0x33, 0xd9, 0x11, 0x5f}}; + (void)ed11SigningKey; + auto const thresh10Msg = "P9P8abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim12CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim12Cond{Type::preimageSha256, + 9, + Preim12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa13CondConditionFingerprint = { + {0x65, 0x58, 0x3c, 0x41, 0x23, 0xcb, 0x17, 0xee, 0x38, 0xf7, 0x10, + 0x74, 0xdb, 0xa3, 0x24, 0xb4, 0x5b, 0x39, 0x35, 0xc1, 0x1a, 0xa6, + 0xbd, 0xbc, 0xc8, 0xea, 0x71, 0x39, 0x33, 0xe5, 0xd5, 0x1a}}; + Condition const Rsa13Cond{Type::rsaSha256, + 65536, + Rsa13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed14CondConditionFingerprint = { + {0xde, 0x4c, 0x08, 0x88, 0x5c, 0xfe, 0x31, 0x01, 0xbe, 0xe9, 0xe4, + 0x12, 0xce, 0x03, 0x59, 0x75, 0xb3, 0x7b, 0xac, 0x62, 0x26, 0xfa, + 0x78, 0x07, 0x59, 0x64, 0x4e, 0x5e, 0x89, 0x64, 0x17, 0x04}}; + Condition const Ed14Cond{Type::ed25519Sha256, + 131072, + Ed14CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix9Prefix = "P9"s; + auto const prefix9Msg = "P8abcdefghijklmnopqrstuvwxyz"s; + auto const prefix9MaxMsgLength = 28; + auto const prefix8Prefix = "P8"s; + auto const prefix8Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix8MaxMsgLength = 26; + auto const ed16Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed16PublicKey{ + {0x50, 0x5a, 0xcb, 0xfd, 0xac, 0xce, 0x8b, 0x6f, 0xeb, 0x52, 0x06, + 0x75, 0xb8, 0x72, 0x9d, 0x94, 0x62, 0xdc, 0xe4, 0x11, 0x24, 0xd0, + 0xa3, 0x35, 0x47, 0x20, 0x02, 0xd5, 0xf7, 0x3f, 0x9c, 0x93}}; + std::array const ed16Sig{ + {0x70, 0x10, 0xf0, 0xdf, 0x6b, 0xdf, 0xe8, 0x30, 0x56, 0x8e, 0xd9, + 0x48, 0x92, 0x62, 0x1f, 0x2b, 0x0c, 0x6c, 0x8f, 0x15, 0x04, 0x53, + 0xcb, 0x3a, 0x07, 0xbc, 0x0b, 0xec, 0x8f, 0x4d, 0xea, 0x37, 0xd0, + 0x13, 0x03, 0x03, 0x79, 0x87, 0x83, 0x7e, 0x63, 0xde, 0x71, 0x22, + 0x43, 0x6f, 0x3b, 0x10, 0xad, 0x3b, 0x68, 0x6a, 0x73, 0x05, 0x07, + 0x01, 0xbb, 0x08, 0x93, 0xa6, 0xbf, 0x87, 0x7f, 0x06}}; + std::array const ed16SigningKey{ + {0xb7, 0xbd, 0x93, 0x4b, 0x03, 0x39, 0xf8, 0x6f, 0x47, 0x66, 0x7f, + 0xd4, 0x4f, 0x94, 0x32, 0xe6, 0xb2, 0x70, 0x9c, 0x2c, 0x64, 0x92, + 0xc4, 0xb1, 0xdd, 0x04, 0x6d, 0x00, 0x92, 0x41, 0xe9, 0x41}}; + (void)ed16SigningKey; + auto const ed18Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed18PublicKey{ + {0x3b, 0x07, 0x0f, 0xe5, 0x29, 0x34, 0xd9, 0x17, 0xf5, 0x06, 0x00, + 0xb8, 0x87, 0x2f, 0xcf, 0x89, 0x52, 0x70, 0xcc, 0x04, 0x92, 0xe1, + 0x67, 0xcb, 0xba, 0xbb, 0x10, 0xa6, 0x2d, 0x06, 0xa4, 0x6b}}; + std::array const ed18Sig{ + {0x09, 0xc4, 0x1d, 0xc3, 0x8e, 0x6c, 0xd6, 0x04, 0xb7, 0x9e, 0x8c, + 0x8b, 0x30, 0x65, 0x88, 0x43, 0xc7, 0xc6, 0xe5, 0xa0, 0xb0, 0x4c, + 0x60, 0xee, 0xb7, 0x1d, 0x69, 0x2a, 0xb7, 0x5d, 0x5f, 0x16, 0x53, + 0xd1, 0xe6, 0x6a, 0x74, 0x5d, 0x63, 0xc0, 0x41, 0x30, 0x6a, 0x58, + 0xce, 0x52, 0xf2, 0xdb, 0x41, 0x03, 0x78, 0xfd, 0x7f, 0x0e, 0xa5, + 0xc1, 0xe4, 0xd2, 0x50, 0x8d, 0x97, 0x1d, 0xf9, 0x06}}; + std::array const ed18SigningKey{ + {0x59, 0x73, 0xbb, 0x41, 0xb0, 0xe0, 0xce, 0xc2, 0xa9, 0x85, 0xaa, + 0x05, 0xa4, 0x7e, 0x3b, 0x51, 0x09, 0x8d, 0x3e, 0x47, 0xb7, 0x75, + 0xda, 0x81, 0x39, 0xa0, 0xe1, 0xd5, 0x9f, 0xb0, 0x9c, 0x5a}}; + (void)ed18SigningKey; + auto const thresh17Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh15Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim22CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim22Cond{Type::preimageSha256, + 9, + Preim22CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa23CondConditionFingerprint = { + {0x4a, 0x64, 0xbf, 0x23, 0xa9, 0x2b, 0xec, 0x55, 0x00, 0x3d, 0x55, + 0xf5, 0xbf, 0x3f, 0x26, 0x49, 0x18, 0xbb, 0xe0, 0xda, 0xf8, 0x0c, + 0xf4, 0x5c, 0x8a, 0x33, 0x74, 0xb6, 0x58, 0xa4, 0x38, 0x30}}; + Condition const Rsa23Cond{Type::rsaSha256, + 65536, + Rsa23CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed24CondConditionFingerprint = { + {0x6b, 0xf3, 0xe3, 0x0f, 0x92, 0x6d, 0x45, 0x8d, 0xae, 0xd2, 0x8a, + 0x2a, 0x3e, 0x53, 0x37, 0x1f, 0x57, 0x82, 0x21, 0x60, 0xe4, 0x5b, + 0x88, 0x9a, 0x9d, 0x13, 0xa2, 0x56, 0x13, 0x88, 0x9e, 0x21}}; + Condition const Ed24Cond{Type::ed25519Sha256, + 131072, + Ed24CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh25CondConditionFingerprint = { + {0x29, 0xe8, 0x9c, 0x4f, 0x52, 0x99, 0x3e, 0x96, 0x07, 0x4f, 0x16, + 0x1c, 0x2b, 0x76, 0x5b, 0xb1, 0xb0, 0x80, 0xd3, 0xbe, 0x4f, 0xbe, + 0xf9, 0x8c, 0x54, 0x36, 0x1e, 0x6f, 0x67, 0xf4, 0xa5, 0xbb}}; + Condition const Thresh25Cond{Type::thresholdSha256, + 135168, + Thresh25CondConditionFingerprint, + std::bitset<5>{25}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim30CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim30Cond{Type::preimageSha256, + 9, + Preim30CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa31CondConditionFingerprint = { + {0x34, 0x77, 0x63, 0xd7, 0x27, 0x76, 0x4d, 0x3a, 0x9b, 0x6c, 0xdb, + 0x09, 0xed, 0xd8, 0x5f, 0xc2, 0x12, 0x9e, 0x9c, 0xc4, 0xc8, 0xa6, + 0x62, 0xcf, 0x14, 0xde, 0x09, 0x30, 0x64, 0x8e, 0xf4, 0x84}}; + Condition const Rsa31Cond{Type::rsaSha256, + 65536, + Rsa31CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed32CondConditionFingerprint = { + {0xe9, 0x54, 0x85, 0xb7, 0x7d, 0xa1, 0x1f, 0x2f, 0xaa, 0x84, 0x72, + 0x3f, 0x4e, 0x3f, 0x09, 0xa7, 0x49, 0xf2, 0x15, 0x2a, 0xe6, 0x13, + 0x5b, 0x68, 0xb6, 0xe1, 0x98, 0xa6, 0x89, 0x76, 0x08, 0x05}}; + Condition const Ed32Cond{Type::ed25519Sha256, + 131072, + Ed32CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto ed11 = std::make_unique(ed11PublicKey, ed11Sig); + std::vector> thresh10Subfulfillments; + thresh10Subfulfillments.emplace_back(std::move(ed11)); + std::vector thresh10Subconditions{ + {Preim12Cond, Rsa13Cond, Ed14Cond}}; + auto thresh10 = std::make_unique( + std::move(thresh10Subfulfillments), + std::move(thresh10Subconditions)); + auto prefix9 = std::make_unique( + makeSlice(prefix9Prefix), prefix9MaxMsgLength, std::move(thresh10)); + auto prefix8 = std::make_unique( + makeSlice(prefix8Prefix), prefix8MaxMsgLength, std::move(prefix9)); + auto ed16 = std::make_unique(ed16PublicKey, ed16Sig); + auto ed18 = std::make_unique(ed18PublicKey, ed18Sig); + std::vector> thresh17Subfulfillments; + thresh17Subfulfillments.emplace_back(std::move(ed18)); + std::vector thresh17Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond}}; + auto thresh17 = std::make_unique( + std::move(thresh17Subfulfillments), + std::move(thresh17Subconditions)); + std::vector> thresh15Subfulfillments; + thresh15Subfulfillments.emplace_back(std::move(ed16)); + thresh15Subfulfillments.emplace_back(std::move(thresh17)); + std::vector thresh15Subconditions{ + {Preim22Cond, Rsa23Cond, Ed24Cond, Thresh25Cond}}; + auto thresh15 = std::make_unique( + std::move(thresh15Subfulfillments), + std::move(thresh15Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix8)); + thresh0Subfulfillments.emplace_back(std::move(thresh15)); + std::vector thresh0Subconditions{ + {Preim30Cond, Rsa31Cond, Ed32Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x04\x7c\xa0\x82\x03\xfd\xa1\x81\xfd\x80\x02\x50\x31" + "\x81\x01\x1a\xa2\x81\xf3\xa1\x81\xf0\x80\x02\x50\x32\x81\x01" + "\x1c\xa2\x81\xe6\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20\x26\x80" + "\x85\x71\x79\x37\x27\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c" + "\x5b\x9f\x99\x54\xb6\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec" + "\x81\x40\x23\x8b\xb2\xc9\xde\xad\x1b\xb6\xce\x93\x9a\x00\x47" + "\x3d\x42\xc1\x30\x19\x95\x03\x55\x19\x74\x85\xe9\xed\x92\xef" + "\x22\xbd\x49\xe5\x44\xa0\x7a\x41\x7d\xa7\xb0\x3a\x90\x1b\xa1" + "\x2b\xcc\x1d\x0a\x8b\x95\xc1\x3c\x05\x68\x26\x39\xad\xe4\xd4" + "\x75\xf0\xb5\x18\xbe\x01\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30" + "\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c" + "\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81" + "\x01\x09\xa3\x27\x80\x20\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06" + "\x3f\xd9\x32\x48\x19\xe1\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c" + "\x9b\x83\xeb\x05\xa7\x59\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1" + "\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0" + "\x21\x8d\x42\xc0\x81\x03\x02\x00\x00\xa1\x81\xfd\x80\x02\x50" + "\x38\x81\x01\x1a\xa2\x81\xf3\xa1\x81\xf0\x80\x02\x50\x39\x81" + "\x01\x1c\xa2\x81\xe6\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20\x89" + "\x5e\x41\x5a\x61\x75\xf5\x16\xd7\x9b\x5c\x57\x69\x5e\xa3\x22" + "\x3e\xa5\x5d\xa3\xc0\x37\x18\x95\x26\xe7\x77\x00\x5f\x95\x58" + "\x20\x81\x40\x36\x92\xe4\xf5\x30\x17\x60\x8b\x86\xf3\x63\xba" + "\x13\x2d\x54\xfe\x4e\xd2\x73\x6d\x44\xd4\x06\x2d\xb7\x71\xde" + "\x39\xbd\x5f\xcd\x1e\x82\x95\x91\x7e\x62\x58\xef\x27\x8d\x3d" + "\xf9\x92\xc7\x46\xc1\x7b\xba\x97\xce\x23\xd5\x30\xfa\x31\x45" + "\xa5\x68\xaa\xcc\x69\x59\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa3\x27\x80\x20\x65\x58\x3c\x41\x23\xcb\x17\xee" + "\x38\xf7\x10\x74\xdb\xa3\x24\xb4\x5b\x39\x35\xc1\x1a\xa6\xbd" + "\xbc\xc8\xea\x71\x39\x33\xe5\xd5\x1a\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\xde\x4c\x08\x88\x5c\xfe\x31\x01\xbe\xe9\xe4\x12" + "\xce\x03\x59\x75\xb3\x7b\xac\x62\x26\xfa\x78\x07\x59\x64\x4e" + "\x5e\x89\x64\x17\x04\x81\x03\x02\x00\x00\xa2\x82\x01\xf9\xa0" + "\x82\x01\x4c\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20\x3b\x07\x0f" + "\xe5\x29\x34\xd9\x17\xf5\x06\x00\xb8\x87\x2f\xcf\x89\x52\x70" + "\xcc\x04\x92\xe1\x67\xcb\xba\xbb\x10\xa6\x2d\x06\xa4\x6b\x81" + "\x40\x09\xc4\x1d\xc3\x8e\x6c\xd6\x04\xb7\x9e\x8c\x8b\x30\x65" + "\x88\x43\xc7\xc6\xe5\xa0\xb0\x4c\x60\xee\xb7\x1d\x69\x2a\xb7" + "\x5d\x5f\x16\x53\xd1\xe6\x6a\x74\x5d\x63\xc0\x41\x30\x6a\x58" + "\xce\x52\xf2\xdb\x41\x03\x78\xfd\x7f\x0e\xa5\xc1\xe4\xd2\x50" + "\x8d\x97\x1d\xf9\x06\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef" + "\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9" + "\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01" + "\x09\xa3\x27\x80\x20\x8d\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84" + "\x64\x57\xca\xf4\x9d\x63\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec" + "\x79\xa9\xc6\xa3\xf1\x33\xfd\x81\x03\x01\x00\x00\xa4\x27\x80" + "\x20\x95\x3c\x86\x65\x91\x76\x69\x6b\x72\x61\xaa\x76\x15\x2a" + "\xd7\x25\x4f\x32\xb7\x73\x7a\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a" + "\x8b\xf7\x65\x81\x03\x02\x00\x00\xa4\x64\x80\x20\x50\x5a\xcb" + "\xfd\xac\xce\x8b\x6f\xeb\x52\x06\x75\xb8\x72\x9d\x94\x62\xdc" + "\xe4\x11\x24\xd0\xa3\x35\x47\x20\x02\xd5\xf7\x3f\x9c\x93\x81" + "\x40\x70\x10\xf0\xdf\x6b\xdf\xe8\x30\x56\x8e\xd9\x48\x92\x62" + "\x1f\x2b\x0c\x6c\x8f\x15\x04\x53\xcb\x3a\x07\xbc\x0b\xec\x8f" + "\x4d\xea\x37\xd0\x13\x03\x03\x79\x87\x83\x7e\x63\xde\x71\x22" + "\x43\x6f\x3b\x10\xad\x3b\x68\x6a\x73\x05\x07\x01\xbb\x08\x93" + "\xa6\xbf\x87\x7f\x06\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30" + "\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c" + "\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81" + "\x01\x09\xa2\x2b\x80\x20\x29\xe8\x9c\x4f\x52\x99\x3e\x96\x07" + "\x4f\x16\x1c\x2b\x76\x5b\xb1\xb0\x80\xd3\xbe\x4f\xbe\xf9\x8c" + "\x54\x36\x1e\x6f\x67\xf4\xa5\xbb\x81\x03\x02\x10\x00\x82\x02" + "\x03\x98\xa3\x27\x80\x20\x4a\x64\xbf\x23\xa9\x2b\xec\x55\x00" + "\x3d\x55\xf5\xbf\x3f\x26\x49\x18\xbb\xe0\xda\xf8\x0c\xf4\x5c" + "\x8a\x33\x74\xb6\x58\xa4\x38\x30\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\x6b\xf3\xe3\x0f\x92\x6d\x45\x8d\xae\xd2\x8a\x2a\x3e" + "\x53\x37\x1f\x57\x82\x21\x60\xe4\x5b\x88\x9a\x9d\x13\xa2\x56" + "\x13\x88\x9e\x21\x81\x03\x02\x00\x00\xa1\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x34\x77\x63\xd7\x27\x76" + "\x4d\x3a\x9b\x6c\xdb\x09\xed\xd8\x5f\xc2\x12\x9e\x9c\xc4\xc8" + "\xa6\x62\xcf\x14\xde\x09\x30\x64\x8e\xf4\x84\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe9\x54\x85\xb7\x7d\xa1\x1f\x2f\xaa\x84" + "\x72\x3f\x4e\x3f\x09\xa7\x49\xf2\x15\x2a\xe6\x13\x5b\x68\xb6" + "\xe1\x98\xa6\x89\x76\x08\x05\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xba\x6c\xdc\x6c\xc4\xcb\xc2\xee\x99\xbf\x73" + "\xea\x1e\x7f\x9b\x62\xbf\x91\x90\x34\xb2\xaf\x88\xdc\xc9\x51" + "\x9c\x50\x7b\x21\x5c\xa9\x81\x03\x08\x80\x74\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\xb8\x77\x40\x98\x2e\x91" + "\xc9\x98\x39\x48\xba\x30\x4a\xa0\x1f\x0a\x57\x7f\x56\xd9\x9d" + "\x05\xeb\xb5\x7b\x07\x50\x22\x1e\x1b\xa0\x57\x81\x03\x02\x18" + "\x3a\x82\x02\x03\xb8\xa1\x2b\x80\x20\xe2\x41\xd4\x68\x11\x00" + "\x16\x0b\xc7\x26\x82\x74\x9a\x7f\x43\xc0\x61\x46\x06\xb0\x0a" + "\x09\x9f\xad\xe0\x31\xa3\x79\x5f\x81\xa1\x44\x81\x03\x02\x18" + "\x3a\x82\x02\x03\xb8\xa2\x2b\x80\x20\x64\xb6\x9a\x8e\xca\xeb" + "\x8f\x0b\xb0\x58\x87\xc1\x4c\xf3\x9e\x26\x0a\x5f\x7e\xc3\xcb" + "\xbb\xf3\x8d\xf8\x70\xd9\xdc\x98\x53\x46\xd7\x81\x03\x04\x38" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x34\x77\x63\xd7\x27\x76" + "\x4d\x3a\x9b\x6c\xdb\x09\xed\xd8\x5f\xc2\x12\x9e\x9c\xc4\xc8" + "\xa6\x62\xcf\x14\xde\x09\x30\x64\x8e\xf4\x84\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe9\x54\x85\xb7\x7d\xa1\x1f\x2f\xaa\x84" + "\x72\x3f\x4e\x3f\x09\xa7\x49\xf2\x15\x2a\xe6\x13\x5b\x68\xb6" + "\xe1\x98\xa6\x89\x76\x08\x05\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh59() + { + testcase("Thresh59"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim11Cond + // ** Rsa12Cond + // ** Ed13Cond + // ** Prefix14Cond + // ** Thresh21Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim5Cond + // ***** Rsa6Cond + // ***** Ed7Cond + // ***** ed4 + // ** preim8 + // ** rsa9 + // ** ed10 + + auto const ed4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x23, 0x8b, 0xb2, 0xc9, 0xde, 0xad, 0x1b, 0xb6, 0xce, 0x93, 0x9a, + 0x00, 0x47, 0x3d, 0x42, 0xc1, 0x30, 0x19, 0x95, 0x03, 0x55, 0x19, + 0x74, 0x85, 0xe9, 0xed, 0x92, 0xef, 0x22, 0xbd, 0x49, 0xe5, 0x44, + 0xa0, 0x7a, 0x41, 0x7d, 0xa7, 0xb0, 0x3a, 0x90, 0x1b, 0xa1, 0x2b, + 0xcc, 0x1d, 0x0a, 0x8b, 0x95, 0xc1, 0x3c, 0x05, 0x68, 0x26, 0x39, + 0xad, 0xe4, 0xd4, 0x75, 0xf0, 0xb5, 0x18, 0xbe, 0x01}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim8Preimage = "I am root"s; + auto const preim8Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa9PublicKey{ + {0xb6, 0x7b, 0xe2, 0x98, 0x9f, 0xff, 0x6c, 0x37, 0xd0, 0xb6, 0x64, + 0x19, 0xfb, 0xa0, 0x21, 0x18, 0xe2, 0xc0, 0xd1, 0x92, 0xbd, 0x04, + 0xa6, 0xd2, 0xb4, 0x7e, 0xc6, 0x6a, 0x1a, 0x34, 0x20, 0x7b, 0xfe, + 0x84, 0xeb, 0xe8, 0xc1, 0x6f, 0xfd, 0xdc, 0x0a, 0xfe, 0x60, 0x55, + 0xb6, 0xfc, 0x86, 0x5a, 0x21, 0xbf, 0xf1, 0x39, 0xfa, 0xec, 0x42, + 0xca, 0x57, 0xb3, 0x3e, 0x3f, 0xe6, 0x26, 0x5a, 0xb7, 0x4a, 0x5f, + 0xbb, 0xb1, 0xf5, 0x91, 0x85, 0x92, 0x3e, 0x6a, 0x18, 0x48, 0x4d, + 0x9e, 0xdd, 0x08, 0x25, 0xa3, 0x3b, 0x3d, 0x75, 0x9a, 0xbe, 0xee, + 0x0d, 0x6e, 0xd2, 0x5d, 0xe2, 0xbd, 0xed, 0x45, 0x60, 0xef, 0xa0, + 0x37, 0xfd, 0xbb, 0xcf, 0x30, 0x97, 0xf1, 0x5b, 0xc8, 0x9c, 0x29, + 0x33, 0x67, 0x3e, 0x23, 0x33, 0x7f, 0x36, 0xd4, 0x75, 0x8b, 0xa1, + 0xcf, 0x9e, 0xe6, 0xc5, 0x63, 0x63, 0xb0, 0x3f, 0xa0, 0xc2, 0xa2, + 0x10, 0xc9, 0xb2, 0x6b, 0xaa, 0x67, 0xc9, 0xf5, 0xb8, 0xbf, 0x5b, + 0x97, 0xe5, 0x29, 0xf2, 0xbb, 0xc7, 0x22, 0x0f, 0x1f, 0xc1, 0xf6, + 0xca, 0x4a, 0x8a, 0x46, 0x89, 0xa0, 0xca, 0x4e, 0x49, 0x9d, 0xfc, + 0x23, 0xd3, 0xb4, 0xdb, 0xc6, 0x84, 0x45, 0xbd, 0x9f, 0x10, 0x86, + 0xe2, 0xf0, 0x47, 0x7b, 0x75, 0xbf, 0x25, 0x99, 0x02, 0x2c, 0xdb, + 0x6b, 0xd6, 0x2b, 0x67, 0x0d, 0xcd, 0x46, 0x63, 0xbd, 0xce, 0x1c, + 0xc5, 0x56, 0x63, 0x58, 0x5b, 0xc8, 0xb2, 0x58, 0x42, 0xf6, 0xaf, + 0xce, 0x47, 0xb2, 0xa9, 0x2a, 0x71, 0x8b, 0x82, 0xf4, 0x72, 0xff, + 0xef, 0xe7, 0xc1, 0x70, 0x12, 0xfa, 0xb8, 0xad, 0xb2, 0xfe, 0xa9, + 0x14, 0xe7, 0xc2, 0xec, 0x12, 0xbf, 0x29, 0x5a, 0x65, 0x91, 0x74, + 0x82, 0xd3, 0x77, 0x1f, 0x14, 0xbf, 0x5f, 0x41, 0x11, 0x6c, 0x7c, + 0x22, 0x70, 0x65}}; + std::array const rsa9Sig{ + {0x5e, 0xaf, 0x04, 0x50, 0x56, 0x99, 0x89, 0xd9, 0x83, 0xbf, 0x2e, + 0xcb, 0x64, 0x9e, 0xae, 0x60, 0x19, 0x44, 0x25, 0xe4, 0x4b, 0x29, + 0xf0, 0x09, 0x89, 0xfb, 0x45, 0xc3, 0xcc, 0xe1, 0x33, 0xf0, 0x92, + 0x4d, 0x5f, 0x5c, 0x59, 0x3c, 0x4b, 0x6f, 0x0f, 0x9f, 0x5b, 0xb8, + 0x0d, 0x06, 0xac, 0x2c, 0x16, 0xad, 0x30, 0xb9, 0x60, 0xec, 0x76, + 0x2a, 0x92, 0x02, 0x90, 0x0a, 0xac, 0x4a, 0x2a, 0x87, 0x6e, 0xe5, + 0x70, 0xd7, 0x95, 0xd7, 0x33, 0xc8, 0x8d, 0xd7, 0x7c, 0x21, 0x81, + 0x94, 0xa5, 0x55, 0xe9, 0xb6, 0xc0, 0xc9, 0x05, 0x6d, 0xfc, 0x57, + 0xb4, 0xbd, 0xb9, 0x22, 0xf1, 0x9e, 0x27, 0x87, 0x84, 0x27, 0x0f, + 0x24, 0xd3, 0xf2, 0xe2, 0x7f, 0x9b, 0xc9, 0x22, 0x2d, 0xd9, 0xa3, + 0x29, 0x56, 0x56, 0x0f, 0x6e, 0x1a, 0x8f, 0x99, 0xa7, 0xb3, 0x32, + 0x63, 0x62, 0xef, 0x81, 0x89, 0xd8, 0xee, 0x51, 0xe5, 0x61, 0xb2, + 0x50, 0xaf, 0xaf, 0x21, 0x50, 0x67, 0xd1, 0x71, 0x83, 0x4c, 0xc0, + 0xca, 0x2b, 0x74, 0x7f, 0xf4, 0x26, 0x0a, 0x0f, 0x31, 0x9f, 0x67, + 0xb6, 0x26, 0x04, 0xda, 0x73, 0xc5, 0x1f, 0xc0, 0x2c, 0x82, 0xed, + 0x69, 0xbb, 0xea, 0xfd, 0x3c, 0x38, 0x18, 0x55, 0x29, 0xdf, 0x27, + 0x71, 0x2e, 0xee, 0xb2, 0x56, 0x30, 0xdf, 0x79, 0x90, 0x02, 0x37, + 0x72, 0x5b, 0x43, 0xde, 0x01, 0x66, 0xd3, 0x61, 0xae, 0xa6, 0x95, + 0x82, 0xcf, 0x89, 0x24, 0xab, 0x51, 0xed, 0x17, 0x2a, 0x14, 0x34, + 0xeb, 0x73, 0xbd, 0x9e, 0x1c, 0x2a, 0x14, 0xa8, 0x66, 0x27, 0x9f, + 0xb0, 0x25, 0x5e, 0x73, 0x72, 0xbd, 0x26, 0xce, 0x0d, 0xdc, 0x56, + 0xf4, 0x44, 0x75, 0xa9, 0xdf, 0x96, 0xcb, 0xfd, 0xe9, 0x89, 0x56, + 0xad, 0x19, 0x06, 0xf0, 0xc1, 0xb0, 0xc4, 0xd8, 0xdb, 0x5d, 0x65, + 0xd5, 0xc9, 0x33}}; + auto const ed10Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed10PublicKey{ + {0x7a, 0xdc, 0x65, 0x52, 0x0f, 0xca, 0x06, 0x72, 0x5c, 0xe4, 0x65, + 0x57, 0x82, 0x6d, 0x3f, 0x57, 0x1f, 0xc6, 0xc6, 0xe4, 0x5d, 0xaf, + 0x08, 0xda, 0xe2, 0x07, 0x02, 0xcb, 0x42, 0x3d, 0x2a, 0xd0}}; + std::array const ed10Sig{ + {0xf2, 0x7c, 0x5f, 0x61, 0xec, 0xbc, 0xc2, 0x8c, 0xad, 0xd0, 0xd3, + 0xcb, 0x89, 0xab, 0xac, 0xe4, 0x01, 0x6f, 0x90, 0x60, 0x6f, 0x89, + 0xc0, 0xd9, 0xca, 0x2b, 0x4b, 0xfd, 0x78, 0x80, 0xae, 0xf9, 0xd0, + 0x3f, 0x45, 0x7a, 0xb2, 0x26, 0x0c, 0xee, 0xc5, 0x06, 0x0e, 0x94, + 0x6b, 0xf8, 0xfe, 0x96, 0x4f, 0x0d, 0xa0, 0x2c, 0x66, 0x78, 0xa5, + 0x60, 0xfe, 0x47, 0x1e, 0xa9, 0x88, 0x76, 0x55, 0x03}}; + std::array const ed10SigningKey{ + {0x84, 0x04, 0xdd, 0x34, 0x6a, 0x4d, 0x40, 0xef, 0x70, 0xf7, 0xef, + 0x7f, 0x25, 0xf4, 0xd0, 0xa0, 0xa8, 0xad, 0xc1, 0x51, 0x1c, 0x16, + 0x57, 0x9d, 0x5e, 0xd9, 0xa6, 0x45, 0xda, 0xff, 0x5e, 0x1e}}; + (void)ed10SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim11CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim11Cond{Type::preimageSha256, + 9, + Preim11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa12CondConditionFingerprint = { + {0x38, 0xb9, 0xf0, 0xeb, 0x68, 0x8b, 0x9f, 0x55, 0x37, 0x9a, 0xec, + 0x07, 0xd4, 0xa2, 0x13, 0xac, 0x34, 0xa1, 0x67, 0x31, 0x34, 0xea, + 0xc2, 0x2f, 0xef, 0x13, 0xe3, 0x5c, 0xcf, 0x8f, 0x90, 0x1e}}; + Condition const Rsa12Cond{Type::rsaSha256, + 65536, + Rsa12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed13CondConditionFingerprint = { + {0x7c, 0x54, 0x6a, 0x6d, 0x7f, 0x00, 0x52, 0x31, 0x03, 0xe7, 0xb4, + 0x5b, 0x1c, 0x9f, 0x72, 0xeb, 0x3c, 0x18, 0x08, 0xa3, 0x24, 0xb2, + 0x63, 0x5f, 0x77, 0x55, 0x4a, 0x42, 0xdb, 0x1e, 0xff, 0x1e}}; + Condition const Ed13Cond{Type::ed25519Sha256, + 131072, + Ed13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix14CondConditionFingerprint = { + {0x3e, 0xd9, 0xb4, 0x18, 0x6b, 0x96, 0xf6, 0xe1, 0x13, 0xb3, 0x62, + 0xcb, 0xd8, 0xa0, 0x27, 0xc4, 0xa3, 0x67, 0x2d, 0xb2, 0x63, 0x1c, + 0xc7, 0xa1, 0xaf, 0xef, 0xf7, 0xf6, 0x65, 0x61, 0x51, 0xf6}}; + Condition const Prefix14Cond{Type::prefixSha256, + 137251, + Prefix14CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh21CondConditionFingerprint = { + {0x0d, 0x91, 0x83, 0xba, 0xa1, 0x52, 0xe7, 0xdc, 0x99, 0x9e, 0x47, + 0xcb, 0x56, 0x0f, 0x80, 0x5a, 0x71, 0xc0, 0x40, 0x40, 0x21, 0x2a, + 0xdf, 0xbb, 0x77, 0xdf, 0x56, 0x17, 0x05, 0xd3, 0x28, 0x3f}}; + Condition const Thresh21Cond{Type::thresholdSha256, + 276480, + Thresh21CondConditionFingerprint, + std::bitset<5>{25}}; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim8 = + std::make_unique(makeSlice(preim8Preimage)); + auto rsa9 = std::make_unique( + makeSlice(rsa9PublicKey), makeSlice(rsa9Sig)); + auto ed10 = std::make_unique(ed10PublicKey, ed10Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim8)); + thresh0Subfulfillments.emplace_back(std::move(rsa9)); + thresh0Subfulfillments.emplace_back(std::move(ed10)); + std::vector thresh0Subconditions{ + {Preim11Cond, Rsa12Cond, Ed13Cond, Prefix14Cond, Thresh21Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x04\x59\xa0\x82\x03\x7f\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x81\xfd\x80\x02\x50\x31\x81\x01" + "\x1a\xa2\x81\xf3\xa1\x81\xf0\x80\x02\x50\x32\x81\x01\x1c\xa2" + "\x81\xe6\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20\x26\x80\x85\x71" + "\x79\x37\x27\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c\x5b\x9f" + "\x99\x54\xb6\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec\x81\x40" + "\x23\x8b\xb2\xc9\xde\xad\x1b\xb6\xce\x93\x9a\x00\x47\x3d\x42" + "\xc1\x30\x19\x95\x03\x55\x19\x74\x85\xe9\xed\x92\xef\x22\xbd" + "\x49\xe5\x44\xa0\x7a\x41\x7d\xa7\xb0\x3a\x90\x1b\xa1\x2b\xcc" + "\x1d\x0a\x8b\x95\xc1\x3c\x05\x68\x26\x39\xad\xe4\xd4\x75\xf0" + "\xb5\x18\xbe\x01\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa3\x27\x80\x20\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9" + "\x32\x48\x19\xe1\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83" + "\xeb\x05\xa7\x59\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d" + "\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d" + "\x42\xc0\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00" + "\xb6\x7b\xe2\x98\x9f\xff\x6c\x37\xd0\xb6\x64\x19\xfb\xa0\x21" + "\x18\xe2\xc0\xd1\x92\xbd\x04\xa6\xd2\xb4\x7e\xc6\x6a\x1a\x34" + "\x20\x7b\xfe\x84\xeb\xe8\xc1\x6f\xfd\xdc\x0a\xfe\x60\x55\xb6" + "\xfc\x86\x5a\x21\xbf\xf1\x39\xfa\xec\x42\xca\x57\xb3\x3e\x3f" + "\xe6\x26\x5a\xb7\x4a\x5f\xbb\xb1\xf5\x91\x85\x92\x3e\x6a\x18" + "\x48\x4d\x9e\xdd\x08\x25\xa3\x3b\x3d\x75\x9a\xbe\xee\x0d\x6e" + "\xd2\x5d\xe2\xbd\xed\x45\x60\xef\xa0\x37\xfd\xbb\xcf\x30\x97" + "\xf1\x5b\xc8\x9c\x29\x33\x67\x3e\x23\x33\x7f\x36\xd4\x75\x8b" + "\xa1\xcf\x9e\xe6\xc5\x63\x63\xb0\x3f\xa0\xc2\xa2\x10\xc9\xb2" + "\x6b\xaa\x67\xc9\xf5\xb8\xbf\x5b\x97\xe5\x29\xf2\xbb\xc7\x22" + "\x0f\x1f\xc1\xf6\xca\x4a\x8a\x46\x89\xa0\xca\x4e\x49\x9d\xfc" + "\x23\xd3\xb4\xdb\xc6\x84\x45\xbd\x9f\x10\x86\xe2\xf0\x47\x7b" + "\x75\xbf\x25\x99\x02\x2c\xdb\x6b\xd6\x2b\x67\x0d\xcd\x46\x63" + "\xbd\xce\x1c\xc5\x56\x63\x58\x5b\xc8\xb2\x58\x42\xf6\xaf\xce" + "\x47\xb2\xa9\x2a\x71\x8b\x82\xf4\x72\xff\xef\xe7\xc1\x70\x12" + "\xfa\xb8\xad\xb2\xfe\xa9\x14\xe7\xc2\xec\x12\xbf\x29\x5a\x65" + "\x91\x74\x82\xd3\x77\x1f\x14\xbf\x5f\x41\x11\x6c\x7c\x22\x70" + "\x65\x81\x82\x01\x00\x5e\xaf\x04\x50\x56\x99\x89\xd9\x83\xbf" + "\x2e\xcb\x64\x9e\xae\x60\x19\x44\x25\xe4\x4b\x29\xf0\x09\x89" + "\xfb\x45\xc3\xcc\xe1\x33\xf0\x92\x4d\x5f\x5c\x59\x3c\x4b\x6f" + "\x0f\x9f\x5b\xb8\x0d\x06\xac\x2c\x16\xad\x30\xb9\x60\xec\x76" + "\x2a\x92\x02\x90\x0a\xac\x4a\x2a\x87\x6e\xe5\x70\xd7\x95\xd7" + "\x33\xc8\x8d\xd7\x7c\x21\x81\x94\xa5\x55\xe9\xb6\xc0\xc9\x05" + "\x6d\xfc\x57\xb4\xbd\xb9\x22\xf1\x9e\x27\x87\x84\x27\x0f\x24" + "\xd3\xf2\xe2\x7f\x9b\xc9\x22\x2d\xd9\xa3\x29\x56\x56\x0f\x6e" + "\x1a\x8f\x99\xa7\xb3\x32\x63\x62\xef\x81\x89\xd8\xee\x51\xe5" + "\x61\xb2\x50\xaf\xaf\x21\x50\x67\xd1\x71\x83\x4c\xc0\xca\x2b" + "\x74\x7f\xf4\x26\x0a\x0f\x31\x9f\x67\xb6\x26\x04\xda\x73\xc5" + "\x1f\xc0\x2c\x82\xed\x69\xbb\xea\xfd\x3c\x38\x18\x55\x29\xdf" + "\x27\x71\x2e\xee\xb2\x56\x30\xdf\x79\x90\x02\x37\x72\x5b\x43" + "\xde\x01\x66\xd3\x61\xae\xa6\x95\x82\xcf\x89\x24\xab\x51\xed" + "\x17\x2a\x14\x34\xeb\x73\xbd\x9e\x1c\x2a\x14\xa8\x66\x27\x9f" + "\xb0\x25\x5e\x73\x72\xbd\x26\xce\x0d\xdc\x56\xf4\x44\x75\xa9" + "\xdf\x96\xcb\xfd\xe9\x89\x56\xad\x19\x06\xf0\xc1\xb0\xc4\xd8" + "\xdb\x5d\x65\xd5\xc9\x33\xa4\x64\x80\x20\x7a\xdc\x65\x52\x0f" + "\xca\x06\x72\x5c\xe4\x65\x57\x82\x6d\x3f\x57\x1f\xc6\xc6\xe4" + "\x5d\xaf\x08\xda\xe2\x07\x02\xcb\x42\x3d\x2a\xd0\x81\x40\xf2" + "\x7c\x5f\x61\xec\xbc\xc2\x8c\xad\xd0\xd3\xcb\x89\xab\xac\xe4" + "\x01\x6f\x90\x60\x6f\x89\xc0\xd9\xca\x2b\x4b\xfd\x78\x80\xae" + "\xf9\xd0\x3f\x45\x7a\xb2\x26\x0c\xee\xc5\x06\x0e\x94\x6b\xf8" + "\xfe\x96\x4f\x0d\xa0\x2c\x66\x78\xa5\x60\xfe\x47\x1e\xa9\x88" + "\x76\x55\x03\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa1\x2b\x80\x20\x3e\xd9\xb4\x18\x6b\x96\xf6\xe1\x13\xb3\x62" + "\xcb\xd8\xa0\x27\xc4\xa3\x67\x2d\xb2\x63\x1c\xc7\xa1\xaf\xef" + "\xf7\xf6\x65\x61\x51\xf6\x81\x03\x02\x18\x23\x82\x02\x03\xb8" + "\xa2\x2b\x80\x20\x0d\x91\x83\xba\xa1\x52\xe7\xdc\x99\x9e\x47" + "\xcb\x56\x0f\x80\x5a\x71\xc0\x40\x40\x21\x2a\xdf\xbb\x77\xdf" + "\x56\x17\x05\xd3\x28\x3f\x81\x03\x04\x38\x00\x82\x02\x03\x98" + "\xa3\x27\x80\x20\x38\xb9\xf0\xeb\x68\x8b\x9f\x55\x37\x9a\xec" + "\x07\xd4\xa2\x13\xac\x34\xa1\x67\x31\x34\xea\xc2\x2f\xef\x13" + "\xe3\x5c\xcf\x8f\x90\x1e\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\x7c\x54\x6a\x6d\x7f\x00\x52\x31\x03\xe7\xb4\x5b\x1c\x9f\x72" + "\xeb\x3c\x18\x08\xa3\x24\xb2\x63\x5f\x77\x55\x4a\x42\xdb\x1e" + "\xff\x1e\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x19\xea\x31\xe3\xf2\x87\x1d\xe4\x1a\x9c\xff" + "\x56\xc6\x29\x8c\xc7\xac\xb0\xdd\x27\x19\x50\x6b\x35\xbe\x89" + "\x11\x8c\x97\x3a\x5d\x1c\x81\x03\x0a\x8c\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x3e\xd9\xb4\x18\x6b\x96\xf6\xe1\x13\xb3\x62\xcb" + "\xd8\xa0\x27\xc4\xa3\x67\x2d\xb2\x63\x1c\xc7\xa1\xaf\xef\xf7" + "\xf6\x65\x61\x51\xf6\x81\x03\x02\x18\x23\x82\x02\x03\xb8\xa1" + "\x2b\x80\x20\xe2\x41\xd4\x68\x11\x00\x16\x0b\xc7\x26\x82\x74" + "\x9a\x7f\x43\xc0\x61\x46\x06\xb0\x0a\x09\x9f\xad\xe0\x31\xa3" + "\x79\x5f\x81\xa1\x44\x81\x03\x02\x18\x3a\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\x0d\x91\x83\xba\xa1\x52\xe7\xdc\x99\x9e\x47\xcb" + "\x56\x0f\x80\x5a\x71\xc0\x40\x40\x21\x2a\xdf\xbb\x77\xdf\x56" + "\x17\x05\xd3\x28\x3f\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x38\xb9\xf0\xeb\x68\x8b\x9f\x55\x37\x9a\xec\x07" + "\xd4\xa2\x13\xac\x34\xa1\x67\x31\x34\xea\xc2\x2f\xef\x13\xe3" + "\x5c\xcf\x8f\x90\x1e\x81\x03\x01\x00\x00\xa3\x27\x80\x20\xe5" + "\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70\x64\x51" + "\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7\xe4" + "\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4" + "\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79" + "\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x7c\x54\x6a\x6d\x7f\x00\x52\x31\x03" + "\xe7\xb4\x5b\x1c\x9f\x72\xeb\x3c\x18\x08\xa3\x24\xb2\x63\x5f" + "\x77\x55\x4a\x42\xdb\x1e\xff\x1e\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh60() + { + testcase("Thresh60"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim27Cond + // ** Rsa28Cond + // ** Ed29Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** ed4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** ed6 + // ** prefix13 + // *** prefix14 + // **** thresh15 + // ***** Preim22Cond + // ***** Rsa23Cond + // ***** Ed24Cond + // ***** ed16 + // ***** thresh17 + // ****** Preim19Cond + // ****** Rsa20Cond + // ****** Ed21Cond + // ****** ed18 + // ** thresh25 + // *** ed26 + + auto const ed4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x23, 0x8b, 0xb2, 0xc9, 0xde, 0xad, 0x1b, 0xb6, 0xce, 0x93, 0x9a, + 0x00, 0x47, 0x3d, 0x42, 0xc1, 0x30, 0x19, 0x95, 0x03, 0x55, 0x19, + 0x74, 0x85, 0xe9, 0xed, 0x92, 0xef, 0x22, 0xbd, 0x49, 0xe5, 0x44, + 0xa0, 0x7a, 0x41, 0x7d, 0xa7, 0xb0, 0x3a, 0x90, 0x1b, 0xa1, 0x2b, + 0xcc, 0x1d, 0x0a, 0x8b, 0x95, 0xc1, 0x3c, 0x05, 0x68, 0x26, 0x39, + 0xad, 0xe4, 0xd4, 0x75, 0xf0, 0xb5, 0x18, 0xbe, 0x01}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const ed6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed6PublicKey{ + {0xa0, 0x45, 0x26, 0xcf, 0xee, 0x7e, 0xda, 0x68, 0xd9, 0x70, 0x23, + 0xac, 0x68, 0x48, 0x9e, 0x20, 0xa4, 0x5e, 0xf8, 0x51, 0xcb, 0xfe, + 0x72, 0xc1, 0x11, 0x5d, 0x25, 0x9c, 0xbc, 0xfd, 0xbb, 0x8b}}; + std::array const ed6Sig{ + {0xfb, 0xc0, 0xf1, 0x77, 0xf4, 0x14, 0xdf, 0xb2, 0x32, 0xc8, 0x99, + 0xc7, 0x9a, 0x9d, 0xe0, 0x4a, 0x03, 0x2d, 0xf5, 0xc9, 0xde, 0x46, + 0xda, 0x77, 0x52, 0x24, 0x22, 0xef, 0xfb, 0x93, 0x63, 0xb1, 0x05, + 0x36, 0x57, 0x4c, 0x78, 0xbc, 0x78, 0x6d, 0x20, 0x08, 0xbd, 0x75, + 0xc3, 0x1e, 0xe0, 0x29, 0x24, 0xde, 0xa7, 0x03, 0xd3, 0xad, 0x5d, + 0x7c, 0x31, 0x05, 0x83, 0xd0, 0xa4, 0xed, 0x95, 0x07}}; + std::array const ed6SigningKey{ + {0x8f, 0xac, 0x15, 0x02, 0xce, 0xb4, 0x10, 0x27, 0x56, 0x91, 0x2b, + 0xd0, 0x57, 0xe7, 0x6c, 0xe0, 0xc5, 0x46, 0x65, 0x38, 0xf0, 0xc8, + 0x09, 0xe0, 0xb4, 0x57, 0xfb, 0x11, 0xfc, 0x00, 0xe9, 0xdf}}; + (void)ed6SigningKey; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const ed16Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + std::array const ed16PublicKey{ + {0x50, 0x5a, 0xcb, 0xfd, 0xac, 0xce, 0x8b, 0x6f, 0xeb, 0x52, 0x06, + 0x75, 0xb8, 0x72, 0x9d, 0x94, 0x62, 0xdc, 0xe4, 0x11, 0x24, 0xd0, + 0xa3, 0x35, 0x47, 0x20, 0x02, 0xd5, 0xf7, 0x3f, 0x9c, 0x93}}; + std::array const ed16Sig{ + {0x34, 0x3f, 0xf1, 0xb4, 0x3c, 0x0d, 0x27, 0x82, 0xf9, 0xea, 0x84, + 0xf4, 0x21, 0x39, 0x58, 0xf7, 0x53, 0xe1, 0x19, 0x65, 0x8a, 0x7c, + 0x90, 0x42, 0x60, 0x16, 0xc7, 0x53, 0xfa, 0x8f, 0x50, 0x2c, 0x4b, + 0x00, 0x15, 0x17, 0x30, 0x1c, 0x2a, 0xc9, 0xf9, 0xe7, 0xe6, 0x83, + 0x94, 0x43, 0xad, 0x6f, 0x3f, 0x4f, 0xec, 0x09, 0x21, 0xed, 0x48, + 0x2c, 0x7f, 0xd9, 0x64, 0x23, 0xa7, 0x69, 0x58, 0x07}}; + std::array const ed16SigningKey{ + {0xb7, 0xbd, 0x93, 0x4b, 0x03, 0x39, 0xf8, 0x6f, 0x47, 0x66, 0x7f, + 0xd4, 0x4f, 0x94, 0x32, 0xe6, 0xb2, 0x70, 0x9c, 0x2c, 0x64, 0x92, + 0xc4, 0xb1, 0xdd, 0x04, 0x6d, 0x00, 0x92, 0x41, 0xe9, 0x41}}; + (void)ed16SigningKey; + auto const ed18Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + std::array const ed18PublicKey{ + {0x3b, 0x07, 0x0f, 0xe5, 0x29, 0x34, 0xd9, 0x17, 0xf5, 0x06, 0x00, + 0xb8, 0x87, 0x2f, 0xcf, 0x89, 0x52, 0x70, 0xcc, 0x04, 0x92, 0xe1, + 0x67, 0xcb, 0xba, 0xbb, 0x10, 0xa6, 0x2d, 0x06, 0xa4, 0x6b}}; + std::array const ed18Sig{ + {0xb7, 0x54, 0x1c, 0xd2, 0x7a, 0x9a, 0x47, 0x24, 0xf5, 0x88, 0xc6, + 0x1d, 0x4f, 0xc1, 0xab, 0x44, 0xe6, 0x2c, 0x76, 0x87, 0x82, 0x18, + 0x8f, 0x6a, 0x23, 0x7d, 0xf1, 0x8f, 0x17, 0x89, 0xc5, 0x7a, 0xb4, + 0xe9, 0xe1, 0x9f, 0x6c, 0x6e, 0x4b, 0x32, 0xca, 0x03, 0x1d, 0xd4, + 0x89, 0x45, 0x2f, 0xb6, 0x98, 0x21, 0xc9, 0xce, 0xb5, 0x60, 0x72, + 0xc2, 0xb1, 0x74, 0x8e, 0x9a, 0xf9, 0xf0, 0xe6, 0x05}}; + std::array const ed18SigningKey{ + {0x59, 0x73, 0xbb, 0x41, 0xb0, 0xe0, 0xce, 0xc2, 0xa9, 0x85, 0xaa, + 0x05, 0xa4, 0x7e, 0x3b, 0x51, 0x09, 0x8d, 0x3e, 0x47, 0xb7, 0x75, + 0xda, 0x81, 0x39, 0xa0, 0xe1, 0xd5, 0x9f, 0xb0, 0x9c, 0x5a}}; + (void)ed18SigningKey; + auto const thresh17Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh15Msg = "P14P13abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim22CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim22Cond{Type::preimageSha256, + 9, + Preim22CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa23CondConditionFingerprint = { + {0x4a, 0x64, 0xbf, 0x23, 0xa9, 0x2b, 0xec, 0x55, 0x00, 0x3d, 0x55, + 0xf5, 0xbf, 0x3f, 0x26, 0x49, 0x18, 0xbb, 0xe0, 0xda, 0xf8, 0x0c, + 0xf4, 0x5c, 0x8a, 0x33, 0x74, 0xb6, 0x58, 0xa4, 0x38, 0x30}}; + Condition const Rsa23Cond{Type::rsaSha256, + 65536, + Rsa23CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed24CondConditionFingerprint = { + {0x6b, 0xf3, 0xe3, 0x0f, 0x92, 0x6d, 0x45, 0x8d, 0xae, 0xd2, 0x8a, + 0x2a, 0x3e, 0x53, 0x37, 0x1f, 0x57, 0x82, 0x21, 0x60, 0xe4, 0x5b, + 0x88, 0x9a, 0x9d, 0x13, 0xa2, 0x56, 0x13, 0x88, 0x9e, 0x21}}; + Condition const Ed24Cond{Type::ed25519Sha256, + 131072, + Ed24CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix14Prefix = "P14"s; + auto const prefix14Msg = "P13abcdefghijklmnopqrstuvwxyz"s; + auto const prefix14MaxMsgLength = 29; + auto const prefix13Prefix = "P13"s; + auto const prefix13Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix13MaxMsgLength = 26; + auto const ed26Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed26PublicKey{ + {0x15, 0x24, 0x2d, 0xe4, 0x7b, 0xab, 0xdb, 0x14, 0x1b, 0x6c, 0x2a, + 0x2d, 0x24, 0x68, 0x71, 0xc8, 0xab, 0x55, 0xd6, 0xad, 0xc4, 0x47, + 0x6b, 0x52, 0xea, 0x79, 0x81, 0x91, 0xe7, 0x8f, 0xc5, 0x49}}; + std::array const ed26Sig{ + {0x44, 0xeb, 0x07, 0x36, 0xc3, 0xf5, 0xf5, 0xe1, 0xd8, 0xff, 0x39, + 0x35, 0xfe, 0xe5, 0x56, 0x49, 0xbc, 0x49, 0x45, 0x45, 0x8b, 0xa0, + 0x3c, 0x74, 0xda, 0x84, 0x9b, 0x74, 0x36, 0x08, 0x41, 0x50, 0xea, + 0x6f, 0x42, 0xe4, 0x93, 0x61, 0x42, 0xea, 0xcb, 0x86, 0xa9, 0x75, + 0x8d, 0xe0, 0x99, 0x07, 0xb5, 0x85, 0x1f, 0xe1, 0xdf, 0x75, 0x03, + 0xe3, 0xff, 0x3d, 0xc9, 0x04, 0x67, 0x4e, 0x6a, 0x00}}; + std::array const ed26SigningKey{ + {0x15, 0x75, 0x2c, 0x00, 0xd7, 0xc6, 0x43, 0xee, 0xa1, 0x22, 0x0b, + 0xf0, 0x5a, 0xf5, 0xcd, 0xf6, 0xa2, 0xc0, 0x16, 0x5d, 0x4c, 0x2a, + 0x5c, 0x57, 0x1e, 0xbf, 0x19, 0x5a, 0xc7, 0xc9, 0xf9, 0x5a}}; + (void)ed26SigningKey; + auto const thresh25Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim27CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim27Cond{Type::preimageSha256, + 9, + Preim27CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa28CondConditionFingerprint = { + {0x58, 0xac, 0x94, 0x55, 0x27, 0x79, 0x7a, 0x0c, 0xac, 0x84, 0x2d, + 0x5c, 0x13, 0x32, 0xee, 0x84, 0x25, 0xb8, 0xb8, 0xec, 0x25, 0x0d, + 0x40, 0xee, 0xc0, 0xd4, 0x79, 0x18, 0x3f, 0xc6, 0xbc, 0xd7}}; + Condition const Rsa28Cond{Type::rsaSha256, + 65536, + Rsa28CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed29CondConditionFingerprint = { + {0xc5, 0x39, 0xb2, 0xc7, 0xc4, 0x92, 0x8a, 0x29, 0xf3, 0x72, 0xb4, + 0x6c, 0xa5, 0x0d, 0x8c, 0xbe, 0x43, 0xda, 0xc9, 0xac, 0x6c, 0x26, + 0x7c, 0x44, 0xb9, 0x3f, 0xee, 0x40, 0xcc, 0x8e, 0x41, 0x3c}}; + Condition const Ed29Cond{Type::ed25519Sha256, + 131072, + Ed29CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + auto ed6 = std::make_unique(ed6PublicKey, ed6Sig); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(ed6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto ed16 = std::make_unique(ed16PublicKey, ed16Sig); + auto ed18 = std::make_unique(ed18PublicKey, ed18Sig); + std::vector> thresh17Subfulfillments; + thresh17Subfulfillments.emplace_back(std::move(ed18)); + std::vector thresh17Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond}}; + auto thresh17 = std::make_unique( + std::move(thresh17Subfulfillments), + std::move(thresh17Subconditions)); + std::vector> thresh15Subfulfillments; + thresh15Subfulfillments.emplace_back(std::move(ed16)); + thresh15Subfulfillments.emplace_back(std::move(thresh17)); + std::vector thresh15Subconditions{ + {Preim22Cond, Rsa23Cond, Ed24Cond}}; + auto thresh15 = std::make_unique( + std::move(thresh15Subfulfillments), + std::move(thresh15Subconditions)); + auto prefix14 = std::make_unique( + makeSlice(prefix14Prefix), + prefix14MaxMsgLength, + std::move(thresh15)); + auto prefix13 = std::make_unique( + makeSlice(prefix13Prefix), + prefix13MaxMsgLength, + std::move(prefix14)); + auto ed26 = std::make_unique(ed26PublicKey, ed26Sig); + std::vector> thresh25Subfulfillments; + thresh25Subfulfillments.emplace_back(std::move(ed26)); + std::vector thresh25Subconditions{}; + auto thresh25 = std::make_unique( + std::move(thresh25Subfulfillments), + std::move(thresh25Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix13)); + thresh0Subfulfillments.emplace_back(std::move(thresh25)); + std::vector thresh0Subconditions{ + {Preim27Cond, Rsa28Cond, Ed29Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x04\xc7\xa0\x82\x04\x48\xa1\x82\x01\xe9\x80\x02\x50" + "\x31\x81\x01\x1a\xa2\x82\x01\xde\xa1\x82\x01\xda\x80\x02\x50" + "\x32\x81\x01\x1c\xa2\x82\x01\xcf\xa2\x82\x01\xcb\xa0\x82\x01" + "\x4c\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20\xa0\x45\x26\xcf\xee" + "\x7e\xda\x68\xd9\x70\x23\xac\x68\x48\x9e\x20\xa4\x5e\xf8\x51" + "\xcb\xfe\x72\xc1\x11\x5d\x25\x9c\xbc\xfd\xbb\x8b\x81\x40\xfb" + "\xc0\xf1\x77\xf4\x14\xdf\xb2\x32\xc8\x99\xc7\x9a\x9d\xe0\x4a" + "\x03\x2d\xf5\xc9\xde\x46\xda\x77\x52\x24\x22\xef\xfb\x93\x63" + "\xb1\x05\x36\x57\x4c\x78\xbc\x78\x6d\x20\x08\xbd\x75\xc3\x1e" + "\xe0\x29\x24\xde\xa7\x03\xd3\xad\x5d\x7c\x31\x05\x83\xd0\xa4" + "\xed\x95\x07\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7" + "\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c" + "\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92" + "\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0" + "\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6" + "\xc9\x81\x03\x02\x00\x00\xa4\x64\x80\x20\x26\x80\x85\x71\x79" + "\x37\x27\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c\x5b\x9f\x99" + "\x54\xb6\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec\x81\x40\x23" + "\x8b\xb2\xc9\xde\xad\x1b\xb6\xce\x93\x9a\x00\x47\x3d\x42\xc1" + "\x30\x19\x95\x03\x55\x19\x74\x85\xe9\xed\x92\xef\x22\xbd\x49" + "\xe5\x44\xa0\x7a\x41\x7d\xa7\xb0\x3a\x90\x1b\xa1\x2b\xcc\x1d" + "\x0a\x8b\x95\xc1\x3c\x05\x68\x26\x39\xad\xe4\xd4\x75\xf0\xb5" + "\x18\xbe\x01\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\xaf\x93\xfd\x22\x45\xc2\x08\xab\x43\xf7\x45\x56" + "\x63\xec\xaf\x15\x33\xa0\x2a\xb4\x9e\x15\xb4\x6e\xda\x87\x35" + "\xde\x09\x4b\x06\x31\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x55" + "\xcc\xd1\xa2\x2c\x90\x8d\xe3\x2e\x42\xd4\xe0\x65\xb2\xf7\xda" + "\xc0\x07\x1e\xd3\x23\x0f\xfe\x78\x13\xa2\x86\x61\xc4\x34\x28" + "\x50\x81\x03\x02\x00\x00\xa1\x82\x01\xeb\x80\x03\x50\x31\x33" + "\x81\x01\x1a\xa2\x82\x01\xdf\xa1\x82\x01\xdb\x80\x03\x50\x31" + "\x34\x81\x01\x1d\xa2\x82\x01\xcf\xa2\x82\x01\xcb\xa0\x82\x01" + "\x4c\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20\x3b\x07\x0f\xe5\x29" + "\x34\xd9\x17\xf5\x06\x00\xb8\x87\x2f\xcf\x89\x52\x70\xcc\x04" + "\x92\xe1\x67\xcb\xba\xbb\x10\xa6\x2d\x06\xa4\x6b\x81\x40\xb7" + "\x54\x1c\xd2\x7a\x9a\x47\x24\xf5\x88\xc6\x1d\x4f\xc1\xab\x44" + "\xe6\x2c\x76\x87\x82\x18\x8f\x6a\x23\x7d\xf1\x8f\x17\x89\xc5" + "\x7a\xb4\xe9\xe1\x9f\x6c\x6e\x4b\x32\xca\x03\x1d\xd4\x89\x45" + "\x2f\xb6\x98\x21\xc9\xce\xb5\x60\x72\xc2\xb1\x74\x8e\x9a\xf9" + "\xf0\xe6\x05\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\x8d\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57" + "\xca\xf4\x9d\x63\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9" + "\xc6\xa3\xf1\x33\xfd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x95" + "\x3c\x86\x65\x91\x76\x69\x6b\x72\x61\xaa\x76\x15\x2a\xd7\x25" + "\x4f\x32\xb7\x73\x7a\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a\x8b\xf7" + "\x65\x81\x03\x02\x00\x00\xa4\x64\x80\x20\x50\x5a\xcb\xfd\xac" + "\xce\x8b\x6f\xeb\x52\x06\x75\xb8\x72\x9d\x94\x62\xdc\xe4\x11" + "\x24\xd0\xa3\x35\x47\x20\x02\xd5\xf7\x3f\x9c\x93\x81\x40\x34" + "\x3f\xf1\xb4\x3c\x0d\x27\x82\xf9\xea\x84\xf4\x21\x39\x58\xf7" + "\x53\xe1\x19\x65\x8a\x7c\x90\x42\x60\x16\xc7\x53\xfa\x8f\x50" + "\x2c\x4b\x00\x15\x17\x30\x1c\x2a\xc9\xf9\xe7\xe6\x83\x94\x43" + "\xad\x6f\x3f\x4f\xec\x09\x21\xed\x48\x2c\x7f\xd9\x64\x23\xa7" + "\x69\x58\x07\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\x4a\x64\xbf\x23\xa9\x2b\xec\x55\x00\x3d\x55\xf5" + "\xbf\x3f\x26\x49\x18\xbb\xe0\xda\xf8\x0c\xf4\x5c\x8a\x33\x74" + "\xb6\x58\xa4\x38\x30\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x6b" + "\xf3\xe3\x0f\x92\x6d\x45\x8d\xae\xd2\x8a\x2a\x3e\x53\x37\x1f" + "\x57\x82\x21\x60\xe4\x5b\x88\x9a\x9d\x13\xa2\x56\x13\x88\x9e" + "\x21\x81\x03\x02\x00\x00\xa2\x6a\xa0\x66\xa4\x64\x80\x20\x15" + "\x24\x2d\xe4\x7b\xab\xdb\x14\x1b\x6c\x2a\x2d\x24\x68\x71\xc8" + "\xab\x55\xd6\xad\xc4\x47\x6b\x52\xea\x79\x81\x91\xe7\x8f\xc5" + "\x49\x81\x40\x44\xeb\x07\x36\xc3\xf5\xf5\xe1\xd8\xff\x39\x35" + "\xfe\xe5\x56\x49\xbc\x49\x45\x45\x8b\xa0\x3c\x74\xda\x84\x9b" + "\x74\x36\x08\x41\x50\xea\x6f\x42\xe4\x93\x61\x42\xea\xcb\x86" + "\xa9\x75\x8d\xe0\x99\x07\xb5\x85\x1f\xe1\xdf\x75\x03\xe3\xff" + "\x3d\xc9\x04\x67\x4e\x6a\x00\xa1\x00\xa1\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x58\xac\x94\x55\x27\x79" + "\x7a\x0c\xac\x84\x2d\x5c\x13\x32\xee\x84\x25\xb8\xb8\xec\x25" + "\x0d\x40\xee\xc0\xd4\x79\x18\x3f\xc6\xbc\xd7\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xc5\x39\xb2\xc7\xc4\x92\x8a\x29\xf3\x72" + "\xb4\x6c\xa5\x0d\x8c\xbe\x43\xda\xc9\xac\x6c\x26\x7c\x44\xb9" + "\x3f\xee\x40\xcc\x8e\x41\x3c\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xe8\x9e\xe0\x3c\xff\x1b\xd9\x02\xd0\xbc\x8a" + "\x55\x2d\x35\x77\xe9\x09\xd2\x33\x0b\xe9\xcf\x22\xb3\x56\x6e" + "\x72\x21\x09\xc2\x0c\x25\x81\x03\x0a\x74\x77\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x5b\xca\x96\x0d\xb5\x6a" + "\x24\x91\x69\x16\x54\x61\x50\x3d\x23\x6e\x7c\x96\x76\x7d\x8c" + "\x99\xac\xbd\x09\x0e\x23\x2a\xe2\xec\xe3\xaf\x81\x03\x04\x2c" + "\x3a\x82\x02\x03\xb8\xa1\x2b\x80\x20\xd4\x2b\x3f\x8a\x7a\x87" + "\x13\xb8\x15\x7f\xc5\x27\x45\x55\x51\x5e\xd1\xdc\x72\x55\xc1" + "\xe4\x52\xd3\xbb\x94\x8f\xad\xad\xea\xcc\xe6\x81\x03\x04\x2c" + "\x3d\x82\x02\x03\xb8\xa2\x2b\x80\x20\x9e\x49\xa3\x57\x1b\x0d" + "\xe2\x18\x99\xd2\xed\x0a\x78\x6e\x51\x57\x7f\x79\xbe\x26\xa0" + "\x31\xd8\xa4\x0a\xc1\xa5\xa3\x7d\xef\x3c\x94\x81\x03\x02\x04" + "\x00\x82\x02\x03\x08\xa3\x27\x80\x20\x58\xac\x94\x55\x27\x79" + "\x7a\x0c\xac\x84\x2d\x5c\x13\x32\xee\x84\x25\xb8\xb8\xec\x25" + "\x0d\x40\xee\xc0\xd4\x79\x18\x3f\xc6\xbc\xd7\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xc5\x39\xb2\xc7\xc4\x92\x8a\x29\xf3\x72" + "\xb4\x6c\xa5\x0d\x8c\xbe\x43\xda\xc9\xac\x6c\x26\x7c\x44\xb9" + "\x3f\xee\x40\xcc\x8e\x41\x3c\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh61() + { + testcase("Thresh61"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim16Cond + // ** Rsa17Cond + // ** Ed18Cond + // ** Prefix19Cond + // ** Thresh31Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** ed4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** ed6 + // ** preim13 + // ** rsa14 + // ** ed15 + + auto const ed4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x23, 0x8b, 0xb2, 0xc9, 0xde, 0xad, 0x1b, 0xb6, 0xce, 0x93, 0x9a, + 0x00, 0x47, 0x3d, 0x42, 0xc1, 0x30, 0x19, 0x95, 0x03, 0x55, 0x19, + 0x74, 0x85, 0xe9, 0xed, 0x92, 0xef, 0x22, 0xbd, 0x49, 0xe5, 0x44, + 0xa0, 0x7a, 0x41, 0x7d, 0xa7, 0xb0, 0x3a, 0x90, 0x1b, 0xa1, 0x2b, + 0xcc, 0x1d, 0x0a, 0x8b, 0x95, 0xc1, 0x3c, 0x05, 0x68, 0x26, 0x39, + 0xad, 0xe4, 0xd4, 0x75, 0xf0, 0xb5, 0x18, 0xbe, 0x01}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const ed6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed6PublicKey{ + {0xa0, 0x45, 0x26, 0xcf, 0xee, 0x7e, 0xda, 0x68, 0xd9, 0x70, 0x23, + 0xac, 0x68, 0x48, 0x9e, 0x20, 0xa4, 0x5e, 0xf8, 0x51, 0xcb, 0xfe, + 0x72, 0xc1, 0x11, 0x5d, 0x25, 0x9c, 0xbc, 0xfd, 0xbb, 0x8b}}; + std::array const ed6Sig{ + {0xfb, 0xc0, 0xf1, 0x77, 0xf4, 0x14, 0xdf, 0xb2, 0x32, 0xc8, 0x99, + 0xc7, 0x9a, 0x9d, 0xe0, 0x4a, 0x03, 0x2d, 0xf5, 0xc9, 0xde, 0x46, + 0xda, 0x77, 0x52, 0x24, 0x22, 0xef, 0xfb, 0x93, 0x63, 0xb1, 0x05, + 0x36, 0x57, 0x4c, 0x78, 0xbc, 0x78, 0x6d, 0x20, 0x08, 0xbd, 0x75, + 0xc3, 0x1e, 0xe0, 0x29, 0x24, 0xde, 0xa7, 0x03, 0xd3, 0xad, 0x5d, + 0x7c, 0x31, 0x05, 0x83, 0xd0, 0xa4, 0xed, 0x95, 0x07}}; + std::array const ed6SigningKey{ + {0x8f, 0xac, 0x15, 0x02, 0xce, 0xb4, 0x10, 0x27, 0x56, 0x91, 0x2b, + 0xd0, 0x57, 0xe7, 0x6c, 0xe0, 0xc5, 0x46, 0x65, 0x38, 0xf0, 0xc8, + 0x09, 0xe0, 0xb4, 0x57, 0xfb, 0x11, 0xfc, 0x00, 0xe9, 0xdf}}; + (void)ed6SigningKey; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim13Preimage = "I am root"s; + auto const preim13Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa14Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa14PublicKey{ + {0xbd, 0x63, 0x74, 0xd9, 0xc0, 0x3e, 0x0c, 0x57,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, 0xfa, 0x6a, 0x37, 0x6a, 0x0c, 0x22, 0x72, 0x5d, 0x30, 0x50, + 0x4a, 0x6b, 0x93, 0xab, 0xcf, 0x69, 0x5a, 0x09, 0xd2, 0x5a, 0x87, + 0x31, 0x80, 0xa7, 0x5b, 0xe4, 0x34, 0x42, 0x13, 0x44, 0x1d, 0xe6, + 0xf9, 0x27, 0x21, 0xa7, 0x03, 0x74, 0x64, 0x18, 0xfa, 0xd0, 0x68, + 0x28, 0x73, 0x37, 0x3c, 0xf6, 0x63, 0x10, 0x56, 0xcc, 0x25, 0x08, + 0xb9, 0xad, 0xc8, 0x25, 0x64, 0xd1, 0x9c, 0x7c, 0xe7, 0x6c, 0xa6, + 0x12, 0x2c, 0x7d}}; + std::array const rsa14Sig{ + {0x04, 0xd4, 0xb0, 0x34, 0x97, 0x14, 0x35, 0xb1, 0xb4, 0x93, 0x5d, + 0xe0, 0xb8, 0x21, 0xdc, 0xfd, 0xae, 0x3b, 0xe7, 0x48, 0xe1, 0x56, + 0xd1, 0x8d, 0x8a, 0x4c, 0xb4, 0x7e, 0x2f, 0x32, 0x41, 0x06, 0x36, + 0x2c, 0xd8, 0xec, 0x4a, 0x86, 0xbb, 0x40, 0x6e, 0x4b, 0xda, 0xd1, + 0x7c, 0x0f, 0xbb, 0x39, 0xc3, 0x81, 0xd5, 0xbf, 0x39, 0x9f, 0x5d, + 0x24, 0x7c, 0x13, 0x1e, 0x54, 0xb4, 0x6c, 0x5c, 0x35, 0x09, 0xba, + 0xf8, 0x15, 0xbf, 0x5d, 0x51, 0xb2, 0x1f, 0xb4, 0xd8, 0x21, 0x79, + 0x5c, 0x95, 0x2a, 0x3e, 0x9f, 0x27, 0xe2, 0x0f, 0xfb, 0x83, 0x95, + 0x77, 0x6d, 0xa1, 0xcc, 0x29, 0x90, 0x05, 0xac, 0x22, 0x16, 0x7d, + 0xa1, 0xf3, 0x9d, 0x07, 0x64, 0x84, 0xa6, 0x80, 0xed, 0x09, 0xa9, + 0xb1, 0xd7, 0xd1, 0x0c, 0x09, 0x04, 0x5c, 0x80, 0x9d, 0x3a, 0x1e, + 0x61, 0x8a, 0x6b, 0x5b, 0xcc, 0xd0, 0x61, 0x5e, 0x16, 0x53, 0x98, + 0x85, 0xf7, 0xd5, 0xdb, 0x9b, 0x12, 0x64, 0x71, 0x2f, 0x84, 0x06, + 0x7c, 0x4c, 0xf6, 0x7d, 0xda, 0xdd, 0xd3, 0x53, 0xbf, 0xe2, 0x81, + 0x9f, 0xa3, 0x0e, 0x06, 0xb8, 0x21, 0x20, 0x5c, 0x68, 0x98, 0x9e, + 0xa9, 0x46, 0x25, 0x30, 0x57, 0xcc, 0x0b, 0xae, 0x5f, 0x04, 0xf2, + 0xce, 0xab, 0x3f, 0x57, 0xfa, 0x04, 0x04, 0xed, 0xc1, 0x24, 0x97, + 0x70, 0xcf, 0xd7, 0x25, 0x3c, 0x38, 0xed, 0xc3, 0x80, 0x41, 0xe0, + 0x99, 0x7c, 0x29, 0xc6, 0x87, 0x1f, 0x9d, 0x36, 0xdb, 0xf5, 0xf7, + 0xa9, 0x57, 0xe6, 0xe9, 0x0f, 0xec, 0xe0, 0x71, 0x2c, 0x5a, 0xe5, + 0x57, 0xa3, 0x05, 0xb1, 0xe4, 0xda, 0x74, 0x69, 0xf5, 0x2b, 0x9a, + 0xbe, 0xc5, 0xf9, 0xfc, 0x3c, 0x19, 0x6a, 0x96, 0x26, 0x71, 0xc5, + 0x0a, 0x6b, 0x96, 0x47, 0x11, 0x03, 0xcf, 0xd3, 0x36, 0x3f, 0x65, + 0x45, 0xed, 0xa0}}; + auto const ed15Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed15PublicKey{ + {0x37, 0x86, 0xc1, 0x8d, 0x06, 0xf2, 0xe9, 0x58, 0x82, 0x95, 0xcd, + 0xb6, 0x5d, 0x37, 0x28, 0xc9, 0x72, 0xa9, 0x41, 0x20, 0xdc, 0x78, + 0x3d, 0xac, 0x24, 0x8c, 0xb0, 0x6f, 0x1e, 0x44, 0x22, 0xc3}}; + std::array const ed15Sig{ + {0xd8, 0x59, 0x56, 0xbd, 0x99, 0x5c, 0xdd, 0xcd, 0x82, 0x9b, 0xea, + 0x14, 0x18, 0x09, 0x9a, 0x8c, 0x54, 0xff, 0xb3, 0xd4, 0xf3, 0xbf, + 0xc1, 0x4b, 0x70, 0x2a, 0xc9, 0x69, 0x5d, 0x42, 0x8a, 0x34, 0x08, + 0x74, 0x3a, 0xef, 0x8b, 0xd9, 0x2e, 0x7a, 0x0d, 0xb7, 0xdb, 0x68, + 0xb3, 0xa8, 0xb8, 0x12, 0x3a, 0x11, 0x60, 0x20, 0xee, 0xd9, 0x1e, + 0x4a, 0xb6, 0x33, 0x94, 0x27, 0x4e, 0x83, 0xf0, 0x0e}}; + std::array const ed15SigningKey{ + {0x0e, 0x2d, 0x40, 0x72, 0x23, 0x7c, 0x11, 0x66, 0xdb, 0xe2, 0xa2, + 0x6e, 0x4a, 0x4e, 0x95, 0x3a, 0x03, 0x78, 0x62, 0x84, 0x2b, 0x40, + 0x3e, 0xc5, 0xa8, 0x93, 0x4d, 0xb5, 0xe0, 0xe4, 0xc5, 0xdd}}; + (void)ed15SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim16CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim16Cond{Type::preimageSha256, + 9, + Preim16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa17CondConditionFingerprint = { + {0x78, 0xe3, 0x04, 0xf4, 0xa6, 0x16, 0x68, 0x4c, 0x1b, 0xcf, 0x3a, + 0x32, 0xff, 0xbc, 0x75, 0x1a, 0xe6, 0x08, 0x9b, 0xff, 0xba, 0x79, + 0xf4, 0x39, 0x7a, 0xfc, 0xe1, 0x6f, 0xff, 0x3e, 0xb3, 0x75}}; + Condition const Rsa17Cond{Type::rsaSha256, + 65536, + Rsa17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed18CondConditionFingerprint = { + {0x0d, 0xea, 0xc5, 0x16, 0x5c, 0x62, 0xb8, 0xd1, 0xa4, 0xe7, 0x5a, + 0x07, 0x58, 0x00, 0x79, 0x51, 0x88, 0x21, 0xe9, 0x4d, 0xba, 0x73, + 0x7b, 0xad, 0x60, 0x9c, 0x5c, 0x26, 0x00, 0x2e, 0xd1, 0x51}}; + Condition const Ed18Cond{Type::ed25519Sha256, + 131072, + Ed18CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix19CondConditionFingerprint = { + {0x03, 0x38, 0x89, 0xc3, 0xc4, 0x31, 0x4e, 0x60, 0x15, 0xe1, 0xda, + 0xdf, 0x1b, 0xa7, 0x5e, 0x7d, 0x64, 0xf8, 0x37, 0x7f, 0xa9, 0x29, + 0x85, 0x9f, 0xae, 0xf9, 0x98, 0x7f, 0xaa, 0x3d, 0x6b, 0xe4}}; + Condition const Prefix19Cond{Type::prefixSha256, + 273443, + Prefix19CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh31CondConditionFingerprint = { + {0xd6, 0xcb, 0x13, 0x43, 0xfa, 0x3d, 0x4a, 0xac, 0x4b, 0x6d, 0x4d, + 0x47, 0x5a, 0xf6, 0x3a, 0xca, 0x1a, 0x83, 0x6b, 0x8a, 0x9a, 0x71, + 0xe1, 0xd3, 0x01, 0x9d, 0xbe, 0x75, 0x4d, 0x1d, 0x7c, 0x92}}; + Condition const Thresh31Cond{Type::thresholdSha256, + 132096, + Thresh31CondConditionFingerprint, + std::bitset<5>{16}}; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + auto ed6 = std::make_unique(ed6PublicKey, ed6Sig); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(ed6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim13 = + std::make_unique(makeSlice(preim13Preimage)); + auto rsa14 = std::make_unique( + makeSlice(rsa14PublicKey), makeSlice(rsa14Sig)); + auto ed15 = std::make_unique(ed15PublicKey, ed15Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim13)); + thresh0Subfulfillments.emplace_back(std::move(rsa14)); + thresh0Subfulfillments.emplace_back(std::move(ed15)); + std::vector thresh0Subconditions{ + {Preim16Cond, Rsa17Cond, Ed18Cond, Prefix19Cond, Thresh31Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x46\xa0\x82\x04\x6c\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x82\x01\xe9\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x82\x01\xde\xa1\x82\x01\xda\x80\x02\x50\x32\x81" + "\x01\x1c\xa2\x82\x01\xcf\xa2\x82\x01\xcb\xa0\x82\x01\x4c\xa2" + "\x81\xe3\xa0\x66\xa4\x64\x80\x20\xa0\x45\x26\xcf\xee\x7e\xda" + "\x68\xd9\x70\x23\xac\x68\x48\x9e\x20\xa4\x5e\xf8\x51\xcb\xfe" + "\x72\xc1\x11\x5d\x25\x9c\xbc\xfd\xbb\x8b\x81\x40\xfb\xc0\xf1" + "\x77\xf4\x14\xdf\xb2\x32\xc8\x99\xc7\x9a\x9d\xe0\x4a\x03\x2d" + "\xf5\xc9\xde\x46\xda\x77\x52\x24\x22\xef\xfb\x93\x63\xb1\x05" + "\x36\x57\x4c\x78\xbc\x78\x6d\x20\x08\xbd\x75\xc3\x1e\xe0\x29" + "\x24\xde\xa7\x03\xd3\xad\x5d\x7c\x31\x05\x83\xd0\xa4\xed\x95" + "\x07\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9" + "\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2" + "\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc" + "\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36" + "\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81" + "\x03\x02\x00\x00\xa4\x64\x80\x20\x26\x80\x85\x71\x79\x37\x27" + "\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c\x5b\x9f\x99\x54\xb6" + "\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec\x81\x40\x23\x8b\xb2" + "\xc9\xde\xad\x1b\xb6\xce\x93\x9a\x00\x47\x3d\x42\xc1\x30\x19" + "\x95\x03\x55\x19\x74\x85\xe9\xed\x92\xef\x22\xbd\x49\xe5\x44" + "\xa0\x7a\x41\x7d\xa7\xb0\x3a\x90\x1b\xa1\x2b\xcc\x1d\x0a\x8b" + "\x95\xc1\x3c\x05\x68\x26\x39\xad\xe4\xd4\x75\xf0\xb5\x18\xbe" + "\x01\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xaf\x93\xfd\x22\x45\xc2\x08\xab\x43\xf7\x45\x56\x63\xec" + "\xaf\x15\x33\xa0\x2a\xb4\x9e\x15\xb4\x6e\xda\x87\x35\xde\x09" + "\x4b\x06\x31\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x55\xcc\xd1" + "\xa2\x2c\x90\x8d\xe3\x2e\x42\xd4\xe0\x65\xb2\xf7\xda\xc0\x07" + "\x1e\xd3\x23\x0f\xfe\x78\x13\xa2\x86\x61\xc4\x34\x28\x50\x81" + "\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xbd\x63\x74" + "\xd9\xc0\x3e\x0c\x57\x55\x99\x00\xf3\xa8\x03\xdc\x9a\x6c\x14" + "\xfc\x83\x33\x63\x87\x35\x9c\xfe\xc3\x00\xb4\x8b\x03\xc7\x5f" + "\x0a\xe2\x94\xaa\x3f\x76\x15\xb1\xb9\xf6\x5f\x0a\x87\x0c\x5c" + "\x35\xbc\x2f\x0f\x04\xdd\x9d\x12\x8d\x94\xeb\x8b\x93\xb4\x4e" + "\x96\x20\xb7\x17\xa0\x8e\xff\x9e\x1f\x43\xbf\xd6\x6a\x1e\xb6" + "\x0d\x7f\x2c\x08\x67\xa5\xe7\xa3\xb6\xd2\x63\x6a\xf2\xeb\xd1" + "\x21\x83\x8f\xa0\x25\x4a\xc6\xcb\x4e\x66\xc3\x5f\x37\xdf\x5c" + "\x12\xb7\xb8\xfa\x7a\x57\x91\x9d\x55\xa6\x96\x91\xee\x94\xb0" + "\xcc\x45\xd3\x76\x70\x6f\x12\xbd\x81\x9d\x08\x1b\x6d\x55\x3c" + "\x19\x56\x9c\xcf\xc4\xb4\x63\x8a\x87\x35\x2b\x4c\xc6\xe1\x0d" + "\x74\x31\xaa\xc6\x25\x0d\x90\x55\x14\xf1\x73\x09\x93\xba\xc6" + "\xda\x52\x7f\xc2\xdd\x9d\xb2\x4f\x92\x43\xa6\xc9\x2c\x22\xc4" + "\x5a\x22\xc2\x56\xac\xfa\x6a\x37\x6a\x0c\x22\x72\x5d\x30\x50" + "\x4a\x6b\x93\xab\xcf\x69\x5a\x09\xd2\x5a\x87\x31\x80\xa7\x5b" + "\xe4\x34\x42\x13\x44\x1d\xe6\xf9\x27\x21\xa7\x03\x74\x64\x18" + "\xfa\xd0\x68\x28\x73\x37\x3c\xf6\x63\x10\x56\xcc\x25\x08\xb9" + "\xad\xc8\x25\x64\xd1\x9c\x7c\xe7\x6c\xa6\x12\x2c\x7d\x81\x82" + "\x01\x00\x04\xd4\xb0\x34\x97\x14\x35\xb1\xb4\x93\x5d\xe0\xb8" + "\x21\xdc\xfd\xae\x3b\xe7\x48\xe1\x56\xd1\x8d\x8a\x4c\xb4\x7e" + "\x2f\x32\x41\x06\x36\x2c\xd8\xec\x4a\x86\xbb\x40\x6e\x4b\xda" + "\xd1\x7c\x0f\xbb\x39\xc3\x81\xd5\xbf\x39\x9f\x5d\x24\x7c\x13" + "\x1e\x54\xb4\x6c\x5c\x35\x09\xba\xf8\x15\xbf\x5d\x51\xb2\x1f" + "\xb4\xd8\x21\x79\x5c\x95\x2a\x3e\x9f\x27\xe2\x0f\xfb\x83\x95" + "\x77\x6d\xa1\xcc\x29\x90\x05\xac\x22\x16\x7d\xa1\xf3\x9d\x07" + "\x64\x84\xa6\x80\xed\x09\xa9\xb1\xd7\xd1\x0c\x09\x04\x5c\x80" + "\x9d\x3a\x1e\x61\x8a\x6b\x5b\xcc\xd0\x61\x5e\x16\x53\x98\x85" + "\xf7\xd5\xdb\x9b\x12\x64\x71\x2f\x84\x06\x7c\x4c\xf6\x7d\xda" + "\xdd\xd3\x53\xbf\xe2\x81\x9f\xa3\x0e\x06\xb8\x21\x20\x5c\x68" + "\x98\x9e\xa9\x46\x25\x30\x57\xcc\x0b\xae\x5f\x04\xf2\xce\xab" + "\x3f\x57\xfa\x04\x04\xed\xc1\x24\x97\x70\xcf\xd7\x25\x3c\x38" + "\xed\xc3\x80\x41\xe0\x99\x7c\x29\xc6\x87\x1f\x9d\x36\xdb\xf5" + "\xf7\xa9\x57\xe6\xe9\x0f\xec\xe0\x71\x2c\x5a\xe5\x57\xa3\x05" + "\xb1\xe4\xda\x74\x69\xf5\x2b\x9a\xbe\xc5\xf9\xfc\x3c\x19\x6a" + "\x96\x26\x71\xc5\x0a\x6b\x96\x47\x11\x03\xcf\xd3\x36\x3f\x65" + "\x45\xed\xa0\xa4\x64\x80\x20\x37\x86\xc1\x8d\x06\xf2\xe9\x58" + "\x82\x95\xcd\xb6\x5d\x37\x28\xc9\x72\xa9\x41\x20\xdc\x78\x3d" + "\xac\x24\x8c\xb0\x6f\x1e\x44\x22\xc3\x81\x40\xd8\x59\x56\xbd" + "\x99\x5c\xdd\xcd\x82\x9b\xea\x14\x18\x09\x9a\x8c\x54\xff\xb3" + "\xd4\xf3\xbf\xc1\x4b\x70\x2a\xc9\x69\x5d\x42\x8a\x34\x08\x74" + "\x3a\xef\x8b\xd9\x2e\x7a\x0d\xb7\xdb\x68\xb3\xa8\xb8\x12\x3a" + "\x11\x60\x20\xee\xd9\x1e\x4a\xb6\x33\x94\x27\x4e\x83\xf0\x0e" + "\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b\x80" + "\x20\x03\x38\x89\xc3\xc4\x31\x4e\x60\x15\xe1\xda\xdf\x1b\xa7" + "\x5e\x7d\x64\xf8\x37\x7f\xa9\x29\x85\x9f\xae\xf9\x98\x7f\xaa" + "\x3d\x6b\xe4\x81\x03\x04\x2c\x23\x82\x02\x03\xb8\xa2\x2b\x80" + "\x20\xd6\xcb\x13\x43\xfa\x3d\x4a\xac\x4b\x6d\x4d\x47\x5a\xf6" + "\x3a\xca\x1a\x83\x6b\x8a\x9a\x71\xe1\xd3\x01\x9d\xbe\x75\x4d" + "\x1d\x7c\x92\x81\x03\x02\x04\x00\x82\x02\x03\x08\xa3\x27\x80" + "\x20\x78\xe3\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32\xff\xbc" + "\x75\x1a\xe6\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1\x6f\xff" + "\x3e\xb3\x75\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5" + "\x16\x5c\x62\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21" + "\xe9\x4d\xba\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81" + "\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xe0\x70\xa7\xe8\x3d\xc9\x0c\x65\x22\xc5\xc6" + "\xeb\xf3\xa2\x39\x11\x46\x7f\xf3\x88\x46\x85\x89\xe9\x84\xe3" + "\xab\x34\xf5\xc9\xa2\x62\x81\x03\x0c\x80\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x03\x38\x89\xc3\xc4\x31\x4e\x60\x15\xe1\xda\xdf" + "\x1b\xa7\x5e\x7d\x64\xf8\x37\x7f\xa9\x29\x85\x9f\xae\xf9\x98" + "\x7f\xaa\x3d\x6b\xe4\x81\x03\x04\x2c\x23\x82\x02\x03\xb8\xa1" + "\x2b\x80\x20\x5b\xca\x96\x0d\xb5\x6a\x24\x91\x69\x16\x54\x61" + "\x50\x3d\x23\x6e\x7c\x96\x76\x7d\x8c\x99\xac\xbd\x09\x0e\x23" + "\x2a\xe2\xec\xe3\xaf\x81\x03\x04\x2c\x3a\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\xd6\xcb\x13\x43\xfa\x3d\x4a\xac\x4b\x6d\x4d\x47" + "\x5a\xf6\x3a\xca\x1a\x83\x6b\x8a\x9a\x71\xe1\xd3\x01\x9d\xbe" + "\x75\x4d\x1d\x7c\x92\x81\x03\x02\x04\x00\x82\x02\x03\x08\xa3" + "\x27\x80\x20\x32\xec\xaa\x5e\xa6\x88\xdc\xe4\x81\x0f\x93\x0f" + "\x65\xde\x87\xfd\x54\x8c\x79\x04\x81\xe3\x63\x3f\x3d\x08\xa1" + "\xba\x0a\x24\x2b\x46\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x78" + "\xe3\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32\xff\xbc\x75\x1a" + "\xe6\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1\x6f\xff\x3e\xb3" + "\x75\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c" + "\x62\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d" + "\xba\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x40\xd1\x9a\x63\x62\x9b\xc0\x76\xab" + "\x11\x73\x42\x86\xb3\x20\x9d\x23\xe8\x5e\xee\xb9\x82\x5d\x93" + "\xe3\xac\xad\xa0\x40\x41\x51\x1b\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh62() + { + testcase("Thresh62"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim40Cond + // ** Rsa41Cond + // ** Ed42Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** Thresh13Cond + // ***** ed4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** ed6 + // ** prefix18 + // *** prefix19 + // **** thresh20 + // ***** Preim27Cond + // ***** Rsa28Cond + // ***** Ed29Cond + // ***** Thresh30Cond + // ***** ed21 + // ***** thresh22 + // ****** Preim24Cond + // ****** Rsa25Cond + // ****** Ed26Cond + // ****** ed23 + // ** thresh35 + // *** Preim37Cond + // *** Rsa38Cond + // *** Ed39Cond + // *** ed36 + + auto const ed4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x23, 0x8b, 0xb2, 0xc9, 0xde, 0xad, 0x1b, 0xb6, 0xce, 0x93, 0x9a, + 0x00, 0x47, 0x3d, 0x42, 0xc1, 0x30, 0x19, 0x95, 0x03, 0x55, 0x19, + 0x74, 0x85, 0xe9, 0xed, 0x92, 0xef, 0x22, 0xbd, 0x49, 0xe5, 0x44, + 0xa0, 0x7a, 0x41, 0x7d, 0xa7, 0xb0, 0x3a, 0x90, 0x1b, 0xa1, 0x2b, + 0xcc, 0x1d, 0x0a, 0x8b, 0x95, 0xc1, 0x3c, 0x05, 0x68, 0x26, 0x39, + 0xad, 0xe4, 0xd4, 0x75, 0xf0, 0xb5, 0x18, 0xbe, 0x01}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const ed6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed6PublicKey{ + {0xa0, 0x45, 0x26, 0xcf, 0xee, 0x7e, 0xda, 0x68, 0xd9, 0x70, 0x23, + 0xac, 0x68, 0x48, 0x9e, 0x20, 0xa4, 0x5e, 0xf8, 0x51, 0xcb, 0xfe, + 0x72, 0xc1, 0x11, 0x5d, 0x25, 0x9c, 0xbc, 0xfd, 0xbb, 0x8b}}; + std::array const ed6Sig{ + {0xfb, 0xc0, 0xf1, 0x77, 0xf4, 0x14, 0xdf, 0xb2, 0x32, 0xc8, 0x99, + 0xc7, 0x9a, 0x9d, 0xe0, 0x4a, 0x03, 0x2d, 0xf5, 0xc9, 0xde, 0x46, + 0xda, 0x77, 0x52, 0x24, 0x22, 0xef, 0xfb, 0x93, 0x63, 0xb1, 0x05, + 0x36, 0x57, 0x4c, 0x78, 0xbc, 0x78, 0x6d, 0x20, 0x08, 0xbd, 0x75, + 0xc3, 0x1e, 0xe0, 0x29, 0x24, 0xde, 0xa7, 0x03, 0xd3, 0xad, 0x5d, + 0x7c, 0x31, 0x05, 0x83, 0xd0, 0xa4, 0xed, 0x95, 0x07}}; + std::array const ed6SigningKey{ + {0x8f, 0xac, 0x15, 0x02, 0xce, 0xb4, 0x10, 0x27, 0x56, 0x91, 0x2b, + 0xd0, 0x57, 0xe7, 0x6c, 0xe0, 0xc5, 0x46, 0x65, 0x38, 0xf0, 0xc8, + 0x09, 0xe0, 0xb4, 0x57, 0xfb, 0x11, 0xfc, 0x00, 0xe9, 0xdf}}; + (void)ed6SigningKey; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh13CondConditionFingerprint = { + {0xae, 0x21, 0x0d, 0x3e, 0x92, 0xa0, 0xdb, 0x8d, 0x22, 0xd6, 0x15, + 0xe6, 0x30, 0xb0, 0x7c, 0x07, 0xc2, 0x89, 0x69, 0x67, 0xb4, 0x87, + 0x81, 0x5c, 0x0a, 0xc7, 0xa1, 0x72, 0xa9, 0x3e, 0x49, 0xe2}}; + Condition const Thresh13Cond{Type::thresholdSha256, + 135168, + Thresh13CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const ed21Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + std::array const ed21PublicKey{ + {0x02, 0x14, 0x74, 0x80, 0x5a, 0xe0, 0x16, 0xb1, 0xfc, 0x36, 0x0f, + 0x1d, 0x57, 0xdb, 0x72, 0x46, 0xf7, 0x50, 0xe0, 0x7c, 0xcc, 0x48, + 0xee, 0x1f, 0x1e, 0x22, 0x2c, 0x96, 0x5f, 0xd0, 0xd7, 0x4b}}; + std::array const ed21Sig{ + {0xd4, 0x5a, 0xfe, 0x26, 0xdf, 0xeb, 0x15, 0xab, 0x82, 0x8d, 0xcc, + 0xf4, 0x8e, 0x22, 0xec, 0x84, 0xf0, 0x6c, 0x71, 0xa3, 0xe0, 0xb2, + 0x2b, 0x55, 0x98, 0x0f, 0x40, 0xae, 0x01, 0x82, 0x07, 0x49, 0x9a, + 0x9e, 0x94, 0x42, 0x93, 0xe7, 0xf7, 0xc0, 0x63, 0xb4, 0x68, 0xe4, + 0xce, 0x54, 0x61, 0x7c, 0xba, 0x1b, 0xaf, 0xcb, 0x67, 0x26, 0xa8, + 0x42, 0x2b, 0x73, 0xb3, 0x95, 0xa7, 0xcb, 0xe9, 0x07}}; + std::array const ed21SigningKey{ + {0x6f, 0x78, 0xdc, 0x8f, 0x33, 0xc2, 0x31, 0x0b, 0x53, 0x7d, 0x72, + 0xae, 0xe1, 0x3a, 0x9b, 0x8d, 0x6f, 0x77, 0x88, 0xdc, 0x3f, 0xba, + 0x1d, 0xc1, 0x78, 0x52, 0x30, 0xf9, 0x4f, 0x20, 0x76, 0xb8}}; + (void)ed21SigningKey; + auto const ed23Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + std::array const ed23PublicKey{ + {0x8a, 0xfc, 0x00, 0xab, 0x50, 0x13, 0x80, 0x92, 0xc3, 0x2f, 0xe7, + 0x61, 0xef, 0xc2, 0xdd, 0xb6, 0x9a, 0x24, 0x0a, 0xb3, 0x36, 0xd5, + 0xe1, 0xe2, 0x89, 0x2f, 0x53, 0x5c, 0xdd, 0x21, 0xd2, 0x81}}; + std::array const ed23Sig{ + {0xb0, 0x16, 0x53, 0x61, 0x6d, 0xcf, 0xa3, 0x94, 0x46, 0x47, 0x60, + 0xd6, 0xf6, 0x9c, 0xae, 0x85, 0x0e, 0x98, 0xfd, 0x98, 0x75, 0xec, + 0x8d, 0x10, 0xa1, 0x4b, 0x35, 0x85, 0x93, 0x1f, 0x28, 0xa4, 0x13, + 0x70, 0x48, 0x57, 0x16, 0xac, 0x5e, 0x5b, 0x4e, 0xf1, 0x2c, 0x7d, + 0xe5, 0x16, 0x22, 0x00, 0x47, 0x5e, 0xc3, 0x9e, 0xd8, 0xd8, 0x06, + 0x9d, 0xdb, 0xf3, 0xe9, 0xbf, 0xf7, 0x02, 0x39, 0x07}}; + std::array const ed23SigningKey{ + {0xc7, 0xab, 0x87, 0x0b, 0xb3, 0xca, 0x9f, 0x0c, 0x87, 0xed, 0x7b, + 0x4c, 0xe2, 0x89, 0xc2, 0x3c, 0xe4, 0xab, 0xa6, 0x23, 0x18, 0x3f, + 0xab, 0xa5, 0xae, 0x7d, 0x20, 0x5f, 0x65, 0x6d, 0x40, 0xa9}}; + (void)ed23SigningKey; + auto const thresh22Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim24CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim24Cond{Type::preimageSha256, + 9, + Preim24CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa25CondConditionFingerprint = { + {0xb2, 0x7f, 0x94, 0xe3, 0xdf, 0x0c, 0x9a, 0x71, 0x3a, 0xd2, 0xeb, + 0x71, 0x91, 0x72, 0x40, 0xb9, 0xcb, 0xb7, 0xac, 0xbc, 0x77, 0x0a, + 0x08, 0x85, 0x07, 0xa3, 0x85, 0x4e, 0x7e, 0xc9, 0x50, 0x96}}; + Condition const Rsa25Cond{Type::rsaSha256, + 65536, + Rsa25CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed26CondConditionFingerprint = { + {0xd6, 0x2f, 0x07, 0xbd, 0x56, 0xfe, 0x9a, 0x02, 0x8c, 0x98, 0x1a, + 0x72, 0x17, 0xb6, 0x26, 0x90, 0x51, 0xaf, 0xe4, 0xea, 0x51, 0x64, + 0xe0, 0x58, 0x3e, 0x85, 0xc9, 0x29, 0x22, 0x94, 0xa1, 0xbf}}; + Condition const Ed26Cond{Type::ed25519Sha256, + 131072, + Ed26CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh20Msg = "P19P18abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim27CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim27Cond{Type::preimageSha256, + 9, + Preim27CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa28CondConditionFingerprint = { + {0x58, 0xac, 0x94, 0x55, 0x27, 0x79, 0x7a, 0x0c, 0xac, 0x84, 0x2d, + 0x5c, 0x13, 0x32, 0xee, 0x84, 0x25, 0xb8, 0xb8, 0xec, 0x25, 0x0d, + 0x40, 0xee, 0xc0, 0xd4, 0x79, 0x18, 0x3f, 0xc6, 0xbc, 0xd7}}; + Condition const Rsa28Cond{Type::rsaSha256, + 65536, + Rsa28CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed29CondConditionFingerprint = { + {0xc5, 0x39, 0xb2, 0xc7, 0xc4, 0x92, 0x8a, 0x29, 0xf3, 0x72, 0xb4, + 0x6c, 0xa5, 0x0d, 0x8c, 0xbe, 0x43, 0xda, 0xc9, 0xac, 0x6c, 0x26, + 0x7c, 0x44, 0xb9, 0x3f, 0xee, 0x40, 0xcc, 0x8e, 0x41, 0x3c}}; + Condition const Ed29Cond{Type::ed25519Sha256, + 131072, + Ed29CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh30CondConditionFingerprint = { + {0x16, 0x94, 0x83, 0xc9, 0x00, 0x1c, 0x85, 0xcc, 0xab, 0xe8, 0x23, + 0xe4, 0xaf, 0x61, 0xa9, 0x61, 0xf1, 0x64, 0x3e, 0x5b, 0x42, 0xac, + 0x03, 0x3c, 0xe1, 0xaf, 0x7a, 0xeb, 0xee, 0x91, 0x10, 0xd6}}; + Condition const Thresh30Cond{Type::thresholdSha256, + 135168, + Thresh30CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix19Prefix = "P19"s; + auto const prefix19Msg = "P18abcdefghijklmnopqrstuvwxyz"s; + auto const prefix19MaxMsgLength = 29; + auto const prefix18Prefix = "P18"s; + auto const prefix18Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix18MaxMsgLength = 26; + auto const ed36Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed36PublicKey{ + {0x05, 0x4a, 0x11, 0x63, 0xdc, 0x2f, 0xec, 0x10, 0x45, 0x73, 0x28, + 0x4f, 0xc1, 0x6d, 0x7c, 0x08, 0xd7, 0x47, 0xa5, 0x2d, 0xb7, 0x18, + 0xde, 0x6c, 0xfe, 0x41, 0x4d, 0x87, 0xfd, 0xda, 0x2d, 0x76}}; + std::array const ed36Sig{ + {0xff, 0x18, 0x6c, 0xc0, 0x6e, 0xfa, 0x25, 0x7c, 0xf5, 0x54, 0x81, + 0x9c, 0x85, 0x33, 0xe1, 0xf6, 0x39, 0xe2, 0x2f, 0xab, 0xaa, 0x27, + 0x6e, 0xf7, 0xcc, 0x65, 0xd5, 0x15, 0x3a, 0x05, 0xc0, 0x6a, 0x21, + 0x52, 0x70, 0xb0, 0x60, 0x62, 0xbb, 0xab, 0x29, 0x3f, 0xe5, 0x69, + 0x81, 0xc2, 0xdb, 0x84, 0xb7, 0xe8, 0x82, 0x07, 0x42, 0xa8, 0xf8, + 0xd2, 0x3f, 0x65, 0x7a, 0xb1, 0x37, 0xb4, 0x39, 0x09}}; + std::array const ed36SigningKey{ + {0x21, 0xc7, 0x26, 0xda, 0x41, 0x61, 0x98, 0x3b, 0x2c, 0xf3, 0xe4, + 0x80, 0x23, 0x34, 0xad, 0x5e, 0xa3, 0xa7, 0xb2, 0xd5, 0x33, 0x29, + 0xc9, 0x8b, 0x4d, 0xd5, 0x1a, 0xdd, 0x8e, 0x54, 0x23, 0x4f}}; + (void)ed36SigningKey; + auto const thresh35Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim37CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim37Cond{Type::preimageSha256, + 9, + Preim37CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa38CondConditionFingerprint = { + {0x13, 0xb3, 0xe0, 0x2d, 0xea, 0x58, 0x68, 0x9a, 0xa7, 0x10, 0x7e, + 0xb2, 0x1a, 0x12, 0x55, 0x79, 0xd6, 0xfe, 0xde, 0x57, 0x0f, 0x6c, + 0x6b, 0xde, 0xd7, 0xfd, 0x12, 0xeb, 0xa6, 0x1d, 0xad, 0x43}}; + Condition const Rsa38Cond{Type::rsaSha256, + 65536, + Rsa38CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed39CondConditionFingerprint = { + {0xbe, 0x9b, 0x3b, 0xe3, 0x70, 0xfc, 0xc2, 0x29, 0xaa, 0xe9, 0x72, + 0x91, 0x42, 0x6b, 0xd7, 0x1f, 0x1a, 0x25, 0x7d, 0xde, 0xa8, 0x39, + 0xfb, 0xce, 0x5c, 0xaa, 0x63, 0xde, 0xfd, 0x1d, 0x23, 0xcf}}; + Condition const Ed39Cond{Type::ed25519Sha256, + 131072, + Ed39CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim40CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim40Cond{Type::preimageSha256, + 9, + Preim40CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa41CondConditionFingerprint = { + {0xf3, 0xe3, 0x0d, 0x35, 0x45, 0x3f, 0x9f, 0x57, 0x07, 0x0b, 0x13, + 0x04, 0x4d, 0x62, 0x56, 0x30, 0x18, 0x34, 0x88, 0x02, 0x22, 0xa6, + 0x94, 0x6e, 0xba, 0x97, 0xa4, 0x4a, 0x64, 0x5d, 0x05, 0xd1}}; + Condition const Rsa41Cond{Type::rsaSha256, + 65536, + Rsa41CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed42CondConditionFingerprint = { + {0xe3, 0x9a, 0x66, 0x70, 0xcd, 0x9b, 0x26, 0x4a, 0x79, 0xac, 0x64, + 0xbe, 0x92, 0xbb, 0xfb, 0x70, 0x0b, 0xdc, 0x9c, 0xbd, 0x13, 0x61, + 0xb7, 0x00, 0x22, 0xaa, 0x2f, 0xdc, 0x96, 0xc9, 0x45, 0x44}}; + Condition const Ed42Cond{Type::ed25519Sha256, + 131072, + Ed42CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + auto ed6 = std::make_unique(ed6PublicKey, ed6Sig); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(ed6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond, Thresh13Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto ed21 = std::make_unique(ed21PublicKey, ed21Sig); + auto ed23 = std::make_unique(ed23PublicKey, ed23Sig); + std::vector> thresh22Subfulfillments; + thresh22Subfulfillments.emplace_back(std::move(ed23)); + std::vector thresh22Subconditions{ + {Preim24Cond, Rsa25Cond, Ed26Cond}}; + auto thresh22 = std::make_unique( + std::move(thresh22Subfulfillments), + std::move(thresh22Subconditions)); + std::vector> thresh20Subfulfillments; + thresh20Subfulfillments.emplace_back(std::move(ed21)); + thresh20Subfulfillments.emplace_back(std::move(thresh22)); + std::vector thresh20Subconditions{ + {Preim27Cond, Rsa28Cond, Ed29Cond, Thresh30Cond}}; + auto thresh20 = std::make_unique( + std::move(thresh20Subfulfillments), + std::move(thresh20Subconditions)); + auto prefix19 = std::make_unique( + makeSlice(prefix19Prefix), + prefix19MaxMsgLength, + std::move(thresh20)); + auto prefix18 = std::make_unique( + makeSlice(prefix18Prefix), + prefix18MaxMsgLength, + std::move(prefix19)); + auto ed36 = std::make_unique(ed36PublicKey, ed36Sig); + std::vector> thresh35Subfulfillments; + thresh35Subfulfillments.emplace_back(std::move(ed36)); + std::vector thresh35Subconditions{ + {Preim37Cond, Rsa38Cond, Ed39Cond}}; + auto thresh35 = std::make_unique( + std::move(thresh35Subfulfillments), + std::move(thresh35Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(prefix18)); + thresh0Subfulfillments.emplace_back(std::move(thresh35)); + std::vector thresh0Subconditions{ + {Preim40Cond, Rsa41Cond, Ed42Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x9d\xa0\x82\x05\x1e\xa1\x82\x02\x17\x80\x02\x50" + "\x31\x81\x01\x1a\xa2\x82\x02\x0c\xa1\x82\x02\x08\x80\x02\x50" + "\x32\x81\x01\x1c\xa2\x82\x01\xfd\xa2\x82\x01\xf9\xa0\x82\x01" + "\x4c\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20\xa0\x45\x26\xcf\xee" + "\x7e\xda\x68\xd9\x70\x23\xac\x68\x48\x9e\x20\xa4\x5e\xf8\x51" + "\xcb\xfe\x72\xc1\x11\x5d\x25\x9c\xbc\xfd\xbb\x8b\x81\x40\xfb" + "\xc0\xf1\x77\xf4\x14\xdf\xb2\x32\xc8\x99\xc7\x9a\x9d\xe0\x4a" + "\x03\x2d\xf5\xc9\xde\x46\xda\x77\x52\x24\x22\xef\xfb\x93\x63" + "\xb1\x05\x36\x57\x4c\x78\xbc\x78\x6d\x20\x08\xbd\x75\xc3\x1e" + "\xe0\x29\x24\xde\xa7\x03\xd3\xad\x5d\x7c\x31\x05\x83\xd0\xa4" + "\xed\x95\x07\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3" + "\x27\x80\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7" + "\x0e\xa9\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c" + "\x7e\xb2\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92" + "\xfa\xfc\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0" + "\x3f\x36\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6" + "\xc9\x81\x03\x02\x00\x00\xa4\x64\x80\x20\x26\x80\x85\x71\x79" + "\x37\x27\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c\x5b\x9f\x99" + "\x54\xb6\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec\x81\x40\x23" + "\x8b\xb2\xc9\xde\xad\x1b\xb6\xce\x93\x9a\x00\x47\x3d\x42\xc1" + "\x30\x19\x95\x03\x55\x19\x74\x85\xe9\xed\x92\xef\x22\xbd\x49" + "\xe5\x44\xa0\x7a\x41\x7d\xa7\xb0\x3a\x90\x1b\xa1\x2b\xcc\x1d" + "\x0a\x8b\x95\xc1\x3c\x05\x68\x26\x39\xad\xe4\xd4\x75\xf0\xb5" + "\x18\xbe\x01\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa2\x2b\x80\x20\xae\x21\x0d\x3e\x92\xa0\xdb\x8d\x22\xd6\x15" + "\xe6\x30\xb0\x7c\x07\xc2\x89\x69\x67\xb4\x87\x81\x5c\x0a\xc7" + "\xa1\x72\xa9\x3e\x49\xe2\x81\x03\x02\x10\x00\x82\x02\x03\x98" + "\xa3\x27\x80\x20\xaf\x93\xfd\x22\x45\xc2\x08\xab\x43\xf7\x45" + "\x56\x63\xec\xaf\x15\x33\xa0\x2a\xb4\x9e\x15\xb4\x6e\xda\x87" + "\x35\xde\x09\x4b\x06\x31\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\x55\xcc\xd1\xa2\x2c\x90\x8d\xe3\x2e\x42\xd4\xe0\x65\xb2\xf7" + "\xda\xc0\x07\x1e\xd3\x23\x0f\xfe\x78\x13\xa2\x86\x61\xc4\x34" + "\x28\x50\x81\x03\x02\x00\x00\xa1\x82\x02\x19\x80\x03\x50\x31" + "\x38\x81\x01\x1a\xa2\x82\x02\x0d\xa1\x82\x02\x09\x80\x03\x50" + "\x31\x39\x81\x01\x1d\xa2\x82\x01\xfd\xa2\x82\x01\xf9\xa0\x82" + "\x01\x4c\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20\x8a\xfc\x00\xab" + "\x50\x13\x80\x92\xc3\x2f\xe7\x61\xef\xc2\xdd\xb6\x9a\x24\x0a" + "\xb3\x36\xd5\xe1\xe2\x89\x2f\x53\x5c\xdd\x21\xd2\x81\x81\x40" + "\xb0\x16\x53\x61\x6d\xcf\xa3\x94\x46\x47\x60\xd6\xf6\x9c\xae" + "\x85\x0e\x98\xfd\x98\x75\xec\x8d\x10\xa1\x4b\x35\x85\x93\x1f" + "\x28\xa4\x13\x70\x48\x57\x16\xac\x5e\x5b\x4e\xf1\x2c\x7d\xe5" + "\x16\x22\x00\x47\x5e\xc3\x9e\xd8\xd8\x06\x9d\xdb\xf3\xe9\xbf" + "\xf7\x02\x39\x07\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa3\x27\x80\x20\xb2\x7f\x94\xe3\xdf\x0c\x9a\x71\x3a\xd2\xeb" + "\x71\x91\x72\x40\xb9\xcb\xb7\xac\xbc\x77\x0a\x08\x85\x07\xa3" + "\x85\x4e\x7e\xc9\x50\x96\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\xd6\x2f\x07\xbd\x56\xfe\x9a\x02\x8c\x98\x1a\x72\x17\xb6\x26" + "\x90\x51\xaf\xe4\xea\x51\x64\xe0\x58\x3e\x85\xc9\x29\x22\x94" + "\xa1\xbf\x81\x03\x02\x00\x00\xa4\x64\x80\x20\x02\x14\x74\x80" + "\x5a\xe0\x16\xb1\xfc\x36\x0f\x1d\x57\xdb\x72\x46\xf7\x50\xe0" + "\x7c\xcc\x48\xee\x1f\x1e\x22\x2c\x96\x5f\xd0\xd7\x4b\x81\x40" + "\xd4\x5a\xfe\x26\xdf\xeb\x15\xab\x82\x8d\xcc\xf4\x8e\x22\xec" + "\x84\xf0\x6c\x71\xa3\xe0\xb2\x2b\x55\x98\x0f\x40\xae\x01\x82" + "\x07\x49\x9a\x9e\x94\x42\x93\xe7\xf7\xc0\x63\xb4\x68\xe4\xce" + "\x54\x61\x7c\xba\x1b\xaf\xcb\x67\x26\xa8\x42\x2b\x73\xb3\x95" + "\xa7\xcb\xe9\x07\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef" + "\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9" + "\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01" + "\x09\xa2\x2b\x80\x20\x16\x94\x83\xc9\x00\x1c\x85\xcc\xab\xe8" + "\x23\xe4\xaf\x61\xa9\x61\xf1\x64\x3e\x5b\x42\xac\x03\x3c\xe1" + "\xaf\x7a\xeb\xee\x91\x10\xd6\x81\x03\x02\x10\x00\x82\x02\x03" + "\x98\xa3\x27\x80\x20\x58\xac\x94\x55\x27\x79\x7a\x0c\xac\x84" + "\x2d\x5c\x13\x32\xee\x84\x25\xb8\xb8\xec\x25\x0d\x40\xee\xc0" + "\xd4\x79\x18\x3f\xc6\xbc\xd7\x81\x03\x01\x00\x00\xa4\x27\x80" + "\x20\xc5\x39\xb2\xc7\xc4\x92\x8a\x29\xf3\x72\xb4\x6c\xa5\x0d" + "\x8c\xbe\x43\xda\xc9\xac\x6c\x26\x7c\x44\xb9\x3f\xee\x40\xcc" + "\x8e\x41\x3c\x81\x03\x02\x00\x00\xa2\x81\xe3\xa0\x66\xa4\x64" + "\x80\x20\x05\x4a\x11\x63\xdc\x2f\xec\x10\x45\x73\x28\x4f\xc1" + "\x6d\x7c\x08\xd7\x47\xa5\x2d\xb7\x18\xde\x6c\xfe\x41\x4d\x87" + "\xfd\xda\x2d\x76\x81\x40\xff\x18\x6c\xc0\x6e\xfa\x25\x7c\xf5" + "\x54\x81\x9c\x85\x33\xe1\xf6\x39\xe2\x2f\xab\xaa\x27\x6e\xf7" + "\xcc\x65\xd5\x15\x3a\x05\xc0\x6a\x21\x52\x70\xb0\x60\x62\xbb" + "\xab\x29\x3f\xe5\x69\x81\xc2\xdb\x84\xb7\xe8\x82\x07\x42\xa8" + "\xf8\xd2\x3f\x65\x7a\xb1\x37\xb4\x39\x09\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x13\xb3\xe0\x2d\xea" + "\x58\x68\x9a\xa7\x10\x7e\xb2\x1a\x12\x55\x79\xd6\xfe\xde\x57" + "\x0f\x6c\x6b\xde\xd7\xfd\x12\xeb\xa6\x1d\xad\x43\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\xbe\x9b\x3b\xe3\x70\xfc\xc2\x29\xaa" + "\xe9\x72\x91\x42\x6b\xd7\x1f\x1a\x25\x7d\xde\xa8\x39\xfb\xce" + "\x5c\xaa\x63\xde\xfd\x1d\x23\xcf\x81\x03\x02\x00\x00\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xf3\xe3" + "\x0d\x35\x45\x3f\x9f\x57\x07\x0b\x13\x04\x4d\x62\x56\x30\x18" + "\x34\x88\x02\x22\xa6\x94\x6e\xba\x97\xa4\x4a\x64\x5d\x05\xd1" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xe3\x9a\x66\x70\xcd\x9b" + "\x26\x4a\x79\xac\x64\xbe\x92\xbb\xfb\x70\x0b\xdc\x9c\xbd\x13" + "\x61\xb7\x00\x22\xaa\x2f\xdc\x96\xc9\x45\x44\x81\x03\x02\x00" + "\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xfb\x86\x3a\x11\xa2\x4d\xb4\x31\x08\xa6\x9f" + "\x3c\x70\x7b\xd2\x8d\xb0\x01\xb8\x21\xd0\xc8\xd3\x44\x24\x3f" + "\xc0\x66\x56\x5d\xd4\x2e\x81\x03\x0a\xa8\x77\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x14\x29\x15\xdd\x6d\xd3" + "\x9a\xdc\x95\x85\x58\x54\xd2\x00\xd2\xee\x23\x74\x73\xe8\x9d" + "\x01\x63\x67\xf3\xe8\x64\x3c\xac\xa8\x1f\x10\x81\x03\x04\x40" + "\x3d\x82\x02\x03\xb8\xa1\x2b\x80\x20\x9c\xd7\xbe\xf1\x71\x00" + "\x03\x96\xf0\xe9\x66\x2b\x82\x21\xcb\x09\x76\xab\x99\x50\xe2" + "\xf9\x37\x71\x03\xd7\x19\xe1\x3c\x97\x6a\x0b\x81\x03\x04\x40" + "\x3a\x82\x02\x03\xb8\xa2\x2b\x80\x20\x14\x9d\x47\xf0\x94\xe1" + "\x4a\xf7\x9c\x4e\x5c\x17\xe0\x5b\x44\xde\x36\xa4\x80\x55\x3c" + "\x83\x65\xd2\xd9\x7a\x60\x40\x63\x3a\xc0\x5b\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xf3\xe3\x0d\x35\x45\x3f" + "\x9f\x57\x07\x0b\x13\x04\x4d\x62\x56\x30\x18\x34\x88\x02\x22" + "\xa6\x94\x6e\xba\x97\xa4\x4a\x64\x5d\x05\xd1\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe3\x9a\x66\x70\xcd\x9b\x26\x4a\x79\xac" + "\x64\xbe\x92\xbb\xfb\x70\x0b\xdc\x9c\xbd\x13\x61\xb7\x00\x22" + "\xaa\x2f\xdc\x96\xc9\x45\x44\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh63() + { + testcase("Thresh63"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim21Cond + // ** Rsa22Cond + // ** Ed23Cond + // ** Prefix24Cond + // ** Thresh41Cond + // ** prefix1 + // *** prefix2 + // **** thresh3 + // ***** Preim10Cond + // ***** Rsa11Cond + // ***** Ed12Cond + // ***** Thresh13Cond + // ***** ed4 + // ***** thresh5 + // ****** Preim7Cond + // ****** Rsa8Cond + // ****** Ed9Cond + // ****** ed6 + // ** preim18 + // ** rsa19 + // ** ed20 + + auto const ed4Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x23, 0x8b, 0xb2, 0xc9, 0xde, 0xad, 0x1b, 0xb6, 0xce, 0x93, 0x9a, + 0x00, 0x47, 0x3d, 0x42, 0xc1, 0x30, 0x19, 0x95, 0x03, 0x55, 0x19, + 0x74, 0x85, 0xe9, 0xed, 0x92, 0xef, 0x22, 0xbd, 0x49, 0xe5, 0x44, + 0xa0, 0x7a, 0x41, 0x7d, 0xa7, 0xb0, 0x3a, 0x90, 0x1b, 0xa1, 0x2b, + 0xcc, 0x1d, 0x0a, 0x8b, 0x95, 0xc1, 0x3c, 0x05, 0x68, 0x26, 0x39, + 0xad, 0xe4, 0xd4, 0x75, 0xf0, 0xb5, 0x18, 0xbe, 0x01}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const ed6Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const ed6PublicKey{ + {0xa0, 0x45, 0x26, 0xcf, 0xee, 0x7e, 0xda, 0x68, 0xd9, 0x70, 0x23, + 0xac, 0x68, 0x48, 0x9e, 0x20, 0xa4, 0x5e, 0xf8, 0x51, 0xcb, 0xfe, + 0x72, 0xc1, 0x11, 0x5d, 0x25, 0x9c, 0xbc, 0xfd, 0xbb, 0x8b}}; + std::array const ed6Sig{ + {0xfb, 0xc0, 0xf1, 0x77, 0xf4, 0x14, 0xdf, 0xb2, 0x32, 0xc8, 0x99, + 0xc7, 0x9a, 0x9d, 0xe0, 0x4a, 0x03, 0x2d, 0xf5, 0xc9, 0xde, 0x46, + 0xda, 0x77, 0x52, 0x24, 0x22, 0xef, 0xfb, 0x93, 0x63, 0xb1, 0x05, + 0x36, 0x57, 0x4c, 0x78, 0xbc, 0x78, 0x6d, 0x20, 0x08, 0xbd, 0x75, + 0xc3, 0x1e, 0xe0, 0x29, 0x24, 0xde, 0xa7, 0x03, 0xd3, 0xad, 0x5d, + 0x7c, 0x31, 0x05, 0x83, 0xd0, 0xa4, 0xed, 0x95, 0x07}}; + std::array const ed6SigningKey{ + {0x8f, 0xac, 0x15, 0x02, 0xce, 0xb4, 0x10, 0x27, 0x56, 0x91, 0x2b, + 0xd0, 0x57, 0xe7, 0x6c, 0xe0, 0xc5, 0x46, 0x65, 0x38, 0xf0, 0xc8, + 0x09, 0xe0, 0xb4, 0x57, 0xfb, 0x11, 0xfc, 0x00, 0xe9, 0xdf}}; + (void)ed6SigningKey; + auto const thresh5Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim7CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim7Cond{Type::preimageSha256, + 9, + Preim7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa8CondConditionFingerprint = { + {0xd1, 0xb5, 0x1d, 0x35, 0x99, 0x9d, 0xb4, 0xc1, 0xaa, 0x81, 0x4d, + 0xd7, 0x0e, 0xa9, 0x2a, 0x20, 0x7f, 0xe5, 0x5c, 0x75, 0xe8, 0x57, + 0x8b, 0xbf, 0xe8, 0xd7, 0x1c, 0x7e, 0xb2, 0xbc, 0x91, 0x16}}; + Condition const Rsa8Cond{Type::rsaSha256, + 65536, + Rsa8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed9CondConditionFingerprint = { + {0x92, 0xfa, 0xfc, 0xc6, 0x2f, 0xe2, 0x8d, 0x8d, 0x25, 0x7c, 0xd4, + 0x46, 0xab, 0xea, 0x82, 0xd0, 0x3f, 0x36, 0xbe, 0x1d, 0x11, 0x2b, + 0xa0, 0xfe, 0xfe, 0xd4, 0x00, 0xd5, 0x7d, 0x9b, 0xf6, 0xc9}}; + Condition const Ed9Cond{Type::ed25519Sha256, + 131072, + Ed9CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh3Msg = "P2P1abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh13CondConditionFingerprint = { + {0xae, 0x21, 0x0d, 0x3e, 0x92, 0xa0, 0xdb, 0x8d, 0x22, 0xd6, 0x15, + 0xe6, 0x30, 0xb0, 0x7c, 0x07, 0xc2, 0x89, 0x69, 0x67, 0xb4, 0x87, + 0x81, 0x5c, 0x0a, 0xc7, 0xa1, 0x72, 0xa9, 0x3e, 0x49, 0xe2}}; + Condition const Thresh13Cond{Type::thresholdSha256, + 135168, + Thresh13CondConditionFingerprint, + std::bitset<5>{25}}; + auto const prefix2Prefix = "P2"s; + auto const prefix2Msg = "P1abcdefghijklmnopqrstuvwxyz"s; + auto const prefix2MaxMsgLength = 28; + auto const prefix1Prefix = "P1"s; + auto const prefix1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix1MaxMsgLength = 26; + auto const preim18Preimage = "I am root"s; + auto const preim18Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa19Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa19PublicKey{ + {0xc0, 0x81, 0x79, 0x3f, 0x26, 0x8f, 0xe8, 0x48, 0xf1, 0x9c, 0xd2, + 0x09, 0x7c, 0x96, 0x0d, 0x3c, 0xbb, 0x85, 0xdb, 0x1f, 0xab, 0xbe, + 0x97, 0x7d, 0xc0, 0x31, 0x07, 0xb0, 0x2e, 0xb9, 0x5c, 0x2c, 0xae, + 0x82, 0xf5, 0x3e, 0xb6, 0x91, 0xb8, 0x88, 0x2a, 0xa4, 0xa7, 0x81, + 0x97, 0xa5, 0x71, 0xad, 0x09, 0x4d, 0xfc, 0x25, 0x41, 0x3e, 0xe0, + 0xa3, 0xa6, 0x19, 0xba, 0x8f, 0x02, 0x41, 0x8d, 0x05, 0x51, 0xcd, + 0xf8, 0x22, 0xb3, 0x7a, 0x6e, 0x94, 0x7e, 0xaa, 0x58, 0xda, 0x02, + 0xae, 0x73, 0x00, 0x94, 0x1c, 0xb5, 0xb5, 0x26, 0x9f, 0xc5, 0x8b, + 0x04, 0xe0, 0xe0, 0x73, 0x96, 0x4b, 0xaf, 0x6d, 0x0a, 0xe4, 0x25, + 0x90, 0x2d, 0x13, 0x3c, 0xbe, 0x0e, 0x68, 0x7d, 0xfe, 0xa6, 0x12, + 0x6b, 0xb6, 0xec, 0xa0, 0xda, 0x2b, 0x22, 0x31, 0xe6, 0x05, 0x76, + 0xf5, 0x98, 0x8e, 0x76, 0x86, 0xbe, 0xc6, 0x07, 0x73, 0x52, 0x20, + 0x13, 0x8f, 0x93, 0x1f, 0xd9, 0x73, 0xfa, 0xb3, 0xed, 0x50, 0x1b, + 0xf7, 0x68, 0xf6, 0x60, 0xa3, 0x12, 0x73, 0x10, 0xda, 0x06, 0x70, + 0x69, 0xcb, 0xb5, 0x6c, 0x85, 0x29, 0xe8, 0x9e, 0x29, 0xb1, 0x4d, + 0x7e, 0x7e, 0xce, 0x15, 0xf5, 0x25, 0x55, 0xc5, 0x89, 0x7e, 0x34, + 0x48, 0x34, 0x43, 0x30, 0x2b, 0x6a, 0x8a, 0x6d, 0x1b, 0x55, 0x2a, + 0x2c, 0xf4, 0xcd, 0xc1, 0x72, 0x78, 0xda, 0x0d, 0x54, 0x32, 0x46, + 0x93, 0xd7, 0x96, 0xce, 0x33, 0x06, 0xe9, 0x7a, 0x7b, 0x6d, 0xe9, + 0x54, 0xe4, 0xbe, 0x56, 0x37, 0xa7, 0x7c, 0xc8, 0xba, 0x17, 0xb1, + 0xba, 0x76, 0xd7, 0x7f, 0xca, 0x7f, 0xfe, 0x60, 0x7d, 0x60, 0x27, + 0xd0, 0x80, 0x65, 0x74, 0xdc, 0xd6, 0xc8, 0x58, 0x4d, 0xcd, 0x8e, + 0xc9, 0x4e, 0xb2, 0x3e, 0x6e, 0x4f, 0xfa, 0x22, 0xfa, 0x9f, 0x3a, + 0x9f, 0x14, 0xeb}}; + std::array const rsa19Sig{ + {0x61, 0x42, 0x89, 0xdc, 0x86, 0x09, 0x05, 0xc4, 0x87, 0x2c, 0xff, + 0x0e, 0xd1, 0xab, 0x15, 0xfe, 0x7b, 0xa7, 0x6a, 0x32, 0x00, 0xcc, + 0x65, 0xb5, 0xca, 0x16, 0x67, 0x48, 0xcc, 0x4c, 0xa1, 0x57, 0x0d, + 0x7e, 0xaf, 0x32, 0x68, 0x71, 0x7d, 0xd0, 0x33, 0xaa, 0xc1, 0xde, + 0x45, 0xe3, 0xa0, 0xb3, 0xc2, 0x50, 0x8b, 0xc7, 0xe5, 0x64, 0xcb, + 0x9e, 0xab, 0x70, 0xe7, 0xd0, 0xe4, 0x9b, 0x35, 0x54, 0xaf, 0x0f, + 0x1b, 0xab, 0x27, 0xf9, 0x59, 0xf3, 0x98, 0xd2, 0x7c, 0x4a, 0xb5, + 0x2a, 0x69, 0x9d, 0x59, 0x72, 0xa4, 0x65, 0x58, 0x99, 0xd5, 0xab, + 0xf4, 0x55, 0xe4, 0xee, 0x4a, 0x47, 0x6a, 0x00, 0x15, 0xfc, 0x96, + 0x1b, 0x65, 0x75, 0x4d, 0x52, 0x7f, 0x6f, 0xbc, 0x4f, 0x52, 0x6c, + 0x8c, 0x22, 0x94, 0xa7, 0x62, 0x7c, 0x12, 0x5e, 0x08, 0x9a, 0xb7, + 0x86, 0x30, 0x37, 0x34, 0x31, 0xb7, 0x2b, 0xfd, 0x53, 0x5c, 0xef, + 0x85, 0xd0, 0xad, 0x0f, 0xd8, 0x5d, 0x68, 0xb0, 0xb5, 0xc9, 0x44, + 0xd8, 0x3e, 0xd2, 0xf9, 0x0f, 0xa9, 0x08, 0x48, 0xd4, 0x6f, 0x53, + 0xe5, 0xb9, 0xb9, 0x98, 0x9a, 0x64, 0x40, 0x84, 0xe1, 0xa2, 0x54, + 0x6b, 0xb7, 0x68, 0x59, 0x75, 0x13, 0xc2, 0xba, 0x71, 0xa2, 0x8d, + 0xd6, 0xe8, 0x32, 0xf0, 0x6e, 0x34, 0x0e, 0x99, 0xde, 0xfa, 0x57, + 0x8f, 0xaf, 0xce, 0xba, 0x0b, 0x0d, 0x15, 0x0a, 0xbb, 0x5e, 0x82, + 0x87, 0xcf, 0x3a, 0x75, 0x03, 0x04, 0xfd, 0xbc, 0x41, 0x62, 0x01, + 0xd3, 0xdb, 0x5a, 0xa9, 0x92, 0x19, 0x18, 0xd8, 0x40, 0xe2, 0x54, + 0xfc, 0xe6, 0x69, 0x06, 0x16, 0x43, 0x09, 0x00, 0x18, 0x6b, 0xab, + 0x26, 0xdb, 0x6a, 0x2b, 0xd4, 0x8b, 0xfc, 0x0a, 0x7c, 0x96, 0xea, + 0xe2, 0x40, 0xdd, 0x1c, 0xa7, 0xde, 0xc5, 0x23, 0x64, 0x4e, 0x4c, + 0xea, 0x0c, 0xd9}}; + auto const ed20Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed20PublicKey{ + {0x63, 0x87, 0xe7, 0xfd, 0x5e, 0x93, 0x76, 0x3e, 0x74, 0x42, 0x8e, + 0xd5, 0xc9, 0x79, 0xa6, 0xa9, 0xc4, 0x3d, 0x61, 0x14, 0x7b, 0x49, + 0xf3, 0xda, 0x52, 0xc2, 0x74, 0x9b, 0x62, 0xae, 0x8c, 0x90}}; + std::array const ed20Sig{ + {0x4f, 0x9d, 0xaf, 0x7e, 0x00, 0x50, 0x3d, 0xdc, 0xb2, 0xd9, 0x56, + 0x79, 0x61, 0xb7, 0xcb, 0xe6, 0x2d, 0xf3, 0xc8, 0xce, 0x6f, 0x7a, + 0xde, 0x9a, 0x85, 0xf8, 0xc5, 0xc7, 0x93, 0x7d, 0xf8, 0xdc, 0xdb, + 0xbc, 0x12, 0x87, 0x0d, 0x42, 0x62, 0xc8, 0xc8, 0xd0, 0xbd, 0xb7, + 0xa9, 0x05, 0x0c, 0x57, 0x2a, 0xf5, 0x59, 0x83, 0x81, 0x69, 0xc8, + 0xbc, 0xec, 0x4b, 0xf8, 0xf6, 0xbd, 0xc7, 0x70, 0x0f}}; + std::array const ed20SigningKey{ + {0x15, 0xe5, 0xd2, 0xb8, 0x15, 0x1f, 0xe1, 0x89, 0x7e, 0x3f, 0x33, + 0x3b, 0x27, 0xed, 0x94, 0xb6, 0xe4, 0x47, 0x82, 0xa0, 0xa8, 0x40, + 0xb9, 0x4d, 0xa8, 0x65, 0xb8, 0x79, 0x2b, 0x0f, 0x1b, 0x4c}}; + (void)ed20SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim21CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim21Cond{Type::preimageSha256, + 9, + Preim21CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa22CondConditionFingerprint = { + {0x1a, 0x59, 0xf0, 0xd9, 0x99, 0xe2, 0xac, 0x9a, 0xc7, 0x84, 0xc3, + 0xe7, 0x21, 0x3d, 0x86, 0x3b, 0x18, 0xfd, 0x67, 0xc1, 0x70, 0x5f, + 0x36, 0x60, 0xc3, 0x4d, 0xb6, 0x1c, 0x84, 0x53, 0x7e, 0xda}}; + Condition const Rsa22Cond{Type::rsaSha256, + 65536, + Rsa22CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed23CondConditionFingerprint = { + {0x1a, 0x18, 0x47, 0x1f, 0xd0, 0x23, 0xc4, 0x4d, 0x07, 0x5b, 0x1e, + 0x43, 0xa6, 0x28, 0x54, 0xce, 0xec, 0x02, 0x4d, 0xc1, 0x00, 0x3c, + 0x0c, 0x55, 0x02, 0xa3, 0xa3, 0x28, 0x38, 0x88, 0x5c, 0x84}}; + Condition const Ed23Cond{Type::ed25519Sha256, + 131072, + Ed23CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix24CondConditionFingerprint = { + {0xbc, 0x96, 0xfd, 0x6e, 0xe1, 0x2e, 0x71, 0xde, 0x95, 0xe8, 0x39, + 0x61, 0xdc, 0x69, 0xf5, 0xe2, 0x3f, 0xdf, 0x4b, 0x6c, 0xdf, 0x76, + 0xee, 0x47, 0x92, 0x17, 0xc8, 0xf5, 0x41, 0xe9, 0x7a, 0x6e}}; + Condition const Prefix24Cond{Type::prefixSha256, + 278563, + Prefix24CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh41CondConditionFingerprint = { + {0x52, 0x92, 0x62, 0x3c, 0x18, 0xb5, 0xda, 0xcd, 0xb0, 0x67, 0xfe, + 0x2b, 0xb0, 0x51, 0x84, 0xf3, 0x90, 0xc9, 0xe6, 0x46, 0x39, 0x96, + 0x20, 0xd2, 0x46, 0x94, 0xad, 0x71, 0x87, 0x34, 0xd8, 0x6c}}; + Condition const Thresh41Cond{Type::thresholdSha256, + 135168, + Thresh41CondConditionFingerprint, + std::bitset<5>{25}}; + + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + auto ed6 = std::make_unique(ed6PublicKey, ed6Sig); + std::vector> thresh5Subfulfillments; + thresh5Subfulfillments.emplace_back(std::move(ed6)); + std::vector thresh5Subconditions{ + {Preim7Cond, Rsa8Cond, Ed9Cond}}; + auto thresh5 = std::make_unique( + std::move(thresh5Subfulfillments), std::move(thresh5Subconditions)); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + thresh3Subfulfillments.emplace_back(std::move(thresh5)); + std::vector thresh3Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond, Thresh13Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + auto prefix2 = std::make_unique( + makeSlice(prefix2Prefix), prefix2MaxMsgLength, std::move(thresh3)); + auto prefix1 = std::make_unique( + makeSlice(prefix1Prefix), prefix1MaxMsgLength, std::move(prefix2)); + auto preim18 = + std::make_unique(makeSlice(preim18Preimage)); + auto rsa19 = std::make_unique( + makeSlice(rsa19PublicKey), makeSlice(rsa19Sig)); + auto ed20 = std::make_unique(ed20PublicKey, ed20Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(prefix1)); + thresh0Subfulfillments.emplace_back(std::move(preim18)); + thresh0Subfulfillments.emplace_back(std::move(rsa19)); + thresh0Subfulfillments.emplace_back(std::move(ed20)); + std::vector thresh0Subconditions{ + {Preim21Cond, Rsa22Cond, Ed23Cond, Prefix24Cond, Thresh41Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x74\xa0\x82\x04\x9a\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa1\x82\x02\x17\x80\x02\x50\x31\x81" + "\x01\x1a\xa2\x82\x02\x0c\xa1\x82\x02\x08\x80\x02\x50\x32\x81" + "\x01\x1c\xa2\x82\x01\xfd\xa2\x82\x01\xf9\xa0\x82\x01\x4c\xa2" + "\x81\xe3\xa0\x66\xa4\x64\x80\x20\xa0\x45\x26\xcf\xee\x7e\xda" + "\x68\xd9\x70\x23\xac\x68\x48\x9e\x20\xa4\x5e\xf8\x51\xcb\xfe" + "\x72\xc1\x11\x5d\x25\x9c\xbc\xfd\xbb\x8b\x81\x40\xfb\xc0\xf1" + "\x77\xf4\x14\xdf\xb2\x32\xc8\x99\xc7\x9a\x9d\xe0\x4a\x03\x2d" + "\xf5\xc9\xde\x46\xda\x77\x52\x24\x22\xef\xfb\x93\x63\xb1\x05" + "\x36\x57\x4c\x78\xbc\x78\x6d\x20\x08\xbd\x75\xc3\x1e\xe0\x29" + "\x24\xde\xa7\x03\xd3\xad\x5d\x7c\x31\x05\x83\xd0\xa4\xed\x95" + "\x07\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xd1\xb5\x1d\x35\x99\x9d\xb4\xc1\xaa\x81\x4d\xd7\x0e\xa9" + "\x2a\x20\x7f\xe5\x5c\x75\xe8\x57\x8b\xbf\xe8\xd7\x1c\x7e\xb2" + "\xbc\x91\x16\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x92\xfa\xfc" + "\xc6\x2f\xe2\x8d\x8d\x25\x7c\xd4\x46\xab\xea\x82\xd0\x3f\x36" + "\xbe\x1d\x11\x2b\xa0\xfe\xfe\xd4\x00\xd5\x7d\x9b\xf6\xc9\x81" + "\x03\x02\x00\x00\xa4\x64\x80\x20\x26\x80\x85\x71\x79\x37\x27" + "\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c\x5b\x9f\x99\x54\xb6" + "\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec\x81\x40\x23\x8b\xb2" + "\xc9\xde\xad\x1b\xb6\xce\x93\x9a\x00\x47\x3d\x42\xc1\x30\x19" + "\x95\x03\x55\x19\x74\x85\xe9\xed\x92\xef\x22\xbd\x49\xe5\x44" + "\xa0\x7a\x41\x7d\xa7\xb0\x3a\x90\x1b\xa1\x2b\xcc\x1d\x0a\x8b" + "\x95\xc1\x3c\x05\x68\x26\x39\xad\xe4\xd4\x75\xf0\xb5\x18\xbe" + "\x01\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b" + "\x80\x20\xae\x21\x0d\x3e\x92\xa0\xdb\x8d\x22\xd6\x15\xe6\x30" + "\xb0\x7c\x07\xc2\x89\x69\x67\xb4\x87\x81\x5c\x0a\xc7\xa1\x72" + "\xa9\x3e\x49\xe2\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27" + "\x80\x20\xaf\x93\xfd\x22\x45\xc2\x08\xab\x43\xf7\x45\x56\x63" + "\xec\xaf\x15\x33\xa0\x2a\xb4\x9e\x15\xb4\x6e\xda\x87\x35\xde" + "\x09\x4b\x06\x31\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x55\xcc" + "\xd1\xa2\x2c\x90\x8d\xe3\x2e\x42\xd4\xe0\x65\xb2\xf7\xda\xc0" + "\x07\x1e\xd3\x23\x0f\xfe\x78\x13\xa2\x86\x61\xc4\x34\x28\x50" + "\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xc0\x81" + "\x79\x3f\x26\x8f\xe8\x48\xf1\x9c\xd2\x09\x7c\x96\x0d\x3c\xbb" + "\x85\xdb\x1f\xab\xbe\x97\x7d\xc0\x31\x07\xb0\x2e\xb9\x5c\x2c" + "\xae\x82\xf5\x3e\xb6\x91\xb8\x88\x2a\xa4\xa7\x81\x97\xa5\x71" + "\xad\x09\x4d\xfc\x25\x41\x3e\xe0\xa3\xa6\x19\xba\x8f\x02\x41" + "\x8d\x05\x51\xcd\xf8\x22\xb3\x7a\x6e\x94\x7e\xaa\x58\xda\x02" + "\xae\x73\x00\x94\x1c\xb5\xb5\x26\x9f\xc5\x8b\x04\xe0\xe0\x73" + "\x96\x4b\xaf\x6d\x0a\xe4\x25\x90\x2d\x13\x3c\xbe\x0e\x68\x7d" + "\xfe\xa6\x12\x6b\xb6\xec\xa0\xda\x2b\x22\x31\xe6\x05\x76\xf5" + "\x98\x8e\x76\x86\xbe\xc6\x07\x73\x52\x20\x13\x8f\x93\x1f\xd9" + "\x73\xfa\xb3\xed\x50\x1b\xf7\x68\xf6\x60\xa3\x12\x73\x10\xda" + "\x06\x70\x69\xcb\xb5\x6c\x85\x29\xe8\x9e\x29\xb1\x4d\x7e\x7e" + "\xce\x15\xf5\x25\x55\xc5\x89\x7e\x34\x48\x34\x43\x30\x2b\x6a" + "\x8a\x6d\x1b\x55\x2a\x2c\xf4\xcd\xc1\x72\x78\xda\x0d\x54\x32" + "\x46\x93\xd7\x96\xce\x33\x06\xe9\x7a\x7b\x6d\xe9\x54\xe4\xbe" + "\x56\x37\xa7\x7c\xc8\xba\x17\xb1\xba\x76\xd7\x7f\xca\x7f\xfe" + "\x60\x7d\x60\x27\xd0\x80\x65\x74\xdc\xd6\xc8\x58\x4d\xcd\x8e" + "\xc9\x4e\xb2\x3e\x6e\x4f\xfa\x22\xfa\x9f\x3a\x9f\x14\xeb\x81" + "\x82\x01\x00\x61\x42\x89\xdc\x86\x09\x05\xc4\x87\x2c\xff\x0e" + "\xd1\xab\x15\xfe\x7b\xa7\x6a\x32\x00\xcc\x65\xb5\xca\x16\x67" + "\x48\xcc\x4c\xa1\x57\x0d\x7e\xaf\x32\x68\x71\x7d\xd0\x33\xaa" + "\xc1\xde\x45\xe3\xa0\xb3\xc2\x50\x8b\xc7\xe5\x64\xcb\x9e\xab" + "\x70\xe7\xd0\xe4\x9b\x35\x54\xaf\x0f\x1b\xab\x27\xf9\x59\xf3" + "\x98\xd2\x7c\x4a\xb5\x2a\x69\x9d\x59\x72\xa4\x65\x58\x99\xd5" + "\xab\xf4\x55\xe4\xee\x4a\x47\x6a\x00\x15\xfc\x96\x1b\x65\x75" + "\x4d\x52\x7f\x6f\xbc\x4f\x52\x6c\x8c\x22\x94\xa7\x62\x7c\x12" + "\x5e\x08\x9a\xb7\x86\x30\x37\x34\x31\xb7\x2b\xfd\x53\x5c\xef" + "\x85\xd0\xad\x0f\xd8\x5d\x68\xb0\xb5\xc9\x44\xd8\x3e\xd2\xf9" + "\x0f\xa9\x08\x48\xd4\x6f\x53\xe5\xb9\xb9\x98\x9a\x64\x40\x84" + "\xe1\xa2\x54\x6b\xb7\x68\x59\x75\x13\xc2\xba\x71\xa2\x8d\xd6" + "\xe8\x32\xf0\x6e\x34\x0e\x99\xde\xfa\x57\x8f\xaf\xce\xba\x0b" + "\x0d\x15\x0a\xbb\x5e\x82\x87\xcf\x3a\x75\x03\x04\xfd\xbc\x41" + "\x62\x01\xd3\xdb\x5a\xa9\x92\x19\x18\xd8\x40\xe2\x54\xfc\xe6" + "\x69\x06\x16\x43\x09\x00\x18\x6b\xab\x26\xdb\x6a\x2b\xd4\x8b" + "\xfc\x0a\x7c\x96\xea\xe2\x40\xdd\x1c\xa7\xde\xc5\x23\x64\x4e" + "\x4c\xea\x0c\xd9\xa4\x64\x80\x20\x63\x87\xe7\xfd\x5e\x93\x76" + "\x3e\x74\x42\x8e\xd5\xc9\x79\xa6\xa9\xc4\x3d\x61\x14\x7b\x49" + "\xf3\xda\x52\xc2\x74\x9b\x62\xae\x8c\x90\x81\x40\x4f\x9d\xaf" + "\x7e\x00\x50\x3d\xdc\xb2\xd9\x56\x79\x61\xb7\xcb\xe6\x2d\xf3" + "\xc8\xce\x6f\x7a\xde\x9a\x85\xf8\xc5\xc7\x93\x7d\xf8\xdc\xdb" + "\xbc\x12\x87\x0d\x42\x62\xc8\xc8\xd0\xbd\xb7\xa9\x05\x0c\x57" + "\x2a\xf5\x59\x83\x81\x69\xc8\xbc\xec\x4b\xf8\xf6\xbd\xc7\x70" + "\x0f\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b" + "\x80\x20\xbc\x96\xfd\x6e\xe1\x2e\x71\xde\x95\xe8\x39\x61\xdc" + "\x69\xf5\xe2\x3f\xdf\x4b\x6c\xdf\x76\xee\x47\x92\x17\xc8\xf5" + "\x41\xe9\x7a\x6e\x81\x03\x04\x40\x23\x82\x02\x03\xb8\xa2\x2b" + "\x80\x20\x52\x92\x62\x3c\x18\xb5\xda\xcd\xb0\x67\xfe\x2b\xb0" + "\x51\x84\xf3\x90\xc9\xe6\x46\x39\x96\x20\xd2\x46\x94\xad\x71" + "\x87\x34\xd8\x6c\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27" + "\x80\x20\x1a\x59\xf0\xd9\x99\xe2\xac\x9a\xc7\x84\xc3\xe7\x21" + "\x3d\x86\x3b\x18\xfd\x67\xc1\x70\x5f\x36\x60\xc3\x4d\xb6\x1c" + "\x84\x53\x7e\xda\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1a\x18" + "\x47\x1f\xd0\x23\xc4\x4d\x07\x5b\x1e\x43\xa6\x28\x54\xce\xec" + "\x02\x4d\xc1\x00\x3c\x0c\x55\x02\xa3\xa3\x28\x38\x88\x5c\x84" + "\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x61\xfd\x47\x52\x5c\x8f\xe8\xdb\x7d\xc7\x1e" + "\x6f\x58\x63\x2e\x75\xca\x13\xfd\x14\x96\x96\x91\x21\xc8\xa1" + "\xd4\x03\x7f\x84\x53\x1f\x81\x03\x0c\xb4\x5d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x9c\xd7\xbe\xf1\x71\x00\x03\x96\xf0\xe9\x66\x2b" + "\x82\x21\xcb\x09\x76\xab\x99\x50\xe2\xf9\x37\x71\x03\xd7\x19" + "\xe1\x3c\x97\x6a\x0b\x81\x03\x04\x40\x3a\x82\x02\x03\xb8\xa1" + "\x2b\x80\x20\xbc\x96\xfd\x6e\xe1\x2e\x71\xde\x95\xe8\x39\x61" + "\xdc\x69\xf5\xe2\x3f\xdf\x4b\x6c\xdf\x76\xee\x47\x92\x17\xc8" + "\xf5\x41\xe9\x7a\x6e\x81\x03\x04\x40\x23\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\x52\x92\x62\x3c\x18\xb5\xda\xcd\xb0\x67\xfe\x2b" + "\xb0\x51\x84\xf3\x90\xc9\xe6\x46\x39\x96\x20\xd2\x46\x94\xad" + "\x71\x87\x34\xd8\x6c\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x19\x8c\xcc\x4c\x02\x17\xf3\xb7\xc0\x65\x68\xae" + "\xf6\xd8\x1a\x44\xd5\x39\x52\x93\x1c\xb2\x4f\x8f\xb3\x6f\x21" + "\xfc\x18\x2c\x58\x10\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x1a" + "\x59\xf0\xd9\x99\xe2\xac\x9a\xc7\x84\xc3\xe7\x21\x3d\x86\x3b" + "\x18\xfd\x67\xc1\x70\x5f\x36\x60\xc3\x4d\xb6\x1c\x84\x53\x7e" + "\xda\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1a\x18\x47\x1f\xd0" + "\x23\xc4\x4d\x07\x5b\x1e\x43\xa6\x28\x54\xce\xec\x02\x4d\xc1" + "\x00\x3c\x0c\x55\x02\xa3\xa3\x28\x38\x88\x5c\x84\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\xa1\xa0\xd1\xf4\xea\x8d\x9a\x14\x25" + "\xca\x52\x3a\x77\x7e\xf4\x0d\x86\x56\xc7\x22\x12\xd3\xa3\xc2" + "\x32\xa3\x2b\x80\x96\xf3\xd4\x23\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh64() + { + testcase("Thresh64"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim16Cond + // ** Rsa17Cond + // ** Ed18Cond + // ** thresh1 + // *** ed2 + // ** prefix3 + // *** prefix4 + // **** ed5 + // ** thresh6 + // *** Preim13Cond + // *** Rsa14Cond + // *** Ed15Cond + // *** ed7 + // *** thresh8 + // **** Preim10Cond + // **** Rsa11Cond + // **** Ed12Cond + // **** ed9 + + auto const ed2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed2PublicKey{ + {0xb1, 0x2f, 0x54, 0xbe, 0xb6, 0xf8, 0x76, 0x71, 0x72, 0xed, 0x44, + 0x03, 0x71, 0x74, 0x2d, 0x7f, 0x98, 0x10, 0x4b, 0x57, 0xf2, 0x45, + 0xfb, 0x3e, 0xea, 0xfd, 0xdd, 0x39, 0x42, 0xbf, 0x24, 0x4d}}; + std::array const ed2Sig{ + {0x86, 0xf5, 0xe9, 0x44, 0x74, 0xe8, 0x98, 0xca, 0xc8, 0x20, 0xde, + 0x21, 0xcb, 0xf7, 0xf8, 0x65, 0x37, 0x6c, 0xd2, 0xe2, 0xd2, 0x46, + 0x6f, 0xcf, 0xd4, 0xdd, 0x48, 0x66, 0x8a, 0x9c, 0x06, 0xda, 0xa5, + 0x0e, 0x11, 0xfb, 0x87, 0x94, 0xd2, 0xed, 0xaa, 0xdd, 0x4e, 0x48, + 0x09, 0x7a, 0x4b, 0xdd, 0xa5, 0xe8, 0x46, 0x2e, 0x1a, 0xbb, 0x51, + 0x60, 0x0c, 0x9d, 0x8e, 0x35, 0x3e, 0xc1, 0x79, 0x09}}; + std::array const ed2SigningKey{ + {0xa7, 0xeb, 0x15, 0xc5, 0x2a, 0x41, 0x59, 0xf9, 0xf7, 0xb4, 0x78, + 0x5f, 0xdb, 0x79, 0xe5, 0x5b, 0x16, 0x44, 0xf7, 0xc7, 0xcf, 0xe2, + 0x46, 0xc5, 0xb3, 0x54, 0x64, 0xb5, 0x2f, 0x6c, 0x8e, 0x8e}}; + (void)ed2SigningKey; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const ed5Msg = "P4P3abcdefghijklmnopqrstuvwxyz"s; + std::array const ed5PublicKey{ + {0xae, 0xbc, 0xe5, 0x4b, 0x88, 0x09, 0x8d, 0x4f, 0xc4, 0xe1, 0x22, + 0xa0, 0x7c, 0x41, 0x05, 0xd7, 0x9f, 0xbe, 0xc8, 0x3d, 0x1d, 0x7e, + 0xd6, 0x55, 0xf4, 0x01, 0x67, 0x68, 0x93, 0x55, 0x85, 0xdf}}; + std::array const ed5Sig{ + {0x2d, 0x65, 0x3f, 0x89, 0xcb, 0x5e, 0x7b, 0x0c, 0x8d, 0x4f, 0xe4, + 0x27, 0xe6, 0xa4, 0x72, 0x93, 0xf7, 0xef, 0xba, 0xab, 0x6d, 0x8a, + 0xd8, 0xb3, 0x46, 0x96, 0x93, 0x47, 0xe6, 0xa8, 0x0f, 0x34, 0x40, + 0x02, 0x20, 0x78, 0x71, 0x1a, 0x81, 0x01, 0x83, 0x66, 0x49, 0xc0, + 0x59, 0x1c, 0x13, 0x16, 0x55, 0x4b, 0x62, 0xa3, 0x68, 0x67, 0x4c, + 0x82, 0x9a, 0x12, 0xb9, 0x12, 0x47, 0x92, 0x44, 0x0f}}; + std::array const ed5SigningKey{ + {0x42, 0x67, 0x67, 0xc0, 0xba, 0xdf, 0xb4, 0xd3, 0xf5, 0xc5, 0x1f, + 0x71, 0x97, 0x8a, 0xb4, 0x8e, 0x9a, 0xea, 0x3e, 0xec, 0xaf, 0xdc, + 0xc7, 0x2b, 0x01, 0x1b, 0x06, 0x8f, 0x05, 0x56, 0x63, 0xbc}}; + (void)ed5SigningKey; + auto const prefix4Prefix = "P4"s; + auto const prefix4Msg = "P3abcdefghijklmnopqrstuvwxyz"s; + auto const prefix4MaxMsgLength = 28; + auto const prefix3Prefix = "P3"s; + auto const prefix3Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix3MaxMsgLength = 26; + auto const ed7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed7PublicKey{ + {0x58, 0xcf, 0x4b, 0xc5, 0x59, 0xdb, 0xba, 0x62, 0x25, 0x14, 0x3a, + 0xc0, 0xad, 0xab, 0x5e, 0x35, 0xa1, 0xb4, 0x0e, 0xc1, 0xaf, 0x3c, + 0xa8, 0x2f, 0x69, 0x2c, 0xb6, 0x25, 0xd7, 0xea, 0x15, 0xb3}}; + std::array const ed7Sig{ + {0xd0, 0xd1, 0x17, 0xe2, 0xb5, 0x40, 0x14, 0x81, 0x0b, 0x12, 0xd8, + 0xbe, 0x1d, 0x1c, 0xb0, 0x88, 0x27, 0xaf, 0x6e, 0xc3, 0x13, 0x71, + 0xea, 0xac, 0xf3, 0xd8, 0x6f, 0x38, 0x21, 0xe2, 0x6d, 0x77, 0xe9, + 0xa6, 0xba, 0x03, 0x2a, 0xe3, 0x50, 0xcb, 0x38, 0xbe, 0x36, 0xba, + 0x62, 0x6e, 0x37, 0x5c, 0x8d, 0x69, 0x9f, 0xf0, 0x43, 0x64, 0x83, + 0x82, 0x8e, 0xbe, 0xf5, 0xa6, 0x96, 0x35, 0xb7, 0x03}}; + std::array const ed7SigningKey{ + {0x9c, 0x02, 0x4b, 0x5e, 0x6a, 0x83, 0x35, 0x8a, 0x2a, 0x71, 0x70, + 0x4e, 0xab, 0x74, 0x72, 0x22, 0x33, 0x5a, 0x82, 0xd9, 0x8e, 0x9c, + 0x8c, 0x41, 0x62, 0x6b, 0x02, 0x62, 0xbd, 0x59, 0x31, 0xcb}}; + (void)ed7SigningKey; + auto const ed9Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed9PublicKey{ + {0x33, 0xcd, 0x8f, 0x06, 0xdd, 0xfe, 0x8e, 0xf2, 0x53, 0x04, 0x88, + 0x2d, 0xb0, 0xa0, 0x58, 0xbd, 0xdc, 0xcf, 0xc8, 0x1e, 0x77, 0x28, + 0x4e, 0xf8, 0x45, 0xb2, 0x31, 0x2a, 0x7c, 0x88, 0x23, 0x5e}}; + std::array const ed9Sig{ + {0x28, 0x7f, 0x0d, 0x0a, 0x6d, 0x6f, 0xbd, 0xdc, 0xc9, 0x65, 0x9a, + 0xb5, 0x2c, 0xf0, 0xf0, 0xbf, 0xc3, 0x43, 0xad, 0x7f, 0x89, 0x4e, + 0x57, 0x50, 0xe2, 0x72, 0x1d, 0x00, 0x81, 0x15, 0xbe, 0x4e, 0x58, + 0x0a, 0x4e, 0xcb, 0xe7, 0xd1, 0xc6, 0x85, 0xed, 0x39, 0x45, 0x82, + 0xfe, 0x09, 0x10, 0x47, 0x37, 0x7c, 0xf3, 0x5f, 0xbc, 0x40, 0xf1, + 0x93, 0xfc, 0x97, 0xf3, 0x20, 0x5e, 0x3a, 0x87, 0x00}}; + std::array const ed9SigningKey{ + {0x3e, 0x5f, 0x71, 0xf5, 0x40, 0xbf, 0xa2, 0xe5, 0xbb, 0xae, 0xd4, + 0x9e, 0xb8, 0xfd, 0xcf, 0x8b, 0xb5, 0x7a, 0x30, 0x53, 0x80, 0xf9, + 0x1f, 0x0f, 0x4e, 0xdd, 0x7b, 0x2e, 0x49, 0xcf, 0x7c, 0x12}}; + (void)ed9SigningKey; + auto const thresh8Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim10CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim10Cond{Type::preimageSha256, + 9, + Preim10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa11CondConditionFingerprint = { + {0xaf, 0x93, 0xfd, 0x22, 0x45, 0xc2, 0x08, 0xab, 0x43, 0xf7, 0x45, + 0x56, 0x63, 0xec, 0xaf, 0x15, 0x33, 0xa0, 0x2a, 0xb4, 0x9e, 0x15, + 0xb4, 0x6e, 0xda, 0x87, 0x35, 0xde, 0x09, 0x4b, 0x06, 0x31}}; + Condition const Rsa11Cond{Type::rsaSha256, + 65536, + Rsa11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed12CondConditionFingerprint = { + {0x55, 0xcc, 0xd1, 0xa2, 0x2c, 0x90, 0x8d, 0xe3, 0x2e, 0x42, 0xd4, + 0xe0, 0x65, 0xb2, 0xf7, 0xda, 0xc0, 0x07, 0x1e, 0xd3, 0x23, 0x0f, + 0xfe, 0x78, 0x13, 0xa2, 0x86, 0x61, 0xc4, 0x34, 0x28, 0x50}}; + Condition const Ed12Cond{Type::ed25519Sha256, + 131072, + Ed12CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh6Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim13CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim13Cond{Type::preimageSha256, + 9, + Preim13CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa14CondConditionFingerprint = { + {0x32, 0xec, 0xaa, 0x5e, 0xa6, 0x88, 0xdc, 0xe4, 0x81, 0x0f, 0x93, + 0x0f, 0x65, 0xde, 0x87, 0xfd, 0x54, 0x8c, 0x79, 0x04, 0x81, 0xe3, + 0x63, 0x3f, 0x3d, 0x08, 0xa1, 0xba, 0x0a, 0x24, 0x2b, 0x46}}; + Condition const Rsa14Cond{Type::rsaSha256, + 65536, + Rsa14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed15CondConditionFingerprint = { + {0x40, 0xd1, 0x9a, 0x63, 0x62, 0x9b, 0xc0, 0x76, 0xab, 0x11, 0x73, + 0x42, 0x86, 0xb3, 0x20, 0x9d, 0x23, 0xe8, 0x5e, 0xee, 0xb9, 0x82, + 0x5d, 0x93, 0xe3, 0xac, 0xad, 0xa0, 0x40, 0x41, 0x51, 0x1b}}; + Condition const Ed15Cond{Type::ed25519Sha256, + 131072, + Ed15CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim16CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim16Cond{Type::preimageSha256, + 9, + Preim16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa17CondConditionFingerprint = { + {0x78, 0xe3, 0x04, 0xf4, 0xa6, 0x16, 0x68, 0x4c, 0x1b, 0xcf, 0x3a, + 0x32, 0xff, 0xbc, 0x75, 0x1a, 0xe6, 0x08, 0x9b, 0xff, 0xba, 0x79, + 0xf4, 0x39, 0x7a, 0xfc, 0xe1, 0x6f, 0xff, 0x3e, 0xb3, 0x75}}; + Condition const Rsa17Cond{Type::rsaSha256, + 65536, + Rsa17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed18CondConditionFingerprint = { + {0x0d, 0xea, 0xc5, 0x16, 0x5c, 0x62, 0xb8, 0xd1, 0xa4, 0xe7, 0x5a, + 0x07, 0x58, 0x00, 0x79, 0x51, 0x88, 0x21, 0xe9, 0x4d, 0xba, 0x73, + 0x7b, 0xad, 0x60, 0x9c, 0x5c, 0x26, 0x00, 0x2e, 0xd1, 0x51}}; + Condition const Ed18Cond{Type::ed25519Sha256, + 131072, + Ed18CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(ed2)); + std::vector thresh1Subconditions{}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto ed5 = std::make_unique(ed5PublicKey, ed5Sig); + auto prefix4 = std::make_unique( + makeSlice(prefix4Prefix), prefix4MaxMsgLength, std::move(ed5)); + auto prefix3 = std::make_unique( + makeSlice(prefix3Prefix), prefix3MaxMsgLength, std::move(prefix4)); + auto ed7 = std::make_unique(ed7PublicKey, ed7Sig); + auto ed9 = std::make_unique(ed9PublicKey, ed9Sig); + std::vector> thresh8Subfulfillments; + thresh8Subfulfillments.emplace_back(std::move(ed9)); + std::vector thresh8Subconditions{ + {Preim10Cond, Rsa11Cond, Ed12Cond}}; + auto thresh8 = std::make_unique( + std::move(thresh8Subfulfillments), std::move(thresh8Subconditions)); + std::vector> thresh6Subfulfillments; + thresh6Subfulfillments.emplace_back(std::move(ed7)); + thresh6Subfulfillments.emplace_back(std::move(thresh8)); + std::vector thresh6Subconditions{ + {Preim13Cond, Rsa14Cond, Ed15Cond}}; + auto thresh6 = std::make_unique( + std::move(thresh6Subfulfillments), std::move(thresh6Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix3)); + thresh0Subfulfillments.emplace_back(std::move(thresh6)); + std::vector thresh0Subconditions{ + {Preim16Cond, Rsa17Cond, Ed18Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\x36\xa0\x82\x02\xb7\xa1\x7a\x80\x02\x50\x33\x81" + "\x01\x1a\xa2\x71\xa1\x6f\x80\x02\x50\x34\x81\x01\x1c\xa2\x66" + "\xa4\x64\x80\x20\xae\xbc\xe5\x4b\x88\x09\x8d\x4f\xc4\xe1\x22" + "\xa0\x7c\x41\x05\xd7\x9f\xbe\xc8\x3d\x1d\x7e\xd6\x55\xf4\x01" + "\x67\x68\x93\x55\x85\xdf\x81\x40\x2d\x65\x3f\x89\xcb\x5e\x7b" + "\x0c\x8d\x4f\xe4\x27\xe6\xa4\x72\x93\xf7\xef\xba\xab\x6d\x8a" + "\xd8\xb3\x46\x96\x93\x47\xe6\xa8\x0f\x34\x40\x02\x20\x78\x71" + "\x1a\x81\x01\x83\x66\x49\xc0\x59\x1c\x13\x16\x55\x4b\x62\xa3" + "\x68\x67\x4c\x82\x9a\x12\xb9\x12\x47\x92\x44\x0f\xa2\x6a\xa0" + "\x66\xa4\x64\x80\x20\xb1\x2f\x54\xbe\xb6\xf8\x76\x71\x72\xed" + "\x44\x03\x71\x74\x2d\x7f\x98\x10\x4b\x57\xf2\x45\xfb\x3e\xea" + "\xfd\xdd\x39\x42\xbf\x24\x4d\x81\x40\x86\xf5\xe9\x44\x74\xe8" + "\x98\xca\xc8\x20\xde\x21\xcb\xf7\xf8\x65\x37\x6c\xd2\xe2\xd2" + "\x46\x6f\xcf\xd4\xdd\x48\x66\x8a\x9c\x06\xda\xa5\x0e\x11\xfb" + "\x87\x94\xd2\xed\xaa\xdd\x4e\x48\x09\x7a\x4b\xdd\xa5\xe8\x46" + "\x2e\x1a\xbb\x51\x60\x0c\x9d\x8e\x35\x3e\xc1\x79\x09\xa1\x00" + "\xa2\x82\x01\xcb\xa0\x82\x01\x4c\xa2\x81\xe3\xa0\x66\xa4\x64" + "\x80\x20\x33\xcd\x8f\x06\xdd\xfe\x8e\xf2\x53\x04\x88\x2d\xb0" + "\xa0\x58\xbd\xdc\xcf\xc8\x1e\x77\x28\x4e\xf8\x45\xb2\x31\x2a" + "\x7c\x88\x23\x5e\x81\x40\x28\x7f\x0d\x0a\x6d\x6f\xbd\xdc\xc9" + "\x65\x9a\xb5\x2c\xf0\xf0\xbf\xc3\x43\xad\x7f\x89\x4e\x57\x50" + "\xe2\x72\x1d\x00\x81\x15\xbe\x4e\x58\x0a\x4e\xcb\xe7\xd1\xc6" + "\x85\xed\x39\x45\x82\xfe\x09\x10\x47\x37\x7c\xf3\x5f\xbc\x40" + "\xf1\x93\xfc\x97\xf3\x20\x5e\x3a\x87\x00\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xaf\x93\xfd\x22\x45" + "\xc2\x08\xab\x43\xf7\x45\x56\x63\xec\xaf\x15\x33\xa0\x2a\xb4" + "\x9e\x15\xb4\x6e\xda\x87\x35\xde\x09\x4b\x06\x31\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\x55\xcc\xd1\xa2\x2c\x90\x8d\xe3\x2e" + "\x42\xd4\xe0\x65\xb2\xf7\xda\xc0\x07\x1e\xd3\x23\x0f\xfe\x78" + "\x13\xa2\x86\x61\xc4\x34\x28\x50\x81\x03\x02\x00\x00\xa4\x64" + "\x80\x20\x58\xcf\x4b\xc5\x59\xdb\xba\x62\x25\x14\x3a\xc0\xad" + "\xab\x5e\x35\xa1\xb4\x0e\xc1\xaf\x3c\xa8\x2f\x69\x2c\xb6\x25" + "\xd7\xea\x15\xb3\x81\x40\xd0\xd1\x17\xe2\xb5\x40\x14\x81\x0b" + "\x12\xd8\xbe\x1d\x1c\xb0\x88\x27\xaf\x6e\xc3\x13\x71\xea\xac" + "\xf3\xd8\x6f\x38\x21\xe2\x6d\x77\xe9\xa6\xba\x03\x2a\xe3\x50" + "\xcb\x38\xbe\x36\xba\x62\x6e\x37\x5c\x8d\x69\x9f\xf0\x43\x64" + "\x83\x82\x8e\xbe\xf5\xa6\x96\x35\xb7\x03\xa1\x79\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x32\xec\xaa\x5e\xa6" + "\x88\xdc\xe4\x81\x0f\x93\x0f\x65\xde\x87\xfd\x54\x8c\x79\x04" + "\x81\xe3\x63\x3f\x3d\x08\xa1\xba\x0a\x24\x2b\x46\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\x40\xd1\x9a\x63\x62\x9b\xc0\x76\xab" + "\x11\x73\x42\x86\xb3\x20\x9d\x23\xe8\x5e\xee\xb9\x82\x5d\x93" + "\xe3\xac\xad\xa0\x40\x41\x51\x1b\x81\x03\x02\x00\x00\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x78\xe3" + "\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32\xff\xbc\x75\x1a\xe6" + "\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1\x6f\xff\x3e\xb3\x75" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c\x62" + "\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d\xba" + "\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02\x00" + "\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x21\x36\xae\xe4\x5a\x50\xff\xd4\x77\xe6\xf9" + "\xc8\xd5\x4e\xbd\xfb\x93\xba\xbb\x52\xca\xe8\xa7\xdd\xc8\xee" + "\xeb\xf5\x3c\xcc\x48\xfe\x81\x03\x08\x48\x3a\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\xfe\x5f\x70\x98\xd2\x9a" + "\x38\x67\xc8\xa9\x27\xa8\x8f\xb4\x80\x48\x28\xa6\x33\x7c\x98" + "\xa8\xff\xa6\x82\x41\x54\x59\xe9\x65\x2c\x41\x81\x03\x02\x08" + "\x3a\x82\x02\x03\x08\xa2\x2b\x80\x20\x1a\xcd\xf4\x00\x7d\xba" + "\xb8\x97\xdd\x52\xa5\x9f\xe4\xf9\x08\xce\x4e\xe3\xce\xe3\x53" + "\x76\xb1\xf8\xa2\x0d\x70\xc8\xf5\x09\x0d\x1d\x81\x03\x02\x04" + "\x00\x82\x02\x03\x08\xa2\x2b\x80\x20\x94\xcf\x62\x9f\x9d\x94" + "\x41\x76\x29\x2b\x22\x45\x9b\xe8\x05\xc1\x11\x74\x81\xc7\x3f" + "\xe7\xe9\xba\x31\xf2\xf5\xa0\x47\x52\x86\x23\x81\x03\x04\x24" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x78\xe3\x04\xf4\xa6\x16" + "\x68\x4c\x1b\xcf\x3a\x32\xff\xbc\x75\x1a\xe6\x08\x9b\xff\xba" + "\x79\xf4\x39\x7a\xfc\xe1\x6f\xff\x3e\xb3\x75\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c\x62\xb8\xd1\xa4\xe7" + "\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d\xba\x73\x7b\xad\x60" + "\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh65() + { + testcase("Thresh65"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim6Cond + // ** Rsa7Cond + // ** Ed8Cond + // ** Prefix9Cond + // ** Thresh12Cond + // ** thresh1 + // *** ed2 + // ** preim3 + // ** rsa4 + // ** ed5 + + auto const ed2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed2PublicKey{ + {0xb1, 0x2f, 0x54, 0xbe, 0xb6, 0xf8, 0x76, 0x71, 0x72, 0xed, 0x44, + 0x03, 0x71, 0x74, 0x2d, 0x7f, 0x98, 0x10, 0x4b, 0x57, 0xf2, 0x45, + 0xfb, 0x3e, 0xea, 0xfd, 0xdd, 0x39, 0x42, 0xbf, 0x24, 0x4d}}; + std::array const ed2Sig{ + {0x86, 0xf5, 0xe9, 0x44, 0x74, 0xe8, 0x98, 0xca, 0xc8, 0x20, 0xde, + 0x21, 0xcb, 0xf7, 0xf8, 0x65, 0x37, 0x6c, 0xd2, 0xe2, 0xd2, 0x46, + 0x6f, 0xcf, 0xd4, 0xdd, 0x48, 0x66, 0x8a, 0x9c, 0x06, 0xda, 0xa5, + 0x0e, 0x11, 0xfb, 0x87, 0x94, 0xd2, 0xed, 0xaa, 0xdd, 0x4e, 0x48, + 0x09, 0x7a, 0x4b, 0xdd, 0xa5, 0xe8, 0x46, 0x2e, 0x1a, 0xbb, 0x51, + 0x60, 0x0c, 0x9d, 0x8e, 0x35, 0x3e, 0xc1, 0x79, 0x09}}; + std::array const ed2SigningKey{ + {0xa7, 0xeb, 0x15, 0xc5, 0x2a, 0x41, 0x59, 0xf9, 0xf7, 0xb4, 0x78, + 0x5f, 0xdb, 0x79, 0xe5, 0x5b, 0x16, 0x44, 0xf7, 0xc7, 0xcf, 0xe2, + 0x46, 0xc5, 0xb3, 0x54, 0x64, 0xb5, 0x2f, 0x6c, 0x8e, 0x8e}}; + (void)ed2SigningKey; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const preim3Preimage = "I am root"s; + auto const preim3Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa4PublicKey{ + {0xbe, 0x09, 0xc5, 0xa4, 0x27, 0x29, 0xdf, 0xd4, 0x67, 0x76, 0xbe, + 0xbf, 0x2c, 0xf3, 0xa2, 0x0b, 0x42, 0xe4, 0xbf, 0xeb, 0xdd, 0x67, + 0x20, 0xfb, 0x7a, 0x27, 0x93, 0xc0, 0x78, 0x47, 0x78, 0xd7, 0x15, + 0x32, 0xee, 0x38, 0x81, 0x0d, 0x36, 0xa2, 0xc4, 0x65, 0x44, 0xe6, + 0x62, 0x26, 0xb9, 0x58, 0x13, 0xa4, 0x15, 0x82, 0xab, 0xb1, 0x16, + 0x61, 0xfc, 0x01, 0x98, 0xc6, 0x1a, 0x69, 0xc6, 0xba, 0x39, 0x3f, + 0x01, 0x55, 0x3d, 0xd7, 0x8e, 0x14, 0x42, 0x6d, 0x78, 0x74, 0x9b, + 0x28, 0xcb, 0x31, 0x39, 0x98, 0x5a, 0x11, 0xdc, 0xc1, 0x18, 0x9d, + 0x8d, 0xb0, 0xcd, 0x1b, 0x4c, 0x10, 0xab, 0x14, 0x64, 0x19, 0xf1, + 0x33, 0x15, 0x45, 0xc8, 0x92, 0x82, 0x03, 0x82, 0x8a, 0xaa, 0xad, + 0x94, 0xfc, 0x24, 0x11, 0x96, 0x99, 0x7e, 0x94, 0x5a, 0x82, 0x57, + 0x68, 0x61, 0x9f, 0x7b, 0x45, 0xe0, 0x99, 0x9e, 0x4f, 0x32, 0x50, + 0x5f, 0x05, 0xc8, 0x11, 0xae, 0xc4, 0x0c, 0x63, 0x18, 0x0e, 0x02, + 0x59, 0x36, 0x25, 0x92, 0x06, 0x32, 0xc7, 0x71, 0x47, 0x99, 0xcc, + 0x0a, 0x6e, 0x0a, 0x58, 0x71, 0x3f, 0x5e, 0xb7, 0x78, 0xf7, 0x98, + 0x79, 0xdf, 0x74, 0xa4, 0xeb, 0xa9, 0x00, 0xfd, 0x81, 0xb3, 0xcf, + 0x04, 0x8c, 0x5d, 0x7d, 0xe7, 0xb2, 0x82, 0x90, 0x49, 0xbd, 0x69, + 0xf3, 0x08, 0xe9, 0x92, 0xc6, 0x9e, 0x41, 0xba, 0x74, 0xd8, 0x8d, + 0x81, 0x97, 0x6f, 0x86, 0xab, 0xc9, 0xf1, 0x02, 0x31, 0xb4, 0xce, + 0x47, 0xb0, 0x39, 0xc8, 0xba, 0x51, 0xa7, 0x39, 0xf3, 0x71, 0xa2, + 0x25, 0x27, 0x37, 0x6e, 0x09, 0x6f, 0x19, 0x59, 0xbc, 0x65, 0xd9, + 0xcd, 0x12, 0xd3, 0x2c, 0xa2, 0x78, 0xfa, 0x23, 0x15, 0x1a, 0x82, + 0x41, 0x91, 0x1b, 0xbe, 0x8a, 0xe7, 0xfe, 0x3c, 0x3c, 0x30, 0x32, + 0xaa, 0xe9, 0xf3}}; + std::array const rsa4Sig{ + {0xbb, 0x8a, 0x7f, 0x7e, 0x16, 0xf3, 0x92, 0x90, 0x3c, 0xf8, 0xe9, + 0xa4, 0x90, 0x28, 0x29, 0xf8, 0xfc, 0x52, 0x63, 0xf0, 0x3d, 0xd8, + 0x53, 0x50, 0x81, 0xf7, 0x73, 0x71, 0x4e, 0x0d, 0x2f, 0x13, 0xac, + 0x35, 0x6e, 0x2a, 0x6f, 0xad, 0x44, 0x92, 0xc6, 0xc2, 0x76, 0xe7, + 0x3c, 0xdd, 0xe5, 0xd2, 0x36, 0xb7, 0x34, 0x13, 0x7f, 0xb9, 0x35, + 0xd1, 0xdf, 0xa5, 0x90, 0x06, 0x92, 0xe1, 0xf4, 0x5f, 0xa4, 0x7f, + 0xe1, 0x13, 0x10, 0xaf, 0xd4, 0xb4, 0x87, 0x9d, 0x90, 0x68, 0x87, + 0xa2, 0x0c, 0xe7, 0x8e, 0x56, 0xc9, 0x91, 0x2f, 0x58, 0x30, 0x8c, + 0xb5, 0xd2, 0x03, 0xdb, 0x9c, 0x2d, 0x81, 0xf6, 0xa5, 0x66, 0x41, + 0xc3, 0xb2, 0xf3, 0x26, 0x54, 0x06, 0xb9, 0xe9, 0xb3, 0x3f, 0x4e, + 0x90, 0xc8, 0x5e, 0xb5, 0x07, 0xa8, 0x39, 0xa2, 0x16, 0xec, 0x5a, + 0x6e, 0x17, 0x84, 0x3b, 0xa7, 0xba, 0x19, 0x8f, 0x41, 0x6f, 0x17, + 0xd0, 0x50, 0xf9, 0xd3, 0xc1, 0x10, 0xb7, 0xad, 0x6a, 0x24, 0x3c, + 0x23, 0x0e, 0x5b, 0x35, 0x95, 0x28, 0xd6, 0x4e, 0xa1, 0x53, 0xd9, + 0x34, 0x93, 0x3c, 0x88, 0xb7, 0x9c, 0xd9, 0x5b, 0x48, 0x69, 0x80, + 0x87, 0x47, 0x11, 0x7f, 0xd1, 0x04, 0x32, 0x03, 0x25, 0x57, 0x9c, + 0xf4, 0xc6, 0xda, 0x21, 0xc5, 0x1e, 0xb7, 0xbd, 0x7f, 0x9e, 0xea, + 0xa4, 0x7f, 0x0b, 0x31, 0xf5, 0x85, 0x4c, 0x3d, 0xab, 0xc0, 0x7b, + 0x6f, 0x23, 0x64, 0xb8, 0x52, 0xdb, 0xb6, 0x13, 0x04, 0x24, 0x2f, + 0x62, 0x00, 0xa4, 0x23, 0xaa, 0xbc, 0xb0, 0x25, 0x3a, 0xa4, 0x57, + 0xff, 0x05, 0x9c, 0x0a, 0x04, 0xe5, 0x6d, 0xb3, 0x78, 0x36, 0x7d, + 0xf5, 0xb2, 0x73, 0xc5, 0xa6, 0x4e, 0x59, 0xbd, 0x7a, 0xc9, 0x3d, + 0xe6, 0xd6, 0x18, 0x0c, 0xa5, 0x91, 0x95, 0x22, 0x47, 0xc9, 0xed, + 0xba, 0x66, 0xab}}; + auto const ed5Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed5PublicKey{ + {0xae, 0xbc, 0xe5, 0x4b, 0x88, 0x09, 0x8d, 0x4f, 0xc4, 0xe1, 0x22, + 0xa0, 0x7c, 0x41, 0x05, 0xd7, 0x9f, 0xbe, 0xc8, 0x3d, 0x1d, 0x7e, + 0xd6, 0x55, 0xf4, 0x01, 0x67, 0x68, 0x93, 0x55, 0x85, 0xdf}}; + std::array const ed5Sig{ + {0x30, 0xe8, 0x22, 0x9b, 0x51, 0x8c, 0xaa, 0x86, 0x9b, 0xd0, 0xb2, + 0x06, 0xe0, 0xf0, 0xf2, 0xc0, 0x87, 0x43, 0x0f, 0xb0, 0xbd, 0xe1, + 0xeb, 0x17, 0x7f, 0x85, 0xe8, 0x79, 0xc6, 0xa2, 0x9d, 0x19, 0x17, + 0x07, 0x7e, 0x56, 0x06, 0xcb, 0x5a, 0xe1, 0xca, 0x36, 0x5c, 0x0a, + 0xb5, 0x81, 0x2a, 0x42, 0xf6, 0xcc, 0x6e, 0x04, 0xe2, 0x61, 0x8b, + 0x12, 0x16, 0xc2, 0x36, 0xfc, 0xd5, 0xd8, 0xfc, 0x0c}}; + std::array const ed5SigningKey{ + {0x42, 0x67, 0x67, 0xc0, 0xba, 0xdf, 0xb4, 0xd3, 0xf5, 0xc5, 0x1f, + 0x71, 0x97, 0x8a, 0xb4, 0x8e, 0x9a, 0xea, 0x3e, 0xec, 0xaf, 0xdc, + 0xc7, 0x2b, 0x01, 0x1b, 0x06, 0x8f, 0x05, 0x56, 0x63, 0xbc}}; + (void)ed5SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim6CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim6Cond{Type::preimageSha256, + 9, + Preim6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa7CondConditionFingerprint = { + {0x6c, 0x7b, 0xea, 0x83, 0xa1, 0xf4, 0x82, 0x3d, 0x36, 0xe7, 0x6e, + 0xae, 0x1a, 0xbc, 0xa0, 0xba, 0x90, 0x3d, 0x96, 0xc1, 0xe6, 0xad, + 0x3a, 0x47, 0xa5, 0xcb, 0x88, 0xab, 0x3c, 0x5f, 0xcc, 0xd5}}; + Condition const Rsa7Cond{Type::rsaSha256, + 65536, + Rsa7CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed8CondConditionFingerprint = { + {0xf1, 0x68, 0x96, 0xa6, 0x2e, 0xef, 0x7f, 0x47, 0x06, 0x51, 0x4c, + 0xc6, 0x7e, 0x24, 0xf7, 0x29, 0x84, 0x9c, 0xd6, 0xb0, 0xd9, 0x4b, + 0xd9, 0x0f, 0xc9, 0x34, 0x01, 0x9d, 0x92, 0xeb, 0xbc, 0x0a}}; + Condition const Ed8Cond{Type::ed25519Sha256, + 131072, + Ed8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix9CondConditionFingerprint = { + {0x74, 0xbc, 0xf6, 0x56, 0xf4, 0x49, 0x9e, 0x93, 0xba, 0x17, 0x0c, + 0xd8, 0xd8, 0x5c, 0x12, 0x2a, 0x8a, 0xba, 0x67, 0x18, 0xcb, 0xd2, + 0xe0, 0xc2, 0x2b, 0xf4, 0x44, 0xa9, 0x8f, 0x04, 0x5b, 0x9a}}; + Condition const Prefix9Cond{Type::prefixSha256, + 133155, + Prefix9CondConditionFingerprint, + std::bitset<5>{16}}; + std::array const Thresh12CondConditionFingerprint = { + {0xb0, 0x40, 0x18, 0xf3, 0x6b, 0x1b, 0xa9, 0x36, 0x3a, 0x3c, 0xf7, + 0x7d, 0x0f, 0x1a, 0x40, 0x22, 0xb1, 0x09, 0x48, 0x0e, 0xd5, 0x8e, + 0x6e, 0xbe, 0x8d, 0xa6, 0x50, 0x20, 0x0c, 0x20, 0x78, 0x19}}; + Condition const Thresh12Cond{Type::thresholdSha256, + 271360, + Thresh12CondConditionFingerprint, + std::bitset<5>{25}}; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(ed2)); + std::vector thresh1Subconditions{}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim3 = + std::make_unique(makeSlice(preim3Preimage)); + auto rsa4 = std::make_unique( + makeSlice(rsa4PublicKey), makeSlice(rsa4Sig)); + auto ed5 = std::make_unique(ed5PublicKey, ed5Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim3)); + thresh0Subfulfillments.emplace_back(std::move(rsa4)); + thresh0Subfulfillments.emplace_back(std::move(ed5)); + std::vector thresh0Subconditions{ + {Preim6Cond, Rsa7Cond, Ed8Cond, Prefix9Cond, Thresh12Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\xc5\xa0\x82\x02\xeb\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x6a\xa0\x66\xa4\x64\x80\x20\xb1" + "\x2f\x54\xbe\xb6\xf8\x76\x71\x72\xed\x44\x03\x71\x74\x2d\x7f" + "\x98\x10\x4b\x57\xf2\x45\xfb\x3e\xea\xfd\xdd\x39\x42\xbf\x24" + "\x4d\x81\x40\x86\xf5\xe9\x44\x74\xe8\x98\xca\xc8\x20\xde\x21" + "\xcb\xf7\xf8\x65\x37\x6c\xd2\xe2\xd2\x46\x6f\xcf\xd4\xdd\x48" + "\x66\x8a\x9c\x06\xda\xa5\x0e\x11\xfb\x87\x94\xd2\xed\xaa\xdd" + "\x4e\x48\x09\x7a\x4b\xdd\xa5\xe8\x46\x2e\x1a\xbb\x51\x60\x0c" + "\x9d\x8e\x35\x3e\xc1\x79\x09\xa1\x00\xa3\x82\x02\x08\x80\x82" + "\x01\x00\xbe\x09\xc5\xa4\x27\x29\xdf\xd4\x67\x76\xbe\xbf\x2c" + "\xf3\xa2\x0b\x42\xe4\xbf\xeb\xdd\x67\x20\xfb\x7a\x27\x93\xc0" + "\x78\x47\x78\xd7\x15\x32\xee\x38\x81\x0d\x36\xa2\xc4\x65\x44" + "\xe6\x62\x26\xb9\x58\x13\xa4\x15\x82\xab\xb1\x16\x61\xfc\x01" + "\x98\xc6\x1a\x69\xc6\xba\x39\x3f\x01\x55\x3d\xd7\x8e\x14\x42" + "\x6d\x78\x74\x9b\x28\xcb\x31\x39\x98\x5a\x11\xdc\xc1\x18\x9d" + "\x8d\xb0\xcd\x1b\x4c\x10\xab\x14\x64\x19\xf1\x33\x15\x45\xc8" + "\x92\x82\x03\x82\x8a\xaa\xad\x94\xfc\x24\x11\x96\x99\x7e\x94" + "\x5a\x82\x57\x68\x61\x9f\x7b\x45\xe0\x99\x9e\x4f\x32\x50\x5f" + "\x05\xc8\x11\xae\xc4\x0c\x63\x18\x0e\x02\x59\x36\x25\x92\x06" + "\x32\xc7\x71\x47\x99\xcc\x0a\x6e\x0a\x58\x71\x3f\x5e\xb7\x78" + "\xf7\x98\x79\xdf\x74\xa4\xeb\xa9\x00\xfd\x81\xb3\xcf\x04\x8c" + "\x5d\x7d\xe7\xb2\x82\x90\x49\xbd\x69\xf3\x08\xe9\x92\xc6\x9e" + "\x41\xba\x74\xd8\x8d\x81\x97\x6f\x86\xab\xc9\xf1\x02\x31\xb4" + "\xce\x47\xb0\x39\xc8\xba\x51\xa7\x39\xf3\x71\xa2\x25\x27\x37" + "\x6e\x09\x6f\x19\x59\xbc\x65\xd9\xcd\x12\xd3\x2c\xa2\x78\xfa" + "\x23\x15\x1a\x82\x41\x91\x1b\xbe\x8a\xe7\xfe\x3c\x3c\x30\x32" + "\xaa\xe9\xf3\x81\x82\x01\x00\xbb\x8a\x7f\x7e\x16\xf3\x92\x90" + "\x3c\xf8\xe9\xa4\x90\x28\x29\xf8\xfc\x52\x63\xf0\x3d\xd8\x53" + "\x50\x81\xf7\x73\x71\x4e\x0d\x2f\x13\xac\x35\x6e\x2a\x6f\xad" + "\x44\x92\xc6\xc2\x76\xe7\x3c\xdd\xe5\xd2\x36\xb7\x34\x13\x7f" + "\xb9\x35\xd1\xdf\xa5\x90\x06\x92\xe1\xf4\x5f\xa4\x7f\xe1\x13" + "\x10\xaf\xd4\xb4\x87\x9d\x90\x68\x87\xa2\x0c\xe7\x8e\x56\xc9" + "\x91\x2f\x58\x30\x8c\xb5\xd2\x03\xdb\x9c\x2d\x81\xf6\xa5\x66" + "\x41\xc3\xb2\xf3\x26\x54\x06\xb9\xe9\xb3\x3f\x4e\x90\xc8\x5e" + "\xb5\x07\xa8\x39\xa2\x16\xec\x5a\x6e\x17\x84\x3b\xa7\xba\x19" + "\x8f\x41\x6f\x17\xd0\x50\xf9\xd3\xc1\x10\xb7\xad\x6a\x24\x3c" + "\x23\x0e\x5b\x35\x95\x28\xd6\x4e\xa1\x53\xd9\x34\x93\x3c\x88" + "\xb7\x9c\xd9\x5b\x48\x69\x80\x87\x47\x11\x7f\xd1\x04\x32\x03" + "\x25\x57\x9c\xf4\xc6\xda\x21\xc5\x1e\xb7\xbd\x7f\x9e\xea\xa4" + "\x7f\x0b\x31\xf5\x85\x4c\x3d\xab\xc0\x7b\x6f\x23\x64\xb8\x52" + "\xdb\xb6\x13\x04\x24\x2f\x62\x00\xa4\x23\xaa\xbc\xb0\x25\x3a" + "\xa4\x57\xff\x05\x9c\x0a\x04\xe5\x6d\xb3\x78\x36\x7d\xf5\xb2" + "\x73\xc5\xa6\x4e\x59\xbd\x7a\xc9\x3d\xe6\xd6\x18\x0c\xa5\x91" + "\x95\x22\x47\xc9\xed\xba\x66\xab\xa4\x64\x80\x20\xae\xbc\xe5" + "\x4b\x88\x09\x8d\x4f\xc4\xe1\x22\xa0\x7c\x41\x05\xd7\x9f\xbe" + "\xc8\x3d\x1d\x7e\xd6\x55\xf4\x01\x67\x68\x93\x55\x85\xdf\x81" + "\x40\x30\xe8\x22\x9b\x51\x8c\xaa\x86\x9b\xd0\xb2\x06\xe0\xf0" + "\xf2\xc0\x87\x43\x0f\xb0\xbd\xe1\xeb\x17\x7f\x85\xe8\x79\xc6" + "\xa2\x9d\x19\x17\x07\x7e\x56\x06\xcb\x5a\xe1\xca\x36\x5c\x0a" + "\xb5\x81\x2a\x42\xf6\xcc\x6e\x04\xe2\x61\x8b\x12\x16\xc2\x36" + "\xfc\xd5\xd8\xfc\x0c\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30" + "\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c" + "\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81" + "\x01\x09\xa1\x2b\x80\x20\x74\xbc\xf6\x56\xf4\x49\x9e\x93\xba" + "\x17\x0c\xd8\xd8\x5c\x12\x2a\x8a\xba\x67\x18\xcb\xd2\xe0\xc2" + "\x2b\xf4\x44\xa9\x8f\x04\x5b\x9a\x81\x03\x02\x08\x23\x82\x02" + "\x03\x08\xa2\x2b\x80\x20\xb0\x40\x18\xf3\x6b\x1b\xa9\x36\x3a" + "\x3c\xf7\x7d\x0f\x1a\x40\x22\xb1\x09\x48\x0e\xd5\x8e\x6e\xbe" + "\x8d\xa6\x50\x20\x0c\x20\x78\x19\x81\x03\x04\x24\x00\x82\x02" + "\x03\x98\xa3\x27\x80\x20\x6c\x7b\xea\x83\xa1\xf4\x82\x3d\x36" + "\xe7\x6e\xae\x1a\xbc\xa0\xba\x90\x3d\x96\xc1\xe6\xad\x3a\x47" + "\xa5\xcb\x88\xab\x3c\x5f\xcc\xd5\x81\x03\x01\x00\x00\xa4\x27" + "\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06\x51\x4c\xc6\x7e" + "\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f\xc9\x34\x01\x9d" + "\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x46\xa8\x26\x8a\x5f\xe3\xf8\xc4\xd4\xd6\x1c" + "\xd5\xd7\xd0\x77\x28\xa8\xda\xd8\x31\xd6\xf1\x86\x07\x51\xdc" + "\x2c\x16\x25\x4a\x31\x38\x81\x03\x0a\x54\x23\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x74\xbc\xf6\x56\xf4\x49\x9e\x93\xba\x17\x0c\xd8" + "\xd8\x5c\x12\x2a\x8a\xba\x67\x18\xcb\xd2\xe0\xc2\x2b\xf4\x44" + "\xa9\x8f\x04\x5b\x9a\x81\x03\x02\x08\x23\x82\x02\x03\x08\xa2" + "\x2b\x80\x20\x1a\xcd\xf4\x00\x7d\xba\xb8\x97\xdd\x52\xa5\x9f" + "\xe4\xf9\x08\xce\x4e\xe3\xce\xe3\x53\x76\xb1\xf8\xa2\x0d\x70" + "\xc8\xf5\x09\x0d\x1d\x81\x03\x02\x04\x00\x82\x02\x03\x08\xa2" + "\x2b\x80\x20\xb0\x40\x18\xf3\x6b\x1b\xa9\x36\x3a\x3c\xf7\x7d" + "\x0f\x1a\x40\x22\xb1\x09\x48\x0e\xd5\x8e\x6e\xbe\x8d\xa6\x50" + "\x20\x0c\x20\x78\x19\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x3a\x82\x3b\x32\x38\xb1\x3c\x17\x87\x60\x62\xec" + "\xcf\x91\xb0\xaf\xaa\xe5\x11\xe6\xfb\xe2\xb0\x3d\x70\x4d\x1d" + "\xad\xd6\x7c\xee\xa6\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x6c" + "\x7b\xea\x83\xa1\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba" + "\x90\x3d\x96\xc1\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc" + "\xd5\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x90\xce\xed\x45\x98" + "\x68\xff\x19\x2b\x27\xc1\x2a\xa2\x6e\x2e\x82\xf3\xbd\x71\x13" + "\x61\xb0\x76\x40\x4d\x48\xea\x16\xfb\x27\x57\xdc\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06" + "\x51\x4c\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f" + "\xc9\x34\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh66() + { + testcase("Thresh66"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim25Cond + // ** Rsa26Cond + // ** Ed27Cond + // ** thresh1 + // *** Preim3Cond + // *** Rsa4Cond + // *** Ed5Cond + // *** ed2 + // ** prefix6 + // *** prefix7 + // **** prefix8 + // ***** ed9 + // ** thresh10 + // *** Preim17Cond + // *** Rsa18Cond + // *** Ed19Cond + // *** Thresh20Cond + // *** ed11 + // *** thresh12 + // **** Preim14Cond + // **** Rsa15Cond + // **** Ed16Cond + // **** ed13 + + auto const ed2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed2PublicKey{ + {0xb1, 0x2f, 0x54, 0xbe, 0xb6, 0xf8, 0x76, 0x71, 0x72, 0xed, 0x44, + 0x03, 0x71, 0x74, 0x2d, 0x7f, 0x98, 0x10, 0x4b, 0x57, 0xf2, 0x45, + 0xfb, 0x3e, 0xea, 0xfd, 0xdd, 0x39, 0x42, 0xbf, 0x24, 0x4d}}; + std::array const ed2Sig{ + {0x86, 0xf5, 0xe9, 0x44, 0x74, 0xe8, 0x98, 0xca, 0xc8, 0x20, 0xde, + 0x21, 0xcb, 0xf7, 0xf8, 0x65, 0x37, 0x6c, 0xd2, 0xe2, 0xd2, 0x46, + 0x6f, 0xcf, 0xd4, 0xdd, 0x48, 0x66, 0x8a, 0x9c, 0x06, 0xda, 0xa5, + 0x0e, 0x11, 0xfb, 0x87, 0x94, 0xd2, 0xed, 0xaa, 0xdd, 0x4e, 0x48, + 0x09, 0x7a, 0x4b, 0xdd, 0xa5, 0xe8, 0x46, 0x2e, 0x1a, 0xbb, 0x51, + 0x60, 0x0c, 0x9d, 0x8e, 0x35, 0x3e, 0xc1, 0x79, 0x09}}; + std::array const ed2SigningKey{ + {0xa7, 0xeb, 0x15, 0xc5, 0x2a, 0x41, 0x59, 0xf9, 0xf7, 0xb4, 0x78, + 0x5f, 0xdb, 0x79, 0xe5, 0x5b, 0x16, 0x44, 0xf7, 0xc7, 0xcf, 0xe2, + 0x46, 0xc5, 0xb3, 0x54, 0x64, 0xb5, 0x2f, 0x6c, 0x8e, 0x8e}}; + (void)ed2SigningKey; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim3CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim3Cond{Type::preimageSha256, + 9, + Preim3CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa4CondConditionFingerprint = { + {0x3a, 0x82, 0x3b, 0x32, 0x38, 0xb1, 0x3c, 0x17, 0x87, 0x60, 0x62, + 0xec, 0xcf, 0x91, 0xb0, 0xaf, 0xaa, 0xe5, 0x11, 0xe6, 0xfb, 0xe2, + 0xb0, 0x3d, 0x70, 0x4d, 0x1d, 0xad, 0xd6, 0x7c, 0xee, 0xa6}}; + Condition const Rsa4Cond{Type::rsaSha256, + 65536, + Rsa4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed5CondConditionFingerprint = { + {0x90, 0xce, 0xed, 0x45, 0x98, 0x68, 0xff, 0x19, 0x2b, 0x27, 0xc1, + 0x2a, 0xa2, 0x6e, 0x2e, 0x82, 0xf3, 0xbd, 0x71, 0x13, 0x61, 0xb0, + 0x76, 0x40, 0x4d, 0x48, 0xea, 0x16, 0xfb, 0x27, 0x57, 0xdc}}; + Condition const Ed5Cond{Type::ed25519Sha256, + 131072, + Ed5CondConditionFingerprint, + std::bitset<5>{0}}; + auto const ed9Msg = "P8P7P6abcdefghijklmnopqrstuvwxyz"s; + std::array const ed9PublicKey{ + {0x33, 0xcd, 0x8f, 0x06, 0xdd, 0xfe, 0x8e, 0xf2, 0x53, 0x04, 0x88, + 0x2d, 0xb0, 0xa0, 0x58, 0xbd, 0xdc, 0xcf, 0xc8, 0x1e, 0x77, 0x28, + 0x4e, 0xf8, 0x45, 0xb2, 0x31, 0x2a, 0x7c, 0x88, 0x23, 0x5e}}; + std::array const ed9Sig{ + {0xd6, 0xae, 0xb2, 0xf8, 0xaf, 0x3b, 0xfe, 0x3b, 0x73, 0x27, 0xef, + 0x22, 0x86, 0xf4, 0xca, 0x40, 0x82, 0x3b, 0x2b, 0x21, 0xa5, 0xc4, + 0xa5, 0x1e, 0x32, 0x78, 0x8c, 0xe9, 0xbe, 0x40, 0x48, 0x82, 0x83, + 0x2f, 0x31, 0x65, 0x79, 0x97, 0x23, 0x72, 0x77, 0x97, 0x16, 0x06, + 0x94, 0xef, 0x37, 0x6d, 0x68, 0xef, 0x5c, 0x6b, 0xb5, 0x8c, 0xab, + 0x0d, 0x74, 0x5c, 0x52, 0x91, 0xc8, 0x1e, 0x12, 0x02}}; + std::array const ed9SigningKey{ + {0x3e, 0x5f, 0x71, 0xf5, 0x40, 0xbf, 0xa2, 0xe5, 0xbb, 0xae, 0xd4, + 0x9e, 0xb8, 0xfd, 0xcf, 0x8b, 0xb5, 0x7a, 0x30, 0x53, 0x80, 0xf9, + 0x1f, 0x0f, 0x4e, 0xdd, 0x7b, 0x2e, 0x49, 0xcf, 0x7c, 0x12}}; + (void)ed9SigningKey; + auto const prefix8Prefix = "P8"s; + auto const prefix8Msg = "P7P6abcdefghijklmnopqrstuvwxyz"s; + auto const prefix8MaxMsgLength = 30; + auto const prefix7Prefix = "P7"s; + auto const prefix7Msg = "P6abcdefghijklmnopqrstuvwxyz"s; + auto const prefix7MaxMsgLength = 28; + auto const prefix6Prefix = "P6"s; + auto const prefix6Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix6MaxMsgLength = 26; + auto const ed11Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed11PublicKey{ + {0x89, 0x5e, 0x41, 0x5a, 0x61, 0x75, 0xf5, 0x16, 0xd7, 0x9b, 0x5c, + 0x57, 0x69, 0x5e, 0xa3, 0x22, 0x3e, 0xa5, 0x5d, 0xa3, 0xc0, 0x37, + 0x18, 0x95, 0x26, 0xe7, 0x77, 0x00, 0x5f, 0x95, 0x58, 0x20}}; + std::array const ed11Sig{ + {0x06, 0x41, 0xf5, 0xcf, 0x53, 0x93, 0xe5, 0x1f, 0x90, 0x49, 0xcf, + 0x52, 0xf8, 0x23, 0xc8, 0xd1, 0xac, 0x80, 0xd6, 0x18, 0x17, 0xbc, + 0x70, 0x41, 0x4e, 0x96, 0xce, 0x1a, 0x07, 0x87, 0x30, 0xcc, 0x01, + 0x85, 0x0b, 0x7a, 0x31, 0xb9, 0x0f, 0x11, 0xa5, 0x14, 0x1f, 0x1e, + 0x27, 0x8d, 0xcd, 0xca, 0xd3, 0xa7, 0xa0, 0x86, 0x6f, 0x62, 0xce, + 0xf2, 0x3b, 0x0c, 0x39, 0x61, 0xb7, 0x65, 0xa1, 0x01}}; + std::array const ed11SigningKey{ + {0x56, 0x3d, 0xfd, 0x5f, 0x56, 0xef, 0x52, 0xa4, 0xbc, 0xc5, 0x20, + 0x99, 0x8b, 0xc7, 0xf1, 0xc8, 0x41, 0xcd, 0x93, 0x6e, 0x4e, 0x7f, + 0x95, 0x81, 0x2a, 0xa1, 0x6b, 0x46, 0x33, 0xd9, 0x11, 0x5f}}; + (void)ed11SigningKey; + auto const ed13Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed13PublicKey{ + {0xe8, 0xb1, 0xe9, 0x04, 0xef, 0x8f, 0x78, 0x4c, 0x54, 0xf2, 0x45, + 0x60, 0x93, 0xb4, 0xc6, 0xa4, 0xc2, 0x9a, 0xa9, 0xb7, 0x5a, 0x0b, + 0x06, 0xf1, 0x78, 0xdc, 0xa9, 0x08, 0x12, 0xb2, 0x2f, 0xf4}}; + std::array const ed13Sig{ + {0x03, 0x17, 0xa0, 0x49, 0x7b, 0xee, 0x0d, 0x84, 0x64, 0xee, 0xa8, + 0xc1, 0xe6, 0x3e, 0xc6, 0xed, 0xd6, 0x25, 0x7e, 0x7d, 0xad, 0x96, + 0xf3, 0x82, 0x4a, 0xa6, 0xb1, 0x38, 0xf1, 0x2f, 0x54, 0x6a, 0x52, + 0x39, 0x26, 0x08, 0x2d, 0xe6, 0xfd, 0xb2, 0xfa, 0x23, 0xb3, 0x91, + 0x30, 0x07, 0x9a, 0x4b, 0x63, 0xbb, 0x6f, 0x55, 0xcb, 0x0a, 0xe9, + 0xb1, 0xfb, 0x40, 0x9e, 0x1f, 0x87, 0x70, 0x5a, 0x07}}; + std::array const ed13SigningKey{ + {0x0c, 0x45, 0x3e, 0x20, 0xe2, 0x12, 0x63, 0x6a, 0x7c, 0x36, 0x75, + 0xad, 0x2e, 0xd7, 0xc0, 0x39, 0x27, 0x7e, 0x38, 0x9a, 0xa2, 0xd3, + 0x3b, 0x24, 0x18, 0xf8, 0x68, 0x4e, 0x7f, 0xfa, 0x5d, 0xf3}}; + (void)ed13SigningKey; + auto const thresh12Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim14CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim14Cond{Type::preimageSha256, + 9, + Preim14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa15CondConditionFingerprint = { + {0x55, 0x6b, 0x6d, 0xe3, 0x00, 0xd4, 0xf3, 0x7e, 0x75, 0x3a, 0x68, + 0xfc, 0x25, 0xdf, 0xf2, 0xf7, 0x18, 0x54, 0xa5, 0x55, 0x0c, 0xa5, + 0xa9, 0x65, 0xbf, 0x66, 0x9e, 0x4e, 0x49, 0x56, 0x1e, 0xf1}}; + Condition const Rsa15Cond{Type::rsaSha256, + 65536, + Rsa15CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed16CondConditionFingerprint = { + {0xe4, 0x66, 0x69, 0x86, 0x87, 0x57, 0x0e, 0xac, 0xf1, 0xfd, 0x06, + 0x81, 0x48, 0x90, 0x82, 0x42, 0x48, 0x50, 0x75, 0x8e, 0xd4, 0x2d, + 0xf3, 0x02, 0x37, 0x89, 0x28, 0xc5, 0x68, 0xd7, 0xa0, 0x11}}; + Condition const Ed16Cond{Type::ed25519Sha256, + 131072, + Ed16CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh10Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim17CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim17Cond{Type::preimageSha256, + 9, + Preim17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa18CondConditionFingerprint = { + {0x9d, 0xbe, 0x65, 0xf4, 0xae, 0x81, 0x90, 0x79, 0x09, 0x18, 0xa2, + 0x66, 0x12, 0x9c, 0x10, 0x94, 0x66, 0x21, 0x94, 0x70, 0x60, 0x20, + 0x4a, 0x3d, 0x5f, 0xb3, 0x62, 0xb6, 0x06, 0x46, 0x37, 0xfe}}; + Condition const Rsa18Cond{Type::rsaSha256, + 65536, + Rsa18CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed19CondConditionFingerprint = { + {0xe5, 0x88, 0xb7, 0x6e, 0xec, 0x2d, 0xaf, 0x47, 0xc7, 0xa2, 0xf4, + 0x6e, 0xbf, 0x7f, 0x5e, 0x46, 0xd7, 0xfa, 0x33, 0x2c, 0x0a, 0x7e, + 0x86, 0x1d, 0x8c, 0x38, 0xa8, 0x93, 0x52, 0xe8, 0x97, 0xe9}}; + Condition const Ed19Cond{Type::ed25519Sha256, + 131072, + Ed19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh20CondConditionFingerprint = { + {0xbb, 0x5c, 0x6d, 0x91, 0xa5, 0x7d, 0x41, 0x56, 0x1f, 0x07, 0x7e, + 0xc5, 0x3d, 0x14, 0x43, 0x8b, 0xbd, 0x04, 0xb2, 0xf2, 0x2c, 0x44, + 0x50, 0xff, 0x06, 0x5f, 0x5a, 0x2e, 0xa5, 0x03, 0xe4, 0xdf}}; + Condition const Thresh20Cond{Type::thresholdSha256, + 135168, + Thresh20CondConditionFingerprint, + std::bitset<5>{25}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim25CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim25Cond{Type::preimageSha256, + 9, + Preim25CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa26CondConditionFingerprint = { + {0xd6, 0x40, 0x0d, 0x21, 0x44, 0x8a, 0xd4, 0x5a, 0xe6, 0x10, 0x3f, + 0xd4, 0x3a, 0x14, 0x5a, 0x5b, 0x87, 0x86, 0x20, 0x3c, 0x43, 0x20, + 0x9d, 0x9d, 0x0c, 0x75, 0x57, 0x80, 0x7d, 0xda, 0x9d, 0x06}}; + Condition const Rsa26Cond{Type::rsaSha256, + 65536, + Rsa26CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed27CondConditionFingerprint = { + {0x6a, 0x26, 0x73, 0x6f, 0xc3, 0xbf, 0x25, 0x73, 0x8e, 0x3b, 0x27, + 0x79, 0x47, 0xa5, 0x37, 0x7c, 0x78, 0xa0, 0x72, 0xd8, 0x77, 0x91, + 0xfc, 0x45, 0x87, 0x7f, 0x11, 0x57, 0xfe, 0x94, 0x57, 0x45}}; + Condition const Ed27Cond{Type::ed25519Sha256, + 131072, + Ed27CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(ed2)); + std::vector thresh1Subconditions{ + {Preim3Cond, Rsa4Cond, Ed5Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto ed9 = std::make_unique(ed9PublicKey, ed9Sig); + auto prefix8 = std::make_unique( + makeSlice(prefix8Prefix), prefix8MaxMsgLength, std::move(ed9)); + auto prefix7 = std::make_unique( + makeSlice(prefix7Prefix), prefix7MaxMsgLength, std::move(prefix8)); + auto prefix6 = std::make_unique( + makeSlice(prefix6Prefix), prefix6MaxMsgLength, std::move(prefix7)); + auto ed11 = std::make_unique(ed11PublicKey, ed11Sig); + auto ed13 = std::make_unique(ed13PublicKey, ed13Sig); + std::vector> thresh12Subfulfillments; + thresh12Subfulfillments.emplace_back(std::move(ed13)); + std::vector thresh12Subconditions{ + {Preim14Cond, Rsa15Cond, Ed16Cond}}; + auto thresh12 = std::make_unique( + std::move(thresh12Subfulfillments), + std::move(thresh12Subconditions)); + std::vector> thresh10Subfulfillments; + thresh10Subfulfillments.emplace_back(std::move(ed11)); + thresh10Subfulfillments.emplace_back(std::move(thresh12)); + std::vector thresh10Subconditions{ + {Preim17Cond, Rsa18Cond, Ed19Cond, Thresh20Cond}}; + auto thresh10 = std::make_unique( + std::move(thresh10Subfulfillments), + std::move(thresh10Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix6)); + thresh0Subfulfillments.emplace_back(std::move(thresh10)); + std::vector thresh0Subconditions{ + {Preim25Cond, Rsa26Cond, Ed27Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\xea\xa0\x82\x03\x6b\xa1\x81\x85\x80\x02\x50\x36" + "\x81\x01\x1a\xa2\x7c\xa1\x7a\x80\x02\x50\x37\x81\x01\x1c\xa2" + "\x71\xa1\x6f\x80\x02\x50\x38\x81\x01\x1e\xa2\x66\xa4\x64\x80" + "\x20\x33\xcd\x8f\x06\xdd\xfe\x8e\xf2\x53\x04\x88\x2d\xb0\xa0" + "\x58\xbd\xdc\xcf\xc8\x1e\x77\x28\x4e\xf8\x45\xb2\x31\x2a\x7c" + "\x88\x23\x5e\x81\x40\xd6\xae\xb2\xf8\xaf\x3b\xfe\x3b\x73\x27" + "\xef\x22\x86\xf4\xca\x40\x82\x3b\x2b\x21\xa5\xc4\xa5\x1e\x32" + "\x78\x8c\xe9\xbe\x40\x48\x82\x83\x2f\x31\x65\x79\x97\x23\x72" + "\x77\x97\x16\x06\x94\xef\x37\x6d\x68\xef\x5c\x6b\xb5\x8c\xab" + "\x0d\x74\x5c\x52\x91\xc8\x1e\x12\x02\xa2\x81\xe3\xa0\x66\xa4" + "\x64\x80\x20\xb1\x2f\x54\xbe\xb6\xf8\x76\x71\x72\xed\x44\x03" + "\x71\x74\x2d\x7f\x98\x10\x4b\x57\xf2\x45\xfb\x3e\xea\xfd\xdd" + "\x39\x42\xbf\x24\x4d\x81\x40\x86\xf5\xe9\x44\x74\xe8\x98\xca" + "\xc8\x20\xde\x21\xcb\xf7\xf8\x65\x37\x6c\xd2\xe2\xd2\x46\x6f" + "\xcf\xd4\xdd\x48\x66\x8a\x9c\x06\xda\xa5\x0e\x11\xfb\x87\x94" + "\xd2\xed\xaa\xdd\x4e\x48\x09\x7a\x4b\xdd\xa5\xe8\x46\x2e\x1a" + "\xbb\x51\x60\x0c\x9d\x8e\x35\x3e\xc1\x79\x09\xa1\x79\xa0\x25" + "\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54" + "\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee" + "\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x3a\x82\x3b\x32" + "\x38\xb1\x3c\x17\x87\x60\x62\xec\xcf\x91\xb0\xaf\xaa\xe5\x11" + "\xe6\xfb\xe2\xb0\x3d\x70\x4d\x1d\xad\xd6\x7c\xee\xa6\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x90\xce\xed\x45\x98\x68\xff\x19" + "\x2b\x27\xc1\x2a\xa2\x6e\x2e\x82\xf3\xbd\x71\x13\x61\xb0\x76" + "\x40\x4d\x48\xea\x16\xfb\x27\x57\xdc\x81\x03\x02\x00\x00\xa2" + "\x82\x01\xf9\xa0\x82\x01\x4c\xa2\x81\xe3\xa0\x66\xa4\x64\x80" + "\x20\xe8\xb1\xe9\x04\xef\x8f\x78\x4c\x54\xf2\x45\x60\x93\xb4" + "\xc6\xa4\xc2\x9a\xa9\xb7\x5a\x0b\x06\xf1\x78\xdc\xa9\x08\x12" + "\xb2\x2f\xf4\x81\x40\x03\x17\xa0\x49\x7b\xee\x0d\x84\x64\xee" + "\xa8\xc1\xe6\x3e\xc6\xed\xd6\x25\x7e\x7d\xad\x96\xf3\x82\x4a" + "\xa6\xb1\x38\xf1\x2f\x54\x6a\x52\x39\x26\x08\x2d\xe6\xfd\xb2" + "\xfa\x23\xb3\x91\x30\x07\x9a\x4b\x63\xbb\x6f\x55\xcb\x0a\xe9" + "\xb1\xfb\x40\x9e\x1f\x87\x70\x5a\x07\xa1\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\x55\x6b\x6d\xe3\x00\xd4" + "\xf3\x7e\x75\x3a\x68\xfc\x25\xdf\xf2\xf7\x18\x54\xa5\x55\x0c" + "\xa5\xa9\x65\xbf\x66\x9e\x4e\x49\x56\x1e\xf1\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe4\x66\x69\x86\x87\x57\x0e\xac\xf1\xfd" + "\x06\x81\x48\x90\x82\x42\x48\x50\x75\x8e\xd4\x2d\xf3\x02\x37" + "\x89\x28\xc5\x68\xd7\xa0\x11\x81\x03\x02\x00\x00\xa4\x64\x80" + "\x20\x89\x5e\x41\x5a\x61\x75\xf5\x16\xd7\x9b\x5c\x57\x69\x5e" + "\xa3\x22\x3e\xa5\x5d\xa3\xc0\x37\x18\x95\x26\xe7\x77\x00\x5f" + "\x95\x58\x20\x81\x40\x06\x41\xf5\xcf\x53\x93\xe5\x1f\x90\x49" + "\xcf\x52\xf8\x23\xc8\xd1\xac\x80\xd6\x18\x17\xbc\x70\x41\x4e" + "\x96\xce\x1a\x07\x87\x30\xcc\x01\x85\x0b\x7a\x31\xb9\x0f\x11" + "\xa5\x14\x1f\x1e\x27\x8d\xcd\xca\xd3\xa7\xa0\x86\x6f\x62\xce" + "\xf2\x3b\x0c\x39\x61\xb7\x65\xa1\x01\xa1\x81\xa6\xa0\x25\x80" + "\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d" + "\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93" + "\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\xbb\x5c\x6d\x91\xa5" + "\x7d\x41\x56\x1f\x07\x7e\xc5\x3d\x14\x43\x8b\xbd\x04\xb2\xf2" + "\x2c\x44\x50\xff\x06\x5f\x5a\x2e\xa5\x03\xe4\xdf\x81\x03\x02" + "\x10\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x9d\xbe\x65\xf4\xae" + "\x81\x90\x79\x09\x18\xa2\x66\x12\x9c\x10\x94\x66\x21\x94\x70" + "\x60\x20\x4a\x3d\x5f\xb3\x62\xb6\x06\x46\x37\xfe\x81\x03\x01" + "\x00\x00\xa4\x27\x80\x20\xe5\x88\xb7\x6e\xec\x2d\xaf\x47\xc7" + "\xa2\xf4\x6e\xbf\x7f\x5e\x46\xd7\xfa\x33\x2c\x0a\x7e\x86\x1d" + "\x8c\x38\xa8\x93\x52\xe8\x97\xe9\x81\x03\x02\x00\x00\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xd6\x40" + "\x0d\x21\x44\x8a\xd4\x5a\xe6\x10\x3f\xd4\x3a\x14\x5a\x5b\x87" + "\x86\x20\x3c\x43\x20\x9d\x9d\x0c\x75\x57\x80\x7d\xda\x9d\x06" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x6a\x26\x73\x6f\xc3\xbf" + "\x25\x73\x8e\x3b\x27\x79\x47\xa5\x37\x7c\x78\xa0\x72\xd8\x77" + "\x91\xfc\x45\x87\x7f\x11\x57\xfe\x94\x57\x45\x81\x03\x02\x00" + "\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xd3\x70\x97\x2f\xa9\xcd\xb3\xa5\x56\x6c\x37" + "\xfd\x6a\xf0\x9c\x17\xf6\x91\x51\x0b\x2b\x38\x11\xad\xed\x41" + "\xff\x9f\xf8\xab\x32\x36\x81\x03\x08\x6c\x5a\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x9e\xc1\x63\xd6\xea\x2a" + "\x91\xe6\xa0\x2d\xfc\xac\x29\xfc\xad\x0b\x30\x64\xb6\x28\x41" + "\x0a\x6d\x4d\x00\x2f\x0b\xd7\x83\x14\xe8\x66\x81\x03\x02\x0c" + "\x5a\x82\x02\x03\x08\xa2\x2b\x80\x20\x04\x1d\xf9\x4a\xb5\xa5" + "\x1c\xe3\x4d\x70\xa8\xa4\xf3\x75\x21\x04\x7b\x5f\x95\xff\x34" + "\x2e\x84\xbb\x2d\x24\x92\x74\x82\x65\xc3\xe4\x81\x03\x04\x38" + "\x00\x82\x02\x03\x98\xa2\x2b\x80\x20\x9f\x36\x43\xa2\x47\xa2" + "\xbb\xd4\x21\x5d\x1c\x8b\xc0\x74\x8f\x83\xf5\x20\x64\x35\x02" + "\xbb\x0a\xd9\x49\xed\x85\xf8\x9d\x8e\x8f\xe6\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xd6\x40\x0d\x21\x44\x8a" + "\xd4\x5a\xe6\x10\x3f\xd4\x3a\x14\x5a\x5b\x87\x86\x20\x3c\x43" + "\x20\x9d\x9d\x0c\x75\x57\x80\x7d\xda\x9d\x06\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\x6a\x26\x73\x6f\xc3\xbf\x25\x73\x8e\x3b" + "\x27\x79\x47\xa5\x37\x7c\x78\xa0\x72\xd8\x77\x91\xfc\x45\x87" + "\x7f\x11\x57\xfe\x94\x57\x45\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh67() + { + testcase("Thresh67"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim9Cond + // ** Rsa10Cond + // ** Ed11Cond + // ** Prefix12Cond + // ** Thresh16Cond + // ** thresh1 + // *** Preim3Cond + // *** Rsa4Cond + // *** Ed5Cond + // *** ed2 + // ** preim6 + // ** rsa7 + // ** ed8 + + auto const ed2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed2PublicKey{ + {0xb1, 0x2f, 0x54, 0xbe, 0xb6, 0xf8, 0x76, 0x71, 0x72, 0xed, 0x44, + 0x03, 0x71, 0x74, 0x2d, 0x7f, 0x98, 0x10, 0x4b, 0x57, 0xf2, 0x45, + 0xfb, 0x3e, 0xea, 0xfd, 0xdd, 0x39, 0x42, 0xbf, 0x24, 0x4d}}; + std::array const ed2Sig{ + {0x86, 0xf5, 0xe9, 0x44, 0x74, 0xe8, 0x98, 0xca, 0xc8, 0x20, 0xde, + 0x21, 0xcb, 0xf7, 0xf8, 0x65, 0x37, 0x6c, 0xd2, 0xe2, 0xd2, 0x46, + 0x6f, 0xcf, 0xd4, 0xdd, 0x48, 0x66, 0x8a, 0x9c, 0x06, 0xda, 0xa5, + 0x0e, 0x11, 0xfb, 0x87, 0x94, 0xd2, 0xed, 0xaa, 0xdd, 0x4e, 0x48, + 0x09, 0x7a, 0x4b, 0xdd, 0xa5, 0xe8, 0x46, 0x2e, 0x1a, 0xbb, 0x51, + 0x60, 0x0c, 0x9d, 0x8e, 0x35, 0x3e, 0xc1, 0x79, 0x09}}; + std::array const ed2SigningKey{ + {0xa7, 0xeb, 0x15, 0xc5, 0x2a, 0x41, 0x59, 0xf9, 0xf7, 0xb4, 0x78, + 0x5f, 0xdb, 0x79, 0xe5, 0x5b, 0x16, 0x44, 0xf7, 0xc7, 0xcf, 0xe2, + 0x46, 0xc5, 0xb3, 0x54, 0x64, 0xb5, 0x2f, 0x6c, 0x8e, 0x8e}}; + (void)ed2SigningKey; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim3CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim3Cond{Type::preimageSha256, + 9, + Preim3CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa4CondConditionFingerprint = { + {0x3a, 0x82, 0x3b, 0x32, 0x38, 0xb1, 0x3c, 0x17, 0x87, 0x60, 0x62, + 0xec, 0xcf, 0x91, 0xb0, 0xaf, 0xaa, 0xe5, 0x11, 0xe6, 0xfb, 0xe2, + 0xb0, 0x3d, 0x70, 0x4d, 0x1d, 0xad, 0xd6, 0x7c, 0xee, 0xa6}}; + Condition const Rsa4Cond{Type::rsaSha256, + 65536, + Rsa4CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed5CondConditionFingerprint = { + {0x90, 0xce, 0xed, 0x45, 0x98, 0x68, 0xff, 0x19, 0x2b, 0x27, 0xc1, + 0x2a, 0xa2, 0x6e, 0x2e, 0x82, 0xf3, 0xbd, 0x71, 0x13, 0x61, 0xb0, + 0x76, 0x40, 0x4d, 0x48, 0xea, 0x16, 0xfb, 0x27, 0x57, 0xdc}}; + Condition const Ed5Cond{Type::ed25519Sha256, + 131072, + Ed5CondConditionFingerprint, + std::bitset<5>{0}}; + auto const preim6Preimage = "I am root"s; + auto const preim6Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa7Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa7PublicKey{ + {0xb5, 0x8b, 0xa2, 0xa1, 0xc0, 0x5b, 0xc3, 0xa3, 0x64, 0xe9, 0x88, + 0xe3, 0x25, 0x89, 0xa0, 0x6d, 0x73, 0x8a, 0x46, 0x09, 0x58, 0xb4, + 0x85, 0x66, 0x87, 0x56, 0x85, 0x39, 0xee, 0x6d, 0x77, 0xbb, 0x99, + 0x57, 0x90, 0x0e, 0x9c, 0x9c, 0xd5, 0x40, 0xc4, 0x8b, 0x37, 0xb1, + 0xfe, 0x78, 0xb7, 0xe1, 0xe8, 0xb7, 0x74, 0xee, 0x74, 0x9c, 0xe5, + 0xa3, 0xdd, 0xb7, 0x87, 0x77, 0xb7, 0x14, 0x08, 0x71, 0xc4, 0xec, + 0x85, 0xe2, 0xe3, 0xc1, 0x1e, 0x34, 0x14, 0x21, 0xe1, 0xac, 0xd3, + 0x20, 0x0f, 0xb8, 0x11, 0x24, 0x69, 0xa3, 0x7d, 0x98, 0x35, 0x2a, + 0xdf, 0x56, 0x7d, 0x30, 0xf7, 0x31, 0x64, 0x73, 0xcf, 0x0c, 0x9e, + 0xa6, 0x3b, 0x7d, 0x93, 0xb1, 0xc4, 0xb6, 0x78, 0x39, 0x52, 0x3b, + 0x4d, 0xb6, 0xb2, 0x55, 0x17, 0x95, 0x27, 0x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xd9, 0xa1, + 0xc4, 0xf3, 0x87, 0xc1, 0x13, 0xb2, 0x49, 0xf2, 0x77, 0xb2, 0x89, + 0x4b, 0x43, 0x79, 0xff, 0x23, 0x1c, 0x5d, 0x31, 0xef, 0x2a, 0x62, + 0x2c, 0x6d, 0x4e, 0xae, 0xe5, 0x60, 0xad, 0x2d, 0xb8, 0xb2, 0x94, + 0x5f, 0x9b, 0xdf}}; + auto const ed8Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed8PublicKey{ + {0xb6, 0x55, 0xc8, 0xa4, 0x14, 0x20, 0x73, 0x44, 0x12, 0x06, 0xf6, + 0xf7, 0xd0, 0x03, 0x74, 0x53, 0xaa, 0x74, 0x6c, 0xf1, 0x84, 0x0e, + 0x86, 0x1d, 0xb1, 0x97, 0x1a, 0x04, 0x91, 0x83, 0x3b, 0x49}}; + std::array const ed8Sig{ + {0x4d, 0xf6, 0x5a, 0x0e, 0xa4, 0x6f, 0x3d, 0xa0, 0x76, 0xe4, 0x3a, + 0xea, 0x69, 0x1e, 0x3f, 0xe4, 0x45, 0x51, 0x97, 0xc8, 0x7e, 0x3c, + 0xd6, 0x34, 0xc8, 0x7f, 0xa3, 0xf9, 0xd7, 0xfe, 0x0a, 0xf4, 0x86, + 0x18, 0xc5, 0xfa, 0x1c, 0x73, 0x88, 0x37, 0x33, 0x3d, 0xd4, 0x8c, + 0x08, 0xf9, 0xa5, 0xf0, 0x83, 0x37, 0x06, 0x5b, 0xd3, 0xfc, 0x20, + 0x12, 0x42, 0x7a, 0x7a, 0xd7, 0x60, 0xc5, 0xd1, 0x0b}}; + std::array const ed8SigningKey{ + {0xc2, 0x00, 0xc6, 0x2e, 0x45, 0xde, 0xf2, 0x39, 0x81, 0x0a, 0xf8, + 0x6d, 0x53, 0x29, 0xe3, 0x1b, 0x8e, 0x57, 0xad, 0xfa, 0x29, 0x1b, + 0x07, 0x1a, 0xee, 0x34, 0xe6, 0x57, 0x5a, 0xeb, 0xf2, 0x1c}}; + (void)ed8SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim9CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim9Cond{Type::preimageSha256, + 9, + Preim9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa10CondConditionFingerprint = { + {0x3c, 0x73, 0x38, 0xcf, 0x23, 0xc6, 0x31, 0x53, 0x28, 0xc4, 0x27, + 0xf8, 0x95, 0x87, 0x99, 0x83, 0x2d, 0x35, 0x3c, 0x03, 0x9b, 0xd1, + 0xff, 0xff, 0x2e, 0x53, 0x20, 0xe9, 0x5e, 0x62, 0xb9, 0xb7}}; + Condition const Rsa10Cond{Type::rsaSha256, + 65536, + Rsa10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed11CondConditionFingerprint = { + {0x41, 0x80, 0x08, 0xb2, 0x60, 0x74, 0x57, 0x6d, 0xac, 0xed, 0x74, + 0x7f, 0x54, 0xdb, 0x96, 0x18, 0x91, 0x06, 0x0a, 0x95, 0xa1, 0x49, + 0x17, 0xc7, 0x65, 0xe3, 0x94, 0xc8, 0x5e, 0x2c, 0x92, 0x20}}; + Condition const Ed11Cond{Type::ed25519Sha256, + 131072, + Ed11CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix12CondConditionFingerprint = { + {0x3d, 0x98, 0x97, 0xf3, 0xa0, 0xea, 0x67, 0xba, 0x69, 0x5b, 0xfa, + 0x0e, 0x07, 0xc4, 0x22, 0xce, 0x8a, 0xd5, 0x85, 0xe4, 0x76, 0x56, + 0xde, 0xc3, 0x4a, 0x82, 0x9d, 0xdc, 0xc2, 0x98, 0x1e, 0xcb}}; + Condition const Prefix12Cond{Type::prefixSha256, + 134207, + Prefix12CondConditionFingerprint, + std::bitset<5>{16}}; + std::array const Thresh16CondConditionFingerprint = { + {0xb3, 0x51, 0x97, 0xe4, 0x76, 0xfa, 0xfb, 0x73, 0x98, 0x2a, 0xbb, + 0x87, 0x0f, 0x46, 0xe3, 0x68, 0x99, 0x9d, 0xe8, 0x14, 0x51, 0xeb, + 0xa0, 0xec, 0x18, 0xa7, 0x53, 0xf5, 0x47, 0x45, 0x8a, 0x5e}}; + Condition const Thresh16Cond{Type::thresholdSha256, + 276480, + Thresh16CondConditionFingerprint, + std::bitset<5>{25}}; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(ed2)); + std::vector thresh1Subconditions{ + {Preim3Cond, Rsa4Cond, Ed5Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim6 = + std::make_unique(makeSlice(preim6Preimage)); + auto rsa7 = std::make_unique( + makeSlice(rsa7PublicKey), makeSlice(rsa7Sig)); + auto ed8 = std::make_unique(ed8PublicKey, ed8Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim6)); + thresh0Subfulfillments.emplace_back(std::move(rsa7)); + thresh0Subfulfillments.emplace_back(std::move(ed8)); + std::vector thresh0Subconditions{ + {Preim9Cond, Rsa10Cond, Ed11Cond, Prefix12Cond, Thresh16Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x04\x3f\xa0\x82\x03\x65\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20" + "\xb1\x2f\x54\xbe\xb6\xf8\x76\x71\x72\xed\x44\x03\x71\x74\x2d" + "\x7f\x98\x10\x4b\x57\xf2\x45\xfb\x3e\xea\xfd\xdd\x39\x42\xbf" + "\x24\x4d\x81\x40\x86\xf5\xe9\x44\x74\xe8\x98\xca\xc8\x20\xde" + "\x21\xcb\xf7\xf8\x65\x37\x6c\xd2\xe2\xd2\x46\x6f\xcf\xd4\xdd" + "\x48\x66\x8a\x9c\x06\xda\xa5\x0e\x11\xfb\x87\x94\xd2\xed\xaa" + "\xdd\x4e\x48\x09\x7a\x4b\xdd\xa5\xe8\x46\x2e\x1a\xbb\x51\x60" + "\x0c\x9d\x8e\x35\x3e\xc1\x79\x09\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\x3a\x82\x3b\x32\x38\xb1\x3c" + "\x17\x87\x60\x62\xec\xcf\x91\xb0\xaf\xaa\xe5\x11\xe6\xfb\xe2" + "\xb0\x3d\x70\x4d\x1d\xad\xd6\x7c\xee\xa6\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x90\xce\xed\x45\x98\x68\xff\x19\x2b\x27\xc1" + "\x2a\xa2\x6e\x2e\x82\xf3\xbd\x71\x13\x61\xb0\x76\x40\x4d\x48" + "\xea\x16\xfb\x27\x57\xdc\x81\x03\x02\x00\x00\xa3\x82\x02\x08" + "\x80\x82\x01\x00\xb5\x8b\xa2\xa1\xc0\x5b\xc3\xa3\x64\xe9\x88" + "\xe3\x25\x89\xa0\x6d\x73\x8a\x46\x09\x58\xb4\x85\x66\x87\x56" + "\x85\x39\xee\x6d\x77\xbb\x99\x57\x90\x0e\x9c\x9c\xd5\x40\xc4" + "\x8b\x37\xb1\xfe\x78\xb7\xe1\xe8\xb7\x74\xee\x74\x9c\xe5\xa3" + "\xdd\xb7\x87\x77\xb7\x14\x08\x71\xc4\xec\x85\xe2\xe3\xc1\x1e" + "\x34\x14\x21\xe1\xac\xd3\x20\x0f\xb8\x11\x24\x69\xa3\x7d\x98" + "\x35\x2a\xdf\x56\x7d\x30\xf7\x31\x64\x73\xcf\x0c\x9e\xa6\x3b" + "\x7d\x93\xb1\xc4\xb6\x78\x39\x52\x3b\x4d\xb6\xb2\x55\x17\x95" + "\x27\xbd\xd6\xc1\x28\x7b\x82\xbb\xeb\xea\xec\x7e\x48\x35\xb3" + "\x4b\x78\x30\xc4\x66\x32\x39\x2d\xd6\x5f\x59\xeb\x81\x64\x68" + "\xdb\x94\xf4\x8e\x5f\x34\x4f\x3b\x03\xe5\xa6\x1b\x30\x6c\xea" + "\xe8\xc6\x36\xf8\xee\x0b\x0f\xb5\xd2\xe7\xa4\x0a\xbc\xef\x80" + "\x7e\xb1\x9b\xda\xe6\x40\x4a\x3f\x6f\xd1\x5a\x64\x84\xb2\x5c" + "\xd2\xf0\x38\x7c\xcb\xd1\xcd\xdd\x37\x3f\x76\xe7\x08\x25\xe5" + "\xd3\xd9\xe3\x21\x1b\x88\x41\x3d\x2d\x32\xff\xd3\xfe\x4d\x40" + "\x85\x1b\x0f\xd6\xab\x4e\xb7\x38\x68\xe9\x67\xc7\xb5\xd1\x38" + "\xdb\x85\x2e\x2f\x76\xea\x4a\xce\xff\x08\x5e\x93\x87\x98\xf7" + "\x95\xeb\x49\xf6\x8d\x81\x82\x01\x00\x8a\xa6\x35\x05\x45\xa9" + "\xbf\x68\x8f\xbf\x4a\x24\x5c\xc8\xb6\xbb\x7d\x32\xf8\x2f\x79" + "\x27\xaf\x2a\xda\xf7\xf9\x70\xe9\xf0\x7e\x36\xa4\x4f\xc6\xaf" + "\x71\x6e\xc0\xfe\x95\xe7\xf5\xad\x84\x83\xc3\x1d\xf6\x04\xdd" + "\x3c\x24\x27\x8b\xcc\x7c\xfe\x6e\x1b\xa7\xe6\x86\x5d\x8f\xbb" + "\xdc\xc7\xc0\x90\xdc\x43\x4b\x18\x94\x15\x17\x04\xd6\xbd\x04" + "\xe5\x57\xe9\xa0\xca\x22\x02\x74\x12\xaf\xe8\xd5\xde\xc8\xa9" + "\x22\x44\x6f\xe3\x32\x52\x7d\xd5\xe4\x65\xfc\xd6\x84\x74\x7a" + "\xc5\x6e\xbc\x6d\x4c\x4c\x47\x14\x62\x77\x05\xc3\x3c\xcb\x4a" + "\x38\x42\xc0\x4d\x03\xb1\x5c\x49\x82\xe3\xde\x77\x56\xe5\xc0" + "\x5c\x70\x07\xfc\x75\xe7\x3c\x3a\x7e\x69\x9f\x79\xb2\xe0\xf5" + "\xb6\x91\x96\x99\x9a\xbf\x68\x80\xc9\x25\xa0\x4b\x8d\x24\x24" + "\x2f\xe8\x92\xbc\xb9\xba\x7c\x4b\xdd\x6d\x12\xf5\xfe\x3d\x06" + "\x05\x90\x19\xb6\x5f\x36\xf2\xec\xd0\x1a\xbc\xd8\x65\x62\x50" + "\x32\xa7\x3c\x7c\xa6\xa5\xcd\xff\xb2\xed\x1b\x52\x50\x0e\xa8" + "\x18\x7d\xd9\xa1\xc4\xf3\x87\xc1\x13\xb2\x49\xf2\x77\xb2\x89" + "\x4b\x43\x79\xff\x23\x1c\x5d\x31\xef\x2a\x62\x2c\x6d\x4e\xae" + "\xe5\x60\xad\x2d\xb8\xb2\x94\x5f\x9b\xdf\xa4\x64\x80\x20\xb6" + "\x55\xc8\xa4\x14\x20\x73\x44\x12\x06\xf6\xf7\xd0\x03\x74\x53" + "\xaa\x74\x6c\xf1\x84\x0e\x86\x1d\xb1\x97\x1a\x04\x91\x83\x3b" + "\x49\x81\x40\x4d\xf6\x5a\x0e\xa4\x6f\x3d\xa0\x76\xe4\x3a\xea" + "\x69\x1e\x3f\xe4\x45\x51\x97\xc8\x7e\x3c\xd6\x34\xc8\x7f\xa3" + "\xf9\xd7\xfe\x0a\xf4\x86\x18\xc5\xfa\x1c\x73\x88\x37\x33\x3d" + "\xd4\x8c\x08\xf9\xa5\xf0\x83\x37\x06\x5b\xd3\xfc\x20\x12\x42" + "\x7a\x7a\xd7\x60\xc5\xd1\x0b\xa1\x81\xd3\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa1\x2b\x80\x20\x3d\x98\x97\xf3\xa0\xea\x67" + "\xba\x69\x5b\xfa\x0e\x07\xc4\x22\xce\x8a\xd5\x85\xe4\x76\x56" + "\xde\xc3\x4a\x82\x9d\xdc\xc2\x98\x1e\xcb\x81\x03\x02\x0c\x3f" + "\x82\x02\x03\x08\xa2\x2b\x80\x20\xb3\x51\x97\xe4\x76\xfa\xfb" + "\x73\x98\x2a\xbb\x87\x0f\x46\xe3\x68\x99\x9d\xe8\x14\x51\xeb" + "\xa0\xec\x18\xa7\x53\xf5\x47\x45\x8a\x5e\x81\x03\x04\x38\x00" + "\x82\x02\x03\x98\xa3\x27\x80\x20\x3c\x73\x38\xcf\x23\xc6\x31" + "\x53\x28\xc4\x27\xf8\x95\x87\x99\x83\x2d\x35\x3c\x03\x9b\xd1" + "\xff\xff\x2e\x53\x20\xe9\x5e\x62\xb9\xb7\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\x41\x80\x08\xb2\x60\x74\x57\x6d\xac\xed\x74" + "\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95\xa1\x49\x17\xc7\x65\xe3" + "\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xf3\x65\x01\x56\xbf\x51\x4a\x87\x88\xb6\x1a" + "\x57\x4f\xa7\x6c\x70\x46\x3f\x10\x14\xfd\x20\x7e\x4f\xbc\x10" + "\xdc\x72\x6d\xfc\xb2\xa7\x81\x03\x0a\x78\x3f\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x3d\x98\x97\xf3\xa0\xea\x67\xba\x69\x5b\xfa\x0e" + "\x07\xc4\x22\xce\x8a\xd5\x85\xe4\x76\x56\xde\xc3\x4a\x82\x9d" + "\xdc\xc2\x98\x1e\xcb\x81\x03\x02\x0c\x3f\x82\x02\x03\x08\xa2" + "\x2b\x80\x20\x9f\x36\x43\xa2\x47\xa2\xbb\xd4\x21\x5d\x1c\x8b" + "\xc0\x74\x8f\x83\xf5\x20\x64\x35\x02\xbb\x0a\xd9\x49\xed\x85" + "\xf8\x9d\x8e\x8f\xe6\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa2" + "\x2b\x80\x20\xb3\x51\x97\xe4\x76\xfa\xfb\x73\x98\x2a\xbb\x87" + "\x0f\x46\xe3\x68\x99\x9d\xe8\x14\x51\xeb\xa0\xec\x18\xa7\x53" + "\xf5\x47\x45\x8a\x5e\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x3c\x73\x38\xcf\x23\xc6\x31\x53\x28\xc4\x27\xf8" + "\x95\x87\x99\x83\x2d\x35\x3c\x03\x9b\xd1\xff\xff\x2e\x53\x20" + "\xe9\x5e\x62\xb9\xb7\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x6c" + "\x7b\xea\x83\xa1\xf4\x82\x3d\x36\xe7\x6e\xae\x1a\xbc\xa0\xba" + "\x90\x3d\x96\xc1\xe6\xad\x3a\x47\xa5\xcb\x88\xab\x3c\x5f\xcc" + "\xd5\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x41\x80\x08\xb2\x60" + "\x74\x57\x6d\xac\xed\x74\x7f\x54\xdb\x96\x18\x91\x06\x0a\x95" + "\xa1\x49\x17\xc7\x65\xe3\x94\xc8\x5e\x2c\x92\x20\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\xf1\x68\x96\xa6\x2e\xef\x7f\x47\x06" + "\x51\x4c\xc6\x7e\x24\xf7\x29\x84\x9c\xd6\xb0\xd9\x4b\xd9\x0f" + "\xc9\x34\x01\x9d\x92\xeb\xbc\x0a\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh68() + { + testcase("Thresh68"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim17Cond + // ** Rsa18Cond + // ** Ed19Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** ed2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** ed4 + // ** prefix11 + // *** prefix12 + // **** thresh13 + // ***** ed14 + // ** thresh15 + // *** ed16 + + auto const ed2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed2PublicKey{ + {0xb1, 0x2f, 0x54, 0xbe, 0xb6, 0xf8, 0x76, 0x71, 0x72, 0xed, 0x44, + 0x03, 0x71, 0x74, 0x2d, 0x7f, 0x98, 0x10, 0x4b, 0x57, 0xf2, 0x45, + 0xfb, 0x3e, 0xea, 0xfd, 0xdd, 0x39, 0x42, 0xbf, 0x24, 0x4d}}; + std::array const ed2Sig{ + {0x86, 0xf5, 0xe9, 0x44, 0x74, 0xe8, 0x98, 0xca, 0xc8, 0x20, 0xde, + 0x21, 0xcb, 0xf7, 0xf8, 0x65, 0x37, 0x6c, 0xd2, 0xe2, 0xd2, 0x46, + 0x6f, 0xcf, 0xd4, 0xdd, 0x48, 0x66, 0x8a, 0x9c, 0x06, 0xda, 0xa5, + 0x0e, 0x11, 0xfb, 0x87, 0x94, 0xd2, 0xed, 0xaa, 0xdd, 0x4e, 0x48, + 0x09, 0x7a, 0x4b, 0xdd, 0xa5, 0xe8, 0x46, 0x2e, 0x1a, 0xbb, 0x51, + 0x60, 0x0c, 0x9d, 0x8e, 0x35, 0x3e, 0xc1, 0x79, 0x09}}; + std::array const ed2SigningKey{ + {0xa7, 0xeb, 0x15, 0xc5, 0x2a, 0x41, 0x59, 0xf9, 0xf7, 0xb4, 0x78, + 0x5f, 0xdb, 0x79, 0xe5, 0x5b, 0x16, 0x44, 0xf7, 0xc7, 0xcf, 0xe2, + 0x46, 0xc5, 0xb3, 0x54, 0x64, 0xb5, 0x2f, 0x6c, 0x8e, 0x8e}}; + (void)ed2SigningKey; + auto const ed4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x8d, 0xea, 0x41, 0xb3, 0xf6, 0x63, 0xef, 0xfe, 0x6e, 0x52, 0xf2, + 0x37, 0x9c, 0xd3, 0x57, 0x55, 0x0e, 0xe9, 0x51, 0x31, 0x07, 0xf9, + 0x9c, 0x6c, 0x58, 0xbf, 0x7f, 0x00, 0xa4, 0xe1, 0x81, 0x55, 0xfc, + 0xd5, 0xfb, 0x5c, 0xfc, 0xda, 0x85, 0xd3, 0xd5, 0xf4, 0xca, 0x25, + 0x5e, 0xa0, 0x0b, 0x4e, 0x70, 0x50, 0x6e, 0x70, 0x34, 0x91, 0x30, + 0x96, 0x75, 0xb2, 0x8f, 0x39, 0xf8, 0xd3, 0x8b, 0x0d}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + auto const ed14Msg = "P12P11abcdefghijklmnopqrstuvwxyz"s; + std::array const ed14PublicKey{ + {0x43, 0x3f, 0x99, 0xf7, 0x16, 0x69, 0xed, 0xc3, 0xdb, 0xfb, 0x19, + 0xca, 0x32, 0x08, 0x6d, 0x4e, 0xb1, 0x04, 0x16, 0xb7, 0x9f, 0xf3, + 0x9f, 0xbd, 0x9b, 0xb1, 0xaf, 0xdb, 0xba, 0x50, 0x4f, 0x00}}; + std::array const ed14Sig{ + {0x14, 0xf1, 0xfe, 0x3a, 0x37, 0xf0, 0x32, 0x65, 0xf2, 0xa2, 0xa6, + 0x0d, 0x5f, 0x8f, 0x74, 0x9b, 0x5f, 0xcc, 0x64, 0xca, 0x5f, 0x44, + 0x16, 0x79, 0xf2, 0xdb, 0x93, 0x5f, 0x60, 0xe1, 0xe6, 0x3e, 0x33, + 0xc7, 0xea, 0x87, 0x74, 0xd7, 0xca, 0x65, 0xb3, 0xd0, 0xd6, 0x71, + 0xf0, 0x11, 0xa4, 0x8c, 0x59, 0x0c, 0xa1, 0x03, 0x7b, 0x29, 0x2a, + 0xd0, 0x70, 0x28, 0xec, 0x87, 0xcc, 0x3b, 0x58, 0x06}}; + std::array const ed14SigningKey{ + {0x55, 0x91, 0x83, 0xd0, 0x62, 0xbb, 0x44, 0x99, 0x6e, 0xfd, 0xc1, + 0xaa, 0xef, 0xf4, 0x8b, 0x05, 0x5f, 0x39, 0xda, 0x5a, 0xcd, 0xa0, + 0xc5, 0xd4, 0x3b, 0x12, 0xe9, 0xc2, 0x2b, 0x7d, 0x0c, 0xc7}}; + (void)ed14SigningKey; + auto const thresh13Msg = "P12P11abcdefghijklmnopqrstuvwxyz"s; + auto const prefix12Prefix = "P12"s; + auto const prefix12Msg = "P11abcdefghijklmnopqrstuvwxyz"s; + auto const prefix12MaxMsgLength = 29; + auto const prefix11Prefix = "P11"s; + auto const prefix11Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix11MaxMsgLength = 26; + auto const ed16Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed16PublicKey{ + {0x50, 0x5a, 0xcb, 0xfd, 0xac, 0xce, 0x8b, 0x6f, 0xeb, 0x52, 0x06, + 0x75, 0xb8, 0x72, 0x9d, 0x94, 0x62, 0xdc, 0xe4, 0x11, 0x24, 0xd0, + 0xa3, 0x35, 0x47, 0x20, 0x02, 0xd5, 0xf7, 0x3f, 0x9c, 0x93}}; + std::array const ed16Sig{ + {0x70, 0x10, 0xf0, 0xdf, 0x6b, 0xdf, 0xe8, 0x30, 0x56, 0x8e, 0xd9, + 0x48, 0x92, 0x62, 0x1f, 0x2b, 0x0c, 0x6c, 0x8f, 0x15, 0x04, 0x53, + 0xcb, 0x3a, 0x07, 0xbc, 0x0b, 0xec, 0x8f, 0x4d, 0xea, 0x37, 0xd0, + 0x13, 0x03, 0x03, 0x79, 0x87, 0x83, 0x7e, 0x63, 0xde, 0x71, 0x22, + 0x43, 0x6f, 0x3b, 0x10, 0xad, 0x3b, 0x68, 0x6a, 0x73, 0x05, 0x07, + 0x01, 0xbb, 0x08, 0x93, 0xa6, 0xbf, 0x87, 0x7f, 0x06}}; + std::array const ed16SigningKey{ + {0xb7, 0xbd, 0x93, 0x4b, 0x03, 0x39, 0xf8, 0x6f, 0x47, 0x66, 0x7f, + 0xd4, 0x4f, 0x94, 0x32, 0xe6, 0xb2, 0x70, 0x9c, 0x2c, 0x64, 0x92, + 0xc4, 0xb1, 0xdd, 0x04, 0x6d, 0x00, 0x92, 0x41, 0xe9, 0x41}}; + (void)ed16SigningKey; + auto const thresh15Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim17CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim17Cond{Type::preimageSha256, + 9, + Preim17CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa18CondConditionFingerprint = { + {0x9d, 0xbe, 0x65, 0xf4, 0xae, 0x81, 0x90, 0x79, 0x09, 0x18, 0xa2, + 0x66, 0x12, 0x9c, 0x10, 0x94, 0x66, 0x21, 0x94, 0x70, 0x60, 0x20, + 0x4a, 0x3d, 0x5f, 0xb3, 0x62, 0xb6, 0x06, 0x46, 0x37, 0xfe}}; + Condition const Rsa18Cond{Type::rsaSha256, + 65536, + Rsa18CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed19CondConditionFingerprint = { + {0xe5, 0x88, 0xb7, 0x6e, 0xec, 0x2d, 0xaf, 0x47, 0xc7, 0xa2, 0xf4, + 0x6e, 0xbf, 0x7f, 0x5e, 0x46, 0xd7, 0xfa, 0x33, 0x2c, 0x0a, 0x7e, + 0x86, 0x1d, 0x8c, 0x38, 0xa8, 0x93, 0x52, 0xe8, 0x97, 0xe9}}; + Condition const Ed19Cond{Type::ed25519Sha256, + 131072, + Ed19CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(ed2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto ed14 = std::make_unique(ed14PublicKey, ed14Sig); + std::vector> thresh13Subfulfillments; + thresh13Subfulfillments.emplace_back(std::move(ed14)); + std::vector thresh13Subconditions{}; + auto thresh13 = std::make_unique( + std::move(thresh13Subfulfillments), + std::move(thresh13Subconditions)); + auto prefix12 = std::make_unique( + makeSlice(prefix12Prefix), + prefix12MaxMsgLength, + std::move(thresh13)); + auto prefix11 = std::make_unique( + makeSlice(prefix11Prefix), + prefix11MaxMsgLength, + std::move(prefix12)); + auto ed16 = std::make_unique(ed16PublicKey, ed16Sig); + std::vector> thresh15Subfulfillments; + thresh15Subfulfillments.emplace_back(std::move(ed16)); + std::vector thresh15Subconditions{}; + auto thresh15 = std::make_unique( + std::move(thresh15Subfulfillments), + std::move(thresh15Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix11)); + thresh0Subfulfillments.emplace_back(std::move(thresh15)); + std::vector thresh0Subconditions{ + {Preim17Cond, Rsa18Cond, Ed19Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x03\x3f\xa0\x82\x02\xc0\xa1\x81\x82\x80\x03\x50\x31" + "\x31\x81\x01\x1a\xa2\x78\xa1\x76\x80\x03\x50\x31\x32\x81\x01" + "\x1d\xa2\x6c\xa2\x6a\xa0\x66\xa4\x64\x80\x20\x43\x3f\x99\xf7" + "\x16\x69\xed\xc3\xdb\xfb\x19\xca\x32\x08\x6d\x4e\xb1\x04\x16" + "\xb7\x9f\xf3\x9f\xbd\x9b\xb1\xaf\xdb\xba\x50\x4f\x00\x81\x40" + "\x14\xf1\xfe\x3a\x37\xf0\x32\x65\xf2\xa2\xa6\x0d\x5f\x8f\x74" + "\x9b\x5f\xcc\x64\xca\x5f\x44\x16\x79\xf2\xdb\x93\x5f\x60\xe1" + "\xe6\x3e\x33\xc7\xea\x87\x74\xd7\xca\x65\xb3\xd0\xd6\x71\xf0" + "\x11\xa4\x8c\x59\x0c\xa1\x03\x7b\x29\x2a\xd0\x70\x28\xec\x87" + "\xcc\x3b\x58\x06\xa1\x00\xa2\x6a\xa0\x66\xa4\x64\x80\x20\x50" + "\x5a\xcb\xfd\xac\xce\x8b\x6f\xeb\x52\x06\x75\xb8\x72\x9d\x94" + "\x62\xdc\xe4\x11\x24\xd0\xa3\x35\x47\x20\x02\xd5\xf7\x3f\x9c" + "\x93\x81\x40\x70\x10\xf0\xdf\x6b\xdf\xe8\x30\x56\x8e\xd9\x48" + "\x92\x62\x1f\x2b\x0c\x6c\x8f\x15\x04\x53\xcb\x3a\x07\xbc\x0b" + "\xec\x8f\x4d\xea\x37\xd0\x13\x03\x03\x79\x87\x83\x7e\x63\xde" + "\x71\x22\x43\x6f\x3b\x10\xad\x3b\x68\x6a\x73\x05\x07\x01\xbb" + "\x08\x93\xa6\xbf\x87\x7f\x06\xa1\x00\xa2\x82\x01\xcb\xa0\x82" + "\x01\x4c\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20\x26\x80\x85\x71" + "\x79\x37\x27\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c\x5b\x9f" + "\x99\x54\xb6\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec\x81\x40" + "\x8d\xea\x41\xb3\xf6\x63\xef\xfe\x6e\x52\xf2\x37\x9c\xd3\x57" + "\x55\x0e\xe9\x51\x31\x07\xf9\x9c\x6c\x58\xbf\x7f\x00\xa4\xe1" + "\x81\x55\xfc\xd5\xfb\x5c\xfc\xda\x85\xd3\xd5\xf4\xca\x25\x5e" + "\xa0\x0b\x4e\x70\x50\x6e\x70\x34\x91\x30\x96\x75\xb2\x8f\x39" + "\xf8\xd3\x8b\x0d\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa3\x27\x80\x20\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9" + "\x32\x48\x19\xe1\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83" + "\xeb\x05\xa7\x59\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d" + "\xf0\x8b\x86\x91\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d" + "\x42\xc0\x81\x03\x02\x00\x00\xa4\x64\x80\x20\xb1\x2f\x54\xbe" + "\xb6\xf8\x76\x71\x72\xed\x44\x03\x71\x74\x2d\x7f\x98\x10\x4b" + "\x57\xf2\x45\xfb\x3e\xea\xfd\xdd\x39\x42\xbf\x24\x4d\x81\x40" + "\x86\xf5\xe9\x44\x74\xe8\x98\xca\xc8\x20\xde\x21\xcb\xf7\xf8" + "\x65\x37\x6c\xd2\xe2\xd2\x46\x6f\xcf\xd4\xdd\x48\x66\x8a\x9c" + "\x06\xda\xa5\x0e\x11\xfb\x87\x94\xd2\xed\xaa\xdd\x4e\x48\x09" + "\x7a\x4b\xdd\xa5\xe8\x46\x2e\x1a\xbb\x51\x60\x0c\x9d\x8e\x35" + "\x3e\xc1\x79\x09\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd" + "\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33" + "\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09" + "\xa3\x27\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1" + "\x88\x7e\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7" + "\xcb\x9f\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20" + "\x00\x8b\xe6\x62\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3" + "\x16\xda\x09\xbe\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87" + "\x62\xfa\x81\x03\x02\x00\x00\xa1\x79\xa0\x25\x80\x20\x5d\xa0" + "\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1" + "\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e" + "\x81\x01\x09\xa3\x27\x80\x20\x9d\xbe\x65\xf4\xae\x81\x90\x79" + "\x09\x18\xa2\x66\x12\x9c\x10\x94\x66\x21\x94\x70\x60\x20\x4a" + "\x3d\x5f\xb3\x62\xb6\x06\x46\x37\xfe\x81\x03\x01\x00\x00\xa4" + "\x27\x80\x20\xe5\x88\xb7\x6e\xec\x2d\xaf\x47\xc7\xa2\xf4\x6e" + "\xbf\x7f\x5e\x46\xd7\xfa\x33\x2c\x0a\x7e\x86\x1d\x8c\x38\xa8" + "\x93\x52\xe8\x97\xe9\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x01\x85\x9c\x22\xa2\x2e\x07\xed\x46\x73\x46" + "\x3a\x64\x1a\xf6\xd8\xda\x76\xc3\x6c\x56\x10\xd4\x9d\x96\x53" + "\xe7\xac\x77\x1f\xb7\x6b\x81\x03\x08\x4c\x3d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x29\x3f\xd0\xae\x64\x9a" + "\xbb\xd9\xbb\x61\xed\x61\x50\x8f\x56\x19\x05\x1e\xd7\x14\xd9" + "\x67\x27\xd6\x0b\x88\x91\xc9\x0a\x45\xd5\xd8\x81\x03\x02\x0c" + "\x3d\x82\x02\x03\x28\xa2\x2b\x80\x20\x58\x74\xa9\x88\x06\x27" + "\x9b\xb5\x18\xe1\x31\x8d\x83\xe8\xe7\xfc\x9c\xd5\xd0\xc1\x36" + "\xa4\x23\x67\x5f\x5d\x6d\xd8\xc1\x26\xc8\x8f\x81\x03\x02\x04" + "\x00\x82\x02\x03\x08\xa2\x2b\x80\x20\x6e\x43\x2a\xb9\x45\x97" + "\xfb\x3d\x36\x01\x97\x4c\x2e\xd2\x64\x38\x84\xdb\xc6\x2a\x9f" + "\x58\x55\x9b\xda\x5d\x3a\xa3\xdf\x36\x31\xa5\x81\x03\x04\x24" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x9d\xbe\x65\xf4\xae\x81" + "\x90\x79\x09\x18\xa2\x66\x12\x9c\x10\x94\x66\x21\x94\x70\x60" + "\x20\x4a\x3d\x5f\xb3\x62\xb6\x06\x46\x37\xfe\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xe5\x88\xb7\x6e\xec\x2d\xaf\x47\xc7\xa2" + "\xf4\x6e\xbf\x7f\x5e\x46\xd7\xfa\x33\x2c\x0a\x7e\x86\x1d\x8c" + "\x38\xa8\x93\x52\xe8\x97\xe9\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh69() + { + testcase("Thresh69"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim14Cond + // ** Rsa15Cond + // ** Ed16Cond + // ** Prefix17Cond + // ** Thresh21Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** ed2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** ed4 + // ** preim11 + // ** rsa12 + // ** ed13 + + auto const ed2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed2PublicKey{ + {0xb1, 0x2f, 0x54, 0xbe, 0xb6, 0xf8, 0x76, 0x71, 0x72, 0xed, 0x44, + 0x03, 0x71, 0x74, 0x2d, 0x7f, 0x98, 0x10, 0x4b, 0x57, 0xf2, 0x45, + 0xfb, 0x3e, 0xea, 0xfd, 0xdd, 0x39, 0x42, 0xbf, 0x24, 0x4d}}; + std::array const ed2Sig{ + {0x86, 0xf5, 0xe9, 0x44, 0x74, 0xe8, 0x98, 0xca, 0xc8, 0x20, 0xde, + 0x21, 0xcb, 0xf7, 0xf8, 0x65, 0x37, 0x6c, 0xd2, 0xe2, 0xd2, 0x46, + 0x6f, 0xcf, 0xd4, 0xdd, 0x48, 0x66, 0x8a, 0x9c, 0x06, 0xda, 0xa5, + 0x0e, 0x11, 0xfb, 0x87, 0x94, 0xd2, 0xed, 0xaa, 0xdd, 0x4e, 0x48, + 0x09, 0x7a, 0x4b, 0xdd, 0xa5, 0xe8, 0x46, 0x2e, 0x1a, 0xbb, 0x51, + 0x60, 0x0c, 0x9d, 0x8e, 0x35, 0x3e, 0xc1, 0x79, 0x09}}; + std::array const ed2SigningKey{ + {0xa7, 0xeb, 0x15, 0xc5, 0x2a, 0x41, 0x59, 0xf9, 0xf7, 0xb4, 0x78, + 0x5f, 0xdb, 0x79, 0xe5, 0x5b, 0x16, 0x44, 0xf7, 0xc7, 0xcf, 0xe2, + 0x46, 0xc5, 0xb3, 0x54, 0x64, 0xb5, 0x2f, 0x6c, 0x8e, 0x8e}}; + (void)ed2SigningKey; + auto const ed4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x8d, 0xea, 0x41, 0xb3, 0xf6, 0x63, 0xef, 0xfe, 0x6e, 0x52, 0xf2, + 0x37, 0x9c, 0xd3, 0x57, 0x55, 0x0e, 0xe9, 0x51, 0x31, 0x07, 0xf9, + 0x9c, 0x6c, 0x58, 0xbf, 0x7f, 0x00, 0xa4, 0xe1, 0x81, 0x55, 0xfc, + 0xd5, 0xfb, 0x5c, 0xfc, 0xda, 0x85, 0xd3, 0xd5, 0xf4, 0xca, 0x25, + 0x5e, 0xa0, 0x0b, 0x4e, 0x70, 0x50, 0x6e, 0x70, 0x34, 0x91, 0x30, + 0x96, 0x75, 0xb2, 0x8f, 0x39, 0xf8, 0xd3, 0x8b, 0x0d}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + auto const preim11Preimage = "I am root"s; + auto const preim11Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa12Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa12PublicKey{ + {0xd9, 0x25, 0xc3, 0xba, 0x0a, 0x46, 0x6e, 0xa9, 0x1d, 0x05, 0xd7, + 0x54, 0xf1, 0xff, 0xf4, 0xaf, 0xe5, 0x13, 0xcf, 0xd6, 0x74, 0xb0, + 0xcf, 0xc2, 0x8c, 0x68, 0x5c, 0xa9, 0xf3, 0x44, 0x4b, 0xfd, 0x4a, + 0x4d, 0x29, 0x64, 0xbc, 0xa8, 0x98, 0xf5, 0x35, 0x0a, 0x65, 0xe5, + 0xcd, 0x5d, 0x08, 0x9f, 0x58, 0x22, 0xed, 0x21, 0x78, 0x04, 0x4d, + 0x2a, 0xce, 0x80, 0x33, 0x19, 0x5b, 0x7a, 0xbd, 0xa6, 0x89, 0xfa, + 0x80, 0xa4, 0xf5, 0x32, 0xa6, 0xb1, 0x34, 0x61, 0x55, 0x5a, 0xbd, + 0x05, 0xaf, 0x4b, 0x4b, 0xdf, 0xe0, 0xa9, 0x3e, 0x1d, 0x2f, 0x3e, + 0xaf, 0x0c, 0x65, 0x32, 0xc6, 0xf2, 0xe0, 0x5c, 0x09, 0xc0, 0xa2, + 0x41, 0xe6, 0xc9, 0x96, 0x5e, 0x88, 0x62, 0x4a, 0x28, 0x4b, 0x23, + 0x2f, 0xcf, 0xb3, 0xb7, 0x1e, 0x11, 0x7f, 0xc4, 0x63, 0x1a, 0xe4, + 0x24, 0x29, 0x46, 0xf4, 0x48, 0xde, 0x30, 0x45, 0x97, 0xf8, 0x6c, + 0x8d, 0x4e, 0x4a, 0xce, 0x5e, 0x41, 0xb2, 0xb7, 0x5a, 0xd5, 0x94, + 0x42, 0x5a, 0x14, 0xd1, 0x11, 0x99, 0xc5, 0xeb, 0x66, 0xbe, 0xb1, + 0xc6, 0xc3, 0xdb, 0x2f, 0x8f, 0xa0, 0x6c, 0xa9, 0x27, 0x0f, 0xc0, + 0x92, 0x77, 0x0b, 0x8d, 0x66, 0xb8, 0x93, 0x0b, 0xc0, 0x5c, 0xcb, + 0x51, 0x4e, 0xa3, 0x83, 0xd2, 0xbd, 0x04, 0xd8, 0xc0, 0x0c, 0xb2, + 0xf7, 0x38, 0x4e, 0x6a, 0xec, 0xfe, 0x76, 0xd9, 0x71, 0x0b, 0x90, + 0x21, 0x7c, 0xbf, 0x07, 0xc4, 0xd8, 0x4c, 0x6d, 0xb9, 0x35, 0x48, + 0x5d, 0x82, 0xea, 0x61, 0xc5, 0x14, 0xff, 0x25, 0x50, 0x47, 0xaf, + 0x06, 0x58, 0xa9, 0x95, 0x2c, 0xdd, 0xe5, 0xbd, 0x95, 0x4a, 0x7b, + 0x27, 0xa1, 0x46, 0xe3, 0xf0, 0x16, 0xe8, 0xf9, 0xba, 0x43, 0xb8, + 0x77, 0xdc, 0x87, 0x81, 0x3a, 0xc0, 0xf2, 0xed, 0x3b, 0x03, 0x5e, + 0xe6, 0x89, 0x71}}; + std::array const rsa12Sig{ + {0xa6, 0x9b, 0x79, 0xe7, 0x22, 0x0c, 0x7a, 0xcc, 0x5b, 0xab, 0x81, + 0x9b, 0xac, 0x75, 0xf3, 0xb8, 0x51, 0x66, 0xb2, 0x36, 0x7c, 0x9d, + 0x8e, 0xa3, 0xcd, 0x07, 0x37, 0x42, 0x70, 0x23, 0xa8, 0x72, 0x1c, + 0x65, 0x40, 0xc6, 0x1f, 0xd6, 0x24, 0x4b, 0x82, 0x2a, 0x50, 0x50, + 0xfc, 0x19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0x73, 0xfe, 0x20, + 0x65, 0xad, 0x68, 0x7c, 0x19, 0x21, 0x13, 0x84, 0xaf, 0xca, 0xb7, + 0xeb, 0x57, 0xfa, 0xc2, 0x32, 0x6f, 0x43, 0xd1, 0xe6, 0x06, 0x56, + 0xeb, 0x0b, 0x76}}; + auto const ed13Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed13PublicKey{ + {0xe8, 0xb1, 0xe9, 0x04, 0xef, 0x8f, 0x78, 0x4c, 0x54, 0xf2, 0x45, + 0x60, 0x93, 0xb4, 0xc6, 0xa4, 0xc2, 0x9a, 0xa9, 0xb7, 0x5a, 0x0b, + 0x06, 0xf1, 0x78, 0xdc, 0xa9, 0x08, 0x12, 0xb2, 0x2f, 0xf4}}; + std::array const ed13Sig{ + {0x03, 0x17, 0xa0, 0x49, 0x7b, 0xee, 0x0d, 0x84, 0x64, 0xee, 0xa8, + 0xc1, 0xe6, 0x3e, 0xc6, 0xed, 0xd6, 0x25, 0x7e, 0x7d, 0xad, 0x96, + 0xf3, 0x82, 0x4a, 0xa6, 0xb1, 0x38, 0xf1, 0x2f, 0x54, 0x6a, 0x52, + 0x39, 0x26, 0x08, 0x2d, 0xe6, 0xfd, 0xb2, 0xfa, 0x23, 0xb3, 0x91, + 0x30, 0x07, 0x9a, 0x4b, 0x63, 0xbb, 0x6f, 0x55, 0xcb, 0x0a, 0xe9, + 0xb1, 0xfb, 0x40, 0x9e, 0x1f, 0x87, 0x70, 0x5a, 0x07}}; + std::array const ed13SigningKey{ + {0x0c, 0x45, 0x3e, 0x20, 0xe2, 0x12, 0x63, 0x6a, 0x7c, 0x36, 0x75, + 0xad, 0x2e, 0xd7, 0xc0, 0x39, 0x27, 0x7e, 0x38, 0x9a, 0xa2, 0xd3, + 0x3b, 0x24, 0x18, 0xf8, 0x68, 0x4e, 0x7f, 0xfa, 0x5d, 0xf3}}; + (void)ed13SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim14CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim14Cond{Type::preimageSha256, + 9, + Preim14CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa15CondConditionFingerprint = { + {0x55, 0x6b, 0x6d, 0xe3, 0x00, 0xd4, 0xf3, 0x7e, 0x75, 0x3a, 0x68, + 0xfc, 0x25, 0xdf, 0xf2, 0xf7, 0x18, 0x54, 0xa5, 0x55, 0x0c, 0xa5, + 0xa9, 0x65, 0xbf, 0x66, 0x9e, 0x4e, 0x49, 0x56, 0x1e, 0xf1}}; + Condition const Rsa15Cond{Type::rsaSha256, + 65536, + Rsa15CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed16CondConditionFingerprint = { + {0xe4, 0x66, 0x69, 0x86, 0x87, 0x57, 0x0e, 0xac, 0xf1, 0xfd, 0x06, + 0x81, 0x48, 0x90, 0x82, 0x42, 0x48, 0x50, 0x75, 0x8e, 0xd4, 0x2d, + 0xf3, 0x02, 0x37, 0x89, 0x28, 0xc5, 0x68, 0xd7, 0xa0, 0x11}}; + Condition const Ed16Cond{Type::ed25519Sha256, + 131072, + Ed16CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix17CondConditionFingerprint = { + {0x33, 0xd1, 0x6f, 0xa8, 0xb3, 0x5d, 0x6b, 0xb7, 0x85, 0xdc, 0x93, + 0x25, 0x5c, 0x75, 0x0a, 0xad, 0x62, 0x2b, 0xe1, 0xb2, 0x52, 0x40, + 0x8f, 0xd9, 0x3f, 0xbc, 0x03, 0x9c, 0x4e, 0x25, 0x47, 0x2d}}; + Condition const Prefix17Cond{Type::prefixSha256, + 134179, + Prefix17CondConditionFingerprint, + std::bitset<5>{20}}; + std::array const Thresh21CondConditionFingerprint = { + {0x13, 0xe9, 0xc7, 0xaf, 0x08, 0xf9, 0xff, 0x83, 0x07, 0xaa, 0xb7, + 0x0c, 0xa0, 0x82, 0x88, 0x02, 0x30, 0x04, 0xd8, 0xc5, 0xd1, 0xfd, + 0xf7, 0x18, 0x3e, 0x4d, 0x7b, 0x6e, 0x59, 0x5f, 0x83, 0x87}}; + Condition const Thresh21Cond{Type::thresholdSha256, + 132096, + Thresh21CondConditionFingerprint, + std::bitset<5>{16}}; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(ed2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim11 = + std::make_unique(makeSlice(preim11Preimage)); + auto rsa12 = std::make_unique( + makeSlice(rsa12PublicKey), makeSlice(rsa12Sig)); + auto ed13 = std::make_unique(ed13PublicKey, ed13Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim11)); + thresh0Subfulfillments.emplace_back(std::move(rsa12)); + thresh0Subfulfillments.emplace_back(std::move(ed13)); + std::vector thresh0Subconditions{ + {Preim14Cond, Rsa15Cond, Ed16Cond, Prefix17Cond, Thresh21Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x28\xa0\x82\x04\x4e\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x82\x01\xcb\xa0\x82\x01\x4c\xa2" + "\x81\xe3\xa0\x66\xa4\x64\x80\x20\x26\x80\x85\x71\x79\x37\x27" + "\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c\x5b\x9f\x99\x54\xb6" + "\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec\x81\x40\x8d\xea\x41" + "\xb3\xf6\x63\xef\xfe\x6e\x52\xf2\x37\x9c\xd3\x57\x55\x0e\xe9" + "\x51\x31\x07\xf9\x9c\x6c\x58\xbf\x7f\x00\xa4\xe1\x81\x55\xfc" + "\xd5\xfb\x5c\xfc\xda\x85\xd3\xd5\xf4\xca\x25\x5e\xa0\x0b\x4e" + "\x70\x50\x6e\x70\x34\x91\x30\x96\x75\xb2\x8f\x39\xf8\xd3\x8b" + "\x0d\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19" + "\xe1\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7" + "\x59\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf" + "\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86" + "\x91\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81" + "\x03\x02\x00\x00\xa4\x64\x80\x20\xb1\x2f\x54\xbe\xb6\xf8\x76" + "\x71\x72\xed\x44\x03\x71\x74\x2d\x7f\x98\x10\x4b\x57\xf2\x45" + "\xfb\x3e\xea\xfd\xdd\x39\x42\xbf\x24\x4d\x81\x40\x86\xf5\xe9" + "\x44\x74\xe8\x98\xca\xc8\x20\xde\x21\xcb\xf7\xf8\x65\x37\x6c" + "\xd2\xe2\xd2\x46\x6f\xcf\xd4\xdd\x48\x66\x8a\x9c\x06\xda\xa5" + "\x0e\x11\xfb\x87\x94\xd2\xed\xaa\xdd\x4e\x48\x09\x7a\x4b\xdd" + "\xa5\xe8\x46\x2e\x1a\xbb\x51\x60\x0c\x9d\x8e\x35\x3e\xc1\x79" + "\x09\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70" + "\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f" + "\xc7\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6" + "\x62\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09" + "\xbe\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81" + "\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xd9\x25\xc3" + "\xba\x0a\x46\x6e\xa9\x1d\x05\xd7\x54\xf1\xff\xf4\xaf\xe5\x13" + "\xcf\xd6\x74\xb0\xcf\xc2\x8c\x68\x5c\xa9\xf3\x44\x4b\xfd\x4a" + "\x4d\x29\x64\xbc\xa8\x98\xf5\x35\x0a\x65\xe5\xcd\x5d\x08\x9f" + "\x58\x22\xed\x21\x78\x04\x4d\x2a\xce\x80\x33\x19\x5b\x7a\xbd" + "\xa6\x89\xfa\x80\xa4\xf5\x32\xa6\xb1\x34\x61\x55\x5a\xbd\x05" + "\xaf\x4b\x4b\xdf\xe0\xa9\x3e\x1d\x2f\x3e\xaf\x0c\x65\x32\xc6" + "\xf2\xe0\x5c\x09\xc0\xa2\x41\xe6\xc9\x96\x5e\x88\x62\x4a\x28" + "\x4b\x23\x2f\xcf\xb3\xb7\x1e\x11\x7f\xc4\x63\x1a\xe4\x24\x29" + "\x46\xf4\x48\xde\x30\x45\x97\xf8\x6c\x8d\x4e\x4a\xce\x5e\x41" + "\xb2\xb7\x5a\xd5\x94\x42\x5a\x14\xd1\x11\x99\xc5\xeb\x66\xbe" + "\xb1\xc6\xc3\xdb\x2f\x8f\xa0\x6c\xa9\x27\x0f\xc0\x92\x77\x0b" + "\x8d\x66\xb8\x93\x0b\xc0\x5c\xcb\x51\x4e\xa3\x83\xd2\xbd\x04" + "\xd8\xc0\x0c\xb2\xf7\x38\x4e\x6a\xec\xfe\x76\xd9\x71\x0b\x90" + "\x21\x7c\xbf\x07\xc4\xd8\x4c\x6d\xb9\x35\x48\x5d\x82\xea\x61" + "\xc5\x14\xff\x25\x50\x47\xaf\x06\x58\xa9\x95\x2c\xdd\xe5\xbd" + "\x95\x4a\x7b\x27\xa1\x46\xe3\xf0\x16\xe8\xf9\xba\x43\xb8\x77" + "\xdc\x87\x81\x3a\xc0\xf2\xed\x3b\x03\x5e\xe6\x89\x71\x81\x82" + "\x01\x00\xa6\x9b\x79\xe7\x22\x0c\x7a\xcc\x5b\xab\x81\x9b\xac" + "\x75\xf3\xb8\x51\x66\xb2\x36\x7c\x9d\x8e\xa3\xcd\x07\x37\x42" + "\x70\x23\xa8\x72\x1c\x65\x40\xc6\x1f\xd6\x24\x4b\x82\x2a\x50" + "\x50\xfc\x19\x36\x16\xd2\x47\xf8\x84\x45\xf7\x1c\x9f\x41\x71" + "\x44\xbe\x6e\xd5\x48\xf5\x92\x41\x60\x43\xae\x67\x8a\x73\xc1" + "\xe6\x6d\x95\x91\x1f\x35\x49\xf9\x11\x7b\x00\x3f\xed\x4c\x1a" + "\x0e\x40\xe0\x2a\x2e\xea\x9b\x1a\xb5\x81\x30\xb0\x7e\xd4\xcf" + "\x93\x71\x56\xab\x54\xde\xca\xdb\xb1\x9b\x07\x86\x13\x04\x3c" + "\x54\x9e\x65\x2b\xe8\x07\xcc\xd8\x2f\x16\xfe\x6c\x02\x9a\x5b" + "\x27\xc1\x29\x1f\x08\x34\x3b\x10\xa4\x11\x66\xb8\x02\x56\x79" + "\xfc\x69\x51\xe8\xe9\x8c\x92\xe3\xdf\x30\x5d\x83\x91\x22\xa2" + "\x2c\x93\x49\xb3\x8f\x41\x87\xa1\xcf\x75\xc1\xf0\xc3\xc5\x3e" + "\x1d\x40\x82\xae\xb1\xfc\xf3\x35\x3f\x18\xbe\xf7\xfc\xfc\x9f" + "\xb5\xe9\x28\x05\x7b\x4c\xcc\x51\x85\x59\x8c\xc8\x56\x21\x96" + "\x2b\xb5\xa0\x28\x4f\x5f\x2f\x98\x60\x51\xcf\xee\xcf\xbd\x36" + "\xcf\x40\xb2\x2b\x47\x73\xfe\x20\x65\xad\x68\x7c\x19\x21\x13" + "\x84\xaf\xca\xb7\xeb\x57\xfa\xc2\x32\x6f\x43\xd1\xe6\x06\x56" + "\xeb\x0b\x76\xa4\x64\x80\x20\xe8\xb1\xe9\x04\xef\x8f\x78\x4c" + "\x54\xf2\x45\x60\x93\xb4\xc6\xa4\xc2\x9a\xa9\xb7\x5a\x0b\x06" + "\xf1\x78\xdc\xa9\x08\x12\xb2\x2f\xf4\x81\x40\x03\x17\xa0\x49" + "\x7b\xee\x0d\x84\x64\xee\xa8\xc1\xe6\x3e\xc6\xed\xd6\x25\x7e" + "\x7d\xad\x96\xf3\x82\x4a\xa6\xb1\x38\xf1\x2f\x54\x6a\x52\x39" + "\x26\x08\x2d\xe6\xfd\xb2\xfa\x23\xb3\x91\x30\x07\x9a\x4b\x63" + "\xbb\x6f\x55\xcb\x0a\xe9\xb1\xfb\x40\x9e\x1f\x87\x70\x5a\x07" + "\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b\x80" + "\x20\x33\xd1\x6f\xa8\xb3\x5d\x6b\xb7\x85\xdc\x93\x25\x5c\x75" + "\x0a\xad\x62\x2b\xe1\xb2\x52\x40\x8f\xd9\x3f\xbc\x03\x9c\x4e" + "\x25\x47\x2d\x81\x03\x02\x0c\x23\x82\x02\x03\x28\xa2\x2b\x80" + "\x20\x13\xe9\xc7\xaf\x08\xf9\xff\x83\x07\xaa\xb7\x0c\xa0\x82" + "\x88\x02\x30\x04\xd8\xc5\xd1\xfd\xf7\x18\x3e\x4d\x7b\x6e\x59" + "\x5f\x83\x87\x81\x03\x02\x04\x00\x82\x02\x03\x08\xa3\x27\x80" + "\x20\x55\x6b\x6d\xe3\x00\xd4\xf3\x7e\x75\x3a\x68\xfc\x25\xdf" + "\xf2\xf7\x18\x54\xa5\x55\x0c\xa5\xa9\x65\xbf\x66\x9e\x4e\x49" + "\x56\x1e\xf1\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xe4\x66\x69" + "\x86\x87\x57\x0e\xac\xf1\xfd\x06\x81\x48\x90\x82\x42\x48\x50" + "\x75\x8e\xd4\x2d\xf3\x02\x37\x89\x28\xc5\x68\xd7\xa0\x11\x81" + "\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\x3a\xcf\xa8\x6a\xe7\xb9\xaf\x69\x03\x91\x38" + "\x55\x7c\xc9\xb0\x48\x90\x2b\x8e\x15\x73\x14\xa3\x54\x1f\x30" + "\xe0\x44\x5c\x28\x74\x96\x81\x03\x0a\x58\x23\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\x33\xd1\x6f\xa8\xb3\x5d\x6b\xb7\x85\xdc\x93\x25" + "\x5c\x75\x0a\xad\x62\x2b\xe1\xb2\x52\x40\x8f\xd9\x3f\xbc\x03" + "\x9c\x4e\x25\x47\x2d\x81\x03\x02\x0c\x23\x82\x02\x03\x28\xa2" + "\x2b\x80\x20\x13\xe9\xc7\xaf\x08\xf9\xff\x83\x07\xaa\xb7\x0c" + "\xa0\x82\x88\x02\x30\x04\xd8\xc5\xd1\xfd\xf7\x18\x3e\x4d\x7b" + "\x6e\x59\x5f\x83\x87\x81\x03\x02\x04\x00\x82\x02\x03\x08\xa2" + "\x2b\x80\x20\x6e\x43\x2a\xb9\x45\x97\xfb\x3d\x36\x01\x97\x4c" + "\x2e\xd2\x64\x38\x84\xdb\xc6\x2a\x9f\x58\x55\x9b\xda\x5d\x3a" + "\xa3\xdf\x36\x31\xa5\x81\x03\x04\x24\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x38\xb9\xf0\xeb\x68\x8b\x9f\x55\x37\x9a\xec\x07" + "\xd4\xa2\x13\xac\x34\xa1\x67\x31\x34\xea\xc2\x2f\xef\x13\xe3" + "\x5c\xcf\x8f\x90\x1e\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x55" + "\x6b\x6d\xe3\x00\xd4\xf3\x7e\x75\x3a\x68\xfc\x25\xdf\xf2\xf7" + "\x18\x54\xa5\x55\x0c\xa5\xa9\x65\xbf\x66\x9e\x4e\x49\x56\x1e" + "\xf1\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x7c\x54\x6a\x6d\x7f" + "\x00\x52\x31\x03\xe7\xb4\x5b\x1c\x9f\x72\xeb\x3c\x18\x08\xa3" + "\x24\xb2\x63\x5f\x77\x55\x4a\x42\xdb\x1e\xff\x1e\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\xe4\x66\x69\x86\x87\x57\x0e\xac\xf1" + "\xfd\x06\x81\x48\x90\x82\x42\x48\x50\x75\x8e\xd4\x2d\xf3\x02" + "\x37\x89\x28\xc5\x68\xd7\xa0\x11\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh70() + { + testcase("Thresh70"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim28Cond + // ** Rsa29Cond + // ** Ed30Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** Thresh11Cond + // *** ed2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** ed4 + // ** prefix16 + // *** prefix17 + // **** thresh18 + // ***** Preim20Cond + // ***** Rsa21Cond + // ***** Ed22Cond + // ***** ed19 + // ** thresh23 + // *** Preim25Cond + // *** Rsa26Cond + // *** Ed27Cond + // *** ed24 + + auto const ed2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed2PublicKey{ + {0xb1, 0x2f, 0x54, 0xbe, 0xb6, 0xf8, 0x76, 0x71, 0x72, 0xed, 0x44, + 0x03, 0x71, 0x74, 0x2d, 0x7f, 0x98, 0x10, 0x4b, 0x57, 0xf2, 0x45, + 0xfb, 0x3e, 0xea, 0xfd, 0xdd, 0x39, 0x42, 0xbf, 0x24, 0x4d}}; + std::array const ed2Sig{ + {0x86, 0xf5, 0xe9, 0x44, 0x74, 0xe8, 0x98, 0xca, 0xc8, 0x20, 0xde, + 0x21, 0xcb, 0xf7, 0xf8, 0x65, 0x37, 0x6c, 0xd2, 0xe2, 0xd2, 0x46, + 0x6f, 0xcf, 0xd4, 0xdd, 0x48, 0x66, 0x8a, 0x9c, 0x06, 0xda, 0xa5, + 0x0e, 0x11, 0xfb, 0x87, 0x94, 0xd2, 0xed, 0xaa, 0xdd, 0x4e, 0x48, + 0x09, 0x7a, 0x4b, 0xdd, 0xa5, 0xe8, 0x46, 0x2e, 0x1a, 0xbb, 0x51, + 0x60, 0x0c, 0x9d, 0x8e, 0x35, 0x3e, 0xc1, 0x79, 0x09}}; + std::array const ed2SigningKey{ + {0xa7, 0xeb, 0x15, 0xc5, 0x2a, 0x41, 0x59, 0xf9, 0xf7, 0xb4, 0x78, + 0x5f, 0xdb, 0x79, 0xe5, 0x5b, 0x16, 0x44, 0xf7, 0xc7, 0xcf, 0xe2, + 0x46, 0xc5, 0xb3, 0x54, 0x64, 0xb5, 0x2f, 0x6c, 0x8e, 0x8e}}; + (void)ed2SigningKey; + auto const ed4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x8d, 0xea, 0x41, 0xb3, 0xf6, 0x63, 0xef, 0xfe, 0x6e, 0x52, 0xf2, + 0x37, 0x9c, 0xd3, 0x57, 0x55, 0x0e, 0xe9, 0x51, 0x31, 0x07, 0xf9, + 0x9c, 0x6c, 0x58, 0xbf, 0x7f, 0x00, 0xa4, 0xe1, 0x81, 0x55, 0xfc, + 0xd5, 0xfb, 0x5c, 0xfc, 0xda, 0x85, 0xd3, 0xd5, 0xf4, 0xca, 0x25, + 0x5e, 0xa0, 0x0b, 0x4e, 0x70, 0x50, 0x6e, 0x70, 0x34, 0x91, 0x30, + 0x96, 0x75, 0xb2, 0x8f, 0x39, 0xf8, 0xd3, 0x8b, 0x0d}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh11CondConditionFingerprint = { + {0x79, 0x95, 0xae, 0x4f, 0xba, 0x2b, 0x23, 0x42, 0x8e, 0xae, 0x72, + 0x3f, 0xdc, 0x13, 0xf8, 0xc9, 0x1a, 0x35, 0x71, 0x25, 0x4f, 0x89, + 0x8f, 0x40, 0xed, 0x8c, 0x99, 0xc4, 0xbb, 0x66, 0x24, 0xac}}; + Condition const Thresh11Cond{Type::thresholdSha256, + 135168, + Thresh11CondConditionFingerprint, + std::bitset<5>{25}}; + auto const ed19Msg = "P17P16abcdefghijklmnopqrstuvwxyz"s; + std::array const ed19PublicKey{ + {0xe5, 0x6b, 0xde, 0x3b, 0x0b, 0x02, 0xf2, 0xc4, 0x25, 0x85, 0x28, + 0x3f, 0x44, 0x22, 0x73, 0x35, 0x42, 0x73, 0xab, 0x0b, 0x0b, 0x3e, + 0xfe, 0x5f, 0x9b, 0x77, 0x25, 0x0f, 0x91, 0x87, 0x27, 0xbc}}; + std::array const ed19Sig{ + {0x5a, 0x8a, 0xa9, 0xd4, 0x08, 0x92, 0xa3, 0xdb, 0x84, 0xde, 0xe5, + 0xdd, 0x99, 0x43, 0x30, 0xab, 0x68, 0xd5, 0x98, 0x9d, 0xef, 0x97, + 0x58, 0x70, 0x54, 0xd0, 0x25, 0xc4, 0x9f, 0x35, 0xdb, 0xa5, 0x27, + 0x4b, 0xd7, 0xa0, 0x1f, 0x53, 0xe4, 0x4f, 0xac, 0xf9, 0xaf, 0x2e, + 0x71, 0x9f, 0x10, 0xfb, 0xdb, 0xc1, 0xe8, 0x2f, 0xab, 0x00, 0x95, + 0x7a, 0xef, 0xfd, 0x87, 0x48, 0x77, 0xd4, 0xf6, 0x04}}; + std::array const ed19SigningKey{ + {0x59, 0xde, 0x60, 0x42, 0x59, 0x4e, 0xbc, 0xfb, 0x36, 0x92, 0x14, + 0xf5, 0x54, 0x85, 0x3a, 0x94, 0xc4, 0x94, 0x2a, 0x15, 0x1c, 0x81, + 0xbd, 0xed, 0x81, 0x8f, 0xcc, 0x51, 0x06, 0xa4, 0xae, 0x45}}; + (void)ed19SigningKey; + auto const thresh18Msg = "P17P16abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim20CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim20Cond{Type::preimageSha256, + 9, + Preim20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa21CondConditionFingerprint = { + {0x18, 0x13, 0xb3, 0x53, 0x3a, 0x10, 0x06, 0xee, 0xf9, 0x67, 0xa2, + 0xcb, 0x27, 0x5e, 0xb8, 0x79, 0x5c, 0x09, 0xd1, 0x8f, 0xa0, 0xc7, + 0xb3, 0x95, 0x59, 0x14, 0xf6, 0x24, 0x99, 0x6b, 0x1a, 0xdd}}; + Condition const Rsa21Cond{Type::rsaSha256, + 65536, + Rsa21CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed22CondConditionFingerprint = { + {0xce, 0xba, 0x65, 0x8f, 0x48, 0xe3, 0x35, 0x4b, 0x51, 0xb6, 0xfd, + 0xe9, 0x57, 0xd7, 0xb9, 0xf0, 0x9b, 0x80, 0xb3, 0x6e, 0xdf, 0x73, + 0x20, 0x22, 0x5c, 0x0a, 0xda, 0x13, 0xf8, 0xc0, 0xa7, 0x5d}}; + Condition const Ed22Cond{Type::ed25519Sha256, + 131072, + Ed22CondConditionFingerprint, + std::bitset<5>{0}}; + auto const prefix17Prefix = "P17"s; + auto const prefix17Msg = "P16abcdefghijklmnopqrstuvwxyz"s; + auto const prefix17MaxMsgLength = 29; + auto const prefix16Prefix = "P16"s; + auto const prefix16Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const prefix16MaxMsgLength = 26; + auto const ed24Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed24PublicKey{ + {0x77, 0x02, 0x19, 0xa2, 0x6a, 0xa1, 0x21, 0x71, 0x6d, 0x10, 0x12, + 0xb5, 0xd7, 0x47, 0x4c, 0x79, 0x34, 0x9c, 0x10, 0x73, 0xf2, 0x07, + 0x3e, 0x2a, 0x2a, 0xa3, 0xa0, 0x1f, 0xc1, 0x44, 0x8c, 0xce}}; + std::array const ed24Sig{ + {0xa6, 0xc7, 0xf0, 0x18, 0xc8, 0xd5, 0x3c, 0xf0, 0x04, 0x2a, 0x88, + 0x13, 0xde, 0xb9, 0x82, 0x1b, 0xe1, 0xd9, 0x3d, 0x53, 0x25, 0x7c, + 0xc9, 0xab, 0x8b, 0xaf, 0x2a, 0x19, 0x43, 0x76, 0xc5, 0x56, 0x5d, + 0x72, 0x62, 0x05, 0x88, 0x37, 0xb3, 0x8b, 0x21, 0x3b, 0xff, 0xa4, + 0x3d, 0xfe, 0xd2, 0x32, 0xac, 0x3d, 0x87, 0xd1, 0x1f, 0xeb, 0x6a, + 0x99, 0x17, 0x99, 0x44, 0xe3, 0xa2, 0x2d, 0x6d, 0x08}}; + std::array const ed24SigningKey{ + {0x1d, 0xfa, 0x69, 0x28, 0xbe, 0xae, 0x45, 0xfb, 0x23, 0x7e, 0x3e, + 0x40, 0x38, 0x2d, 0xfa, 0x28, 0xd7, 0xff, 0xb8, 0x74, 0xf5, 0x52, + 0x4b, 0x3d, 0xf4, 0x99, 0x06, 0x29, 0x30, 0xa6, 0xfa, 0x01}}; + (void)ed24SigningKey; + auto const thresh23Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim25CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim25Cond{Type::preimageSha256, + 9, + Preim25CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa26CondConditionFingerprint = { + {0xd6, 0x40, 0x0d, 0x21, 0x44, 0x8a, 0xd4, 0x5a, 0xe6, 0x10, 0x3f, + 0xd4, 0x3a, 0x14, 0x5a, 0x5b, 0x87, 0x86, 0x20, 0x3c, 0x43, 0x20, + 0x9d, 0x9d, 0x0c, 0x75, 0x57, 0x80, 0x7d, 0xda, 0x9d, 0x06}}; + Condition const Rsa26Cond{Type::rsaSha256, + 65536, + Rsa26CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed27CondConditionFingerprint = { + {0x6a, 0x26, 0x73, 0x6f, 0xc3, 0xbf, 0x25, 0x73, 0x8e, 0x3b, 0x27, + 0x79, 0x47, 0xa5, 0x37, 0x7c, 0x78, 0xa0, 0x72, 0xd8, 0x77, 0x91, + 0xfc, 0x45, 0x87, 0x7f, 0x11, 0x57, 0xfe, 0x94, 0x57, 0x45}}; + Condition const Ed27Cond{Type::ed25519Sha256, + 131072, + Ed27CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim28CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim28Cond{Type::preimageSha256, + 9, + Preim28CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa29CondConditionFingerprint = { + {0x5c, 0xe1, 0xef, 0x71, 0xf6, 0x96, 0x65, 0x37, 0x01, 0x15, 0x1a, + 0xdd, 0xfe, 0x28, 0x5d, 0xef, 0x33, 0x99, 0x1f, 0xe9, 0x6a, 0x51, + 0x2d, 0x22, 0x62, 0x2c, 0x2e, 0x26, 0xb8, 0xda, 0x1e, 0xfa}}; + Condition const Rsa29Cond{Type::rsaSha256, + 65536, + Rsa29CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed30CondConditionFingerprint = { + {0xcc, 0x8a, 0x65, 0x38, 0xf7, 0x7c, 0xf9, 0x28, 0xc9, 0xdd, 0xf3, + 0x0c, 0x26, 0x64, 0x02, 0xde, 0x89, 0xd0, 0x71, 0xde, 0x61, 0x3e, + 0x31, 0x4d, 0x9b, 0x4e, 0x91, 0x6f, 0xcc, 0x36, 0x5c, 0xa3}}; + Condition const Ed30Cond{Type::ed25519Sha256, + 131072, + Ed30CondConditionFingerprint, + std::bitset<5>{0}}; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(ed2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Thresh11Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto ed19 = std::make_unique(ed19PublicKey, ed19Sig); + std::vector> thresh18Subfulfillments; + thresh18Subfulfillments.emplace_back(std::move(ed19)); + std::vector thresh18Subconditions{ + {Preim20Cond, Rsa21Cond, Ed22Cond}}; + auto thresh18 = std::make_unique( + std::move(thresh18Subfulfillments), + std::move(thresh18Subconditions)); + auto prefix17 = std::make_unique( + makeSlice(prefix17Prefix), + prefix17MaxMsgLength, + std::move(thresh18)); + auto prefix16 = std::make_unique( + makeSlice(prefix16Prefix), + prefix16MaxMsgLength, + std::move(prefix17)); + auto ed24 = std::make_unique(ed24PublicKey, ed24Sig); + std::vector> thresh23Subfulfillments; + thresh23Subfulfillments.emplace_back(std::move(ed24)); + std::vector thresh23Subconditions{ + {Preim25Cond, Rsa26Cond, Ed27Cond}}; + auto thresh23 = std::make_unique( + std::move(thresh23Subfulfillments), + std::move(thresh23Subconditions)); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(prefix16)); + thresh0Subfulfillments.emplace_back(std::move(thresh23)); + std::vector thresh0Subconditions{ + {Preim28Cond, Rsa29Cond, Ed30Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x04\x64\xa0\x82\x03\xe5\xa1\x81\xff\x80\x03\x50\x31" + "\x36\x81\x01\x1a\xa2\x81\xf4\xa1\x81\xf1\x80\x03\x50\x31\x37" + "\x81\x01\x1d\xa2\x81\xe6\xa2\x81\xe3\xa0\x66\xa4\x64\x80\x20" + "\xe5\x6b\xde\x3b\x0b\x02\xf2\xc4\x25\x85\x28\x3f\x44\x22\x73" + "\x35\x42\x73\xab\x0b\x0b\x3e\xfe\x5f\x9b\x77\x25\x0f\x91\x87" + "\x27\xbc\x81\x40\x5a\x8a\xa9\xd4\x08\x92\xa3\xdb\x84\xde\xe5" + "\xdd\x99\x43\x30\xab\x68\xd5\x98\x9d\xef\x97\x58\x70\x54\xd0" + "\x25\xc4\x9f\x35\xdb\xa5\x27\x4b\xd7\xa0\x1f\x53\xe4\x4f\xac" + "\xf9\xaf\x2e\x71\x9f\x10\xfb\xdb\xc1\xe8\x2f\xab\x00\x95\x7a" + "\xef\xfd\x87\x48\x77\xd4\xf6\x04\xa1\x79\xa0\x25\x80\x20\x5d" + "\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b" + "\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb" + "\x4e\x81\x01\x09\xa3\x27\x80\x20\x18\x13\xb3\x53\x3a\x10\x06" + "\xee\xf9\x67\xa2\xcb\x27\x5e\xb8\x79\x5c\x09\xd1\x8f\xa0\xc7" + "\xb3\x95\x59\x14\xf6\x24\x99\x6b\x1a\xdd\x81\x03\x01\x00\x00" + "\xa4\x27\x80\x20\xce\xba\x65\x8f\x48\xe3\x35\x4b\x51\xb6\xfd" + "\xe9\x57\xd7\xb9\xf0\x9b\x80\xb3\x6e\xdf\x73\x20\x22\x5c\x0a" + "\xda\x13\xf8\xc0\xa7\x5d\x81\x03\x02\x00\x00\xa2\x81\xe3\xa0" + "\x66\xa4\x64\x80\x20\x77\x02\x19\xa2\x6a\xa1\x21\x71\x6d\x10" + "\x12\xb5\xd7\x47\x4c\x79\x34\x9c\x10\x73\xf2\x07\x3e\x2a\x2a" + "\xa3\xa0\x1f\xc1\x44\x8c\xce\x81\x40\xa6\xc7\xf0\x18\xc8\xd5" + "\x3c\xf0\x04\x2a\x88\x13\xde\xb9\x82\x1b\xe1\xd9\x3d\x53\x25" + "\x7c\xc9\xab\x8b\xaf\x2a\x19\x43\x76\xc5\x56\x5d\x72\x62\x05" + "\x88\x37\xb3\x8b\x21\x3b\xff\xa4\x3d\xfe\xd2\x32\xac\x3d\x87" + "\xd1\x1f\xeb\x6a\x99\x17\x99\x44\xe3\xa2\x2d\x6d\x08\xa1\x79" + "\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f" + "\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd" + "\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xd6\x40" + "\x0d\x21\x44\x8a\xd4\x5a\xe6\x10\x3f\xd4\x3a\x14\x5a\x5b\x87" + "\x86\x20\x3c\x43\x20\x9d\x9d\x0c\x75\x57\x80\x7d\xda\x9d\x06" + "\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x6a\x26\x73\x6f\xc3\xbf" + "\x25\x73\x8e\x3b\x27\x79\x47\xa5\x37\x7c\x78\xa0\x72\xd8\x77" + "\x91\xfc\x45\x87\x7f\x11\x57\xfe\x94\x57\x45\x81\x03\x02\x00" + "\x00\xa2\x82\x01\xf9\xa0\x82\x01\x4c\xa2\x81\xe3\xa0\x66\xa4" + "\x64\x80\x20\x26\x80\x85\x71\x79\x37\x27\xbd\x85\xaf\x22\x49" + "\x59\x42\x99\x5c\x9c\x5b\x9f\x99\x54\xb6\xd4\xd1\x81\x94\x4c" + "\x22\x53\x03\xc0\xec\x81\x40\x8d\xea\x41\xb3\xf6\x63\xef\xfe" + "\x6e\x52\xf2\x37\x9c\xd3\x57\x55\x0e\xe9\x51\x31\x07\xf9\x9c" + "\x6c\x58\xbf\x7f\x00\xa4\xe1\x81\x55\xfc\xd5\xfb\x5c\xfc\xda" + "\x85\xd3\xd5\xf4\xca\x25\x5e\xa0\x0b\x4e\x70\x50\x6e\x70\x34" + "\x91\x30\x96\x75\xb2\x8f\x39\xf8\xd3\x8b\x0d\xa1\x79\xa0\x25" + "\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54" + "\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee" + "\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20\xee\x75\xbe\xb3" + "\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19\xe1\x5c\x70\x85\x92" + "\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7\x59\xe2\xa0\x81\x03" + "\x01\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf\x3e\x46\xf6\xd4\xdf" + "\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86\x91\xac\xb2\xf2\x24" + "\xf0\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81\x03\x02\x00\x00\xa4" + "\x64\x80\x20\xb1\x2f\x54\xbe\xb6\xf8\x76\x71\x72\xed\x44\x03" + "\x71\x74\x2d\x7f\x98\x10\x4b\x57\xf2\x45\xfb\x3e\xea\xfd\xdd" + "\x39\x42\xbf\x24\x4d\x81\x40\x86\xf5\xe9\x44\x74\xe8\x98\xca" + "\xc8\x20\xde\x21\xcb\xf7\xf8\x65\x37\x6c\xd2\xe2\xd2\x46\x6f" + "\xcf\xd4\xdd\x48\x66\x8a\x9c\x06\xda\xa5\x0e\x11\xfb\x87\x94" + "\xd2\xed\xaa\xdd\x4e\x48\x09\x7a\x4b\xdd\xa5\xe8\x46\x2e\x1a" + "\xbb\x51\x60\x0c\x9d\x8e\x35\x3e\xc1\x79\x09\xa1\x81\xa6\xa0" + "\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e" + "\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53" + "\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b\x80\x20\x79\x95\xae" + "\x4f\xba\x2b\x23\x42\x8e\xae\x72\x3f\xdc\x13\xf8\xc9\x1a\x35" + "\x71\x25\x4f\x89\x8f\x40\xed\x8c\x99\xc4\xbb\x66\x24\xac\x81" + "\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27\x80\x20\xe5\x15\x0a" + "\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e\x70\x64\x51\xeb\x6f" + "\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f\x7f\xc7\xe4\x52\x81" + "\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b\xe6\x62\xd4\x30\x65" + "\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda\x09\xbe\x79\x5f\x41" + "\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa\x81\x03\x02\x00\x00" + "\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51" + "\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68" + "\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80\x20" + "\x5c\xe1\xef\x71\xf6\x96\x65\x37\x01\x15\x1a\xdd\xfe\x28\x5d" + "\xef\x33\x99\x1f\xe9\x6a\x51\x2d\x22\x62\x2c\x2e\x26\xb8\xda" + "\x1e\xfa\x81\x03\x01\x00\x00\xa4\x27\x80\x20\xcc\x8a\x65\x38" + "\xf7\x7c\xf9\x28\xc9\xdd\xf3\x0c\x26\x64\x02\xde\x89\xd0\x71" + "\xde\x61\x3e\x31\x4d\x9b\x4e\x91\x6f\xcc\x36\x5c\xa3\x81\x03" + "\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xaf\x8a\xc8\xdf\x4c\x10\x8b\xf5\x9a\xe1\xba" + "\x77\x21\xae\x81\x3b\x19\x86\xf8\x84\xc1\x95\xc3\x8d\xcc\x7b" + "\x95\x9a\x5b\x04\x2c\x9f\x81\x03\x08\x78\x3d\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x07\x80\x01\x03\xa1\x82\x01\x00\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa1\x2b\x80\x20\x4f\xfe\x3c\xd8\xcf\xc8" + "\x62\xdc\xcc\x27\xb3\x06\xf3\x56\x01\xbd\x73\x3b\xfa\x88\xf9" + "\xcd\xc7\x85\x5f\x9c\x25\x65\x37\x78\xfe\xa6\x81\x03\x02\x18" + "\x3d\x82\x02\x03\xb8\xa2\x2b\x80\x20\x3c\x87\xc9\xf7\x46\x52" + "\x3a\x53\x2b\xcc\x10\x47\x73\x24\x8e\x84\x11\xac\xfb\xed\xf3" + "\xa0\x01\x94\x68\x00\x8d\x66\xc9\x7e\x83\x96\x81\x03\x04\x38" + "\x00\x82\x02\x03\x98\xa2\x2b\x80\x20\xd8\x1d\xe5\x4d\xc0\xea" + "\x5c\x49\x99\x56\x75\x95\x7a\xfe\xce\xc9\x28\xdb\x31\xc6\xf6" + "\x63\xf0\xb4\x57\x1a\x23\x13\x29\xe1\x32\x4d\x81\x03\x02\x10" + "\x00\x82\x02\x03\x98\xa3\x27\x80\x20\x5c\xe1\xef\x71\xf6\x96" + "\x65\x37\x01\x15\x1a\xdd\xfe\x28\x5d\xef\x33\x99\x1f\xe9\x6a" + "\x51\x2d\x22\x62\x2c\x2e\x26\xb8\xda\x1e\xfa\x81\x03\x01\x00" + "\x00\xa4\x27\x80\x20\xcc\x8a\x65\x38\xf7\x7c\xf9\x28\xc9\xdd" + "\xf3\x0c\x26\x64\x02\xde\x89\xd0\x71\xde\x61\x3e\x31\x4d\x9b" + "\x4e\x91\x6f\xcc\x36\x5c\xa3\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + testThresh71() + { + testcase("Thresh71"); + + using namespace std::string_literals; + using namespace ripple::cryptoconditions; + + // Fulfillment structure + // * thresh0 + // ** Preim19Cond + // ** Rsa20Cond + // ** Ed21Cond + // ** Prefix22Cond + // ** Thresh29Cond + // ** thresh1 + // *** Preim8Cond + // *** Rsa9Cond + // *** Ed10Cond + // *** Thresh11Cond + // *** ed2 + // *** thresh3 + // **** Preim5Cond + // **** Rsa6Cond + // **** Ed7Cond + // **** ed4 + // ** preim16 + // ** rsa17 + // ** ed18 + + auto const ed2Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed2PublicKey{ + {0xb1, 0x2f, 0x54, 0xbe, 0xb6, 0xf8, 0x76, 0x71, 0x72, 0xed, 0x44, + 0x03, 0x71, 0x74, 0x2d, 0x7f, 0x98, 0x10, 0x4b, 0x57, 0xf2, 0x45, + 0xfb, 0x3e, 0xea, 0xfd, 0xdd, 0x39, 0x42, 0xbf, 0x24, 0x4d}}; + std::array const ed2Sig{ + {0x86, 0xf5, 0xe9, 0x44, 0x74, 0xe8, 0x98, 0xca, 0xc8, 0x20, 0xde, + 0x21, 0xcb, 0xf7, 0xf8, 0x65, 0x37, 0x6c, 0xd2, 0xe2, 0xd2, 0x46, + 0x6f, 0xcf, 0xd4, 0xdd, 0x48, 0x66, 0x8a, 0x9c, 0x06, 0xda, 0xa5, + 0x0e, 0x11, 0xfb, 0x87, 0x94, 0xd2, 0xed, 0xaa, 0xdd, 0x4e, 0x48, + 0x09, 0x7a, 0x4b, 0xdd, 0xa5, 0xe8, 0x46, 0x2e, 0x1a, 0xbb, 0x51, + 0x60, 0x0c, 0x9d, 0x8e, 0x35, 0x3e, 0xc1, 0x79, 0x09}}; + std::array const ed2SigningKey{ + {0xa7, 0xeb, 0x15, 0xc5, 0x2a, 0x41, 0x59, 0xf9, 0xf7, 0xb4, 0x78, + 0x5f, 0xdb, 0x79, 0xe5, 0x5b, 0x16, 0x44, 0xf7, 0xc7, 0xcf, 0xe2, + 0x46, 0xc5, 0xb3, 0x54, 0x64, 0xb5, 0x2f, 0x6c, 0x8e, 0x8e}}; + (void)ed2SigningKey; + auto const ed4Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed4PublicKey{ + {0x26, 0x80, 0x85, 0x71, 0x79, 0x37, 0x27, 0xbd, 0x85, 0xaf, 0x22, + 0x49, 0x59, 0x42, 0x99, 0x5c, 0x9c, 0x5b, 0x9f, 0x99, 0x54, 0xb6, + 0xd4, 0xd1, 0x81, 0x94, 0x4c, 0x22, 0x53, 0x03, 0xc0, 0xec}}; + std::array const ed4Sig{ + {0x8d, 0xea, 0x41, 0xb3, 0xf6, 0x63, 0xef, 0xfe, 0x6e, 0x52, 0xf2, + 0x37, 0x9c, 0xd3, 0x57, 0x55, 0x0e, 0xe9, 0x51, 0x31, 0x07, 0xf9, + 0x9c, 0x6c, 0x58, 0xbf, 0x7f, 0x00, 0xa4, 0xe1, 0x81, 0x55, 0xfc, + 0xd5, 0xfb, 0x5c, 0xfc, 0xda, 0x85, 0xd3, 0xd5, 0xf4, 0xca, 0x25, + 0x5e, 0xa0, 0x0b, 0x4e, 0x70, 0x50, 0x6e, 0x70, 0x34, 0x91, 0x30, + 0x96, 0x75, 0xb2, 0x8f, 0x39, 0xf8, 0xd3, 0x8b, 0x0d}}; + std::array const ed4SigningKey{ + {0x2a, 0x7a, 0x9a, 0x1f, 0xf1, 0x08, 0x8f, 0x8e, 0xef, 0x3a, 0x39, + 0xce, 0x13, 0xea, 0x08, 0x08, 0x8a, 0xf6, 0x06, 0x78, 0xd5, 0x3e, + 0x0b, 0x9c, 0x84, 0xfb, 0x39, 0x93, 0xd6, 0xfe, 0xa0, 0x3d}}; + (void)ed4SigningKey; + auto const thresh3Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim5CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim5Cond{Type::preimageSha256, + 9, + Preim5CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa6CondConditionFingerprint = { + {0xee, 0x75, 0xbe, 0xb3, 0x52, 0x54, 0xbd, 0x24, 0x06, 0x3f, 0xd9, + 0x32, 0x48, 0x19, 0xe1, 0x5c, 0x70, 0x85, 0x92, 0x11, 0x6c, 0x3a, + 0xc1, 0x4c, 0x9b, 0x83, 0xeb, 0x05, 0xa7, 0x59, 0xe2, 0xa0}}; + Condition const Rsa6Cond{Type::rsaSha256, + 65536, + Rsa6CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed7CondConditionFingerprint = { + {0x1e, 0x5a, 0xaf, 0x3e, 0x46, 0xf6, 0xd4, 0xdf, 0x4d, 0x70, 0xf0, + 0xa1, 0xd1, 0x35, 0x6d, 0xf0, 0x8b, 0x86, 0x91, 0xac, 0xb2, 0xf2, + 0x24, 0xf0, 0x1a, 0xd4, 0x23, 0xc0, 0x21, 0x8d, 0x42, 0xc0}}; + Condition const Ed7Cond{Type::ed25519Sha256, + 131072, + Ed7CondConditionFingerprint, + std::bitset<5>{0}}; + auto const thresh1Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim8CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim8Cond{Type::preimageSha256, + 9, + Preim8CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa9CondConditionFingerprint = { + {0xe5, 0x15, 0x0a, 0xbd, 0xf6, 0x06, 0xbe, 0xaa, 0x6c, 0x81, 0xf1, + 0x88, 0x7e, 0x70, 0x64, 0x51, 0xeb, 0x6f, 0x70, 0xb1, 0xdd, 0xc5, + 0xf1, 0x20, 0x53, 0xf7, 0xcb, 0x9f, 0x7f, 0xc7, 0xe4, 0x52}}; + Condition const Rsa9Cond{Type::rsaSha256, + 65536, + Rsa9CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed10CondConditionFingerprint = { + {0x00, 0x8b, 0xe6, 0x62, 0xd4, 0x30, 0x65, 0x1e, 0x40, 0xb3, 0x23, + 0x05, 0x52, 0x3a, 0xf3, 0x16, 0xda, 0x09, 0xbe, 0x79, 0x5f, 0x41, + 0xc9, 0x03, 0x93, 0x34, 0x5b, 0x7c, 0x24, 0x87, 0x62, 0xfa}}; + Condition const Ed10Cond{Type::ed25519Sha256, + 131072, + Ed10CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Thresh11CondConditionFingerprint = { + {0x79, 0x95, 0xae, 0x4f, 0xba, 0x2b, 0x23, 0x42, 0x8e, 0xae, 0x72, + 0x3f, 0xdc, 0x13, 0xf8, 0xc9, 0x1a, 0x35, 0x71, 0x25, 0x4f, 0x89, + 0x8f, 0x40, 0xed, 0x8c, 0x99, 0xc4, 0xbb, 0x66, 0x24, 0xac}}; + Condition const Thresh11Cond{Type::thresholdSha256, + 135168, + Thresh11CondConditionFingerprint, + std::bitset<5>{25}}; + auto const preim16Preimage = "I am root"s; + auto const preim16Msg = "abcdefghijklmnopqrstuvwxyz"s; + auto const rsa17Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const rsa17PublicKey{ + {0xb0, 0x41, 0xe9, 0x6e, 0xfe, 0x3b, 0xde, 0x46, 0x52, 0x56, 0x34, + 0x2a, 0x92, 0x83, 0x4d, 0x3a, 0x7b, 0x94, 0xe7, 0xc2, 0x06, 0x5b, + 0x8c, 0xf4, 0x9d, 0x71, 0x9d, 0x00, 0x73, 0xd9, 0x15, 0x81, 0x12, + 0x1a, 0x0c, 0x9e, 0xd8, 0xa6, 0xa6, 0xd8, 0x62, 0xbe, 0xfe, 0xa3, + 0x7c, 0xc5, 0xd0, 0x71, 0xdd, 0x83, 0xed, 0xcf, 0x71, 0xd8, 0xe5, + 0x72, 0x27, 0xcb, 0xce, 0xd7, 0x06, 0xda, 0xe8, 0x4b, 0xb8, 0x8d, + 0x45, 0xc0, 0x9c, 0xe3, 0x13, 0x27, 0xbf, 0x60, 0x50, 0x85, 0xbf, + 0xd1, 0xfc, 0x8c, 0x41, 0x75, 0x2d, 0x51, 0x83, 0x24, 0x06, 0xcb, + 0xe6, 0x98, 0x8e, 0x0d, 0x35, 0xfa, 0x58, 0x34, 0x43, 0x90, 0x55, + 0x6a, 0x40, 0xc9, 0x78, 0x31, 0xfb, 0x28, 0x8b, 0x10, 0x78, 0x46, + 0x59, 0x49, 0xf5, 0x89, 0x1c, 0x66, 0xc0, 0x6e, 0x6b, 0x73, 0x05, + 0x75, 0x83, 0x2b, 0x86, 0x78, 0x02, 0xc1, 0xb0, 0xf1, 0x2a, 0x6e, + 0x7e, 0xf6, 0x65, 0x8f, 0xe3, 0xc2, 0x02, 0x6d, 0xae, 0x03, 0xc5, + 0xef, 0x41, 0x03, 0x3a, 0x6b, 0xeb, 0xb0, 0xab, 0x6a, 0x27, 0x2e, + 0xcb, 0x13, 0xf5, 0xd3, 0xae, 0x11, 0x18, 0x33, 0x6a, 0xc3, 0x08, + 0x7a, 0xf8, 0xb9, 0xd7, 0xf3, 0x37, 0xee, 0x05, 0x32, 0xd9, 0xb5, + 0xa4, 0xb9, 0xeb, 0x67, 0xa8, 0x84, 0xeb, 0xb2, 0xc3, 0x2f, 0x8a, + 0x8f, 0xa7, 0x24, 0xac, 0x9a, 0x24, 0x91, 0x11, 0x70, 0xab, 0xc5, + 0x05, 0x25, 0xa9, 0xd3, 0x93, 0x17, 0x6d, 0x70, 0xb1, 0x67, 0x60, + 0x6b, 0x50, 0x69, 0xdd, 0x22, 0x8b, 0x6a, 0xa9, 0x11, 0x7e, 0x5e, + 0x09, 0xa8, 0xaa, 0xdc, 0x4a, 0xc8, 0x09, 0x4c, 0x1a, 0xe7, 0x4c, + 0x1e, 0x42, 0xb2, 0x27, 0x9d, 0xa9, 0x1b, 0xa3, 0x59, 0x14, 0xcb, + 0x0b, 0xca, 0xff, 0x6e, 0x8d, 0x8e, 0x38, 0xf6, 0x19, 0xb1, 0x81, + 0x5f, 0xf4, 0x7d}}; + std::array const rsa17Sig{ + {0x42, 0xb7, 0x2f, 0x8c, 0x2b, 0x94, 0x61, 0x70, 0x46, 0x27, 0xce, + 0xab, 0xa2, 0x76, 0xe4, 0xdd, 0x74, 0xc3, 0x6a, 0xd0, 0x94, 0xaf, + 0xba, 0x17, 0xc7, 0x30, 0xba, 0x9c, 0x3e, 0x80, 0x6e, 0x9d, 0xca, + 0x9f, 0x10, 0xbf, 0x54, 0x41, 0xce, 0x64, 0x92, 0x0f, 0xd1, 0xc5, + 0xae, 0xa1, 0x0a, 0xf3, 0xb2, 0x0b, 0x37, 0xed, 0x93, 0xef, 0x4c, + 0xb1, 0x49, 0x83, 0x26, 0xfa, 0x60, 0x84, 0x7e, 0xb4, 0x8b, 0x17, + 0x5a, 0xe7, 0xa0, 0xba, 0xd5, 0x9e, 0xa8, 0x47, 0x6e, 0x30, 0xcb, + 0xd1, 0xab, 0x7d, 0x13, 0xef, 0xc6, 0xb5, 0xcf, 0xcd, 0x38, 0x10, + 0x11, 0xce, 0xed, 0x08, 0xbf, 0x83, 0x52, 0xc2, 0xd8, 0x8c, 0xc6, + 0x59, 0x18, 0x9a, 0x6b, 0x87, 0x96, 0x01, 0x3f, 0x0c, 0xe2, 0xc1, + 0x46, 0x70, 0x3f, 0xa6, 0xb2, 0x64, 0x3d, 0xcf, 0x97, 0x19, 0x2b, + 0x52, 0xe4, 0xed, 0x9a, 0x50, 0x52, 0xb2, 0xad, 0xbe, 0x1b, 0x11, + 0xf6, 0x5e, 0x36, 0x24, 0xce, 0x3a, 0x21, 0xe5, 0x20, 0x43, 0xf7, + 0xb7, 0x9d, 0xf7, 0x54, 0xfa, 0x12, 0x93, 0x9a, 0xbf, 0x64, 0x68, + 0x65, 0xd3, 0xec, 0xa1, 0x70, 0x0e, 0x10, 0x0a, 0x7a, 0x73, 0x38, + 0xcb, 0x57, 0x07, 0xf4, 0xfb, 0xaf, 0xec, 0x9c, 0x7a, 0xaa, 0x8d, + 0x31, 0xa1, 0xb4, 0xfe, 0x24, 0xb4, 0xf1, 0x9d, 0x33, 0x9b, 0x79, + 0xcc, 0xec, 0xc2, 0x76, 0x9a, 0x7d, 0x43, 0xb8, 0xc0, 0x7e, 0xc6, + 0x42, 0x54, 0x1d, 0x72, 0x5d, 0xb2, 0xfd, 0x90, 0x96, 0x15, 0x0f, + 0x18, 0x36, 0xe7, 0x77, 0xdf, 0xe5, 0x4b, 0xbe, 0xd7, 0x94, 0x87, + 0x0c, 0xff, 0x2c, 0xfb, 0xa2, 0x0e, 0x8c, 0x1f, 0x93, 0xa5, 0xd5, + 0x3b, 0x0b, 0x63, 0x3a, 0xea, 0x87, 0xce, 0x77, 0x62, 0xa4, 0x1f, + 0x2c, 0x7e, 0xe5, 0x08, 0xa4, 0x9b, 0x62, 0x12, 0x9c, 0x06, 0x25, + 0x04, 0x95, 0xb3}}; + auto const ed18Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const ed18PublicKey{ + {0x3b, 0x07, 0x0f, 0xe5, 0x29, 0x34, 0xd9, 0x17, 0xf5, 0x06, 0x00, + 0xb8, 0x87, 0x2f, 0xcf, 0x89, 0x52, 0x70, 0xcc, 0x04, 0x92, 0xe1, + 0x67, 0xcb, 0xba, 0xbb, 0x10, 0xa6, 0x2d, 0x06, 0xa4, 0x6b}}; + std::array const ed18Sig{ + {0x09, 0xc4, 0x1d, 0xc3, 0x8e, 0x6c, 0xd6, 0x04, 0xb7, 0x9e, 0x8c, + 0x8b, 0x30, 0x65, 0x88, 0x43, 0xc7, 0xc6, 0xe5, 0xa0, 0xb0, 0x4c, + 0x60, 0xee, 0xb7, 0x1d, 0x69, 0x2a, 0xb7, 0x5d, 0x5f, 0x16, 0x53, + 0xd1, 0xe6, 0x6a, 0x74, 0x5d, 0x63, 0xc0, 0x41, 0x30, 0x6a, 0x58, + 0xce, 0x52, 0xf2, 0xdb, 0x41, 0x03, 0x78, 0xfd, 0x7f, 0x0e, 0xa5, + 0xc1, 0xe4, 0xd2, 0x50, 0x8d, 0x97, 0x1d, 0xf9, 0x06}}; + std::array const ed18SigningKey{ + {0x59, 0x73, 0xbb, 0x41, 0xb0, 0xe0, 0xce, 0xc2, 0xa9, 0x85, 0xaa, + 0x05, 0xa4, 0x7e, 0x3b, 0x51, 0x09, 0x8d, 0x3e, 0x47, 0xb7, 0x75, + 0xda, 0x81, 0x39, 0xa0, 0xe1, 0xd5, 0x9f, 0xb0, 0x9c, 0x5a}}; + (void)ed18SigningKey; + auto const thresh0Msg = "abcdefghijklmnopqrstuvwxyz"s; + std::array const Preim19CondConditionFingerprint = { + {0x5d, 0xa0, 0x30, 0xef, 0xfd, 0xe1, 0x75, 0x11, 0x51, 0xe8, 0x5f, + 0x5e, 0x54, 0x2d, 0x6a, 0x5b, 0xd1, 0x5c, 0xc9, 0x33, 0x21, 0x2c, + 0xe2, 0x68, 0xfc, 0xfd, 0x53, 0xee, 0x93, 0x58, 0xeb, 0x4e}}; + Condition const Preim19Cond{Type::preimageSha256, + 9, + Preim19CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Rsa20CondConditionFingerprint = { + {0x8d, 0xb0, 0x2c, 0xb1, 0x28, 0xc3, 0xf4, 0x97, 0x50, 0x84, 0x64, + 0x57, 0xca, 0xf4, 0x9d, 0x63, 0x08, 0x73, 0xfc, 0xde, 0x2f, 0x90, + 0xf0, 0xf2, 0xec, 0x79, 0xa9, 0xc6, 0xa3, 0xf1, 0x33, 0xfd}}; + Condition const Rsa20Cond{Type::rsaSha256, + 65536, + Rsa20CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Ed21CondConditionFingerprint = { + {0x95, 0x3c, 0x86, 0x65, 0x91, 0x76, 0x69, 0x6b, 0x72, 0x61, 0xaa, + 0x76, 0x15, 0x2a, 0xd7, 0x25, 0x4f, 0x32, 0xb7, 0x73, 0x7a, 0xb2, + 0x49, 0x0c, 0x0b, 0xdf, 0xb5, 0x4e, 0x4a, 0x8b, 0xf7, 0x65}}; + Condition const Ed21Cond{Type::ed25519Sha256, + 131072, + Ed21CondConditionFingerprint, + std::bitset<5>{0}}; + std::array const Prefix22CondConditionFingerprint = { + {0xa2, 0xe5, 0x7d, 0x5a, 0xe0, 0xaa, 0xd0, 0xcc, 0x00, 0x52, 0x58, + 0xad, 0xd1, 0x49, 0xaf, 0xc1, 0x16, 0xb4, 0x66, 0x7b, 0x1e, 0x04, + 0xa1, 0xe2, 0xf6, 0xfa, 0x57, 0x84, 0x7f, 0x8b, 0xee, 0x55}}; + Condition const Prefix22Cond{Type::prefixSha256, + 137251, + Prefix22CondConditionFingerprint, + std::bitset<5>{29}}; + std::array const Thresh29CondConditionFingerprint = { + {0x88, 0x40, 0x2d, 0x0d, 0x6a, 0x33, 0x4c, 0x14, 0x49, 0xbd, 0x34, + 0x72, 0x96, 0xb9, 0x4d, 0xf7, 0xd1, 0x21, 0x4c, 0xff, 0x95, 0xa2, + 0x84, 0xf3, 0xa6, 0x8b, 0xb6, 0x3d, 0x42, 0x97, 0x27, 0x41}}; + Condition const Thresh29Cond{Type::thresholdSha256, + 135168, + Thresh29CondConditionFingerprint, + std::bitset<5>{25}}; + + auto ed2 = std::make_unique(ed2PublicKey, ed2Sig); + auto ed4 = std::make_unique(ed4PublicKey, ed4Sig); + std::vector> thresh3Subfulfillments; + thresh3Subfulfillments.emplace_back(std::move(ed4)); + std::vector thresh3Subconditions{ + {Preim5Cond, Rsa6Cond, Ed7Cond}}; + auto thresh3 = std::make_unique( + std::move(thresh3Subfulfillments), std::move(thresh3Subconditions)); + std::vector> thresh1Subfulfillments; + thresh1Subfulfillments.emplace_back(std::move(ed2)); + thresh1Subfulfillments.emplace_back(std::move(thresh3)); + std::vector thresh1Subconditions{ + {Preim8Cond, Rsa9Cond, Ed10Cond, Thresh11Cond}}; + auto thresh1 = std::make_unique( + std::move(thresh1Subfulfillments), std::move(thresh1Subconditions)); + auto preim16 = + std::make_unique(makeSlice(preim16Preimage)); + auto rsa17 = std::make_unique( + makeSlice(rsa17PublicKey), makeSlice(rsa17Sig)); + auto ed18 = std::make_unique(ed18PublicKey, ed18Sig); + std::vector> thresh0Subfulfillments; + thresh0Subfulfillments.emplace_back(std::move(thresh1)); + thresh0Subfulfillments.emplace_back(std::move(preim16)); + thresh0Subfulfillments.emplace_back(std::move(rsa17)); + thresh0Subfulfillments.emplace_back(std::move(ed18)); + std::vector thresh0Subconditions{ + {Preim19Cond, Rsa20Cond, Ed21Cond, Prefix22Cond, Thresh29Cond}}; + auto thresh0 = std::make_unique( + std::move(thresh0Subfulfillments), std::move(thresh0Subconditions)); + { + auto thresh0EncodedFulfillment = + "\xa2\x82\x05\x56\xa0\x82\x04\x7c\xa0\x0b\x80\x09\x49\x20\x61" + "\x6d\x20\x72\x6f\x6f\x74\xa2\x82\x01\xf9\xa0\x82\x01\x4c\xa2" + "\x81\xe3\xa0\x66\xa4\x64\x80\x20\x26\x80\x85\x71\x79\x37\x27" + "\xbd\x85\xaf\x22\x49\x59\x42\x99\x5c\x9c\x5b\x9f\x99\x54\xb6" + "\xd4\xd1\x81\x94\x4c\x22\x53\x03\xc0\xec\x81\x40\x8d\xea\x41" + "\xb3\xf6\x63\xef\xfe\x6e\x52\xf2\x37\x9c\xd3\x57\x55\x0e\xe9" + "\x51\x31\x07\xf9\x9c\x6c\x58\xbf\x7f\x00\xa4\xe1\x81\x55\xfc" + "\xd5\xfb\x5c\xfc\xda\x85\xd3\xd5\xf4\xca\x25\x5e\xa0\x0b\x4e" + "\x70\x50\x6e\x70\x34\x91\x30\x96\x75\xb2\x8f\x39\xf8\xd3\x8b" + "\x0d\xa1\x79\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75\x11" + "\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2" + "\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa3\x27\x80" + "\x20\xee\x75\xbe\xb3\x52\x54\xbd\x24\x06\x3f\xd9\x32\x48\x19" + "\xe1\x5c\x70\x85\x92\x11\x6c\x3a\xc1\x4c\x9b\x83\xeb\x05\xa7" + "\x59\xe2\xa0\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x1e\x5a\xaf" + "\x3e\x46\xf6\xd4\xdf\x4d\x70\xf0\xa1\xd1\x35\x6d\xf0\x8b\x86" + "\x91\xac\xb2\xf2\x24\xf0\x1a\xd4\x23\xc0\x21\x8d\x42\xc0\x81" + "\x03\x02\x00\x00\xa4\x64\x80\x20\xb1\x2f\x54\xbe\xb6\xf8\x76" + "\x71\x72\xed\x44\x03\x71\x74\x2d\x7f\x98\x10\x4b\x57\xf2\x45" + "\xfb\x3e\xea\xfd\xdd\x39\x42\xbf\x24\x4d\x81\x40\x86\xf5\xe9" + "\x44\x74\xe8\x98\xca\xc8\x20\xde\x21\xcb\xf7\xf8\x65\x37\x6c" + "\xd2\xe2\xd2\x46\x6f\xcf\xd4\xdd\x48\x66\x8a\x9c\x06\xda\xa5" + "\x0e\x11\xfb\x87\x94\xd2\xed\xaa\xdd\x4e\x48\x09\x7a\x4b\xdd" + "\xa5\xe8\x46\x2e\x1a\xbb\x51\x60\x0c\x9d\x8e\x35\x3e\xc1\x79" + "\x09\xa1\x81\xa6\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa2\x2b" + "\x80\x20\x79\x95\xae\x4f\xba\x2b\x23\x42\x8e\xae\x72\x3f\xdc" + "\x13\xf8\xc9\x1a\x35\x71\x25\x4f\x89\x8f\x40\xed\x8c\x99\xc4" + "\xbb\x66\x24\xac\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27" + "\x80\x20\xe5\x15\x0a\xbd\xf6\x06\xbe\xaa\x6c\x81\xf1\x88\x7e" + "\x70\x64\x51\xeb\x6f\x70\xb1\xdd\xc5\xf1\x20\x53\xf7\xcb\x9f" + "\x7f\xc7\xe4\x52\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x00\x8b" + "\xe6\x62\xd4\x30\x65\x1e\x40\xb3\x23\x05\x52\x3a\xf3\x16\xda" + "\x09\xbe\x79\x5f\x41\xc9\x03\x93\x34\x5b\x7c\x24\x87\x62\xfa" + "\x81\x03\x02\x00\x00\xa3\x82\x02\x08\x80\x82\x01\x00\xb0\x41" + "\xe9\x6e\xfe\x3b\xde\x46\x52\x56\x34\x2a\x92\x83\x4d\x3a\x7b" + "\x94\xe7\xc2\x06\x5b\x8c\xf4\x9d\x71\x9d\x00\x73\xd9\x15\x81" + "\x12\x1a\x0c\x9e\xd8\xa6\xa6\xd8\x62\xbe\xfe\xa3\x7c\xc5\xd0" + "\x71\xdd\x83\xed\xcf\x71\xd8\xe5\x72\x27\xcb\xce\xd7\x06\xda" + "\xe8\x4b\xb8\x8d\x45\xc0\x9c\xe3\x13\x27\xbf\x60\x50\x85\xbf" + "\xd1\xfc\x8c\x41\x75\x2d\x51\x83\x24\x06\xcb\xe6\x98\x8e\x0d" + "\x35\xfa\x58\x34\x43\x90\x55\x6a\x40\xc9\x78\x31\xfb\x28\x8b" + "\x10\x78\x46\x59\x49\xf5\x89\x1c\x66\xc0\x6e\x6b\x73\x05\x75" + "\x83\x2b\x86\x78\x02\xc1\xb0\xf1\x2a\x6e\x7e\xf6\x65\x8f\xe3" + "\xc2\x02\x6d\xae\x03\xc5\xef\x41\x03\x3a\x6b\xeb\xb0\xab\x6a" + "\x27\x2e\xcb\x13\xf5\xd3\xae\x11\x18\x33\x6a\xc3\x08\x7a\xf8" + "\xb9\xd7\xf3\x37\xee\x05\x32\xd9\xb5\xa4\xb9\xeb\x67\xa8\x84" + "\xeb\xb2\xc3\x2f\x8a\x8f\xa7\x24\xac\x9a\x24\x91\x11\x70\xab" + "\xc5\x05\x25\xa9\xd3\x93\x17\x6d\x70\xb1\x67\x60\x6b\x50\x69" + "\xdd\x22\x8b\x6a\xa9\x11\x7e\x5e\x09\xa8\xaa\xdc\x4a\xc8\x09" + "\x4c\x1a\xe7\x4c\x1e\x42\xb2\x27\x9d\xa9\x1b\xa3\x59\x14\xcb" + "\x0b\xca\xff\x6e\x8d\x8e\x38\xf6\x19\xb1\x81\x5f\xf4\x7d\x81" + "\x82\x01\x00\x42\xb7\x2f\x8c\x2b\x94\x61\x70\x46\x27\xce\xab" + "\xa2\x76\xe4\xdd\x74\xc3\x6a\xd0\x94\xaf\xba\x17\xc7\x30\xba" + "\x9c\x3e\x80\x6e\x9d\xca\x9f\x10\xbf\x54\x41\xce\x64\x92\x0f" + "\xd1\xc5\xae\xa1\x0a\xf3\xb2\x0b\x37\xed\x93\xef\x4c\xb1\x49" + "\x83\x26\xfa\x60\x84\x7e\xb4\x8b\x17\x5a\xe7\xa0\xba\xd5\x9e" + "\xa8\x47\x6e\x30\xcb\xd1\xab\x7d\x13\xef\xc6\xb5\xcf\xcd\x38" + "\x10\x11\xce\xed\x08\xbf\x83\x52\xc2\xd8\x8c\xc6\x59\x18\x9a" + "\x6b\x87\x96\x01\x3f\x0c\xe2\xc1\x46\x70\x3f\xa6\xb2\x64\x3d" + "\xcf\x97\x19\x2b\x52\xe4\xed\x9a\x50\x52\xb2\xad\xbe\x1b\x11" + "\xf6\x5e\x36\x24\xce\x3a\x21\xe5\x20\x43\xf7\xb7\x9d\xf7\x54" + "\xfa\x12\x93\x9a\xbf\x64\x68\x65\xd3\xec\xa1\x70\x0e\x10\x0a" + "\x7a\x73\x38\xcb\x57\x07\xf4\xfb\xaf\xec\x9c\x7a\xaa\x8d\x31" + "\xa1\xb4\xfe\x24\xb4\xf1\x9d\x33\x9b\x79\xcc\xec\xc2\x76\x9a" + "\x7d\x43\xb8\xc0\x7e\xc6\x42\x54\x1d\x72\x5d\xb2\xfd\x90\x96" + "\x15\x0f\x18\x36\xe7\x77\xdf\xe5\x4b\xbe\xd7\x94\x87\x0c\xff" + "\x2c\xfb\xa2\x0e\x8c\x1f\x93\xa5\xd5\x3b\x0b\x63\x3a\xea\x87" + "\xce\x77\x62\xa4\x1f\x2c\x7e\xe5\x08\xa4\x9b\x62\x12\x9c\x06" + "\x25\x04\x95\xb3\xa4\x64\x80\x20\x3b\x07\x0f\xe5\x29\x34\xd9" + "\x17\xf5\x06\x00\xb8\x87\x2f\xcf\x89\x52\x70\xcc\x04\x92\xe1" + "\x67\xcb\xba\xbb\x10\xa6\x2d\x06\xa4\x6b\x81\x40\x09\xc4\x1d" + "\xc3\x8e\x6c\xd6\x04\xb7\x9e\x8c\x8b\x30\x65\x88\x43\xc7\xc6" + "\xe5\xa0\xb0\x4c\x60\xee\xb7\x1d\x69\x2a\xb7\x5d\x5f\x16\x53" + "\xd1\xe6\x6a\x74\x5d\x63\xc0\x41\x30\x6a\x58\xce\x52\xf2\xdb" + "\x41\x03\x78\xfd\x7f\x0e\xa5\xc1\xe4\xd2\x50\x8d\x97\x1d\xf9" + "\x06\xa1\x81\xd3\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1\x75" + "\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21\x2c" + "\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1\x2b" + "\x80\x20\xa2\xe5\x7d\x5a\xe0\xaa\xd0\xcc\x00\x52\x58\xad\xd1" + "\x49\xaf\xc1\x16\xb4\x66\x7b\x1e\x04\xa1\xe2\xf6\xfa\x57\x84" + "\x7f\x8b\xee\x55\x81\x03\x02\x18\x23\x82\x02\x03\xb8\xa2\x2b" + "\x80\x20\x88\x40\x2d\x0d\x6a\x33\x4c\x14\x49\xbd\x34\x72\x96" + "\xb9\x4d\xf7\xd1\x21\x4c\xff\x95\xa2\x84\xf3\xa6\x8b\xb6\x3d" + "\x42\x97\x27\x41\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3\x27" + "\x80\x20\x8d\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57\xca" + "\xf4\x9d\x63\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9\xc6" + "\xa3\xf1\x33\xfd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x95\x3c" + "\x86\x65\x91\x76\x69\x6b\x72\x61\xaa\x76\x15\x2a\xd7\x25\x4f" + "\x32\xb7\x73\x7a\xb2\x49\x0c\x0b\xdf\xb5\x4e\x4a\x8b\xf7\x65" + "\x81\x03\x02\x00\x00"s; + auto const thresh0EncodedCondition = + "\xa2\x2b\x80\x20\xf3\x10\x98\x21\x80\x98\xf1\x5f\xae\x19\x04" + "\xa3\x6c\x35\xd4\xf8\x04\xb2\x3c\xde\xad\x82\x29\x7e\x6e\xd3" + "\x6b\xb8\xd9\xcd\xf8\x03\x81\x03\x0a\x84\x23\x82\x02\x03\xd8"s; + auto const thresh0EncodedFingerprint = + "\x30\x82\x01\x80\x80\x01\x04\xa1\x82\x01\x79\xa0\x25\x80\x20" + "\x5d\xa0\x30\xef\xfd\xe1\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a" + "\x5b\xd1\x5c\xc9\x33\x21\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58" + "\xeb\x4e\x81\x01\x09\xa0\x25\x80\x20\x5d\xa0\x30\xef\xfd\xe1" + "\x75\x11\x51\xe8\x5f\x5e\x54\x2d\x6a\x5b\xd1\x5c\xc9\x33\x21" + "\x2c\xe2\x68\xfc\xfd\x53\xee\x93\x58\xeb\x4e\x81\x01\x09\xa1" + "\x2b\x80\x20\xa2\xe5\x7d\x5a\xe0\xaa\xd0\xcc\x00\x52\x58\xad" + "\xd1\x49\xaf\xc1\x16\xb4\x66\x7b\x1e\x04\xa1\xe2\xf6\xfa\x57" + "\x84\x7f\x8b\xee\x55\x81\x03\x02\x18\x23\x82\x02\x03\xb8\xa2" + "\x2b\x80\x20\x3c\x87\xc9\xf7\x46\x52\x3a\x53\x2b\xcc\x10\x47" + "\x73\x24\x8e\x84\x11\xac\xfb\xed\xf3\xa0\x01\x94\x68\x00\x8d" + "\x66\xc9\x7e\x83\x96\x81\x03\x04\x38\x00\x82\x02\x03\x98\xa2" + "\x2b\x80\x20\x88\x40\x2d\x0d\x6a\x33\x4c\x14\x49\xbd\x34\x72" + "\x96\xb9\x4d\xf7\xd1\x21\x4c\xff\x95\xa2\x84\xf3\xa6\x8b\xb6" + "\x3d\x42\x97\x27\x41\x81\x03\x02\x10\x00\x82\x02\x03\x98\xa3" + "\x27\x80\x20\x78\xe3\x04\xf4\xa6\x16\x68\x4c\x1b\xcf\x3a\x32" + "\xff\xbc\x75\x1a\xe6\x08\x9b\xff\xba\x79\xf4\x39\x7a\xfc\xe1" + "\x6f\xff\x3e\xb3\x75\x81\x03\x01\x00\x00\xa3\x27\x80\x20\x8d" + "\xb0\x2c\xb1\x28\xc3\xf4\x97\x50\x84\x64\x57\xca\xf4\x9d\x63" + "\x08\x73\xfc\xde\x2f\x90\xf0\xf2\xec\x79\xa9\xc6\xa3\xf1\x33" + "\xfd\x81\x03\x01\x00\x00\xa4\x27\x80\x20\x0d\xea\xc5\x16\x5c" + "\x62\xb8\xd1\xa4\xe7\x5a\x07\x58\x00\x79\x51\x88\x21\xe9\x4d" + "\xba\x73\x7b\xad\x60\x9c\x5c\x26\x00\x2e\xd1\x51\x81\x03\x02" + "\x00\x00\xa4\x27\x80\x20\x95\x3c\x86\x65\x91\x76\x69\x6b\x72" + "\x61\xaa\x76\x15\x2a\xd7\x25\x4f\x32\xb7\x73\x7a\xb2\x49\x0c" + "\x0b\xdf\xb5\x4e\x4a\x8b\xf7\x65\x81\x03\x02\x00\x00"s; + check( + std::move(thresh0), + thresh0Msg, + std::move(thresh0EncodedFulfillment), + thresh0EncodedCondition, + thresh0EncodedFingerprint); + } + } + + void + run() + { + testThresh0(); + testThresh1(); + testThresh2(); + testThresh3(); + testThresh4(); + testThresh5(); + testThresh6(); + testThresh7(); + testThresh8(); + testThresh9(); + testThresh10(); + testThresh11(); + testThresh12(); + testThresh13(); + testThresh14(); + testThresh15(); + testThresh16(); + testThresh17(); + testThresh18(); + testThresh19(); + testThresh20(); + testThresh21(); + testThresh22(); + testThresh23(); + testThresh24(); + testThresh25(); + testThresh26(); + testThresh27(); + testThresh28(); + testThresh29(); + testThresh30(); + testThresh31(); + testThresh32(); + testThresh33(); + testThresh34(); + testThresh35(); + testThresh36(); + testThresh37(); + testThresh38(); + testThresh39(); + testThresh40(); + testThresh41(); + testThresh42(); + testThresh43(); + testThresh44(); + testThresh45(); + testThresh46(); + testThresh47(); + testThresh48(); + testThresh49(); + testThresh50(); + testThresh51(); + testThresh52(); + testThresh53(); + testThresh54(); + testThresh55(); + testThresh56(); + testThresh57(); + testThresh58(); + testThresh59(); + testThresh60(); + testThresh61(); + testThresh62(); + testThresh63(); + testThresh64(); + testThresh65(); + testThresh66(); + testThresh67(); + testThresh68(); + testThresh69(); + testThresh70(); + testThresh71(); + } +}; + +BEAST_DEFINE_TESTSUITE(Conditions_thresh, conditions, ripple); +} // cryptoconditions +} // ripple diff --git a/src/test/conditions/DerChoice.cpp b/src/test/conditions/DerChoice.cpp new file mode 100644 index 00000000000..8a92ca4388f --- /dev/null +++ b/src/test/conditions/DerChoice.cpp @@ -0,0 +1,533 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include + +namespace ripple { + +namespace test { + +DerChoiceDerived1::DerChoiceDerived1( + std::vector const& b, + std::vector> sub, + std::int32_t si) + : buf_(makeSlice(b)), subChoices_(std::move(sub)), signedInt_(si) +{ +} + +std::uint8_t +DerChoiceDerived1::type() const +{ + return 1; +} + +template +void +DerChoiceDerived1::withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache) +{ + auto subAsSeq = cryptoconditions::der::make_sequence(subChoices_); + f(std::tie(buf_, subAsSeq, signedInt_)); +} + +template +void DerChoiceDerived1::withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache) const +{ + auto subAsSeq = cryptoconditions::der::make_sequence(subChoices_); + f(std::tie(buf_, subAsSeq, signedInt_)); +} + +std::uint64_t +DerChoiceDerived1::derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleEncodedLengthHelper( + *this, parentGroupType, encoderTagMode, traitsCache); +} + +void +DerChoiceDerived1::encode(cryptoconditions::der::Encoder& encoder) const +{ + cryptoconditions::der::withTupleEncodeHelper(*this, encoder); +} + +void +DerChoiceDerived1::decode(cryptoconditions::der::Decoder& decoder) +{ + cryptoconditions::der::withTupleDecodeHelper(*this, decoder); +} + +int +DerChoiceDerived1::compare( + DerChoiceBaseClass const& rhs, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleCompareHelper( + *this, rhs, traitsCache); +} + +void +DerChoiceDerived1::print(std::ostream& ostr, bool ordered) const +{ + ostr << "{d1;\n" << signedInt_ << ";\n"; + auto const d = buf_.data(); + ostr << '{'; + for (std::size_t i = 0; i < buf_.size(); ++i) + { + if (i) + ostr << ", "; + ostr << int(d[i]); + } + ostr << "};"; + ostr << '{'; + for (auto const& c : subChoices_) + c->print(ostr, ordered); + ostr << "}\n}\n"; +} + +bool +operator==(DerChoiceDerived1 const& lhs, DerChoiceDerived1 const& rhs) +{ + if (lhs.buf_ != rhs.buf_ || lhs.signedInt_ != rhs.signedInt_ || + lhs.subChoices_.size() != rhs.subChoices_.size()) + return false; + + for (size_t i = 0; i < lhs.subChoices_.size(); ++i) + if (!equal(lhs.subChoices_[i], rhs.subChoices_[i])) + return false; + return true; +} + +bool +operator!=(DerChoiceDerived1 const& lhs, DerChoiceDerived1 const& rhs) +{ + return !(lhs == rhs); +} + +DerChoiceDerived2::DerChoiceDerived2(std::string const& n, std::uint64_t i) : name_(n), id_(i) +{ +} + +std::uint8_t +DerChoiceDerived2::type() const +{ + return 2; +} + +template +void +DerChoiceDerived2::withTuple( + F&& f, + cryptoconditions::der::TraitsCache& traitsCache) +{ + f(std::tie(name_, id_)); +} + +template +void +DerChoiceDerived2::withTuple( + F&& f, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + f(std::tie(name_, id_)); +} + +std::uint64_t +DerChoiceDerived2::derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleEncodedLengthHelper( + *this, parentGroupType, encoderTagMode, traitsCache); +} + +void +DerChoiceDerived2::encode(cryptoconditions::der::Encoder& encoder) const +{ + cryptoconditions::der::withTupleEncodeHelper(*this, encoder); +} + +void +DerChoiceDerived2::decode(cryptoconditions::der::Decoder& decoder) +{ + cryptoconditions::der::withTupleDecodeHelper(*this, decoder); +} + +int +DerChoiceDerived2::compare(DerChoiceBaseClass const& rhs, cryptoconditions::der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleCompareHelper(*this, rhs, traitsCache); +} + +void +DerChoiceDerived2::print(std::ostream& ostr, bool ordered) const +{ + ostr << "{d2;\n" << name_ << ";\n" << id_ << ";}\n"; +} + +bool +operator==(DerChoiceDerived2 const& lhs, DerChoiceDerived2 const& rhs) +{ + return lhs.name_ == rhs.name_ && lhs.id_ == rhs.id_; +} + +bool +operator!=(DerChoiceDerived2 const& lhs, DerChoiceDerived2 const& rhs) +{ + return !(lhs == rhs); +} + +DerChoiceDerived3::DerChoiceDerived3(std::vector> sub) + : subChoices_(std::move(sub)) +{ +} + +std::uint8_t DerChoiceDerived3::type() const { return 3; } + +template +void +DerChoiceDerived3::withTuple( + F&& f, + cryptoconditions::der::TraitsCache& traitsCache) +{ + auto subAsSet = cryptoconditions::der::make_set(subChoices_, traitsCache); + f(std::tie(subAsSet)); +} + +template +void +DerChoiceDerived3::withTuple( + F&& f, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + auto subAsSet = cryptoconditions::der::make_set(subChoices_, traitsCache); + f(std::tie(subAsSet)); +} + +std::uint64_t +DerChoiceDerived3::derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleEncodedLengthHelper( + *this, parentGroupType, encoderTagMode, traitsCache); +} + +void +DerChoiceDerived3::encode(cryptoconditions::der::Encoder& encoder) const +{ + cryptoconditions::der::withTupleEncodeHelper(*this, encoder); +} + +void +DerChoiceDerived3::decode(cryptoconditions::der::Decoder& decoder) +{ + cryptoconditions::der::withTupleDecodeHelper(*this, decoder); +} + +int +DerChoiceDerived3::compare( + DerChoiceBaseClass const& rhs, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleCompareHelper(*this, rhs, traitsCache); +} + +void +DerChoiceDerived3::print(std::ostream& ostr, bool ordered) const +{ + ostr << "{d3;\n"; + ostr << '{'; + if (!ordered) + { + for (auto const& c : subChoices_) + c->print(ostr, ordered); + } + else + { + cryptoconditions::der::TraitsCache dummy; + auto const wrapped = cryptoconditions::der::make_set(subChoices_, dummy); + for(auto i : wrapped.sortOrder_) + subChoices_[i]->print(ostr, ordered); + } + ostr << "}\n}\n"; +} + +bool +operator==(DerChoiceDerived3 const& lhs, DerChoiceDerived3 const& rhs) +{ + if (lhs.subChoices_.size() != rhs.subChoices_.size()) + return false; + + // Order doesn't matter (these are der sets + std::vector rhsChoices; + rhsChoices.reserve(rhs.subChoices_.size()); + for (auto const& s : rhs.subChoices_) + rhsChoices.push_back(s.get()); + + for (size_t i = 0; i < lhs.subChoices_.size(); ++i) + { + auto rhsIt = std::find_if( + rhsChoices.begin(), rhsChoices.end(), [&](auto elem) { + return equal(elem, lhs.subChoices_[i].get()); + }); + if (rhsIt == rhsChoices.end()) + return false; + *rhsIt = nullptr; // let it be found exactly once + } + return true; +} + +bool +operator!=(DerChoiceDerived3 const& lhs, DerChoiceDerived3 const& rhs) +{ + return !(lhs == rhs); +} + +DerChoiceDerived4::DerChoiceDerived4(std::vector> sub) + : subChoices_(std::move(sub)) +{ +} + +std::uint8_t +DerChoiceDerived4::type() const +{ + return 4; +} + +template +void +DerChoiceDerived4::withTuple( + F&& f, + cryptoconditions::der::TraitsCache& traitsCache) +{ + auto subAsSeq = cryptoconditions::der::make_sequence(subChoices_); + f(std::tie(subAsSeq)); +} + +template +void +DerChoiceDerived4::withTuple( + F&& f, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + auto subAsSeq = cryptoconditions::der::make_sequence(subChoices_); + f(std::tie(subAsSeq)); +} + +std::uint64_t +DerChoiceDerived4::derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleEncodedLengthHelper( + *this, parentGroupType, encoderTagMode, traitsCache); +} + +void +DerChoiceDerived4::encode(cryptoconditions::der::Encoder& encoder) const +{ + cryptoconditions::der::withTupleEncodeHelper(*this, encoder); +} + +void +DerChoiceDerived4::decode(cryptoconditions::der::Decoder& decoder) +{ + cryptoconditions::der::withTupleDecodeHelper(*this, decoder); +} + +int +DerChoiceDerived4::compare( + DerChoiceBaseClass const& rhs, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleCompareHelper( + *this, rhs, traitsCache); +} + +void +DerChoiceDerived4::print(std::ostream& ostr, bool ordered) const +{ + ostr << "{d4;\n"; + ostr << '{'; + for (auto const& c : subChoices_) + c->print(ostr, ordered); + ostr << "}\n}\n"; +} + +bool +operator==(DerChoiceDerived4 const& lhs, DerChoiceDerived4 const& rhs) +{ + if (lhs.subChoices_.size() != rhs.subChoices_.size()) + return false; + + for (size_t i = 0; i < lhs.subChoices_.size(); ++i) + if (!equal(lhs.subChoices_[i], rhs.subChoices_[i])) + return false; + return true; +} + +bool +operator!=(DerChoiceDerived4 const& lhs, DerChoiceDerived4 const& rhs) +{ + return !(lhs == rhs); +} + +DerChoiceDerived5::DerChoiceDerived5( + std::unique_ptr sub, + std::string const& n, + std::uint64_t i) + : subChoice_(std::move(sub)), name_{n}, id_{i} +{ +} + +std::uint8_t +DerChoiceDerived5::type() const +{ + return 5; +} + +template +void +DerChoiceDerived5::withTuple( + F&& f, + cryptoconditions::der::TraitsCache& traitsCache) +{ + f(std::tie(subChoice_, name_, id_)); +} + +template +void +DerChoiceDerived5::withTuple( + F&& f, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + f(std::tie(subChoice_, name_, id_)); +} + +std::uint64_t +DerChoiceDerived5::derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleEncodedLengthHelper( + *this, parentGroupType, encoderTagMode, traitsCache); +} + +void +DerChoiceDerived5::encode(cryptoconditions::der::Encoder& encoder) const +{ + cryptoconditions::der::withTupleEncodeHelper(*this, encoder); +} + +void +DerChoiceDerived5::decode(cryptoconditions::der::Decoder& decoder) +{ + cryptoconditions::der::withTupleDecodeHelper(*this, decoder); +} + +int +DerChoiceDerived5::compare( + DerChoiceBaseClass const& rhs, + cryptoconditions::der::TraitsCache& traitsCache) const +{ + return cryptoconditions::der::withTupleCompareHelper( + *this, rhs, traitsCache); +} + +void +DerChoiceDerived5::print(std::ostream& ostr, bool ordered) const +{ + ostr << "{d5;\n" << name_ << ";\n" << id_ << ";"; + ostr << '{'; + if (subChoice_) + subChoice_->print(ostr, ordered); + ostr << "}\n}\n"; +} + +bool +operator==(DerChoiceDerived5 const& lhs, DerChoiceDerived5 const& rhs) +{ + return lhs.name_ == rhs.name_ && lhs.id_ == rhs.id_ && + lhs.subChoice_ == rhs.subChoice_; +} + +bool +operator!=(DerChoiceDerived5 const& lhs, DerChoiceDerived5 const& rhs) +{ + return !(lhs == rhs); +} + +bool +equal(DerChoiceBaseClass const* lhs, DerChoiceBaseClass const* rhs) +{ + if (bool(lhs) != bool(rhs)) + return false; + if (!lhs && !rhs) + return true; + if (auto plhs = dynamic_cast(lhs)) + { + if (auto prhs = dynamic_cast(rhs)) + { + return *plhs == *prhs; + } + return false; + } + if (auto plhs = dynamic_cast(lhs)) + { + if (auto prhs = dynamic_cast(rhs)) + { + return *plhs == *prhs; + } + return false; + } + if (auto plhs = dynamic_cast(lhs)) + { + if (auto prhs = dynamic_cast(rhs)) + { + return *plhs == *prhs; + } + return false; + } + if (auto plhs = dynamic_cast(lhs)) + { + if (auto prhs = dynamic_cast(rhs)) + { + return *plhs == *prhs; + } + return false; + } + if (auto plhs = dynamic_cast(lhs)) + { + if (auto prhs = dynamic_cast(rhs)) + { + return *plhs == *prhs; + } + return false; + } + return false; +} + +} // test +} // ripple diff --git a/src/test/conditions/DerChoice.h b/src/test/conditions/DerChoice.h new file mode 100644 index 00000000000..61ebd2e02e0 --- /dev/null +++ b/src/test/conditions/DerChoice.h @@ -0,0 +1,460 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_TEST_CONDITIONS_DERCHOICE_H_INCLUDED +#define RIPPLE_TEST_CONDITIONS_DERCHOICE_H_INCLUDED + +#include + +#include +#include +#include + +#include + +namespace ripple { + +namespace test { + +struct DerChoiceBaseClass +{ + virtual ~DerChoiceBaseClass() = default; + + virtual std::uint8_t + type() const = 0; + + virtual + void + encode(cryptoconditions::der::Encoder& s) const = 0; + + virtual + void + decode(cryptoconditions::der::Decoder& s) = 0; + + virtual int + compare( + DerChoiceBaseClass const& rhs, + cryptoconditions::der::TraitsCache& traitsCache) const = 0; + + virtual + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const = 0; + + // for debugging + virtual + void + print(std::ostream& ostr, bool ordered=false) const = 0; +}; + +bool +equal(DerChoiceBaseClass const* lhs, DerChoiceBaseClass const* rhs); + +inline +bool +equal( + std::unique_ptr const& lhs, + std::unique_ptr const& rhs) +{ + return equal(lhs.get(), rhs.get()); +} + +inline +bool +operator==( + std::unique_ptr const& lhs, + std::unique_ptr const& rhs) +{ + return equal(lhs, rhs); +} + +inline +bool +operator!=( + std::unique_ptr const& lhs, + std::unique_ptr const& rhs) +{ + return !operator==(lhs, rhs); +} + +struct DerChoiceDerived1 : DerChoiceBaseClass +{ + Buffer buf_; + std::vector> subChoices_; + std::int32_t signedInt_; + + DerChoiceDerived1() = default; + + DerChoiceDerived1( + std::vector const& b, + std::vector> sub, + std::int32_t si); + + template + void withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache); + + template + void withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache) const; + + std::uint8_t + type() const override; + + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const override; + + void + encode(cryptoconditions::der::Encoder& encoder) const override; + + void + decode(cryptoconditions::der::Decoder& decoder) override; + + int + compare( + DerChoiceBaseClass const& rhs, + cryptoconditions::der::TraitsCache& traitsCache) const override; + + void + print(std::ostream& ostr, bool ordered=false) const override; + + friend + bool + operator==(DerChoiceDerived1 const& lhs, DerChoiceDerived1 const& rhs); + + friend + bool + operator!=(DerChoiceDerived1 const& lhs, DerChoiceDerived1 const& rhs); +}; + +struct DerChoiceDerived2 : DerChoiceBaseClass +{ + std::string name_; + std::uint64_t id_; + + DerChoiceDerived2() = default; + + DerChoiceDerived2(std::string const& n, std::uint64_t i); + + template + void + withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache); + + template + void + withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache) const; + + std::uint8_t + type() const override; + + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const override; + + void + encode(cryptoconditions::der::Encoder& encoder) const override; + + void + decode(cryptoconditions::der::Decoder& decoder) override; + + int + compare( + DerChoiceBaseClass const& rhs, + cryptoconditions::der::TraitsCache& traitsCache) const override; + + void + print(std::ostream& ostr, bool ordered=false) const override; + + friend + bool + operator==(DerChoiceDerived2 const& lhs, DerChoiceDerived2 const& rhs); + + friend + bool + operator!=(DerChoiceDerived2 const& lhs, DerChoiceDerived2 const& rhs); +}; + +struct DerChoiceDerived3 : DerChoiceBaseClass +{ + // DER set + std::vector> subChoices_; + + DerChoiceDerived3() = default; + + DerChoiceDerived3(std::vector> sub); + + template + void withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache); + + template + void withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache) const; + + std::uint8_t + type() const override; + + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const override; + + void + encode(cryptoconditions::der::Encoder& encoder) const override; + + void + decode(cryptoconditions::der::Decoder& decoder) override; + + int + compare( + DerChoiceBaseClass const& rhs, + cryptoconditions::der::TraitsCache& traitsCache) const override; + + void + print(std::ostream& ostr, bool ordered=false) const override; + + friend + bool + operator==(DerChoiceDerived3 const& lhs, DerChoiceDerived3 const& rhs); + + friend + bool + operator!=(DerChoiceDerived3 const& lhs, DerChoiceDerived3 const& rhs); +}; + +struct DerChoiceDerived4 : DerChoiceBaseClass +{ + // DER set + std::vector> subChoices_; + + DerChoiceDerived4() = default; + + DerChoiceDerived4(std::vector> sub); + + template + void + withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache); + + template + void + withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache) const; + + std::uint8_t + type() const override; + + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const override; + + void + encode(cryptoconditions::der::Encoder& encoder) const override; + + void + decode(cryptoconditions::der::Decoder& decoder) override; + + int + compare( + DerChoiceBaseClass const& rhs, + cryptoconditions::der::TraitsCache& traitsCache) const override; + + void + print(std::ostream& ostr, bool ordered=false) const override; + + friend + bool + operator==(DerChoiceDerived4 const& lhs, DerChoiceDerived4 const& rhs); + + friend + bool + operator!=(DerChoiceDerived4 const& lhs, DerChoiceDerived4 const& rhs); +}; + +struct DerChoiceDerived5 : DerChoiceBaseClass +{ + std::unique_ptr subChoice_; + std::string name_; + std::uint64_t id_; + + DerChoiceDerived5() = default; + + DerChoiceDerived5( + std::unique_ptr sub, + std::string const& n, + std::uint64_t i); + + template + void + withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache); + + template + void + withTuple(F&& f, cryptoconditions::der::TraitsCache& traitsCache) const; + + std::uint8_t + type() const override; + + std::uint64_t + derEncodedLength( + boost::optional const& parentGroupType, + cryptoconditions::der::TagMode encoderTagMode, + cryptoconditions::der::TraitsCache& traitsCache) const override; + + void + encode(cryptoconditions::der::Encoder& encoder) const override; + + void + decode(cryptoconditions::der::Decoder& decoder) override; + + int + compare( + DerChoiceBaseClass const& rhs, + cryptoconditions::der::TraitsCache& traitsCache) const override; + + void + print(std::ostream& ostr, bool ordered=false) const override; + + friend + bool + operator==(DerChoiceDerived5 const& lhs, DerChoiceDerived5 const& rhs); + + friend + bool + operator!=(DerChoiceDerived5 const& lhs, DerChoiceDerived5 const& rhs); +}; + +} // test + +namespace cryptoconditions { +namespace der { +template <> +struct DerCoderTraits> +{ + constexpr static GroupType + groupType() + { + return GroupType::choice; + } + constexpr static ClassId + classId() + { + return ClassId::contextSpecific; + } + static boost::optional const& + tagNum() + { + static boost::optional tn; + return tn; + } + static std::uint8_t + tagNum(std::unique_ptr const& f) + { + assert(f); + return f->type(); + } + constexpr static bool + primitive() + { + return false; + } + + static void + encode(Encoder& encoder, std::unique_ptr const& b) + { + b->encode(encoder); + } + + static void + decode(Decoder& decoder, std::unique_ptr& v) + { + auto const parentTag = decoder.parentTag(); + if (!parentTag) + { + decoder.ec_ = make_error_code(Error::logicError); + return; + } + + if (parentTag->classId != classId()) + { + decoder.ec_ = make_error_code(Error::preambleMismatch); + return; + } + + switch (parentTag->tagNum) + { + case 1: + v = std::make_unique(); + break; + case 2: + v = std::make_unique(); + break; + case 3: + v = std::make_unique(); + break; + case 4: + v = std::make_unique(); + break; + case 5: + v = std::make_unique(); + break; + default: + decoder.ec_ = make_error_code(der::Error::unknownChoiceTag); + } + + if (v) + v->decode(decoder); + + if (decoder.ec_) + v.reset(); + } + + static std::uint64_t + length( + std::unique_ptr const& v, + boost::optional const& parentGroupType, + TagMode encoderTagMode, + TraitsCache& traitsCache) + { + auto const l = v->derEncodedLength(groupType(), encoderTagMode, traitsCache); + if (encoderTagMode == TagMode::automatic) + return l; + + auto const cll = contentLengthLength(l); + return 1 + cll + l; + } + + static int + compare( + std::unique_ptr const& lhs, + std::unique_ptr const& rhs, + TraitsCache& traitsCache) + { + return lhs->compare(*rhs, traitsCache); + } +}; +} // der +} // cryptoconditions +} // ripple + +#endif diff --git a/src/test/conditions/Der_test.cpp b/src/test/conditions/Der_test.cpp new file mode 100644 index 00000000000..ed8591eecf9 --- /dev/null +++ b/src/test/conditions/Der_test.cpp @@ -0,0 +1,1062 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2016 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include +#include +#include + +#include + +#include +#include +#include + +namespace ripple { +namespace test { + +class Der_test : public beast::unit_test::suite +{ + void + writeBuf(std::vector const& b) + { + using namespace std; + ios::fmtflags f(cout.flags()); + + cerr << " " << hex; + cerr << '{'; + for (auto&& e : b) + cerr << " " << setw(2) << setfill('0') << int(uint8_t(e)); + cerr << " }"; + + cerr.flags(f); + } + template + void + writeDiff( + T const& v, + std::vector const& expected, + std::vector const& encoded) + { + size_t const maxOutput = 64; + if (expected.size() > maxOutput || encoded.size() > maxOutput) + { + std::vector const shortExp{ + expected.begin(), + expected.begin() + std::min(maxOutput, expected.size())}; + std::vector const shortEnc{ + encoded.begin(), + encoded.begin() + std::min(maxOutput, encoded.size())}; + writeDiff(v, shortExp, shortEnc); + return; + } + // std::cerr << v << '\n'; + writeBuf(expected); + std::cerr << '\n'; + writeBuf(encoded); + std::cerr << "\n\n"; + }; + + template + void + test( + T const& v, + std::vector const& expected, + cryptoconditions::der::TagMode tagMode = + cryptoconditions::der::TagMode::direct) + { + using namespace cryptoconditions::der; + { + Encoder s{tagMode}; + s << v << eos; + std::error_code ec; + auto const& encoded = s.serializationBuffer(ec); + if (expected != encoded) + writeDiff(v, expected, encoded); + BEAST_EXPECT(!s.ec() && !ec && expected == encoded); + } + + { + Decoder s(makeSlice(expected), tagMode); + T decoded{}; + s >> decoded >> eos; + BEAST_EXPECT(decoded == v); + BEAST_EXPECT(!s.ec()); + if (decoded != v || s.ec()) + { + std::cerr << "Decoded mismatch: " << s.ec().message() << '\n'; + } + } + } + + template + void + test( + T const& v, + std::string const& expected, + cryptoconditions::der::TagMode tagMode = + cryptoconditions::der::TagMode::direct) + { + std::vector ev(expected.begin(), expected.end()); + test(v, ev, tagMode); + } + + static + int + vecCmp(std::vector const& lhs, std::vector const& rhs) + { + auto const lhsL = lhs.size(); + auto const rhsL = rhs.size(); + auto const commonL = std::min(lhsL, rhsL); + for (size_t i = 0; i < commonL; ++i) + { + auto const lhsV = static_cast(lhs[i]); + auto const rhsV = static_cast(rhs[i]); + + if (lhsV != rhsV) + { + if (lhsV < rhsV) + return -1; + return 1; + } + } + + return (lhsL > rhsL) - (lhsL < rhsL); + }; + + void + testInts() + { + testcase("ints"); + + using v = std::vector; + test(0u, v{2, 1, 0}); + test(1u, v{2, 1, 1}); + test(0xffu, v{2, 2, 0, -1}); + test(0xfeu, v{2, 2, 0, -2}); + test(-1, v{2, 1, -1}); + test(-2, v{2, 1, -2}); + test(std::int32_t(0xffffff00), v{2, 2, -1, 0}); + test(std::uint32_t(0xfffffffe), v{2, 5, 0, -1, -1, -1, -2}); + // make sure writes initial zero octet when skipping zeros + test(std::int32_t(210), v{2, 2, 0, -46}); + test(std::uint64_t(0x101), v{2, 2, 1, 1}); + test(std::uint64_t(0x1000), v{2, 2, 16, 0}); + test(std::uint64_t(0x10001), v{2, 3, 1, 0, 1}); + test(std::uint64_t(0x100000), v{2, 3, 16, 0, 0}); + test(std::uint64_t(0x1001001), v{2, 4, 1, 0, 16, 1}); + test(std::uint64_t(0x1001001), v{2, 4, 1, 0, 16, 1}); + test( + std::uint64_t(0x1000000000000000), + v{2, 8, 16, 0, 0, 0, 0, 0, 0, 0}); + + { + // test compare + std::vector>> cases = { + {std::make_pair(0, v{2, 1, 0}), + std::make_pair(1, v{2, 1, 1}), + std::make_pair(0xffu, v{2, 2, 0, -1}), + std::make_pair(0xfeu, v{2, 2, 0, -2}), + std::make_pair(-1, v{2, 1, -1}), + std::make_pair(-2, v{2, 1, -2}), + std::make_pair(std::int32_t(0xffffff00), v{2, 2, -1, 0}), + std::make_pair( + std::uint32_t(0xfffffffe), v{2, 5, 0, -1, -1, -1, -2}), + std::make_pair(210, v{2, 2, 0, -46}), + std::make_pair(0x101, v{2, 2, 1, 1}), + std::make_pair(0x1000, v{2, 2, 16, 0}), + std::make_pair(0x10001, v{2, 3, 1, 0, 1}), + std::make_pair(0x100000, v{2, 3, 16, 0, 0}), + std::make_pair(0x1001001, v{2, 4, 1, 0, 16, 1}), + std::make_pair(0x1001001, v{2, 4, 1, 0, 16, 1})}}; + + cryptoconditions::der::TraitsCache dummy; + for (auto i = cases.begin(), e = cases.end(); i != e; ++i) + { + using Traits = + cryptoconditions::der::DerCoderTraits; + this->BEAST_EXPECT( + Traits::compare(i->first, i->first, dummy) == 0); + for (auto j = i + 1; j != e; ++j) + { + this->BEAST_EXPECT( + boost::math::sign( + Traits::compare(i->first, j->first, dummy)) == + boost::math::sign(vecCmp(i->second, j->second))); + } + } + } + } + + void + testString() + { + testcase("octet string"); + auto makeTestCase = []( + size_t n, + std::vector const& expectedHeader, + char fillChar) -> std::pair> { + std::string s; + s.resize(n); + std::fill_n(s.begin(), n, fillChar); + std::vector expected(expectedHeader); + auto const headerEnd = expected.size(); + if (n) + { + expected.resize(headerEnd + n); + std::fill_n(&expected[headerEnd], n, fillChar); + } + return std::make_pair(s, expected); + }; + + std::vector>> cases = {{ + makeTestCase(0, {4, 0}, 'a'), + makeTestCase(0, {4, 0}, 'z'), + makeTestCase(1, {4, 1}, 'a'), + makeTestCase(1, {4, 1}, 'z'), + makeTestCase(127, {4, 127}, 'a'), + makeTestCase(127, {4, 127}, 'z'), + makeTestCase(128, {4, -127, -128}, 'a'), + makeTestCase(128, {4, -127, -128}, 'z'), + makeTestCase(66000, {4, -125, 1, 1, -48}, 'a'), + makeTestCase(66000, {4, -125, 1, 1, -48}, 'z'), + }}; + + cryptoconditions::der::TraitsCache dummy; + for (auto i = cases.begin(), e = cases.end(); i != e; ++i) + { + test(i->first, i->second); + using Traits = cryptoconditions::der::DerCoderTraits; + BEAST_EXPECT(Traits::compare(i->first, i->first, dummy) == 0); + for (auto j = i + 1; j != e; ++j) + { + this->BEAST_EXPECT( + boost::math::sign( + Traits::compare(i->first, j->first, dummy)) == + boost::math::sign(vecCmp(i->second, j->second))); + } + } + } + + void + testBitstring() + { + testcase("bit string"); + + using namespace std::string_literals; + + auto doTest = [this](auto const& col, auto numBitsParam) { + // visual studio can't handle bitset + constexpr typename decltype(numBitsParam)::value_type numBits = + decltype(numBitsParam)::value; + for (auto const& ts : col) + { + std::bitset bitset{ts.first}; + test(bitset, ts.second); + } + + using Traits = cryptoconditions::der::DerCoderTraits>; + // check that comare works + for(auto i = col.begin(), e=col.end(); i!=e; ++i) + { + std::bitset bitsetI{i->first}; + cryptoconditions::der::TraitsCache dummy; + this->BEAST_EXPECT(Traits::compare(bitsetI, bitsetI, dummy) == 0); + for(auto j = i+1; j!=e; ++j) + { + std::bitset bitsetJ{j->first}; + this->BEAST_EXPECT( + boost::math::sign( + Traits::compare(bitsetI, bitsetJ, dummy)) == + boost::math::sign(i->second.compare(j->second))); + } + } + }; + + { + // Test all combinations of last five bits + std::array, 32> + testCases = {{std::make_pair(0ull, "\x03\x02\x07\x00"s), + std::make_pair(1ull, "\x03\x02\x07\x80"s), + std::make_pair(2ull, "\x03\x02\x06\x40"s), + std::make_pair(3ull, "\x03\x02\x06\xc0"s), + std::make_pair(4ull, "\x03\x02\x05\x20"s), + std::make_pair(5ull, "\x03\x02\x05\xa0"s), + std::make_pair(6ull, "\x03\x02\x05\x60"s), + std::make_pair(7ull, "\x03\x02\x05\xe0"s), + std::make_pair(8ull, "\x03\x02\x04\x10"s), + std::make_pair(9ull, "\x03\x02\x04\x90"s), + std::make_pair(10ull, "\x03\x02\x04\x50"s), + std::make_pair(11ull, "\x03\x02\x04\xd0"s), + std::make_pair(12ull, "\x03\x02\x04\x30"s), + std::make_pair(13ull, "\x03\x02\x04\xb0"s), + std::make_pair(14ull, "\x03\x02\x04\x70"s), + std::make_pair(15ull, "\x03\x02\x04\xf0"s), + std::make_pair(16ull, "\x03\x02\x03\x08"s), + std::make_pair(17ull, "\x03\x02\x03\x88"s), + std::make_pair(18ull, "\x03\x02\x03\x48"s), + std::make_pair(19ull, "\x03\x02\x03\xc8"s), + std::make_pair(20ull, "\x03\x02\x03\x28"s), + std::make_pair(21ull, "\x03\x02\x03\xa8"s), + std::make_pair(22ull, "\x03\x02\x03\x68"s), + std::make_pair(23ull, "\x03\x02\x03\xe8"s), + std::make_pair(24ull, "\x03\x02\x03\x18"s), + std::make_pair(25ull, "\x03\x02\x03\x98"s), + std::make_pair(26ull, "\x03\x02\x03\x58"s), + std::make_pair(27ull, "\x03\x02\x03\xd8"s), + std::make_pair(28ull, "\x03\x02\x03\x38"s), + std::make_pair(29ull, "\x03\x02\x03\xb8"s), + std::make_pair(30ull, "\x03\x02\x03\x78"s), + std::make_pair(31ull, "\x03\x02\x03\xf8"s)}}; + doTest(testCases, std::integral_constant{}); + doTest(testCases, std::integral_constant{}); + } + + { + // test all combinations of five bits that straddle byte boundary + // between 2nd and 3rd byte: 2 bits in the second byte, 3 bits in + // the third byte + + std::array, 32> + testCases = { + {std::make_pair(0ull, "\x03\x02\x07\x00"s), + std::make_pair(16384ull, "\x03\x03\x01\x00\x02"s), + std::make_pair(32768ull, "\x03\x03\x00\x00\x01"s), + std::make_pair(49152ull, "\x03\x03\x00\x00\x03"s), + std::make_pair(65536ull, "\x03\x04\x07\x00\x00\x80"s), + std::make_pair(81920ull, "\x03\x04\x07\x00\x02\x80"s), + std::make_pair(98304ull, "\x03\x04\x07\x00\x01\x80"s), + std::make_pair(114688ull, "\x03\x04\x07\x00\x03\x80"s), + std::make_pair(131072ull, "\x03\x04\x06\x00\x00\x40"s), + std::make_pair(147456ull, "\x03\x04\x06\x00\x02\x40"s), + std::make_pair(163840ull, "\x03\x04\x06\x00\x01\x40"s), + std::make_pair(180224ull, "\x03\x04\x06\x00\x03\x40"s), + std::make_pair(196608ull, "\x03\x04\x06\x00\x00\xc0"s), + std::make_pair(212992ull, "\x03\x04\x06\x00\x02\xc0"s), + std::make_pair(229376ull, "\x03\x04\x06\x00\x01\xc0"s), + std::make_pair(245760ull, "\x03\x04\x06\x00\x03\xc0"s), + std::make_pair(262144ull, "\x03\x04\x05\x00\x00\x20"s), + std::make_pair(278528ull, "\x03\x04\x05\x00\x02\x20"s), + std::make_pair(294912ull, "\x03\x04\x05\x00\x01\x20"s), + std::make_pair(311296ull, "\x03\x04\x05\x00\x03\x20"s), + std::make_pair(327680ull, "\x03\x04\x05\x00\x00\xa0"s), + std::make_pair(344064ull, "\x03\x04\x05\x00\x02\xa0"s), + std::make_pair(360448ull, "\x03\x04\x05\x00\x01\xa0"s), + std::make_pair(376832ull, "\x03\x04\x05\x00\x03\xa0"s), + std::make_pair(393216ull, "\x03\x04\x05\x00\x00\x60"s), + std::make_pair(409600ull, "\x03\x04\x05\x00\x02\x60"s), + std::make_pair(425984ull, "\x03\x04\x05\x00\x01\x60"s), + std::make_pair(442368ull, "\x03\x04\x05\x00\x03\x60"s), + std::make_pair(458752ull, "\x03\x04\x05\x00\x00\xe0"s), + std::make_pair(475136ull, "\x03\x04\x05\x00\x02\xe0"s), + std::make_pair(491520ull, "\x03\x04\x05\x00\x01\xe0"s), + std::make_pair(507904ull, "\x03\x04\x05\x00\x03\xe0"s)}}; + doTest(testCases, std::integral_constant{}); + } + } + + void + testSequence() + { + testcase("sequence"); + + using namespace cryptoconditions::der; + { + cryptoconditions::der::Encoder s{TagMode::direct}; + { + std::vector v({10}); + s << make_sequence(v) << eos; + } + std::vector expected({48, 3, 2, 1, 10}); + std::error_code ec; + auto const& encoded = s.serializationBuffer(ec); + BEAST_EXPECT(!s.ec() && !ec && expected == encoded); + } + { + cryptoconditions::der::Encoder s{TagMode::direct}; + { + std::vector v({10, 100000, std::uint64_t(100000000000)}); + s << make_sequence(v) << eos; + } + std::vector + expected({48, 15, 2, 1, 10, 2, 3, 1, -122, -96, 2, 5, 23, + 72, 118, -24, 0}); + std::error_code ec; + auto const& encoded = s.serializationBuffer(ec); + BEAST_EXPECT(!s.ec() && !ec && expected == encoded); + } + + { + std::vector v({10, 100000, 100000000000}); + std::vector + expected({48, 15, 2, 1, 10, 2, 3, 1, -122, -96, 2, 5, 23, 72, 118, + -24, 0}); + std::error_code ec; + + Encoder encoder{TagMode::direct}; + encoder << make_sequence(v) << eos; + auto const& encoded = encoder.serializationBuffer(ec); + BEAST_EXPECT(!encoder.ec() && !ec && expected == encoded); + + Decoder decoder(makeSlice(encoded), TagMode::direct); + v.clear(); + decoder >> make_sequence(v) >> eos; + BEAST_EXPECT( + v.size() == 3 && v[0] == 10 && v[1] == 100000 && + v[2] == 100000000000); + BEAST_EXPECT(!decoder.ec()); + } + + { + std::string stringVal("hello"); + std::uint64_t intVal(42); + auto tup = std::tie(stringVal, intVal); + + Encoder encoder{TagMode::direct}; + encoder << tup << eos; + std::error_code ec; + auto const& encoded = encoder.serializationBuffer(ec); + BEAST_EXPECT(!encoder.ec() && !ec); + + { + intVal = 0; + stringVal.clear(); + Decoder decoder(makeSlice(encoded), TagMode::direct); + decoder >> tup >> eos; + BEAST_EXPECT(intVal == 42 && stringVal == std::string("hello")); + BEAST_EXPECT(!decoder.ec()); + } + { + intVal = 0; + stringVal.clear(); + Decoder decoder(makeSlice(encoded), TagMode::direct); + decoder >> std::tie(stringVal, intVal) >> eos; + BEAST_EXPECT(intVal == 42 && stringVal == std::string("hello")); + BEAST_EXPECT(!decoder.ec()); + } + } + + { + auto makeCase = []( + std::initializer_list val, + std::initializer_list encoding) + -> std::pair, std::vector> { + return std::make_pair( + std::vector(val), std::vector(encoding)); + }; + + std::vector, std::vector>> cases = + {{makeCase({100, 1, 10}, {48, 9, 2, 1, 100, 2, 1, 1, 2, 1, 10}), + makeCase({100, 11, 1}, {48, 9, 2, 1, 100, 2, 1, 11, 2, 1, 1}), + makeCase({100, 10, 1}, {48, 9, 2, 1, 100, 2, 1, 10, 2, 1, 1}), + makeCase({1, 10, 100}, {48, 9, 2, 1, 1, 2, 1, 10, 2, 1, 100}), + makeCase({10, 100, 1}, {48, 9, 2, 1, 10, 2, 1, 100, 2, 1, 1}), + makeCase({1, 11}, {48, 6, 2, 1, 1, 2, 1, 11}), + makeCase({1, 10}, {48, 6, 2, 1, 1, 2, 1, 10}), + makeCase({10, 1}, {48, 6, 2, 1, 10, 2, 1, 1})}}; + + using namespace cryptoconditions::der; + TraitsCache dummy; + for (auto i = cases.begin(), e = cases.end(); i != e; ++i) + { + using Traits = DerCoderTraits>>; + auto const wrappedI = make_sequence(i->first); + this->BEAST_EXPECT( + Traits::compare(wrappedI, wrappedI, dummy) == 0); + for (auto j = i + 1; j != e; ++j) + { + auto const wrappedJ = make_sequence(j->first); + this->BEAST_EXPECT( + boost::math::sign( + Traits::compare(wrappedI, wrappedJ, dummy)) == + boost::math::sign(vecCmp(i->second, j->second))); + } + } + } + } + + void + testSet() + { + testcase("set"); + + using namespace cryptoconditions::der; + { + std::vector v({100, 1, 10}); + std::vector expected({49, 9, 2, 1, 1, 2, 1, 10, 2, 1, 100}); + + Encoder encoder{TagMode::direct}; + encoder << make_set(v, encoder) << eos; + std::error_code ec; + auto const& encoded = encoder.serializationBuffer(ec); + BEAST_EXPECT(!encoder.ec() && !ec && expected == encoded); + + Decoder decoder(makeSlice(encoded), TagMode::direct); + v.clear(); + decoder >> make_set(v, decoder) >> eos; + BEAST_EXPECT( + v.size() == 3 && v[0] == 1 && v[1] == 10 && v[2] == 100); + BEAST_EXPECT(!decoder.ec()); + } + + { + auto makeCase = []( + std::initializer_list val, + std::initializer_list encoding) + -> std::pair, std::vector> { + return std::make_pair( + std::vector(val), std::vector(encoding)); + }; + + std::vector, std::vector>> cases = + {{makeCase({100, 1, 10}, {49, 9, 2, 1, 1, 2, 1, 10, 2, 1, 100}), + makeCase({100, 11, 1}, {49, 9, 2, 1, 1, 2, 1, 11, 2, 1, 100}), + makeCase({100, 10, 1}, {49, 9, 2, 1, 1, 2, 1, 10, 2, 1, 100}), + makeCase({1, 10, 100}, {49, 9, 2, 1, 1, 2, 1, 10, 2, 1, 100}), + makeCase({10, 100, 1}, {49, 9, 2, 1, 1, 2, 1, 10, 2, 1, 100}), + makeCase({1, 11}, {49, 6, 2, 1, 1, 2, 1, 11}), + makeCase({1, 10}, {49, 6, 2, 1, 1, 2, 1, 10}), + makeCase({10, 1}, {49, 6, 2, 1, 1, 2, 1, 10})}}; + + using namespace cryptoconditions::der; + TraitsCache dummy; + for (auto i = cases.begin(), e = cases.end(); i != e; ++i) + { + using Traits = DerCoderTraits>>; + auto const wrappedI = make_set(i->first, dummy); + this->BEAST_EXPECT( + Traits::compare(wrappedI, wrappedI, dummy) == 0); + for (auto j = i + 1; j != e; ++j) + { + auto const wrappedJ = make_set(j->first, dummy); + this->BEAST_EXPECT( + boost::math::sign( + Traits::compare(wrappedI, wrappedJ, dummy)) == + boost::math::sign(vecCmp(i->second, j->second))); + } + } + } + } + + void + testChoice() + { + testcase("choice"); + using namespace std::string_literals; + using namespace cryptoconditions::der; + { + /* + db Db ::= + d2: {name 'FF'H, unsignedInt 256} + */ + + std::unique_ptr v = + std::make_unique("\xFF", 256); + auto const expected = + "\xA2\x09\x30\x07\x04\x01\xFF\x02\x02\x01\x00"s; + test(v, expected); + } + { + // test nested objects + std::vector buf({'a', 'a'}); + std::string str("AA"); + int signedInt = -3; + std::uint64_t id = 66000; + int childIndex = 0; // even indexes are of type derived1, odd + // indexes are of type derived2 + std::function(int)> + createDerived = + [&](int level) -> std::unique_ptr { + ++childIndex; + if (childIndex % 2) + { + std::vector> children; + if (level > 1) + { + for (int i = 0; i < 5; ++i) + children.emplace_back(createDerived(level - 1)); + } + ++signedInt; + ++buf[0]; + return std::make_unique( + buf, std::move(children), signedInt); + } + else + { + if (str[1] == 'Z') + { + ++str[0]; + str[1] = 'A'; + } + else + ++str[1]; + ++id; + return std::make_unique(str, id); + } + }; + + auto root = createDerived(/*levels*/ 5); + Encoder encoder{TagMode::direct}; + encoder << root << eos; + std::error_code ec; + auto const& encoded = encoder.serializationBuffer(ec); + BEAST_EXPECT(!encoder.ec() && !ec); + + Decoder decoder(makeSlice(encoded), TagMode::direct); + std::unique_ptr readVal; + decoder >> readVal >> eos; + BEAST_EXPECT(!decoder.ec()); + BEAST_EXPECT(equal(readVal, root)); + } + } + + void + testIllFormed() + { + testcase("ill formed"); + using namespace cryptoconditions::der; + + auto testBad = [&](std::vector const& illFormed) { + std::vector v; + Decoder decoder(makeSlice(illFormed), TagMode::direct); + decoder >> make_sequence(v) >> eos; + BEAST_EXPECT(decoder.ec()); + }; + + std::vector wellFormed( + {48, 15, 2, 1, 10, 2, 3, 1, -122, -96, 2, 5, 23, 72, 118, -24, 0}); + // indexes for the preamble starts and length starts + std::vector indexesToChange({0, 1, 2, 3, 5, 6, 10, 11}); + + for (auto i : indexesToChange) + { + for (auto delta : {-1, 1}) + { + auto illFormed(wellFormed); + illFormed[i] += delta; + testBad(illFormed); + } + } + + { + auto illFormed(wellFormed); + illFormed.push_back(1); + testBad(illFormed); + } + { + auto illFormed(wellFormed); + illFormed.pop_back(); + testBad(illFormed); + } + { + std::vector const illFormed( + wellFormed.begin() + 1, wellFormed.end()); + testBad(illFormed); + } + } + + void + testAutoTags() + { + testcase("auto tags"); + using namespace cryptoconditions::der; + + std::string sVal{"Hello Auto Tags"}; + std::uint32_t uIntVal{42}; + + std::vector expected({48, 20, -128, 15, 72, 101, 108, 108, + 111, 32, 65, 117, 116, 111, 32, 84, + 97, 103, 115, -127, 1, 42}); + + Encoder encoder{TagMode::automatic}; + encoder << std::tie(sVal, uIntVal) << eos; + std::error_code ec; + auto const& encoded = encoder.serializationBuffer(ec); + BEAST_EXPECT(!ec && !encoder.ec() && expected == encoded); + + { + Decoder decoder{makeSlice(encoded), TagMode::automatic}; + std::string readSVal; + std::uint32_t readUIntVal; + decoder >> std::tie(readSVal, readUIntVal) >> eos; + BEAST_EXPECT(!decoder.ec()); + BEAST_EXPECT(readSVal == sVal && readUIntVal == uIntVal); + } + } + + void + testAutoChoice() + { + testcase("auto choice"); + using namespace std::string_literals; + using namespace cryptoconditions::der; + /* + ---- + + CryptoConditions DEFINITIONS AUTOMATIC TAGS ::= BEGIN + + Db ::= CHOICE { + d1 [1] D1, + d2 [2] D2, + d3 [3] D3, + d4 [4] D4, + d5 [5] D5 + } + + D1 ::= SEQUENCE { + buf OCTET STRING, + subChoices SEQUENCE OF Db, + signedInt INTEGER + } + + D2 ::= SEQUENCE { + name OCTET STRING, + unsignedInt INTEGER + } + + D3 ::= SEQUENCE { + subChoices SET OF Db + } + + D4 ::= SEQUENCE { + subChoices SEQUENCE OF Db + } + + D5 ::= SEQUENCE { + subChoice Db , + name OCTET STRING, + unsignedInt INTEGER + } + + END + */ + + auto make_d2_vec = + [](std::initializer_list> v) { + std::vector> result; + for (auto const& p : v) + result.push_back( + std::make_unique(p.first, p.second)); + return result; + }; + { + // Notice that unlike the other tests, this one is in direct mode + /* + db Db ::= + d2: {name 'FF'H, unsignedInt 64} + */ + auto const expected = "\xA2\x08\x30\x06\x04\x01\xFF\x02\x01\x40"s; + std::unique_ptr val = + std::make_unique("\xFF", 64); + test(val, expected, TagMode::direct); + } + { + /* + db Db ::= + d2: {name 'FF'H, unsignedInt 64} + */ + auto const expected = "\xA2\x06\x80\x01\xFF\x81\x01\x40"s; + std::unique_ptr val = + std::make_unique("\xFF", 64); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d2: {name ''H, unsignedInt 64} + */ + auto const expected = "\xA2\x05\x80\x00\x81\x01\x40"s; + std::unique_ptr val = + std::make_unique("", 64); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d4: {subChoices {d2: {name 'FF'H, unsignedInt 64}}} + */ + + auto const expected = + "\xA4\x0A\xA0\x08\xA2\x06\x80\x01\xFF\x81\x01\x40"s; + std::unique_ptr val = + std::make_unique( + make_d2_vec({{"\xFF"s, 64}})); + test(val, expected, TagMode::automatic); + } + { + // Encode all the sequence child numbers. This should fail. + /* + db Db ::= + d4: {subChoices {d2: {name 'FF'H, unsignedInt 64}}} + */ + + auto const expected = + "\xa4\x0c\xa0\x0a\xa0\x08\xa2\x06\x80\x01\xff\x81\x01\x40"s; + std::unique_ptr val = + std::make_unique( + make_d2_vec({{"\xFF"s, 64}})); + Decoder s(makeSlice(expected), TagMode::automatic); + std::unique_ptr decoded; + s >> decoded >> eos; + BEAST_EXPECT(decoded != val || s.ec()); + } + { + /* + db Db ::= + d4: {subChoices {d2: {name ''H, unsignedInt 64}}} + */ + + auto const expected = + "\xA4\x09\xA0\x07\xA2\x05\x80\x00\x81\x01\x40"s; + std::unique_ptr val = + std::make_unique(make_d2_vec({{""s, 64}})); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d3: {subChoices {d2: {name 'FF'H, unsignedInt 64}}} + */ + + auto const expected = + "\xA3\x0A\xA0\x08\xA2\x06\x80\x01\xFF\x81\x01\x40"s; + + std::unique_ptr val = + std::make_unique( + make_d2_vec({{"\xFF"s, 64}})); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d4: {subChoices {}} + */ + auto const expected = "\xA4\x02\xA0\x00"s; + + std::unique_ptr val = + std::make_unique(make_d2_vec({})); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d3: {subChoices {}} + */ + auto const expected = "\xA3\x02\xA0\x00"s; + + std::unique_ptr val = + std::make_unique(make_d2_vec({})); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d4: {subChoices {d2: {name 'FF'H, unsignedInt 64}, d2: {name 'FE'H, + unsignedInt 63}}} + */ + + auto const expected = + "\xA4\x12\xA0\x10\xA2\x06\x80\x01\xFF\x81\x01\x40\xA2\x06\x80\x01\xFE\x81\x01\x3F"s; + std::unique_ptr val = + std::make_unique( + make_d2_vec({{"\xFF", 64}, {"\xFE", 63}})); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d3: {subChoices {d2: {name 'FF'H, unsignedInt 64}, d2: {name 'FE'H, + unsignedInt 63}}} + */ + + auto const expected = + "\xA3\x12\xA0\x10\xA2\x06\x80\x01\xFE\x81\x01\x3F\xA2\x06\x80\x01\xFF\x81\x01\x40"s; + std::unique_ptr val = + std::make_unique( + make_d2_vec({{"\xFF", 64}, {"\xFE", 63}})); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d4: {subChoices {d4: {subChoices {d2: {name 'FF'H, unsignedInt 64}, + d2: {name 'FE'H, unsignedInt + 63}}}, + d4: {subChoices {d2: {name 'FD'H, unsignedInt 62}, + d2: {name 'FC'H, unsignedInt + 61}}}}} + */ + + auto const expected = + "\xA4\x2A\xA0\x28\xA4\x12\xA0\x10\xA2\x06\x80\x01\xFF\x81\x01" + "\x40\xA2\x06\x80\x01\xFE\x81\x01\x3F\xA4\x12\xA0\x10\xA2\x06" + "\x80\x01\xFD\x81\x01\x3E\xA2\x06\x80\x01\xFC\x81\x01\x3D"s; + std::vector> subs; + subs.push_back(std::make_unique( + make_d2_vec({{"\xFF", 64}, {"\xFE", 63}}))); + subs.push_back(std::make_unique( + make_d2_vec({{"\xFD", 62}, {"\xFC", 61}}))); + std::unique_ptr val = + std::make_unique(std::move(subs)); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d3: {subChoices {d3: {subChoices {d2: {name 'FF'H, unsignedInt 64}, + d2: {name 'FE'H, unsignedInt + 63}}}, + d3: {subChoices {d2: {name 'FD'H, unsignedInt 62}, + d2: {name 'FC'H, unsignedInt + 61}}}}} + */ + + auto const expected = + "\xA3\x2A\xA0\x28\xA3\x12\xA0\x10\xA2\x06\x80\x01\xFC\x81\x01" + "\x3D\xA2\x06\x80\x01\xFD\x81\x01\x3E\xA3\x12\xA0\x10\xA2\x06" + "\x80\x01\xFE\x81\x01\x3F\xA2\x06\x80\x01\xFF\x81\x01\x40"s; + std::vector> subs; + subs.push_back(std::make_unique( + make_d2_vec({{"\xFF", 64}, {"\xFE", 63}}))); + subs.push_back(std::make_unique( + make_d2_vec({{"\xFD", 62}, {"\xFC", 61}}))); + std::unique_ptr val = + std::make_unique(std::move(subs)); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d4: {subChoices {d4: {subChoices {}}, + d4: {subChoices {d2: {name 'FD'H, unsignedInt 62}, + d2: {name 'FC'H, unsignedInt + 61}}}}} + */ + + auto const expected = + "\xA4\x1A\xA0\x18\xA4\x02\xA0\x00\xA4\x12\xA0\x10\xA2\x06\x80" + "\x01\xFD\x81\x01\x3E\xA2\x06\x80\x01\xFC\x81\x01\x3D"s; + std::vector> subs; + subs.push_back( + std::make_unique(make_d2_vec({}))); + subs.push_back(std::make_unique( + make_d2_vec({{"\xFD", 62}, {"\xFC", 61}}))); + std::unique_ptr val = + std::make_unique(std::move(subs)); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d3: {subChoices {d3: {subChoices {}}, + d3: {subChoices {d2: {name 'FD'H, unsignedInt 62}, + d2: {name 'FC'H, unsignedInt + 61}}}}} + */ + + auto const expected = + "\xA3\x1A\xA0\x18\xA3\x02\xA0\x00\xA3\x12\xA0\x10\xA2\x06\x80" + "\x01\xFC\x81\x01\x3D\xA2\x06\x80\x01\xFD\x81\x01\x3E"s; + std::vector> subs; + subs.push_back( + std::make_unique(make_d2_vec({}))); + subs.push_back(std::make_unique( + make_d2_vec({{"\xFD", 62}, {"\xFC", 61}}))); + std::unique_ptr val = + std::make_unique(std::move(subs)); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d4: {subChoices {d4: {subChoices {d2: {name 'FF'H, unsignedInt 64}, + d2: {name 'FE'H, unsignedInt + 63}}}, + d4: {subChoices {}}}} + */ + + auto const expected = + "\xA4\x1A\xA0\x18\xA4\x12\xA0\x10\xA2\x06\x80\x01\xFF\x81\x01" + "\x40\xA2\x06\x80\x01\xFE\x81\x01\x3F\xA4\x02\xA0\x00"s; + std::vector> subs; + subs.push_back(std::make_unique( + make_d2_vec({{"\xFF", 64}, {"\xFE", 63}}))); + subs.push_back( + std::make_unique(make_d2_vec({}))); + std::unique_ptr val = + std::make_unique(std::move(subs)); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d3: {subChoices {d3: {subChoices {d2: {name 'FF'H, unsignedInt 64}, + d2: {name 'FE'H, unsignedInt + 63}}}, + d3: {subChoices {}}}} + */ + + auto const expected = + "\xA3\x1A\xA0\x18\xA3\x02\xA0\x00\xA3\x12\xA0\x10\xA2\x06\x80" + "\x01\xFE\x81\x01\x3F\xA2\x06\x80\x01\xFF\x81\x01\x40"s; + std::vector> subs; + subs.push_back(std::make_unique( + make_d2_vec({{"\xFF", 64}, {"\xFE", 63}}))); + subs.push_back( + std::make_unique(make_d2_vec({}))); + std::unique_ptr val = + std::make_unique(std::move(subs)); + test(val, expected, TagMode::automatic); + } + { + /* + db Db ::= + d5: {subChoice d2: {name 'FE'H, unsignedInt 63}, name 'FF'H, + unsignedInt 64} + */ + auto const expected = + "\xA5\x10\xA0\x08\xA2\x06\x80\x01\xFE\x81\x01\x3F\x81\x01\xFF\x82\x01\x40"s; + + std::unique_ptr val = + std::make_unique( + std::make_unique("\xFE", 63), + "\xFF", + 64); + test(val, expected, TagMode::automatic); + } + } + + void + run() + { + testInts(); + testString(); + testBitstring(); + testSequence(); + testSet(); + testChoice(); + testIllFormed(); + testAutoTags(); + testAutoChoice(); + } +}; + +BEAST_DEFINE_TESTSUITE(Der, conditions, ripple); + +} // test +} // ripple diff --git a/src/test/conditions/PreimageSha256_test.cpp b/src/test/conditions/PreimageSha256_test.cpp index 5595d553d85..e2a9758a9f1 100644 --- a/src/test/conditions/PreimageSha256_test.cpp +++ b/src/test/conditions/PreimageSha256_test.cpp @@ -83,7 +83,6 @@ class PreimageSha256_test : public beast::unit_test::suite BEAST_EXPECT (!ec); auto c1 = Condition::deserialize (hexblob(known[0].second), ec); - BEAST_EXPECT (c1); BEAST_EXPECT (!ec); auto f2 = Fulfillment::deserialize(hexblob(known[1].first), ec); @@ -91,58 +90,171 @@ class PreimageSha256_test : public beast::unit_test::suite BEAST_EXPECT(!ec); auto c2 = Condition::deserialize(hexblob(known[1].second), ec); - BEAST_EXPECT(c2); BEAST_EXPECT(!ec); // Check equality and inequality - BEAST_EXPECT (f1->condition() == *c1); - BEAST_EXPECT (f1->condition() != *c2); - BEAST_EXPECT (f2->condition() == *c2); - BEAST_EXPECT (f2->condition() != *c1); - BEAST_EXPECT (*c1 != *c2); - BEAST_EXPECT (*c1 == *c1); - BEAST_EXPECT (f1->condition() == f1->condition()); + + if (! (f1 && f2)) + return; + + std::error_code cec; + BEAST_EXPECT (f1->condition(cec) == c1 && !cec); + BEAST_EXPECT (f1->condition(cec) != c2 && !cec); + BEAST_EXPECT (f2->condition(cec) == c2 && !cec); + BEAST_EXPECT (f2->condition(cec) != c1 && !cec); + BEAST_EXPECT (c1 != c2); + BEAST_EXPECT (c1 == c1); + std::error_code cec2; + BEAST_EXPECT (f1->condition(cec) == f1->condition(cec2) && !cec && !cec2); // Should validate with the empty string - BEAST_EXPECT (validate (*f1, *c1)); - BEAST_EXPECT (validate(*f2, *c2)); + BEAST_EXPECT (validate (*f1, c1)); + BEAST_EXPECT (validate(*f2, c2)); // And with any string - the message doesn't matter for PrefixSha256 - BEAST_EXPECT (validate (*f1, *c1, makeSlice(known[0].first))); - BEAST_EXPECT (validate(*f1, *c1, makeSlice(known[0].second))); - BEAST_EXPECT (validate(*f2, *c2, makeSlice(known[0].first))); - BEAST_EXPECT (validate(*f2, *c2, makeSlice(known[0].second))); + BEAST_EXPECT (validate (*f1, c1, makeSlice(known[0].first))); + BEAST_EXPECT (validate(*f1, c1, makeSlice(known[0].second))); + BEAST_EXPECT (validate(*f2, c2, makeSlice(known[0].first))); + BEAST_EXPECT (validate(*f2, c2, makeSlice(known[0].second))); // Shouldn't validate if the fulfillment & condition don't match // regardless of the message. - BEAST_EXPECT (! validate(*f2, *c1)); - BEAST_EXPECT (! validate(*f2, *c1, makeSlice(known[0].first))); - BEAST_EXPECT (! validate(*f2, *c1, makeSlice(known[0].second))); - BEAST_EXPECT (! validate(*f1, *c2)); - BEAST_EXPECT (! validate(*f1, *c2, makeSlice(known[0].first))); - BEAST_EXPECT (! validate(*f1, *c2, makeSlice(known[0].second))); + BEAST_EXPECT (! validate(*f2, c1)); + BEAST_EXPECT (! validate(*f2, c1, makeSlice(known[0].first))); + BEAST_EXPECT (! validate(*f2, c1, makeSlice(known[0].second))); + BEAST_EXPECT (! validate(*f1, c2)); + BEAST_EXPECT (! validate(*f1, c2, makeSlice(known[0].first))); + BEAST_EXPECT (! validate(*f1, c2, makeSlice(known[0].second))); } void testOtherTypes() { testcase ("Other Types"); - std::pair const others[] = + using namespace std::literals::string_literals; + + auto make_test_case = [](auto const& name, auto const& fulfillment, auto const& condition) { - // PREFIX + PREIMAGE: - { "A10B8000810100A204A0028000", + return std::tuple{name, fulfillment, condition}; + }; + + // name, fulfillment, condition + std::tuple const others[] = + { + // PREFIX + PREIMAGE: + make_test_case("PREFIX + PREIMAGE"s, + + /* + Fulfillment CHOICE + prefixSha256 PrefixFulfillment SEQUENCE: tag = [1] constructed; length = 11 + prefix OCTET STRING: tag = [0] primitive; length = 0 + + maxMessageLength INTEGER: tag = [1] primitive; length = 1 + 0 + subfulfillment : tag = [2] constructed; length = 4 + Fulfillment CHOICE + preimageSha256 PreimageFulfillment SEQUENCE: tag = [0] constructed; length = 2 + preimage OCTET STRING: tag = [0] primitive; length = 0 + + Successfully decoded 13 bytes. + rec1value Fulfillment ::= prefixSha256 : + { + prefix ''H, + maxMessageLength 0, + subfulfillment preimageSha256 : + { + preimage ''H + } + } + */ + "A10B8000810100A204A0028000"s, + + /* + prefixSha256 CompoundSha256Condition SEQUENCE: tag = [1] constructed; length = 42 + fingerprint OCTET STRING: tag = [0] primitive; length = 32 + 0xbb1ac5260c0141b7e54b26ec2330637c55 ... + cost INTEGER: tag = [1] primitive; length = 2 + 1024 + subtypes ConditionTypes BIT STRING: tag = [2] primitive; length = 2 + 0x0780 + Successfully decoded 44 bytes. + rec1value Condition ::= prefixSha256 : + { + fingerprint 'BB1AC5260C0141B7E54B26EC2330637C55 ...'H, + cost 1024, + subtypes { preImageSha256 } + } + */ "A12A8020BB1AC5260C0141B7E54B26EC2330637C5597BF811951AC09E744AD20FF77E287810204" - "0082020780" }, + "0082020780"), // THRESHOLD: - { "A208A004A0028000A100", - + make_test_case("THRESHOLD"s, + /* + Fulfillment CHOICE + thresholdSha256 ThresholdFulfillment SEQUENCE: tag = [2] constructed; length = 8 + subfulfillments SET OF: tag = [0] constructed; length = 4 + Fulfillment CHOICE + preimageSha256 PreimageFulfillment SEQUENCE: tag = [0] constructed; length = 2 + preimage OCTET STRING: tag = [0] primitive; length = 0 + + subconditions SET OF: tag = [1] constructed; length = 0 + Successfully decoded 10 bytes. + rec1value Fulfillment ::= thresholdSha256 : + { + subfulfillments + { + preimageSha256 : + { + preimage ''H + } + }, + subconditions + { + } + } + */ + "A208A004A0028000A100"s, + + /* + Condition CHOICE + thresholdSha256 CompoundSha256Condition SEQUENCE: tag = [2] constructed; length = 42 + fingerprint OCTET STRING: tag = [0] primitive; length = 32 + 0xb4b84136df48a71d73f4985c04c6767a77 ... + cost INTEGER: tag = [1] primitive; length = 2 + 1024 + subtypes ConditionTypes BIT STRING: tag = [2] primitive; length = 2 + 0x0780 + Successfully decoded 44 bytes. + rec1value Condition ::= thresholdSha256 : + { + fingerprint 'B4B84136DF48A71D73F4985C04C6767A77 ...'H, + cost 1024, + subtypes { preImageSha256 } + } + */ "A22A8020B4B84136DF48A71D73F4985C04C6767A778ECB65BA7023B4506823BEEE7631B9810204" - "0082020780" }, + "0082020780"), // RSA: - { "A382020880820100E1EF8B24D6F76B09C81ED7752AA262F044F04A874D43809D31CEA612F99B0C97" + make_test_case("RSA"s, + + /* + Fulfillment CHOICE + rsaSha256 RsaSha256Fulfillment SEQUENCE: tag = [3] constructed; length = 520 + modulus OCTET STRING: tag = [0] primitive; length = 256 + 0xe1ef8b24d6f76b09c81ed7752aa262f044 ... + signature OCTET STRING: tag = [1] primitive; length = 256 + 0xbd42d6569f6599aed455f96bc0ed08ed14 ... + Successfully decoded 524 bytes. + rec1value Fulfillment ::= rsaSha256 : + { + modulus 'E1EF8B24D6F76B09C81ED7752AA262F044 ...'H, + signature 'BD42D6569F6599AED455F96BC0ED08ED14 ...'H + } + */ + "A382020880820100E1EF8B24D6F76B09C81ED7752AA262F044F04A874D43809D31CEA612F99B0C97" "A8B4374153E3EEF3D66616843E0E41C293264B71B6173DB1CF0D6CD558C58657706FCF097F704C48" "3E59CBFDFD5B3EE7BC80D740C5E0F047F3E85FC0D75815776A6F3F23C5DC5E797139A6882E38336A" "4A5FB36137620FF3663DBAE328472801862F72F2F87B202B9C89ADD7CD5B0A076F7C53E35039F67E" @@ -157,23 +269,75 @@ class PreimageSha256_test : public beast::unit_test::suite "C37D8DA2CC924EDAE1D84CF6124587F274C1FA3697DA2901F0269F03B243C03B614E0385E1961FAC" "5000F9BB", - "A32580204849505152535455484950515253545548495051525354554849505152535455810101" }, + /* + Condition CHOICE + rsaSha256 SimpleSha256Condition SEQUENCE: tag = [3] constructed; length = 37 + fingerprint OCTET STRING: tag = [0] primitive; length = 32 + 0x4849505152535455484950515253545548 ... + cost INTEGER: tag = [1] primitive; length = 1 + 1 + Successfully decoded 39 bytes. + rec1value Condition ::= rsaSha256 : + { + fingerprint '4849505152535455484950515253545548 ...'H, + cost 1 + } + */ + "A32580204849505152535455484950515253545548495051525354554849505152535455810101" ), // ED25519: - { "A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140E556" + make_test_case("ED25519"s, + + /* + Fulfillment CHOICE + ed25519Sha256 Ed25519Sha512Fulfillment SEQUENCE: tag = [4] constructed; length = 100 + publicKey OCTET STRING: tag = [0] primitive; length = 32 + 0xd75a980182b10ab7d54bfed3c964073a0e ... + signature OCTET STRING: tag = [1] primitive; length = 64 + 0xe5564300c360ac729086e2cc806e828a84 ... + Successfully decoded 102 bytes. + rec1value Fulfillment ::= ed25519Sha256 : + { + publicKey 'D75A980182B10AB7D54BFED3C964073A0E ...'H, + signature 'E5564300C360AC729086E2CC806E828A84 ...'H + } + */ + "A4648020D75A980182B10AB7D54BFED3C964073A0EE172F3DAA62325AF021A68F707511A8140E556" "4300C360AC729086E2CC806E828A84877F1EB8E5D974D873E065224901555FB8821590A33BACC61E" "39701CF9B46BD25BF5F0595BBE24655141438E7A100B", + /* + Condition CHOICE + ed25519Sha256 SimpleSha256Condition SEQUENCE: tag = [4] constructed; length = 39 + fingerprint OCTET STRING: tag = [0] primitive; length = 32 + 0x799239aba8fc4ff7eabfbc4c44e69e8bdf ... + cost INTEGER: tag = [1] primitive; length = 3 + 131072 + Successfully decoded 41 bytes. + rec1value Condition ::= ed25519Sha256 : + { + fingerprint '799239ABA8FC4FF7EABFBC4C44E69E8BDF ...'H, + cost 131072 + } + */ "A4278020799239ABA8FC4FF7EABFBC4C44E69E8BDFED993324E12ED64792ABE289CF1D5F810302" - "0000" } + "0000" ) }; for (auto x : others) { std::error_code ec; - BEAST_EXPECT (!Fulfillment::deserialize(hexblob(x.first), ec)); - BEAST_EXPECT (!Condition::deserialize (hexblob(x.second), ec)); + if (!BEAST_EXPECT(Fulfillment::deserialize(hexblob(std::get<1>(x)), ec))) + { + log << "Fulfillment deserialize error: " << std::get<0>(x) << " " << ec.message() << '\n'; + } + auto const c = Condition::deserialize (hexblob(std::get<2>(x)), ec); + (void) c; + if (!BEAST_EXPECT(!ec)) + { + log << "Condition deserialize error: " << std::get<0>(x) << " " << ec.message() << '\n'; + } } diff --git a/src/test/unity/conditions_test_unity.cpp b/src/test/unity/conditions_test_unity.cpp index 21032b06e53..aac9ec45e14 100644 --- a/src/test/unity/conditions_test_unity.cpp +++ b/src/test/unity/conditions_test_unity.cpp @@ -17,4 +17,15 @@ */ //============================================================================== +#include +#include + #include + +// tests generated from a script +#include +#include +#include +#include +#include +#include