<commit_before>#ifndef R1CS_PCD_PARAMS_TCC_
#define R1CS_PCD_PARAMS_TCC_

namespace libsnark {

template<typename FieldT>
r1cs_primary_input<FieldT> r1cs_pcd_compliance_predicate_primary_input<FieldT>::as_r1cs_primary_input() const
{
    r1cs_primary_input<FieldT> result;

    result.emplace_back(FieldT(outgoing_message.type));
    result.insert(result.end(), outgoing_message.payload.begin(), outgoing_message.payload.end());

    return result;
}

template<typename FieldT>
r1cs_auxiliary_input<FieldT> r1cs_pcd_compliance_predicate_auxiliary_input<FieldT>::as_r1cs_auxiliary_input(const std::vector<size_t> &incoming_message_payload_lengths) const
{
    r1cs_auxiliary_input<FieldT> result;
    result.emplace_back(FieldT(incoming_messages.size()));

    const size_t max_arity = incoming_message_payload_lengths.size();

    for (size_t i = 0; i < max_arity; ++i)
    {
        if (i < incoming_messages.size())
        {
            result.emplace_back(FieldT(incoming_messages[i].type));
            result.insert(result.end(), incoming_messages[i].payload.begin(), incoming_messages[i].payload.end());
        }
        else
        {
            result.resize(result.size() + incoming_message_payload_lengths[i], FieldT::zero());
        }
    }

    result.insert(result.end(), local_data.payload.begin(), local_data.payload.end());
    result.insert(result.end(), witness.begin(), witness.end());

    return result;
}

} // libsnark

#endif // R1CS_PCD_PARAMS_TCC_
<commit_msg>Fix off-by-one error in method that converts PCD auxiliary input to R1CS auxiliary input.<commit_after>#ifndef R1CS_PCD_PARAMS_TCC_
#define R1CS_PCD_PARAMS_TCC_

namespace libsnark {

template<typename FieldT>
r1cs_primary_input<FieldT> r1cs_pcd_compliance_predicate_primary_input<FieldT>::as_r1cs_primary_input() const
{
    r1cs_primary_input<FieldT> result;

    result.emplace_back(FieldT(outgoing_message.type));
    result.insert(result.end(), outgoing_message.payload.begin(), outgoing_message.payload.end());

    return result;
}

template<typename FieldT>
r1cs_auxiliary_input<FieldT> r1cs_pcd_compliance_predicate_auxiliary_input<FieldT>::as_r1cs_auxiliary_input(const std::vector<size_t> &incoming_message_payload_lengths) const
{
    r1cs_auxiliary_input<FieldT> result;
    result.emplace_back(FieldT(incoming_messages.size()));

    const size_t max_arity = incoming_message_payload_lengths.size();

    for (size_t i = 0; i < max_arity; ++i)
    {
        if (i < incoming_messages.size())
        {
            result.emplace_back(FieldT(incoming_messages[i].type));
            result.insert(result.end(), incoming_messages[i].payload.begin(), incoming_messages[i].payload.end());
        }
        else
        {
            result.resize(result.size() + incoming_message_payload_lengths[i] + 1, FieldT::zero());
        }
    }

    result.insert(result.end(), local_data.payload.begin(), local_data.payload.end());
    result.insert(result.end(), witness.begin(), witness.end());

    return result;
}

} // libsnark

#endif // R1CS_PCD_PARAMS_TCC_

{'fraction_non_alphanumeric': 0.12156862745098039, 'fraction_numerical': 0.00849673202614379, 'mean_word_length': 4.595978062157221, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4259819', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1031, 'n_words': 138}