mirror of https://github.com/zcash/orchard.git
Add `ValueCommitTrapdoor::from_bytes` constructor
This commit is contained in:
parent
591c4b89b9
commit
d428aa3143
|
@ -218,6 +218,11 @@ impl ValueCommitTrapdoor {
|
||||||
pub(crate) fn inner(&self) -> pallas::Scalar {
|
pub(crate) fn inner(&self) -> pallas::Scalar {
|
||||||
self.0
|
self.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Constructs `ValueCommitTrapdoor` from the byte reprsentation of a scalar
|
||||||
|
pub fn from_bytes(bytes: [u8; 32]) -> CtOption<Self> {
|
||||||
|
pallas::Scalar::from_repr(bytes).map(ValueCommitTrapdoor)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Add<&ValueCommitTrapdoor> for ValueCommitTrapdoor {
|
impl Add<&ValueCommitTrapdoor> for ValueCommitTrapdoor {
|
||||||
|
|
Loading…
Reference in New Issue