Skip to content

Commit

Permalink
from witness indices method for ultra
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed Sep 10, 2024
1 parent e5a4f0b commit 29366ac
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,24 @@ template <typename BuilderType> class UltraRecursiveFlavor_ {
commitment = deserialize_from_frs<Commitment>(builder, elements, num_frs_read);
}
}

/**
* @brief Construct a VerificationKey from a set of corresponding witness indices
*
* @param builder
* @param witness_indices
* @return VerificationKey
*/
static VerificationKey from_witness_indices(CircuitBuilder& builder,
const std::span<const uint32_t>& witness_indices)
{
std::vector<FF> vkey_fields;
vkey_fields.reserve(witness_indices.size());
for (const auto& idx : witness_indices) {
vkey_fields.emplace_back(FF::from_witness_index(&builder, idx));
}
return VerificationKey(builder, vkey_fields);
}
};

/**
Expand Down

0 comments on commit 29366ac

Please sign in to comment.