sapling-crypto/src/circuit/mod.rs

40 lines
812 B
Rust
Raw Normal View History

#[cfg(test)]
pub mod test;
pub mod boolean;
pub mod multieq;
pub mod uint32;
pub mod blake2s;
pub mod num;
pub mod lookup;
pub mod ecc;
pub mod pedersen_hash;
pub mod multipack;
2018-03-15 12:08:12 -07:00
pub mod sha256;
2018-03-15 11:44:19 -07:00
pub mod sapling;
pub mod sprout;
2018-02-22 10:36:44 -08:00
use bellman::{
2018-03-15 11:44:19 -07:00
SynthesisError
2018-03-08 00:16:21 -08:00
};
2018-03-07 23:41:47 -08:00
// TODO: This should probably be removed and we
// should use existing helper methods on `Option`
// for mapping with an error.
/// This basically is just an extension to `Option`
/// which allows for a convenient mapping to an
/// error on `None`.
trait Assignment<T> {
fn get(&self) -> Result<&T, SynthesisError>;
}
impl<T> Assignment<T> for Option<T> {
fn get(&self) -> Result<&T, SynthesisError> {
match *self {
Some(ref v) => Ok(v),
None => Err(SynthesisError::AssignmentMissing)
}
}
}