Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/poly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,11 @@ impl Commitment {
let len = self.coeff.len() - zeros;
self.coeff.truncate(len)
}

/// Generates a non-redacted debug string
pub fn reveal(&self) -> String {
format!("Commitment {{ coeff: {:?} }}", self.coeff)
}
}

/// A symmetric bivariate polynomial in the prime field.
Expand Down Expand Up @@ -729,6 +734,16 @@ impl BivarCommitment {
fn powers<T: IntoFr>(&self, x: T) -> Vec<Fr> {
powers(x, self.degree)
}

/// Generates a non-redacted debug string. This method differs from the
/// `Debug` implementation in that it *does* leak the the struct's
/// internal state.
pub fn reveal(&self) -> String {
format!(
"BivarCommitment {{ degree: {}, coeff: {:?} }}",
self.degree, self.coeff
)
}
}

/// Returns the `0`-th to `degree`-th power of `x`.
Expand Down