proof_of_sql/proof_primitive/dory/
dory_public_setup.rs

1use super::{ProverSetup, VerifierSetup};
2
3/// The public setup required for the Dory PCS by the prover and the commitment computation.
4#[derive(Clone, Copy)]
5pub struct DoryProverPublicSetup<'a> {
6    prover_setup: &'a ProverSetup<'a>,
7    sigma: usize,
8}
9impl<'a> DoryProverPublicSetup<'a> {
10    /// Create a new public setup for the Dory PCS.
11    /// `public_parameters`: The public parameters for the Dory protocol.
12    /// `sigma`: A commitment with this setup is a matrix commitment with `1 << sigma` columns.
13    #[must_use]
14    pub fn new(prover_setup: &'a ProverSetup<'a>, sigma: usize) -> Self {
15        Self {
16            prover_setup,
17            sigma,
18        }
19    }
20    /// Returns sigma. A commitment with this setup is a matrix commitment with `1 << sigma` columns.
21    #[must_use]
22    pub fn sigma(&self) -> usize {
23        self.sigma
24    }
25    /// The public setup for the Dory protocol.
26    #[must_use]
27    pub fn prover_setup(&self) -> &ProverSetup {
28        self.prover_setup
29    }
30}
31
32/// The verifier's public setup for the Dory PCS.
33#[derive(Clone, Copy)]
34pub struct DoryVerifierPublicSetup<'a> {
35    verifier_setup: &'a VerifierSetup,
36    sigma: usize,
37}
38impl<'a> DoryVerifierPublicSetup<'a> {
39    /// Create a new public setup for the Dory PCS.
40    /// `verifier_setup`: The verifier's setup parameters for the Dory protocol.
41    /// `sigma`: A commitment with this setup is a matrix commitment with `1 << sigma` columns.
42    #[must_use]
43    pub fn new(verifier_setup: &'a VerifierSetup, sigma: usize) -> Self {
44        Self {
45            verifier_setup,
46            sigma,
47        }
48    }
49    /// Returns sigma. A commitment with this setup is a matrix commitment with `1<<sigma` columns.
50    #[must_use]
51    pub fn sigma(&self) -> usize {
52        self.sigma
53    }
54    /// The verifier's setup parameters for the Dory protocol.
55    #[must_use]
56    pub fn verifier_setup(&self) -> &VerifierSetup {
57        self.verifier_setup
58    }
59}