//! AUTOGENERATED - DO NOT EDIT
//! Generated from Barretenberg msgpack schema
use serde::{Deserialize, Serialize};
mod serde_bytes {
use serde::{Deserialize, Deserializer, Serializer};
pub fn serialize<S>(bytes: &Vec<u8>, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer { serializer.serialize_bytes(bytes) }
pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<u8>, D::Error>
where D: Deserializer<'de> { <Vec<u8>>::deserialize(deserializer) }
}
mod serde_vec_bytes {
use serde::{Deserialize, Deserializer, Serializer, Serialize};
use serde::ser::SerializeSeq;
use serde::de::{SeqAccess, Visitor};
#[derive(Serialize, Deserialize)]
struct BytesWrapper(#[serde(with = "super::serde_bytes")] Vec<u8>);
pub fn serialize<S>(vec: &Vec<Vec<u8>>, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer {
let mut seq = serializer.serialize_seq(Some(vec.len()))?;
for bytes in vec {
seq.serialize_element(&BytesWrapper(bytes.clone()))?;
}
seq.end()
}
pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<Vec<u8>>, D::Error>
where D: Deserializer<'de> {
struct VecVecU8Visitor;
impl<'de> Visitor<'de> for VecVecU8Visitor {
type Value = Vec<Vec<u8>>;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a sequence of byte arrays")
}
fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
where A: SeqAccess<'de> {
let mut vec = Vec::new();
while let Some(wrapper) = seq.next_element::<BytesWrapper>()? {
vec.push(wrapper.0);
}
Ok(vec)
}
}
deserializer.deserialize_seq(VecVecU8Visitor)
}
}
mod serde_array4_bytes {
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde::ser::SerializeTuple;
use serde::de::{SeqAccess, Visitor};
#[derive(Serialize, Deserialize)]
struct BytesWrapper(#[serde(with = "super::serde_bytes")] Vec<u8>);
pub fn serialize<S>(arr: &[Vec<u8>; 4], serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer {
let mut tup = serializer.serialize_tuple(4)?;
for bytes in arr {
tup.serialize_element(&BytesWrapper(bytes.clone()))?;
}
tup.end()
}
pub fn deserialize<'de, D>(deserializer: D) -> Result<[Vec<u8>; 4], D::Error>
where D: Deserializer<'de> {
struct Array4Visitor;
impl<'de> Visitor<'de> for Array4Visitor {
type Value = [Vec<u8>; 4];
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("an array of 4 byte arrays")
}
fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
where A: SeqAccess<'de> {
let mut arr: [Vec<u8>; 4] = Default::default();
for (i, item) in arr.iter_mut().enumerate() {
*item = seq.next_element::<BytesWrapper>()?
.ok_or_else(|| serde::de::Error::invalid_length(i, &self))?.0;
}
Ok(arr)
}
}
deserializer.deserialize_tuple(4, Array4Visitor)
}
}
/// CircuitComputeVkResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitComputeVkResponse {
#[serde(with = "serde_bytes")]
pub bytes: Vec<u8>,
#[serde(with = "serde_vec_bytes")]
pub fields: Vec<Vec<u8>>,
#[serde(with = "serde_bytes")]
pub hash: Vec<u8>,
}
/// CircuitInput
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitInput {
pub name: String,
#[serde(with = "serde_bytes")]
pub bytecode: Vec<u8>,
#[serde(with = "serde_bytes")]
pub verification_key: Vec<u8>,
}
/// ProofSystemSettings
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProofSystemSettings {
pub ipa_accumulation: bool,
pub oracle_hash_type: String,
pub disable_zk: bool,
pub optimized_solidity_verifier: bool,
}
/// CircuitProve
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitProve {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub circuit: CircuitInput,
#[serde(with = "serde_bytes")]
pub witness: Vec<u8>,
pub settings: ProofSystemSettings,
}
impl CircuitProve {
pub fn new(circuit: CircuitInput, witness: Vec<u8>, settings: ProofSystemSettings) -> Self {
Self {
type_name: "CircuitProve".to_string(),
circuit,
witness,
settings,
}
}
}
/// CircuitInputNoVK
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitInputNoVK {
pub name: String,
#[serde(with = "serde_bytes")]
pub bytecode: Vec<u8>,
}
/// CircuitComputeVk
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitComputeVk {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub circuit: CircuitInputNoVK,
pub settings: ProofSystemSettings,
}
impl CircuitComputeVk {
pub fn new(circuit: CircuitInputNoVK, settings: ProofSystemSettings) -> Self {
Self {
type_name: "CircuitComputeVk".to_string(),
circuit,
settings,
}
}
}
/// CircuitStats
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitStats {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub circuit: CircuitInput,
pub include_gates_per_opcode: bool,
pub settings: ProofSystemSettings,
}
impl CircuitStats {
pub fn new(circuit: CircuitInput, include_gates_per_opcode: bool, settings: ProofSystemSettings) -> Self {
Self {
type_name: "CircuitStats".to_string(),
circuit,
include_gates_per_opcode,
settings,
}
}
}
/// CircuitVerify
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitVerify {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub verification_key: Vec<u8>,
#[serde(with = "serde_vec_bytes")]
pub public_inputs: Vec<Vec<u8>>,
#[serde(with = "serde_vec_bytes")]
pub proof: Vec<Vec<u8>>,
pub settings: ProofSystemSettings,
}
impl CircuitVerify {
pub fn new(verification_key: Vec<u8>, public_inputs: Vec<Vec<u8>>, proof: Vec<Vec<u8>>, settings: ProofSystemSettings) -> Self {
Self {
type_name: "CircuitVerify".to_string(),
verification_key,
public_inputs,
proof,
settings,
}
}
}
/// ChonkComputeVk
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkComputeVk {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub circuit: CircuitInputNoVK,
}
impl ChonkComputeVk {
pub fn new(circuit: CircuitInputNoVK) -> Self {
Self {
type_name: "ChonkComputeVk".to_string(),
circuit,
}
}
}
/// ChonkStart
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkStart {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub num_circuits: u32,
}
impl ChonkStart {
pub fn new(num_circuits: u32) -> Self {
Self {
type_name: "ChonkStart".to_string(),
num_circuits,
}
}
}
/// ChonkLoad
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkLoad {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub circuit: CircuitInput,
}
impl ChonkLoad {
pub fn new(circuit: CircuitInput) -> Self {
Self {
type_name: "ChonkLoad".to_string(),
circuit,
}
}
}
/// ChonkAccumulate
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkAccumulate {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub witness: Vec<u8>,
}
impl ChonkAccumulate {
pub fn new(witness: Vec<u8>) -> Self {
Self {
type_name: "ChonkAccumulate".to_string(),
witness,
}
}
}
/// ChonkProve
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkProve {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
}
impl ChonkProve {
pub fn new() -> Self {
Self {
type_name: "ChonkProve".to_string(),
}
}
}
/// ChonkProof
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkProof {
#[serde(with = "serde_vec_bytes")]
pub hiding_oink_proof: Vec<Vec<u8>>,
#[serde(with = "serde_vec_bytes")]
pub merge_proof: Vec<Vec<u8>>,
#[serde(with = "serde_vec_bytes")]
pub eccvm_proof: Vec<Vec<u8>>,
#[serde(with = "serde_vec_bytes")]
pub ipa_proof: Vec<Vec<u8>>,
#[serde(with = "serde_vec_bytes")]
pub joint_proof: Vec<Vec<u8>>,
}
/// ChonkVerify
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkVerify {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub proof: ChonkProof,
#[serde(with = "serde_bytes")]
pub vk: Vec<u8>,
}
impl ChonkVerify {
pub fn new(proof: ChonkProof, vk: Vec<u8>) -> Self {
Self {
type_name: "ChonkVerify".to_string(),
proof,
vk,
}
}
}
/// ChonkBatchVerify
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkBatchVerify {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub proofs: Vec<ChonkProof>,
#[serde(with = "serde_vec_bytes")]
pub vks: Vec<Vec<u8>>,
}
impl ChonkBatchVerify {
pub fn new(proofs: Vec<ChonkProof>, vks: Vec<Vec<u8>>) -> Self {
Self {
type_name: "ChonkBatchVerify".to_string(),
proofs,
vks,
}
}
}
/// VkAsFields
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VkAsFields {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub verification_key: Vec<u8>,
}
impl VkAsFields {
pub fn new(verification_key: Vec<u8>) -> Self {
Self {
type_name: "VkAsFields".to_string(),
verification_key,
}
}
}
/// MegaVkAsFields
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MegaVkAsFields {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub verification_key: Vec<u8>,
}
impl MegaVkAsFields {
pub fn new(verification_key: Vec<u8>) -> Self {
Self {
type_name: "MegaVkAsFields".to_string(),
verification_key,
}
}
}
/// CircuitWriteSolidityVerifier
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitWriteSolidityVerifier {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub verification_key: Vec<u8>,
pub settings: ProofSystemSettings,
}
impl CircuitWriteSolidityVerifier {
pub fn new(verification_key: Vec<u8>, settings: ProofSystemSettings) -> Self {
Self {
type_name: "CircuitWriteSolidityVerifier".to_string(),
verification_key,
settings,
}
}
}
/// ChonkCheckPrecomputedVk
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkCheckPrecomputedVk {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub circuit: CircuitInput,
}
impl ChonkCheckPrecomputedVk {
pub fn new(circuit: CircuitInput) -> Self {
Self {
type_name: "ChonkCheckPrecomputedVk".to_string(),
circuit,
}
}
}
/// ChonkStats
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkStats {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub circuit: CircuitInputNoVK,
pub include_gates_per_opcode: bool,
}
impl ChonkStats {
pub fn new(circuit: CircuitInputNoVK, include_gates_per_opcode: bool) -> Self {
Self {
type_name: "ChonkStats".to_string(),
circuit,
include_gates_per_opcode,
}
}
}
/// ChonkCompressProof
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkCompressProof {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub proof: ChonkProof,
}
impl ChonkCompressProof {
pub fn new(proof: ChonkProof) -> Self {
Self {
type_name: "ChonkCompressProof".to_string(),
proof,
}
}
}
/// ChonkDecompressProof
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkDecompressProof {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub compressed_proof: Vec<u8>,
}
impl ChonkDecompressProof {
pub fn new(compressed_proof: Vec<u8>) -> Self {
Self {
type_name: "ChonkDecompressProof".to_string(),
compressed_proof,
}
}
}
/// Poseidon2Hash
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Poseidon2Hash {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_vec_bytes")]
pub inputs: Vec<Vec<u8>>,
}
impl Poseidon2Hash {
pub fn new(inputs: Vec<Vec<u8>>) -> Self {
Self {
type_name: "Poseidon2Hash".to_string(),
inputs,
}
}
}
/// Poseidon2Permutation
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Poseidon2Permutation {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_array4_bytes")]
pub inputs: [Vec<u8>; 4],
}
impl Poseidon2Permutation {
pub fn new(inputs: [Vec<u8>; 4]) -> Self {
Self {
type_name: "Poseidon2Permutation".to_string(),
inputs,
}
}
}
/// PedersenCommit
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PedersenCommit {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_vec_bytes")]
pub inputs: Vec<Vec<u8>>,
pub hash_index: u32,
}
impl PedersenCommit {
pub fn new(inputs: Vec<Vec<u8>>, hash_index: u32) -> Self {
Self {
type_name: "PedersenCommit".to_string(),
inputs,
hash_index,
}
}
}
/// PedersenHash
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PedersenHash {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_vec_bytes")]
pub inputs: Vec<Vec<u8>>,
pub hash_index: u32,
}
impl PedersenHash {
pub fn new(inputs: Vec<Vec<u8>>, hash_index: u32) -> Self {
Self {
type_name: "PedersenHash".to_string(),
inputs,
hash_index,
}
}
}
/// PedersenHashBuffer
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PedersenHashBuffer {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub input: Vec<u8>,
pub hash_index: u32,
}
impl PedersenHashBuffer {
pub fn new(input: Vec<u8>, hash_index: u32) -> Self {
Self {
type_name: "PedersenHashBuffer".to_string(),
input,
hash_index,
}
}
}
/// Blake2s
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Blake2s {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub data: Vec<u8>,
}
impl Blake2s {
pub fn new(data: Vec<u8>) -> Self {
Self {
type_name: "Blake2s".to_string(),
data,
}
}
}
/// Blake2sToField
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Blake2sToField {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub data: Vec<u8>,
}
impl Blake2sToField {
pub fn new(data: Vec<u8>) -> Self {
Self {
type_name: "Blake2sToField".to_string(),
data,
}
}
}
/// AesEncrypt
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AesEncrypt {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub plaintext: Vec<u8>,
#[serde(with = "serde_bytes")]
pub iv: Vec<u8>,
#[serde(with = "serde_bytes")]
pub key: Vec<u8>,
pub length: u32,
}
impl AesEncrypt {
pub fn new(plaintext: Vec<u8>, iv: Vec<u8>, key: Vec<u8>, length: u32) -> Self {
Self {
type_name: "AesEncrypt".to_string(),
plaintext,
iv,
key,
length,
}
}
}
/// AesDecrypt
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AesDecrypt {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub ciphertext: Vec<u8>,
#[serde(with = "serde_bytes")]
pub iv: Vec<u8>,
#[serde(with = "serde_bytes")]
pub key: Vec<u8>,
pub length: u32,
}
impl AesDecrypt {
pub fn new(ciphertext: Vec<u8>, iv: Vec<u8>, key: Vec<u8>, length: u32) -> Self {
Self {
type_name: "AesDecrypt".to_string(),
ciphertext,
iv,
key,
length,
}
}
}
/// GrumpkinPoint
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinPoint {
#[serde(with = "serde_bytes")]
pub x: Vec<u8>,
#[serde(with = "serde_bytes")]
pub y: Vec<u8>,
}
/// GrumpkinMul
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinMul {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub point: GrumpkinPoint,
#[serde(with = "serde_bytes")]
pub scalar: Vec<u8>,
}
impl GrumpkinMul {
pub fn new(point: GrumpkinPoint, scalar: Vec<u8>) -> Self {
Self {
type_name: "GrumpkinMul".to_string(),
point,
scalar,
}
}
}
/// GrumpkinAdd
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinAdd {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub point_a: GrumpkinPoint,
pub point_b: GrumpkinPoint,
}
impl GrumpkinAdd {
pub fn new(point_a: GrumpkinPoint, point_b: GrumpkinPoint) -> Self {
Self {
type_name: "GrumpkinAdd".to_string(),
point_a,
point_b,
}
}
}
/// GrumpkinBatchMul
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinBatchMul {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub points: Vec<GrumpkinPoint>,
#[serde(with = "serde_bytes")]
pub scalar: Vec<u8>,
}
impl GrumpkinBatchMul {
pub fn new(points: Vec<GrumpkinPoint>, scalar: Vec<u8>) -> Self {
Self {
type_name: "GrumpkinBatchMul".to_string(),
points,
scalar,
}
}
}
/// GrumpkinGetRandomFr
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinGetRandomFr {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub dummy: u8,
}
impl GrumpkinGetRandomFr {
pub fn new(dummy: u8) -> Self {
Self {
type_name: "GrumpkinGetRandomFr".to_string(),
dummy,
}
}
}
/// GrumpkinReduce512
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinReduce512 {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub input: Vec<u8>,
}
impl GrumpkinReduce512 {
pub fn new(input: Vec<u8>) -> Self {
Self {
type_name: "GrumpkinReduce512".to_string(),
input,
}
}
}
/// Secp256k1Point
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Secp256k1Point {
#[serde(with = "serde_bytes")]
pub x: Vec<u8>,
#[serde(with = "serde_bytes")]
pub y: Vec<u8>,
}
/// Secp256k1Mul
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Secp256k1Mul {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub point: Secp256k1Point,
#[serde(with = "serde_bytes")]
pub scalar: Vec<u8>,
}
impl Secp256k1Mul {
pub fn new(point: Secp256k1Point, scalar: Vec<u8>) -> Self {
Self {
type_name: "Secp256k1Mul".to_string(),
point,
scalar,
}
}
}
/// Secp256k1GetRandomFr
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Secp256k1GetRandomFr {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub dummy: u8,
}
impl Secp256k1GetRandomFr {
pub fn new(dummy: u8) -> Self {
Self {
type_name: "Secp256k1GetRandomFr".to_string(),
dummy,
}
}
}
/// Secp256k1Reduce512
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Secp256k1Reduce512 {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub input: Vec<u8>,
}
impl Secp256k1Reduce512 {
pub fn new(input: Vec<u8>) -> Self {
Self {
type_name: "Secp256k1Reduce512".to_string(),
input,
}
}
}
/// Bn254FrSqrt
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254FrSqrt {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub input: Vec<u8>,
}
impl Bn254FrSqrt {
pub fn new(input: Vec<u8>) -> Self {
Self {
type_name: "Bn254FrSqrt".to_string(),
input,
}
}
}
/// Bn254FqSqrt
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254FqSqrt {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub input: Vec<u8>,
}
impl Bn254FqSqrt {
pub fn new(input: Vec<u8>) -> Self {
Self {
type_name: "Bn254FqSqrt".to_string(),
input,
}
}
}
/// Bn254G1Point
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254G1Point {
#[serde(with = "serde_bytes")]
pub x: Vec<u8>,
#[serde(with = "serde_bytes")]
pub y: Vec<u8>,
}
/// Bn254G1Mul
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254G1Mul {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub point: Bn254G1Point,
#[serde(with = "serde_bytes")]
pub scalar: Vec<u8>,
}
impl Bn254G1Mul {
pub fn new(point: Bn254G1Point, scalar: Vec<u8>) -> Self {
Self {
type_name: "Bn254G1Mul".to_string(),
point,
scalar,
}
}
}
/// Bn254G2Point
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254G2Point {
pub x: [Vec<u8>; 2],
pub y: [Vec<u8>; 2],
}
/// Bn254G2Mul
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254G2Mul {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub point: Bn254G2Point,
#[serde(with = "serde_bytes")]
pub scalar: Vec<u8>,
}
impl Bn254G2Mul {
pub fn new(point: Bn254G2Point, scalar: Vec<u8>) -> Self {
Self {
type_name: "Bn254G2Mul".to_string(),
point,
scalar,
}
}
}
/// Bn254G1IsOnCurve
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254G1IsOnCurve {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub point: Bn254G1Point,
}
impl Bn254G1IsOnCurve {
pub fn new(point: Bn254G1Point) -> Self {
Self {
type_name: "Bn254G1IsOnCurve".to_string(),
point,
}
}
}
/// Bn254G1FromCompressed
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254G1FromCompressed {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub compressed: Vec<u8>,
}
impl Bn254G1FromCompressed {
pub fn new(compressed: Vec<u8>) -> Self {
Self {
type_name: "Bn254G1FromCompressed".to_string(),
compressed,
}
}
}
/// SchnorrComputePublicKey
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SchnorrComputePublicKey {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub private_key: Vec<u8>,
}
impl SchnorrComputePublicKey {
pub fn new(private_key: Vec<u8>) -> Self {
Self {
type_name: "SchnorrComputePublicKey".to_string(),
private_key,
}
}
}
/// SchnorrConstructSignature
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SchnorrConstructSignature {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub message: Vec<u8>,
#[serde(with = "serde_bytes")]
pub private_key: Vec<u8>,
}
impl SchnorrConstructSignature {
pub fn new(message: Vec<u8>, private_key: Vec<u8>) -> Self {
Self {
type_name: "SchnorrConstructSignature".to_string(),
message,
private_key,
}
}
}
/// SchnorrVerifySignature
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SchnorrVerifySignature {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub message: Vec<u8>,
pub public_key: GrumpkinPoint,
#[serde(with = "serde_bytes")]
pub s: Vec<u8>,
#[serde(with = "serde_bytes")]
pub e: Vec<u8>,
}
impl SchnorrVerifySignature {
pub fn new(message: Vec<u8>, public_key: GrumpkinPoint, s: Vec<u8>, e: Vec<u8>) -> Self {
Self {
type_name: "SchnorrVerifySignature".to_string(),
message,
public_key,
s,
e,
}
}
}
/// EcdsaSecp256k1ComputePublicKey
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256k1ComputePublicKey {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub private_key: Vec<u8>,
}
impl EcdsaSecp256k1ComputePublicKey {
pub fn new(private_key: Vec<u8>) -> Self {
Self {
type_name: "EcdsaSecp256k1ComputePublicKey".to_string(),
private_key,
}
}
}
/// EcdsaSecp256r1ComputePublicKey
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256r1ComputePublicKey {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub private_key: Vec<u8>,
}
impl EcdsaSecp256r1ComputePublicKey {
pub fn new(private_key: Vec<u8>) -> Self {
Self {
type_name: "EcdsaSecp256r1ComputePublicKey".to_string(),
private_key,
}
}
}
/// EcdsaSecp256k1ConstructSignature
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256k1ConstructSignature {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub message: Vec<u8>,
#[serde(with = "serde_bytes")]
pub private_key: Vec<u8>,
}
impl EcdsaSecp256k1ConstructSignature {
pub fn new(message: Vec<u8>, private_key: Vec<u8>) -> Self {
Self {
type_name: "EcdsaSecp256k1ConstructSignature".to_string(),
message,
private_key,
}
}
}
/// EcdsaSecp256r1ConstructSignature
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256r1ConstructSignature {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub message: Vec<u8>,
#[serde(with = "serde_bytes")]
pub private_key: Vec<u8>,
}
impl EcdsaSecp256r1ConstructSignature {
pub fn new(message: Vec<u8>, private_key: Vec<u8>) -> Self {
Self {
type_name: "EcdsaSecp256r1ConstructSignature".to_string(),
message,
private_key,
}
}
}
/// EcdsaSecp256k1RecoverPublicKey
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256k1RecoverPublicKey {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub message: Vec<u8>,
#[serde(with = "serde_bytes")]
pub r: Vec<u8>,
#[serde(with = "serde_bytes")]
pub s: Vec<u8>,
pub v: u8,
}
impl EcdsaSecp256k1RecoverPublicKey {
pub fn new(message: Vec<u8>, r: Vec<u8>, s: Vec<u8>, v: u8) -> Self {
Self {
type_name: "EcdsaSecp256k1RecoverPublicKey".to_string(),
message,
r,
s,
v,
}
}
}
/// EcdsaSecp256r1RecoverPublicKey
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256r1RecoverPublicKey {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub message: Vec<u8>,
#[serde(with = "serde_bytes")]
pub r: Vec<u8>,
#[serde(with = "serde_bytes")]
pub s: Vec<u8>,
pub v: u8,
}
impl EcdsaSecp256r1RecoverPublicKey {
pub fn new(message: Vec<u8>, r: Vec<u8>, s: Vec<u8>, v: u8) -> Self {
Self {
type_name: "EcdsaSecp256r1RecoverPublicKey".to_string(),
message,
r,
s,
v,
}
}
}
/// EcdsaSecp256k1VerifySignature
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256k1VerifySignature {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub message: Vec<u8>,
pub public_key: Secp256k1Point,
#[serde(with = "serde_bytes")]
pub r: Vec<u8>,
#[serde(with = "serde_bytes")]
pub s: Vec<u8>,
pub v: u8,
}
impl EcdsaSecp256k1VerifySignature {
pub fn new(message: Vec<u8>, public_key: Secp256k1Point, r: Vec<u8>, s: Vec<u8>, v: u8) -> Self {
Self {
type_name: "EcdsaSecp256k1VerifySignature".to_string(),
message,
public_key,
r,
s,
v,
}
}
}
/// Secp256r1Point
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Secp256r1Point {
#[serde(with = "serde_bytes")]
pub x: Vec<u8>,
#[serde(with = "serde_bytes")]
pub y: Vec<u8>,
}
/// EcdsaSecp256r1VerifySignature
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256r1VerifySignature {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub message: Vec<u8>,
pub public_key: Secp256r1Point,
#[serde(with = "serde_bytes")]
pub r: Vec<u8>,
#[serde(with = "serde_bytes")]
pub s: Vec<u8>,
pub v: u8,
}
impl EcdsaSecp256r1VerifySignature {
pub fn new(message: Vec<u8>, public_key: Secp256r1Point, r: Vec<u8>, s: Vec<u8>, v: u8) -> Self {
Self {
type_name: "EcdsaSecp256r1VerifySignature".to_string(),
message,
public_key,
r,
s,
v,
}
}
}
/// SrsInitSrs
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SrsInitSrs {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub points_buf: Vec<u8>,
pub num_points: u32,
#[serde(with = "serde_bytes")]
pub g2_point: Vec<u8>,
}
impl SrsInitSrs {
pub fn new(points_buf: Vec<u8>, num_points: u32, g2_point: Vec<u8>) -> Self {
Self {
type_name: "SrsInitSrs".to_string(),
points_buf,
num_points,
g2_point,
}
}
}
/// ChonkBatchVerifierStart
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkBatchVerifierStart {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_vec_bytes")]
pub vks: Vec<Vec<u8>>,
pub num_cores: u32,
pub batch_size: u32,
pub fifo_path: String,
}
impl ChonkBatchVerifierStart {
pub fn new(vks: Vec<Vec<u8>>, num_cores: u32, batch_size: u32, fifo_path: String) -> Self {
Self {
type_name: "ChonkBatchVerifierStart".to_string(),
vks,
num_cores,
batch_size,
fifo_path,
}
}
}
/// ChonkBatchVerifierQueue
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkBatchVerifierQueue {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
pub request_id: u64,
pub vk_index: u32,
#[serde(with = "serde_vec_bytes")]
pub proof_fields: Vec<Vec<u8>>,
}
impl ChonkBatchVerifierQueue {
pub fn new(request_id: u64, vk_index: u32, proof_fields: Vec<Vec<u8>>) -> Self {
Self {
type_name: "ChonkBatchVerifierQueue".to_string(),
request_id,
vk_index,
proof_fields,
}
}
}
/// ChonkBatchVerifierStop
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkBatchVerifierStop {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
}
impl ChonkBatchVerifierStop {
pub fn new() -> Self {
Self {
type_name: "ChonkBatchVerifierStop".to_string(),
}
}
}
/// SrsInitGrumpkinSrs
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SrsInitGrumpkinSrs {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
#[serde(with = "serde_bytes")]
pub points_buf: Vec<u8>,
pub num_points: u32,
}
impl SrsInitGrumpkinSrs {
pub fn new(points_buf: Vec<u8>, num_points: u32) -> Self {
Self {
type_name: "SrsInitGrumpkinSrs".to_string(),
points_buf,
num_points,
}
}
}
/// Shutdown
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Shutdown {
#[serde(rename = "__typename", skip_serializing)]
pub type_name: String,
}
impl Shutdown {
pub fn new() -> Self {
Self {
type_name: "Shutdown".to_string(),
}
}
}
/// ErrorResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ErrorResponse {
pub message: String,
}
/// CircuitProveResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitProveResponse {
#[serde(with = "serde_vec_bytes")]
pub public_inputs: Vec<Vec<u8>>,
#[serde(with = "serde_vec_bytes")]
pub proof: Vec<Vec<u8>>,
pub vk: CircuitComputeVkResponse,
}
/// CircuitInfoResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitInfoResponse {
pub num_gates: u32,
pub num_gates_dyadic: u32,
pub num_acir_opcodes: u32,
pub gates_per_opcode: Vec<u32>,
}
/// CircuitVerifyResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitVerifyResponse {
pub verified: bool,
}
/// ChonkComputeVkResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkComputeVkResponse {
#[serde(with = "serde_bytes")]
pub bytes: Vec<u8>,
#[serde(with = "serde_vec_bytes")]
pub fields: Vec<Vec<u8>>,
}
/// ChonkStartResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkStartResponse {
}
/// ChonkLoadResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkLoadResponse {
}
/// ChonkAccumulateResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkAccumulateResponse {
}
/// ChonkProveResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkProveResponse {
pub proof: ChonkProof,
}
/// ChonkVerifyResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkVerifyResponse {
pub valid: bool,
}
/// ChonkBatchVerifyResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkBatchVerifyResponse {
pub valid: bool,
}
/// VkAsFieldsResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VkAsFieldsResponse {
#[serde(with = "serde_vec_bytes")]
pub fields: Vec<Vec<u8>>,
}
/// MegaVkAsFieldsResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MegaVkAsFieldsResponse {
#[serde(with = "serde_vec_bytes")]
pub fields: Vec<Vec<u8>>,
}
/// CircuitWriteSolidityVerifierResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CircuitWriteSolidityVerifierResponse {
pub solidity_code: String,
}
/// ChonkCheckPrecomputedVkResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkCheckPrecomputedVkResponse {
pub valid: bool,
#[serde(with = "serde_bytes")]
pub actual_vk: Vec<u8>,
}
/// ChonkStatsResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkStatsResponse {
pub acir_opcodes: u32,
pub circuit_size: u32,
pub gates_per_opcode: Vec<u32>,
}
/// ChonkCompressProofResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkCompressProofResponse {
#[serde(with = "serde_bytes")]
pub compressed_proof: Vec<u8>,
}
/// ChonkDecompressProofResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkDecompressProofResponse {
pub proof: ChonkProof,
}
/// Poseidon2HashResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Poseidon2HashResponse {
#[serde(with = "serde_bytes")]
pub hash: Vec<u8>,
}
/// Poseidon2PermutationResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Poseidon2PermutationResponse {
#[serde(with = "serde_array4_bytes")]
pub outputs: [Vec<u8>; 4],
}
/// PedersenCommitResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PedersenCommitResponse {
pub point: GrumpkinPoint,
}
/// PedersenHashResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PedersenHashResponse {
#[serde(with = "serde_bytes")]
pub hash: Vec<u8>,
}
/// PedersenHashBufferResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PedersenHashBufferResponse {
#[serde(with = "serde_bytes")]
pub hash: Vec<u8>,
}
/// Blake2sResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Blake2sResponse {
#[serde(with = "serde_bytes")]
pub hash: Vec<u8>,
}
/// Blake2sToFieldResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Blake2sToFieldResponse {
#[serde(with = "serde_bytes")]
pub field: Vec<u8>,
}
/// AesEncryptResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AesEncryptResponse {
#[serde(with = "serde_bytes")]
pub ciphertext: Vec<u8>,
}
/// AesDecryptResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AesDecryptResponse {
#[serde(with = "serde_bytes")]
pub plaintext: Vec<u8>,
}
/// GrumpkinMulResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinMulResponse {
pub point: GrumpkinPoint,
}
/// GrumpkinAddResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinAddResponse {
pub point: GrumpkinPoint,
}
/// GrumpkinBatchMulResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinBatchMulResponse {
pub points: Vec<GrumpkinPoint>,
}
/// GrumpkinGetRandomFrResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinGetRandomFrResponse {
#[serde(with = "serde_bytes")]
pub value: Vec<u8>,
}
/// GrumpkinReduce512Response
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GrumpkinReduce512Response {
#[serde(with = "serde_bytes")]
pub value: Vec<u8>,
}
/// Secp256k1MulResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Secp256k1MulResponse {
pub point: Secp256k1Point,
}
/// Secp256k1GetRandomFrResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Secp256k1GetRandomFrResponse {
#[serde(with = "serde_bytes")]
pub value: Vec<u8>,
}
/// Secp256k1Reduce512Response
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Secp256k1Reduce512Response {
#[serde(with = "serde_bytes")]
pub value: Vec<u8>,
}
/// Bn254FrSqrtResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254FrSqrtResponse {
pub is_square_root: bool,
#[serde(with = "serde_bytes")]
pub value: Vec<u8>,
}
/// Bn254FqSqrtResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254FqSqrtResponse {
pub is_square_root: bool,
#[serde(with = "serde_bytes")]
pub value: Vec<u8>,
}
/// Bn254G1MulResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254G1MulResponse {
pub point: Bn254G1Point,
}
/// Bn254G2MulResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254G2MulResponse {
pub point: Bn254G2Point,
}
/// Bn254G1IsOnCurveResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254G1IsOnCurveResponse {
pub is_on_curve: bool,
}
/// Bn254G1FromCompressedResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bn254G1FromCompressedResponse {
pub point: Bn254G1Point,
}
/// SchnorrComputePublicKeyResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SchnorrComputePublicKeyResponse {
pub public_key: GrumpkinPoint,
}
/// SchnorrConstructSignatureResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SchnorrConstructSignatureResponse {
#[serde(with = "serde_bytes")]
pub s: Vec<u8>,
#[serde(with = "serde_bytes")]
pub e: Vec<u8>,
}
/// SchnorrVerifySignatureResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SchnorrVerifySignatureResponse {
pub verified: bool,
}
/// EcdsaSecp256k1ComputePublicKeyResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256k1ComputePublicKeyResponse {
pub public_key: Secp256k1Point,
}
/// EcdsaSecp256r1ComputePublicKeyResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256r1ComputePublicKeyResponse {
pub public_key: Secp256r1Point,
}
/// EcdsaSecp256k1ConstructSignatureResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256k1ConstructSignatureResponse {
#[serde(with = "serde_bytes")]
pub r: Vec<u8>,
#[serde(with = "serde_bytes")]
pub s: Vec<u8>,
pub v: u8,
}
/// EcdsaSecp256r1ConstructSignatureResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256r1ConstructSignatureResponse {
#[serde(with = "serde_bytes")]
pub r: Vec<u8>,
#[serde(with = "serde_bytes")]
pub s: Vec<u8>,
pub v: u8,
}
/// EcdsaSecp256k1RecoverPublicKeyResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256k1RecoverPublicKeyResponse {
pub public_key: Secp256k1Point,
}
/// EcdsaSecp256r1RecoverPublicKeyResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256r1RecoverPublicKeyResponse {
pub public_key: Secp256r1Point,
}
/// EcdsaSecp256k1VerifySignatureResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256k1VerifySignatureResponse {
pub verified: bool,
}
/// EcdsaSecp256r1VerifySignatureResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EcdsaSecp256r1VerifySignatureResponse {
pub verified: bool,
}
/// SrsInitSrsResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SrsInitSrsResponse {
#[serde(with = "serde_bytes")]
pub points_buf: Vec<u8>,
}
/// ChonkBatchVerifierStartResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkBatchVerifierStartResponse {
}
/// ChonkBatchVerifierQueueResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkBatchVerifierQueueResponse {
}
/// ChonkBatchVerifierStopResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChonkBatchVerifierStopResponse {
}
/// SrsInitGrumpkinSrsResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SrsInitGrumpkinSrsResponse {
pub dummy: u8,
}
/// ShutdownResponse
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ShutdownResponse {
}
/// Command enum - wraps all possible commands
#[derive(Debug, Clone)]
pub enum Command {
CircuitComputeVkResponse(CircuitComputeVkResponse),
CircuitInput(CircuitInput),
ProofSystemSettings(ProofSystemSettings),
CircuitProve(CircuitProve),
CircuitInputNoVK(CircuitInputNoVK),
CircuitComputeVk(CircuitComputeVk),
CircuitStats(CircuitStats),
CircuitVerify(CircuitVerify),
ChonkComputeVk(ChonkComputeVk),
ChonkStart(ChonkStart),
ChonkLoad(ChonkLoad),
ChonkAccumulate(ChonkAccumulate),
ChonkProve(ChonkProve),
ChonkProof(ChonkProof),
ChonkVerify(ChonkVerify),
ChonkBatchVerify(ChonkBatchVerify),
VkAsFields(VkAsFields),
MegaVkAsFields(MegaVkAsFields),
CircuitWriteSolidityVerifier(CircuitWriteSolidityVerifier),
ChonkCheckPrecomputedVk(ChonkCheckPrecomputedVk),
ChonkStats(ChonkStats),
ChonkCompressProof(ChonkCompressProof),
ChonkDecompressProof(ChonkDecompressProof),
Poseidon2Hash(Poseidon2Hash),
Poseidon2Permutation(Poseidon2Permutation),
PedersenCommit(PedersenCommit),
PedersenHash(PedersenHash),
PedersenHashBuffer(PedersenHashBuffer),
Blake2s(Blake2s),
Blake2sToField(Blake2sToField),
AesEncrypt(AesEncrypt),
AesDecrypt(AesDecrypt),
GrumpkinPoint(GrumpkinPoint),
GrumpkinMul(GrumpkinMul),
GrumpkinAdd(GrumpkinAdd),
GrumpkinBatchMul(GrumpkinBatchMul),
GrumpkinGetRandomFr(GrumpkinGetRandomFr),
GrumpkinReduce512(GrumpkinReduce512),
Secp256k1Point(Secp256k1Point),
Secp256k1Mul(Secp256k1Mul),
Secp256k1GetRandomFr(Secp256k1GetRandomFr),
Secp256k1Reduce512(Secp256k1Reduce512),
Bn254FrSqrt(Bn254FrSqrt),
Bn254FqSqrt(Bn254FqSqrt),
Bn254G1Point(Bn254G1Point),
Bn254G1Mul(Bn254G1Mul),
Bn254G2Point(Bn254G2Point),
Bn254G2Mul(Bn254G2Mul),
Bn254G1IsOnCurve(Bn254G1IsOnCurve),
Bn254G1FromCompressed(Bn254G1FromCompressed),
SchnorrComputePublicKey(SchnorrComputePublicKey),
SchnorrConstructSignature(SchnorrConstructSignature),
SchnorrVerifySignature(SchnorrVerifySignature),
EcdsaSecp256k1ComputePublicKey(EcdsaSecp256k1ComputePublicKey),
EcdsaSecp256r1ComputePublicKey(EcdsaSecp256r1ComputePublicKey),
EcdsaSecp256k1ConstructSignature(EcdsaSecp256k1ConstructSignature),
EcdsaSecp256r1ConstructSignature(EcdsaSecp256r1ConstructSignature),
EcdsaSecp256k1RecoverPublicKey(EcdsaSecp256k1RecoverPublicKey),
EcdsaSecp256r1RecoverPublicKey(EcdsaSecp256r1RecoverPublicKey),
EcdsaSecp256k1VerifySignature(EcdsaSecp256k1VerifySignature),
Secp256r1Point(Secp256r1Point),
EcdsaSecp256r1VerifySignature(EcdsaSecp256r1VerifySignature),
SrsInitSrs(SrsInitSrs),
ChonkBatchVerifierStart(ChonkBatchVerifierStart),
ChonkBatchVerifierQueue(ChonkBatchVerifierQueue),
ChonkBatchVerifierStop(ChonkBatchVerifierStop),
SrsInitGrumpkinSrs(SrsInitGrumpkinSrs),
Shutdown(Shutdown),
}
impl Serialize for Command {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: serde::Serializer {
use serde::ser::SerializeTuple;
let mut tuple = serializer.serialize_tuple(2)?;
match self {
Command::CircuitComputeVkResponse(data) => {
tuple.serialize_element("CircuitComputeVkResponse")?;
tuple.serialize_element(data)?;
}
Command::CircuitInput(data) => {
tuple.serialize_element("CircuitInput")?;
tuple.serialize_element(data)?;
}
Command::ProofSystemSettings(data) => {
tuple.serialize_element("ProofSystemSettings")?;
tuple.serialize_element(data)?;
}
Command::CircuitProve(data) => {
tuple.serialize_element("CircuitProve")?;
tuple.serialize_element(data)?;
}
Command::CircuitInputNoVK(data) => {
tuple.serialize_element("CircuitInputNoVK")?;
tuple.serialize_element(data)?;
}
Command::CircuitComputeVk(data) => {
tuple.serialize_element("CircuitComputeVk")?;
tuple.serialize_element(data)?;
}
Command::CircuitStats(data) => {
tuple.serialize_element("CircuitStats")?;
tuple.serialize_element(data)?;
}
Command::CircuitVerify(data) => {
tuple.serialize_element("CircuitVerify")?;
tuple.serialize_element(data)?;
}
Command::ChonkComputeVk(data) => {
tuple.serialize_element("ChonkComputeVk")?;
tuple.serialize_element(data)?;
}
Command::ChonkStart(data) => {
tuple.serialize_element("ChonkStart")?;
tuple.serialize_element(data)?;
}
Command::ChonkLoad(data) => {
tuple.serialize_element("ChonkLoad")?;
tuple.serialize_element(data)?;
}
Command::ChonkAccumulate(data) => {
tuple.serialize_element("ChonkAccumulate")?;
tuple.serialize_element(data)?;
}
Command::ChonkProve(data) => {
tuple.serialize_element("ChonkProve")?;
tuple.serialize_element(data)?;
}
Command::ChonkProof(data) => {
tuple.serialize_element("ChonkProof")?;
tuple.serialize_element(data)?;
}
Command::ChonkVerify(data) => {
tuple.serialize_element("ChonkVerify")?;
tuple.serialize_element(data)?;
}
Command::ChonkBatchVerify(data) => {
tuple.serialize_element("ChonkBatchVerify")?;
tuple.serialize_element(data)?;
}
Command::VkAsFields(data) => {
tuple.serialize_element("VkAsFields")?;
tuple.serialize_element(data)?;
}
Command::MegaVkAsFields(data) => {
tuple.serialize_element("MegaVkAsFields")?;
tuple.serialize_element(data)?;
}
Command::CircuitWriteSolidityVerifier(data) => {
tuple.serialize_element("CircuitWriteSolidityVerifier")?;
tuple.serialize_element(data)?;
}
Command::ChonkCheckPrecomputedVk(data) => {
tuple.serialize_element("ChonkCheckPrecomputedVk")?;
tuple.serialize_element(data)?;
}
Command::ChonkStats(data) => {
tuple.serialize_element("ChonkStats")?;
tuple.serialize_element(data)?;
}
Command::ChonkCompressProof(data) => {
tuple.serialize_element("ChonkCompressProof")?;
tuple.serialize_element(data)?;
}
Command::ChonkDecompressProof(data) => {
tuple.serialize_element("ChonkDecompressProof")?;
tuple.serialize_element(data)?;
}
Command::Poseidon2Hash(data) => {
tuple.serialize_element("Poseidon2Hash")?;
tuple.serialize_element(data)?;
}
Command::Poseidon2Permutation(data) => {
tuple.serialize_element("Poseidon2Permutation")?;
tuple.serialize_element(data)?;
}
Command::PedersenCommit(data) => {
tuple.serialize_element("PedersenCommit")?;
tuple.serialize_element(data)?;
}
Command::PedersenHash(data) => {
tuple.serialize_element("PedersenHash")?;
tuple.serialize_element(data)?;
}
Command::PedersenHashBuffer(data) => {
tuple.serialize_element("PedersenHashBuffer")?;
tuple.serialize_element(data)?;
}
Command::Blake2s(data) => {
tuple.serialize_element("Blake2s")?;
tuple.serialize_element(data)?;
}
Command::Blake2sToField(data) => {
tuple.serialize_element("Blake2sToField")?;
tuple.serialize_element(data)?;
}
Command::AesEncrypt(data) => {
tuple.serialize_element("AesEncrypt")?;
tuple.serialize_element(data)?;
}
Command::AesDecrypt(data) => {
tuple.serialize_element("AesDecrypt")?;
tuple.serialize_element(data)?;
}
Command::GrumpkinPoint(data) => {
tuple.serialize_element("GrumpkinPoint")?;
tuple.serialize_element(data)?;
}
Command::GrumpkinMul(data) => {
tuple.serialize_element("GrumpkinMul")?;
tuple.serialize_element(data)?;
}
Command::GrumpkinAdd(data) => {
tuple.serialize_element("GrumpkinAdd")?;
tuple.serialize_element(data)?;
}
Command::GrumpkinBatchMul(data) => {
tuple.serialize_element("GrumpkinBatchMul")?;
tuple.serialize_element(data)?;
}
Command::GrumpkinGetRandomFr(data) => {
tuple.serialize_element("GrumpkinGetRandomFr")?;
tuple.serialize_element(data)?;
}
Command::GrumpkinReduce512(data) => {
tuple.serialize_element("GrumpkinReduce512")?;
tuple.serialize_element(data)?;
}
Command::Secp256k1Point(data) => {
tuple.serialize_element("Secp256k1Point")?;
tuple.serialize_element(data)?;
}
Command::Secp256k1Mul(data) => {
tuple.serialize_element("Secp256k1Mul")?;
tuple.serialize_element(data)?;
}
Command::Secp256k1GetRandomFr(data) => {
tuple.serialize_element("Secp256k1GetRandomFr")?;
tuple.serialize_element(data)?;
}
Command::Secp256k1Reduce512(data) => {
tuple.serialize_element("Secp256k1Reduce512")?;
tuple.serialize_element(data)?;
}
Command::Bn254FrSqrt(data) => {
tuple.serialize_element("Bn254FrSqrt")?;
tuple.serialize_element(data)?;
}
Command::Bn254FqSqrt(data) => {
tuple.serialize_element("Bn254FqSqrt")?;
tuple.serialize_element(data)?;
}
Command::Bn254G1Point(data) => {
tuple.serialize_element("Bn254G1Point")?;
tuple.serialize_element(data)?;
}
Command::Bn254G1Mul(data) => {
tuple.serialize_element("Bn254G1Mul")?;
tuple.serialize_element(data)?;
}
Command::Bn254G2Point(data) => {
tuple.serialize_element("Bn254G2Point")?;
tuple.serialize_element(data)?;
}
Command::Bn254G2Mul(data) => {
tuple.serialize_element("Bn254G2Mul")?;
tuple.serialize_element(data)?;
}
Command::Bn254G1IsOnCurve(data) => {
tuple.serialize_element("Bn254G1IsOnCurve")?;
tuple.serialize_element(data)?;
}
Command::Bn254G1FromCompressed(data) => {
tuple.serialize_element("Bn254G1FromCompressed")?;
tuple.serialize_element(data)?;
}
Command::SchnorrComputePublicKey(data) => {
tuple.serialize_element("SchnorrComputePublicKey")?;
tuple.serialize_element(data)?;
}
Command::SchnorrConstructSignature(data) => {
tuple.serialize_element("SchnorrConstructSignature")?;
tuple.serialize_element(data)?;
}
Command::SchnorrVerifySignature(data) => {
tuple.serialize_element("SchnorrVerifySignature")?;
tuple.serialize_element(data)?;
}
Command::EcdsaSecp256k1ComputePublicKey(data) => {
tuple.serialize_element("EcdsaSecp256k1ComputePublicKey")?;
tuple.serialize_element(data)?;
}
Command::EcdsaSecp256r1ComputePublicKey(data) => {
tuple.serialize_element("EcdsaSecp256r1ComputePublicKey")?;
tuple.serialize_element(data)?;
}
Command::EcdsaSecp256k1ConstructSignature(data) => {
tuple.serialize_element("EcdsaSecp256k1ConstructSignature")?;
tuple.serialize_element(data)?;
}
Command::EcdsaSecp256r1ConstructSignature(data) => {
tuple.serialize_element("EcdsaSecp256r1ConstructSignature")?;
tuple.serialize_element(data)?;
}
Command::EcdsaSecp256k1RecoverPublicKey(data) => {
tuple.serialize_element("EcdsaSecp256k1RecoverPublicKey")?;
tuple.serialize_element(data)?;
}
Command::EcdsaSecp256r1RecoverPublicKey(data) => {
tuple.serialize_element("EcdsaSecp256r1RecoverPublicKey")?;
tuple.serialize_element(data)?;
}
Command::EcdsaSecp256k1VerifySignature(data) => {
tuple.serialize_element("EcdsaSecp256k1VerifySignature")?;
tuple.serialize_element(data)?;
}
Command::Secp256r1Point(data) => {
tuple.serialize_element("Secp256r1Point")?;
tuple.serialize_element(data)?;
}
Command::EcdsaSecp256r1VerifySignature(data) => {
tuple.serialize_element("EcdsaSecp256r1VerifySignature")?;
tuple.serialize_element(data)?;
}
Command::SrsInitSrs(data) => {
tuple.serialize_element("SrsInitSrs")?;
tuple.serialize_element(data)?;
}
Command::ChonkBatchVerifierStart(data) => {
tuple.serialize_element("ChonkBatchVerifierStart")?;
tuple.serialize_element(data)?;
}
Command::ChonkBatchVerifierQueue(data) => {
tuple.serialize_element("ChonkBatchVerifierQueue")?;
tuple.serialize_element(data)?;
}
Command::ChonkBatchVerifierStop(data) => {
tuple.serialize_element("ChonkBatchVerifierStop")?;
tuple.serialize_element(data)?;
}
Command::SrsInitGrumpkinSrs(data) => {
tuple.serialize_element("SrsInitGrumpkinSrs")?;
tuple.serialize_element(data)?;
}
Command::Shutdown(data) => {
tuple.serialize_element("Shutdown")?;
tuple.serialize_element(data)?;
}
}
tuple.end()
}
}
impl<'de> Deserialize<'de> for Command {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: serde::Deserializer<'de> {
use serde::de::{SeqAccess, Visitor};
struct CommandVisitor;
impl<'de> Visitor<'de> for CommandVisitor {
type Value = Command;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a 2-element array [name, payload]")
}
fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
where A: SeqAccess<'de> {
let name: String = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(0, &self))?;
match name.as_str() {
"CircuitComputeVkResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::CircuitComputeVkResponse(data))
}
"CircuitInput" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::CircuitInput(data))
}
"ProofSystemSettings" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ProofSystemSettings(data))
}
"CircuitProve" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::CircuitProve(data))
}
"CircuitInputNoVK" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::CircuitInputNoVK(data))
}
"CircuitComputeVk" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::CircuitComputeVk(data))
}
"CircuitStats" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::CircuitStats(data))
}
"CircuitVerify" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::CircuitVerify(data))
}
"ChonkComputeVk" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkComputeVk(data))
}
"ChonkStart" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkStart(data))
}
"ChonkLoad" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkLoad(data))
}
"ChonkAccumulate" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkAccumulate(data))
}
"ChonkProve" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkProve(data))
}
"ChonkProof" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkProof(data))
}
"ChonkVerify" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkVerify(data))
}
"ChonkBatchVerify" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkBatchVerify(data))
}
"VkAsFields" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::VkAsFields(data))
}
"MegaVkAsFields" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::MegaVkAsFields(data))
}
"CircuitWriteSolidityVerifier" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::CircuitWriteSolidityVerifier(data))
}
"ChonkCheckPrecomputedVk" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkCheckPrecomputedVk(data))
}
"ChonkStats" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkStats(data))
}
"ChonkCompressProof" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkCompressProof(data))
}
"ChonkDecompressProof" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkDecompressProof(data))
}
"Poseidon2Hash" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Poseidon2Hash(data))
}
"Poseidon2Permutation" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Poseidon2Permutation(data))
}
"PedersenCommit" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::PedersenCommit(data))
}
"PedersenHash" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::PedersenHash(data))
}
"PedersenHashBuffer" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::PedersenHashBuffer(data))
}
"Blake2s" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Blake2s(data))
}
"Blake2sToField" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Blake2sToField(data))
}
"AesEncrypt" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::AesEncrypt(data))
}
"AesDecrypt" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::AesDecrypt(data))
}
"GrumpkinPoint" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::GrumpkinPoint(data))
}
"GrumpkinMul" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::GrumpkinMul(data))
}
"GrumpkinAdd" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::GrumpkinAdd(data))
}
"GrumpkinBatchMul" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::GrumpkinBatchMul(data))
}
"GrumpkinGetRandomFr" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::GrumpkinGetRandomFr(data))
}
"GrumpkinReduce512" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::GrumpkinReduce512(data))
}
"Secp256k1Point" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Secp256k1Point(data))
}
"Secp256k1Mul" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Secp256k1Mul(data))
}
"Secp256k1GetRandomFr" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Secp256k1GetRandomFr(data))
}
"Secp256k1Reduce512" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Secp256k1Reduce512(data))
}
"Bn254FrSqrt" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Bn254FrSqrt(data))
}
"Bn254FqSqrt" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Bn254FqSqrt(data))
}
"Bn254G1Point" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Bn254G1Point(data))
}
"Bn254G1Mul" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Bn254G1Mul(data))
}
"Bn254G2Point" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Bn254G2Point(data))
}
"Bn254G2Mul" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Bn254G2Mul(data))
}
"Bn254G1IsOnCurve" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Bn254G1IsOnCurve(data))
}
"Bn254G1FromCompressed" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Bn254G1FromCompressed(data))
}
"SchnorrComputePublicKey" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::SchnorrComputePublicKey(data))
}
"SchnorrConstructSignature" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::SchnorrConstructSignature(data))
}
"SchnorrVerifySignature" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::SchnorrVerifySignature(data))
}
"EcdsaSecp256k1ComputePublicKey" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::EcdsaSecp256k1ComputePublicKey(data))
}
"EcdsaSecp256r1ComputePublicKey" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::EcdsaSecp256r1ComputePublicKey(data))
}
"EcdsaSecp256k1ConstructSignature" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::EcdsaSecp256k1ConstructSignature(data))
}
"EcdsaSecp256r1ConstructSignature" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::EcdsaSecp256r1ConstructSignature(data))
}
"EcdsaSecp256k1RecoverPublicKey" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::EcdsaSecp256k1RecoverPublicKey(data))
}
"EcdsaSecp256r1RecoverPublicKey" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::EcdsaSecp256r1RecoverPublicKey(data))
}
"EcdsaSecp256k1VerifySignature" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::EcdsaSecp256k1VerifySignature(data))
}
"Secp256r1Point" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Secp256r1Point(data))
}
"EcdsaSecp256r1VerifySignature" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::EcdsaSecp256r1VerifySignature(data))
}
"SrsInitSrs" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::SrsInitSrs(data))
}
"ChonkBatchVerifierStart" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkBatchVerifierStart(data))
}
"ChonkBatchVerifierQueue" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkBatchVerifierQueue(data))
}
"ChonkBatchVerifierStop" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::ChonkBatchVerifierStop(data))
}
"SrsInitGrumpkinSrs" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::SrsInitGrumpkinSrs(data))
}
"Shutdown" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Command::Shutdown(data))
}
_ => Err(serde::de::Error::unknown_variant(&name, &["CircuitComputeVkResponse", "CircuitInput", "ProofSystemSettings", "CircuitProve", "CircuitInputNoVK", "CircuitComputeVk", "CircuitStats", "CircuitVerify", "ChonkComputeVk", "ChonkStart", "ChonkLoad", "ChonkAccumulate", "ChonkProve", "ChonkProof", "ChonkVerify", "ChonkBatchVerify", "VkAsFields", "MegaVkAsFields", "CircuitWriteSolidityVerifier", "ChonkCheckPrecomputedVk", "ChonkStats", "ChonkCompressProof", "ChonkDecompressProof", "Poseidon2Hash", "Poseidon2Permutation", "PedersenCommit", "PedersenHash", "PedersenHashBuffer", "Blake2s", "Blake2sToField", "AesEncrypt", "AesDecrypt", "GrumpkinPoint", "GrumpkinMul", "GrumpkinAdd", "GrumpkinBatchMul", "GrumpkinGetRandomFr", "GrumpkinReduce512", "Secp256k1Point", "Secp256k1Mul", "Secp256k1GetRandomFr", "Secp256k1Reduce512", "Bn254FrSqrt", "Bn254FqSqrt", "Bn254G1Point", "Bn254G1Mul", "Bn254G2Point", "Bn254G2Mul", "Bn254G1IsOnCurve", "Bn254G1FromCompressed", "SchnorrComputePublicKey", "SchnorrConstructSignature", "SchnorrVerifySignature", "EcdsaSecp256k1ComputePublicKey", "EcdsaSecp256r1ComputePublicKey", "EcdsaSecp256k1ConstructSignature", "EcdsaSecp256r1ConstructSignature", "EcdsaSecp256k1RecoverPublicKey", "EcdsaSecp256r1RecoverPublicKey", "EcdsaSecp256k1VerifySignature", "Secp256r1Point", "EcdsaSecp256r1VerifySignature", "SrsInitSrs", "ChonkBatchVerifierStart", "ChonkBatchVerifierQueue", "ChonkBatchVerifierStop", "SrsInitGrumpkinSrs", "Shutdown"])),
}
}
}
deserializer.deserialize_tuple(2, CommandVisitor)
}
}
/// Response enum - wraps all possible responses
#[derive(Debug, Clone)]
pub enum Response {
CircuitProveResponse(CircuitProveResponse),
CircuitComputeVkResponse(CircuitComputeVkResponse),
CircuitInfoResponse(CircuitInfoResponse),
CircuitVerifyResponse(CircuitVerifyResponse),
ChonkComputeVkResponse(ChonkComputeVkResponse),
ChonkStartResponse(ChonkStartResponse),
ChonkLoadResponse(ChonkLoadResponse),
ChonkAccumulateResponse(ChonkAccumulateResponse),
ChonkProveResponse(ChonkProveResponse),
ChonkVerifyResponse(ChonkVerifyResponse),
ChonkBatchVerifyResponse(ChonkBatchVerifyResponse),
VkAsFieldsResponse(VkAsFieldsResponse),
MegaVkAsFieldsResponse(MegaVkAsFieldsResponse),
CircuitWriteSolidityVerifierResponse(CircuitWriteSolidityVerifierResponse),
ChonkCheckPrecomputedVkResponse(ChonkCheckPrecomputedVkResponse),
ChonkStatsResponse(ChonkStatsResponse),
ChonkCompressProofResponse(ChonkCompressProofResponse),
ChonkDecompressProofResponse(ChonkDecompressProofResponse),
Poseidon2HashResponse(Poseidon2HashResponse),
Poseidon2PermutationResponse(Poseidon2PermutationResponse),
PedersenCommitResponse(PedersenCommitResponse),
PedersenHashResponse(PedersenHashResponse),
PedersenHashBufferResponse(PedersenHashBufferResponse),
Blake2sResponse(Blake2sResponse),
Blake2sToFieldResponse(Blake2sToFieldResponse),
AesEncryptResponse(AesEncryptResponse),
AesDecryptResponse(AesDecryptResponse),
GrumpkinMulResponse(GrumpkinMulResponse),
GrumpkinAddResponse(GrumpkinAddResponse),
GrumpkinBatchMulResponse(GrumpkinBatchMulResponse),
GrumpkinGetRandomFrResponse(GrumpkinGetRandomFrResponse),
GrumpkinReduce512Response(GrumpkinReduce512Response),
Secp256k1MulResponse(Secp256k1MulResponse),
Secp256k1GetRandomFrResponse(Secp256k1GetRandomFrResponse),
Secp256k1Reduce512Response(Secp256k1Reduce512Response),
Bn254FrSqrtResponse(Bn254FrSqrtResponse),
Bn254FqSqrtResponse(Bn254FqSqrtResponse),
Bn254G1MulResponse(Bn254G1MulResponse),
Bn254G2MulResponse(Bn254G2MulResponse),
Bn254G1IsOnCurveResponse(Bn254G1IsOnCurveResponse),
Bn254G1FromCompressedResponse(Bn254G1FromCompressedResponse),
SchnorrComputePublicKeyResponse(SchnorrComputePublicKeyResponse),
SchnorrConstructSignatureResponse(SchnorrConstructSignatureResponse),
SchnorrVerifySignatureResponse(SchnorrVerifySignatureResponse),
EcdsaSecp256k1ComputePublicKeyResponse(EcdsaSecp256k1ComputePublicKeyResponse),
EcdsaSecp256r1ComputePublicKeyResponse(EcdsaSecp256r1ComputePublicKeyResponse),
EcdsaSecp256k1ConstructSignatureResponse(EcdsaSecp256k1ConstructSignatureResponse),
EcdsaSecp256r1ConstructSignatureResponse(EcdsaSecp256r1ConstructSignatureResponse),
EcdsaSecp256k1RecoverPublicKeyResponse(EcdsaSecp256k1RecoverPublicKeyResponse),
EcdsaSecp256r1RecoverPublicKeyResponse(EcdsaSecp256r1RecoverPublicKeyResponse),
EcdsaSecp256k1VerifySignatureResponse(EcdsaSecp256k1VerifySignatureResponse),
EcdsaSecp256r1VerifySignatureResponse(EcdsaSecp256r1VerifySignatureResponse),
SrsInitSrsResponse(SrsInitSrsResponse),
ChonkBatchVerifierStartResponse(ChonkBatchVerifierStartResponse),
ChonkBatchVerifierQueueResponse(ChonkBatchVerifierQueueResponse),
ChonkBatchVerifierStopResponse(ChonkBatchVerifierStopResponse),
SrsInitGrumpkinSrsResponse(SrsInitGrumpkinSrsResponse),
ShutdownResponse(ShutdownResponse),
ErrorResponse(ErrorResponse),
}
impl Serialize for Response {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: serde::Serializer {
use serde::ser::SerializeTuple;
let mut tuple = serializer.serialize_tuple(2)?;
match self {
Response::CircuitProveResponse(data) => {
tuple.serialize_element("CircuitProveResponse")?;
tuple.serialize_element(data)?;
}
Response::CircuitComputeVkResponse(data) => {
tuple.serialize_element("CircuitComputeVkResponse")?;
tuple.serialize_element(data)?;
}
Response::CircuitInfoResponse(data) => {
tuple.serialize_element("CircuitInfoResponse")?;
tuple.serialize_element(data)?;
}
Response::CircuitVerifyResponse(data) => {
tuple.serialize_element("CircuitVerifyResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkComputeVkResponse(data) => {
tuple.serialize_element("ChonkComputeVkResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkStartResponse(data) => {
tuple.serialize_element("ChonkStartResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkLoadResponse(data) => {
tuple.serialize_element("ChonkLoadResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkAccumulateResponse(data) => {
tuple.serialize_element("ChonkAccumulateResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkProveResponse(data) => {
tuple.serialize_element("ChonkProveResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkVerifyResponse(data) => {
tuple.serialize_element("ChonkVerifyResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkBatchVerifyResponse(data) => {
tuple.serialize_element("ChonkBatchVerifyResponse")?;
tuple.serialize_element(data)?;
}
Response::VkAsFieldsResponse(data) => {
tuple.serialize_element("VkAsFieldsResponse")?;
tuple.serialize_element(data)?;
}
Response::MegaVkAsFieldsResponse(data) => {
tuple.serialize_element("MegaVkAsFieldsResponse")?;
tuple.serialize_element(data)?;
}
Response::CircuitWriteSolidityVerifierResponse(data) => {
tuple.serialize_element("CircuitWriteSolidityVerifierResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkCheckPrecomputedVkResponse(data) => {
tuple.serialize_element("ChonkCheckPrecomputedVkResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkStatsResponse(data) => {
tuple.serialize_element("ChonkStatsResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkCompressProofResponse(data) => {
tuple.serialize_element("ChonkCompressProofResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkDecompressProofResponse(data) => {
tuple.serialize_element("ChonkDecompressProofResponse")?;
tuple.serialize_element(data)?;
}
Response::Poseidon2HashResponse(data) => {
tuple.serialize_element("Poseidon2HashResponse")?;
tuple.serialize_element(data)?;
}
Response::Poseidon2PermutationResponse(data) => {
tuple.serialize_element("Poseidon2PermutationResponse")?;
tuple.serialize_element(data)?;
}
Response::PedersenCommitResponse(data) => {
tuple.serialize_element("PedersenCommitResponse")?;
tuple.serialize_element(data)?;
}
Response::PedersenHashResponse(data) => {
tuple.serialize_element("PedersenHashResponse")?;
tuple.serialize_element(data)?;
}
Response::PedersenHashBufferResponse(data) => {
tuple.serialize_element("PedersenHashBufferResponse")?;
tuple.serialize_element(data)?;
}
Response::Blake2sResponse(data) => {
tuple.serialize_element("Blake2sResponse")?;
tuple.serialize_element(data)?;
}
Response::Blake2sToFieldResponse(data) => {
tuple.serialize_element("Blake2sToFieldResponse")?;
tuple.serialize_element(data)?;
}
Response::AesEncryptResponse(data) => {
tuple.serialize_element("AesEncryptResponse")?;
tuple.serialize_element(data)?;
}
Response::AesDecryptResponse(data) => {
tuple.serialize_element("AesDecryptResponse")?;
tuple.serialize_element(data)?;
}
Response::GrumpkinMulResponse(data) => {
tuple.serialize_element("GrumpkinMulResponse")?;
tuple.serialize_element(data)?;
}
Response::GrumpkinAddResponse(data) => {
tuple.serialize_element("GrumpkinAddResponse")?;
tuple.serialize_element(data)?;
}
Response::GrumpkinBatchMulResponse(data) => {
tuple.serialize_element("GrumpkinBatchMulResponse")?;
tuple.serialize_element(data)?;
}
Response::GrumpkinGetRandomFrResponse(data) => {
tuple.serialize_element("GrumpkinGetRandomFrResponse")?;
tuple.serialize_element(data)?;
}
Response::GrumpkinReduce512Response(data) => {
tuple.serialize_element("GrumpkinReduce512Response")?;
tuple.serialize_element(data)?;
}
Response::Secp256k1MulResponse(data) => {
tuple.serialize_element("Secp256k1MulResponse")?;
tuple.serialize_element(data)?;
}
Response::Secp256k1GetRandomFrResponse(data) => {
tuple.serialize_element("Secp256k1GetRandomFrResponse")?;
tuple.serialize_element(data)?;
}
Response::Secp256k1Reduce512Response(data) => {
tuple.serialize_element("Secp256k1Reduce512Response")?;
tuple.serialize_element(data)?;
}
Response::Bn254FrSqrtResponse(data) => {
tuple.serialize_element("Bn254FrSqrtResponse")?;
tuple.serialize_element(data)?;
}
Response::Bn254FqSqrtResponse(data) => {
tuple.serialize_element("Bn254FqSqrtResponse")?;
tuple.serialize_element(data)?;
}
Response::Bn254G1MulResponse(data) => {
tuple.serialize_element("Bn254G1MulResponse")?;
tuple.serialize_element(data)?;
}
Response::Bn254G2MulResponse(data) => {
tuple.serialize_element("Bn254G2MulResponse")?;
tuple.serialize_element(data)?;
}
Response::Bn254G1IsOnCurveResponse(data) => {
tuple.serialize_element("Bn254G1IsOnCurveResponse")?;
tuple.serialize_element(data)?;
}
Response::Bn254G1FromCompressedResponse(data) => {
tuple.serialize_element("Bn254G1FromCompressedResponse")?;
tuple.serialize_element(data)?;
}
Response::SchnorrComputePublicKeyResponse(data) => {
tuple.serialize_element("SchnorrComputePublicKeyResponse")?;
tuple.serialize_element(data)?;
}
Response::SchnorrConstructSignatureResponse(data) => {
tuple.serialize_element("SchnorrConstructSignatureResponse")?;
tuple.serialize_element(data)?;
}
Response::SchnorrVerifySignatureResponse(data) => {
tuple.serialize_element("SchnorrVerifySignatureResponse")?;
tuple.serialize_element(data)?;
}
Response::EcdsaSecp256k1ComputePublicKeyResponse(data) => {
tuple.serialize_element("EcdsaSecp256k1ComputePublicKeyResponse")?;
tuple.serialize_element(data)?;
}
Response::EcdsaSecp256r1ComputePublicKeyResponse(data) => {
tuple.serialize_element("EcdsaSecp256r1ComputePublicKeyResponse")?;
tuple.serialize_element(data)?;
}
Response::EcdsaSecp256k1ConstructSignatureResponse(data) => {
tuple.serialize_element("EcdsaSecp256k1ConstructSignatureResponse")?;
tuple.serialize_element(data)?;
}
Response::EcdsaSecp256r1ConstructSignatureResponse(data) => {
tuple.serialize_element("EcdsaSecp256r1ConstructSignatureResponse")?;
tuple.serialize_element(data)?;
}
Response::EcdsaSecp256k1RecoverPublicKeyResponse(data) => {
tuple.serialize_element("EcdsaSecp256k1RecoverPublicKeyResponse")?;
tuple.serialize_element(data)?;
}
Response::EcdsaSecp256r1RecoverPublicKeyResponse(data) => {
tuple.serialize_element("EcdsaSecp256r1RecoverPublicKeyResponse")?;
tuple.serialize_element(data)?;
}
Response::EcdsaSecp256k1VerifySignatureResponse(data) => {
tuple.serialize_element("EcdsaSecp256k1VerifySignatureResponse")?;
tuple.serialize_element(data)?;
}
Response::EcdsaSecp256r1VerifySignatureResponse(data) => {
tuple.serialize_element("EcdsaSecp256r1VerifySignatureResponse")?;
tuple.serialize_element(data)?;
}
Response::SrsInitSrsResponse(data) => {
tuple.serialize_element("SrsInitSrsResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkBatchVerifierStartResponse(data) => {
tuple.serialize_element("ChonkBatchVerifierStartResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkBatchVerifierQueueResponse(data) => {
tuple.serialize_element("ChonkBatchVerifierQueueResponse")?;
tuple.serialize_element(data)?;
}
Response::ChonkBatchVerifierStopResponse(data) => {
tuple.serialize_element("ChonkBatchVerifierStopResponse")?;
tuple.serialize_element(data)?;
}
Response::SrsInitGrumpkinSrsResponse(data) => {
tuple.serialize_element("SrsInitGrumpkinSrsResponse")?;
tuple.serialize_element(data)?;
}
Response::ShutdownResponse(data) => {
tuple.serialize_element("ShutdownResponse")?;
tuple.serialize_element(data)?;
}
Response::ErrorResponse(data) => {
tuple.serialize_element("ErrorResponse")?;
tuple.serialize_element(data)?;
}
}
tuple.end()
}
}
impl<'de> Deserialize<'de> for Response {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: serde::Deserializer<'de> {
use serde::de::{SeqAccess, Visitor};
struct ResponseVisitor;
impl<'de> Visitor<'de> for ResponseVisitor {
type Value = Response;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a 2-element array [name, payload]")
}
fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
where A: SeqAccess<'de> {
let name: String = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(0, &self))?;
match name.as_str() {
"CircuitProveResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::CircuitProveResponse(data))
}
"CircuitComputeVkResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::CircuitComputeVkResponse(data))
}
"CircuitInfoResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::CircuitInfoResponse(data))
}
"CircuitVerifyResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::CircuitVerifyResponse(data))
}
"ChonkComputeVkResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkComputeVkResponse(data))
}
"ChonkStartResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkStartResponse(data))
}
"ChonkLoadResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkLoadResponse(data))
}
"ChonkAccumulateResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkAccumulateResponse(data))
}
"ChonkProveResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkProveResponse(data))
}
"ChonkVerifyResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkVerifyResponse(data))
}
"ChonkBatchVerifyResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkBatchVerifyResponse(data))
}
"VkAsFieldsResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::VkAsFieldsResponse(data))
}
"MegaVkAsFieldsResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::MegaVkAsFieldsResponse(data))
}
"CircuitWriteSolidityVerifierResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::CircuitWriteSolidityVerifierResponse(data))
}
"ChonkCheckPrecomputedVkResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkCheckPrecomputedVkResponse(data))
}
"ChonkStatsResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkStatsResponse(data))
}
"ChonkCompressProofResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkCompressProofResponse(data))
}
"ChonkDecompressProofResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkDecompressProofResponse(data))
}
"Poseidon2HashResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Poseidon2HashResponse(data))
}
"Poseidon2PermutationResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Poseidon2PermutationResponse(data))
}
"PedersenCommitResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::PedersenCommitResponse(data))
}
"PedersenHashResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::PedersenHashResponse(data))
}
"PedersenHashBufferResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::PedersenHashBufferResponse(data))
}
"Blake2sResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Blake2sResponse(data))
}
"Blake2sToFieldResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Blake2sToFieldResponse(data))
}
"AesEncryptResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::AesEncryptResponse(data))
}
"AesDecryptResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::AesDecryptResponse(data))
}
"GrumpkinMulResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::GrumpkinMulResponse(data))
}
"GrumpkinAddResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::GrumpkinAddResponse(data))
}
"GrumpkinBatchMulResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::GrumpkinBatchMulResponse(data))
}
"GrumpkinGetRandomFrResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::GrumpkinGetRandomFrResponse(data))
}
"GrumpkinReduce512Response" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::GrumpkinReduce512Response(data))
}
"Secp256k1MulResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Secp256k1MulResponse(data))
}
"Secp256k1GetRandomFrResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Secp256k1GetRandomFrResponse(data))
}
"Secp256k1Reduce512Response" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Secp256k1Reduce512Response(data))
}
"Bn254FrSqrtResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Bn254FrSqrtResponse(data))
}
"Bn254FqSqrtResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Bn254FqSqrtResponse(data))
}
"Bn254G1MulResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Bn254G1MulResponse(data))
}
"Bn254G2MulResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Bn254G2MulResponse(data))
}
"Bn254G1IsOnCurveResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Bn254G1IsOnCurveResponse(data))
}
"Bn254G1FromCompressedResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::Bn254G1FromCompressedResponse(data))
}
"SchnorrComputePublicKeyResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::SchnorrComputePublicKeyResponse(data))
}
"SchnorrConstructSignatureResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::SchnorrConstructSignatureResponse(data))
}
"SchnorrVerifySignatureResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::SchnorrVerifySignatureResponse(data))
}
"EcdsaSecp256k1ComputePublicKeyResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::EcdsaSecp256k1ComputePublicKeyResponse(data))
}
"EcdsaSecp256r1ComputePublicKeyResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::EcdsaSecp256r1ComputePublicKeyResponse(data))
}
"EcdsaSecp256k1ConstructSignatureResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::EcdsaSecp256k1ConstructSignatureResponse(data))
}
"EcdsaSecp256r1ConstructSignatureResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::EcdsaSecp256r1ConstructSignatureResponse(data))
}
"EcdsaSecp256k1RecoverPublicKeyResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::EcdsaSecp256k1RecoverPublicKeyResponse(data))
}
"EcdsaSecp256r1RecoverPublicKeyResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::EcdsaSecp256r1RecoverPublicKeyResponse(data))
}
"EcdsaSecp256k1VerifySignatureResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::EcdsaSecp256k1VerifySignatureResponse(data))
}
"EcdsaSecp256r1VerifySignatureResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::EcdsaSecp256r1VerifySignatureResponse(data))
}
"SrsInitSrsResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::SrsInitSrsResponse(data))
}
"ChonkBatchVerifierStartResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkBatchVerifierStartResponse(data))
}
"ChonkBatchVerifierQueueResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkBatchVerifierQueueResponse(data))
}
"ChonkBatchVerifierStopResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ChonkBatchVerifierStopResponse(data))
}
"SrsInitGrumpkinSrsResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::SrsInitGrumpkinSrsResponse(data))
}
"ShutdownResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ShutdownResponse(data))
}
"ErrorResponse" => {
let data = seq.next_element()?
.ok_or_else(|| serde::de::Error::invalid_length(1, &self))?;
Ok(Response::ErrorResponse(data))
}
_ => Err(serde::de::Error::unknown_variant(&name, &["CircuitProveResponse", "CircuitComputeVkResponse", "CircuitInfoResponse", "CircuitVerifyResponse", "ChonkComputeVkResponse", "ChonkStartResponse", "ChonkLoadResponse", "ChonkAccumulateResponse", "ChonkProveResponse", "ChonkVerifyResponse", "ChonkBatchVerifyResponse", "VkAsFieldsResponse", "MegaVkAsFieldsResponse", "CircuitWriteSolidityVerifierResponse", "ChonkCheckPrecomputedVkResponse", "ChonkStatsResponse", "ChonkCompressProofResponse", "ChonkDecompressProofResponse", "Poseidon2HashResponse", "Poseidon2PermutationResponse", "PedersenCommitResponse", "PedersenHashResponse", "PedersenHashBufferResponse", "Blake2sResponse", "Blake2sToFieldResponse", "AesEncryptResponse", "AesDecryptResponse", "GrumpkinMulResponse", "GrumpkinAddResponse", "GrumpkinBatchMulResponse", "GrumpkinGetRandomFrResponse", "GrumpkinReduce512Response", "Secp256k1MulResponse", "Secp256k1GetRandomFrResponse", "Secp256k1Reduce512Response", "Bn254FrSqrtResponse", "Bn254FqSqrtResponse", "Bn254G1MulResponse", "Bn254G2MulResponse", "Bn254G1IsOnCurveResponse", "Bn254G1FromCompressedResponse", "SchnorrComputePublicKeyResponse", "SchnorrConstructSignatureResponse", "SchnorrVerifySignatureResponse", "EcdsaSecp256k1ComputePublicKeyResponse", "EcdsaSecp256r1ComputePublicKeyResponse", "EcdsaSecp256k1ConstructSignatureResponse", "EcdsaSecp256r1ConstructSignatureResponse", "EcdsaSecp256k1RecoverPublicKeyResponse", "EcdsaSecp256r1RecoverPublicKeyResponse", "EcdsaSecp256k1VerifySignatureResponse", "EcdsaSecp256r1VerifySignatureResponse", "SrsInitSrsResponse", "ChonkBatchVerifierStartResponse", "ChonkBatchVerifierQueueResponse", "ChonkBatchVerifierStopResponse", "SrsInitGrumpkinSrsResponse", "ShutdownResponse", "ErrorResponse"])),
}
}
}
deserializer.deserialize_tuple(2, ResponseVisitor)
}
}