diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp index a908d41226f..5cb743e26e6 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp @@ -158,6 +158,24 @@ template class UltraRecursiveFlavor_ { commitment = deserialize_from_frs(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& witness_indices) + { + std::vector 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); + } }; /**