Allow creation of opaque custom predicate batch (#427)
This is useful for a verifier that wants to verify a MainPod that contains a custom predicate in a public statement without knowledge of how the custom predicate is defined.
This commit is contained in:
parent
5a80fba618
commit
352b1fdac1
1 changed files with 8 additions and 0 deletions
|
|
@ -404,6 +404,14 @@ impl CustomPredicateBatch {
|
||||||
Arc::new(cpb)
|
Arc::new(cpb)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn new_opaque(name: String, id: Hash) -> Arc<Self> {
|
||||||
|
Arc::new(Self {
|
||||||
|
id,
|
||||||
|
name,
|
||||||
|
predicates: vec![],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/// Cryptographic identifier for the batch.
|
/// Cryptographic identifier for the batch.
|
||||||
fn calculate_id(&self, params: &Params) -> Hash {
|
fn calculate_id(&self, params: &Params) -> Hash {
|
||||||
// NOTE: This implementation just hashes the concatenation of all the custom predicates,
|
// NOTE: This implementation just hashes the concatenation of all the custom predicates,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue