Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
hypernova_batching_challenges.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Planned, auditors: [], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
8
9#include <memory>
10#include <string>
11#include <vector>
12
13namespace bb {
14
29template <typename FF, typename Transcript>
31 const std::shared_ptr<Transcript>& transcript, size_t num_unshifted, size_t num_shifted)
32{
33 // Generate N-1 random challenges from transcript (first polynomial uses implicit coefficient 1)
34 std::vector<std::string> labels_unshifted(num_unshifted - 1);
35 std::vector<std::string> labels_shifted(num_shifted - 1);
36
37 for (size_t idx = 0; idx < num_unshifted - 1; idx++) {
38 labels_unshifted[idx] = "unshifted_challenge_" + std::to_string(idx);
39 }
40 for (size_t idx = 0; idx < num_shifted - 1; idx++) {
41 labels_shifted[idx] = "shifted_challenge_" + std::to_string(idx);
42 }
43
44 auto unshifted_challenges = transcript->template get_challenges<FF>(labels_unshifted);
45 auto shifted_challenges = transcript->template get_challenges<FF>(labels_shifted);
46
47 // Prepend implicit coefficient 1 for the first polynomial
48 unshifted_challenges.insert(unshifted_challenges.begin(), FF(1));
49 shifted_challenges.insert(shifted_challenges.begin(), FF(1));
50
51 return { unshifted_challenges, shifted_challenges };
52}
53
54} // namespace bb
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
std::pair< std::vector< FF >, std::vector< FF > > get_hypernova_batching_challenges(const std::shared_ptr< Transcript > &transcript, size_t num_unshifted, size_t num_shifted)
Generate batching challenges for HyperNova folding.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
std::string to_string(bb::avm2::ValueTag tag)