28 template <
typename Transcript>
31 const std::shared_ptr<Transcript>& transcript,
34 if (poly_log_size == 1) {
37 if (poly_log_size == 2) {
41 template <
typename Transcript>
44 const std::shared_ptr<Transcript>& transcript,
47 if (poly_log_size == 1) {
50 if (poly_log_size == 2) {
81 uint64_t parts[4] = { 0, 0, 0, 0 };
83 for (
size_t i = 0; i < (buffer_size + 7) / 8; i++) {
84 size_t to_read = (buffer_size - i * 8) < 8 ? buffer_size - i * 8 : 8;
87 return uint256_t(parts[0], parts[1], parts[2], parts[3]);
105 const auto log_size =
static_cast<size_t>(
data[0]);
107 if (log_size == 0 || log_size > 2) {
111 const auto num_challenges = log_size + 1;
116 const size_t polynomial_size = (1 << log_size);
118 const size_t polynomial_control_bytes = (polynomial_size < 8 ? 1 : polynomial_size / 8);
119 const size_t expected_size =
120 1 + 1 + num_challenges *
sizeof(
uint256_t)
122 1 + polynomial_control_bytes;
123 if (size < expected_size) {
132 const auto control_byte =
offset[0];
135 for (
size_t i = 0; i < num_challenges; i++) {
138 if (((control_byte >> i) & 1) == 1) {
141 auto field_challenge =
Fr(challenge);
143 challenge = field_challenge.from_montgomery_form();
146 if (
Fr(challenge).is_zero()) {
149 challenges[i] = challenge;
154 transcript->initialize(challenges);
158 for (
size_t i = 0; i < polynomial_size; i++) {
165 for (
size_t i = 0; i < polynomial_size; i++) {
168 poly.
at(i) = polynomial_coefficients[i];
169 if (((
b >> (i % 8)) & 1) == 1) {
174 offset += polynomial_control_bytes;
178 if ((
offset[0] & 1) != 0) {
179 x.self_from_montgomery_form();
186 transcript->reset_indices();
#define BB_ASSERT_LTE(left, right,...)
CommitmentKey object over a pairing group 𝔾₁.
IPA (inner product argument) commitment scheme class.
Unverified claim (C,r,v) for some witness polynomial p(X) such that.
Opening pair (r,v) for some witness polynomial p(X) such that p(r) = v.
Structured polynomial class that represents the coefficients 'a' of a_0 + a_1 x .....
Fr evaluate(const Fr &z, size_t target_size) const
Fr & at(size_t index)
Our mutable accessor, unlike operator[]. We abuse precedent a bit to differentiate at() and operator[...
Polynomial p and an opening pair (r,v) such that p(r) = v.
Class that allows us to call internal IPA methods, because it's friendly.
static void compute_opening_proof_internal(const CommitmentKey< Curve > &ck, const ProverOpeningClaim< Curve > &opening_claim, const std::shared_ptr< Transcript > &transcript, size_t poly_log_size)
static bool verify_internal(const VerifierCommitmentKey< Curve > &vk, const OpeningClaim< Curve > &opening_claim, const std::shared_ptr< Transcript > &transcript, size_t poly_log_size)
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
const std::vector< FF > data
int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size)
A fuzzer for the IPA primitive.
uint256_t read_uint256(const uint8_t *data, size_t buffer_size=32)
void LLVMFuzzerInitialize(int *, char ***)
Initialize SRS, commitment key, verification key.
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
Entry point for Barretenberg command-line interface.
constexpr size_t COMMITMENT_TEST_NUM_POINTS
CommitmentKey< Curve > ck
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
BB_INLINE constexpr void self_from_montgomery_form() &noexcept