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