Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bbapi_execute.hpp
Go to the documentation of this file.
1#pragma once
2
12#include <vector>
13
14namespace bb::bbapi {
15
38 Blake2s,
69 Shutdown>;
70
126
134inline CommandResponse execute(BBApiRequest& request, Command&& command)
135{
136 // Reset error state before execution
137 request.error_message.clear();
138
139 CommandResponse response = std::move(command).visit([&request](auto&& cmd) -> CommandResponse {
140 using CmdType = std::decay_t<decltype(cmd)>;
141 return std::forward<CmdType>(cmd).execute(request);
142 });
143
144 // Check if an error occurred during execution
145 if (!request.error_message.empty()) {
146 return ErrorResponse{ .message = std::move(request.error_message) };
147 }
148
149 return response;
150}
151
152// The msgpack scheme is an ad-hoc format that allows for cbind/compiler.ts to
153// generate TypeScript bindings for the API.
154std::string get_msgpack_schema_as_json();
155
156} // namespace bb::bbapi
Chonk-specific command definitions for the Barretenberg RPC API.
Cryptographic primitives command definitions for the Barretenberg RPC API.
Elliptic curve operations command definitions for the Barretenberg RPC API.
ECDSA signature command definitions for the Barretenberg RPC API.
Schnorr signature command definitions for the Barretenberg RPC API.
Shared type definitions for the Barretenberg RPC API.
SRS (Structured Reference String) initialization command definitions for the Barretenberg RPC API.
UltraHonk-specific command definitions for the Barretenberg RPC API.
A wrapper around std::variant that provides msgpack serialization based on type names.
decltype(auto) visit(Visitor &&vis) &&
std::string get_msgpack_schema_as_json()
CommandResponse execute(BBApiRequest &request, Command &&command)
Executes a command by visiting a variant of all possible commands.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
AES-128 CBC decryption.
AES-128 CBC encryption.
Compute Blake2s hash.
Compute Blake2s hash and convert to field element.
Compute square root of a BN254 Fq (base field) element.
Compute square root of a BN254 Fr (scalar field) element.
Decompress a BN254 G1 point from compressed form.
Check if a BN254 G1 point is on the curve.
Multiply a BN254 G1 point by a scalar.
Multiply a BN254 G2 point by a scalar.
Empty response indicating successful circuit accumulation.
Accumulate the previously loaded circuit into the IVC proof.
Contains the validation result.
Verify that a precomputed verification key matches the circuit.
Contains the computed IVC verification key.
Compute IVC verification key for the complete proof.
Contains the computed verification key in multiple formats.
Compute standalone verification key for a circuit.
Empty response indicating successful circuit loading.
Load a circuit into the Chonk instance for accumulation.
Contains the generated IVC proof.
Generate a proof for all accumulated circuits.
Empty response indicating successful initialization.
Initialize a new Chonk instance for incremental proof accumulation.
Contains gate count information.
Get gate counts for a circuit.
Contains the verification result.
Verify a Chonk proof with its verification key.
Contains proof and public inputs. Both are given as vectors of fields. To be used for verification....
Represents a request to generate a proof. Currently, UltraHonk is the only proving system supported b...
Consolidated command for retrieving circuit information. Combines gate count, circuit size,...
Verify a proof against a verification key and public inputs.
Command to generate Solidity verifier contract.
Compute ECDSA public key from private key for secp256k1.
Construct an ECDSA signature for secp256k1.
Recover public key from ECDSA signature for secp256k1.
Verify an ECDSA signature for secp256k1.
Compute ECDSA public key from private key for secp256r1.
Construct an ECDSA signature for secp256r1.
Recover public key from ECDSA signature for secp256r1.
Verify an ECDSA signature for secp256r1.
Error response returned when a command fails.
Add two Grumpkin points.
Definition bbapi_ecc.hpp:47
Multiply multiple Grumpkin points by a single scalar.
Definition bbapi_ecc.hpp:68
Get a random Grumpkin field element (BN254 Fr)
Definition bbapi_ecc.hpp:89
Multiply a Grumpkin point by a scalar.
Definition bbapi_ecc.hpp:26
Reduce a 512-bit value modulo Grumpkin scalar field (BN254 Fr)
Convert a MegaFlavor verification key to field elements representation. Used for private function ver...
Compute Pedersen commitment to field elements.
Compute Pedersen hash of raw buffer.
Compute Pedersen hash of field elements.
Compute accumulated Poseidon2 hash.
Compute Poseidon2 hash of input field elements.
Compute Poseidon2 permutation on state (4 field elements)
Compute Schnorr public key from private key.
Construct a Schnorr signature.
Verify a Schnorr signature.
Get a random Secp256k1 field element.
Multiply a Secp256k1 point by a scalar.
Reduce a 512-bit value modulo Secp256k1 scalar field.
Initialize Grumpkin SRS with Grumpkin points.
Definition bbapi_srs.hpp:42
Initialize BN254 SRS with G1 and G2 points.
Definition bbapi_srs.hpp:20
Convert a verification key to field elements representation. WORKTODO(bbapi): this should become most...