mirror of https://github.com/zcash/halo2.git
Merge pull request #176 from zcash/doc-cmx-canon
ExtractedNoteCommitment::from_bytes: Document cmx canonicity.
This commit is contained in:
commit
c4fb1efb1c
|
@ -66,6 +66,11 @@ pub struct ExtractedNoteCommitment(pub(super) pallas::Base);
|
|||
|
||||
impl ExtractedNoteCommitment {
|
||||
/// Deserialize the extracted note commitment from a byte array.
|
||||
///
|
||||
/// This method enforces the [consensus rule][cmxcanon] that the
|
||||
/// byte representation of cmx MUST be canonical.
|
||||
///
|
||||
/// [cmxcanon]: https://zips.z.cash/protocol/protocol.pdf#actionencodingandconsensus
|
||||
pub fn from_bytes(bytes: &[u8; 32]) -> CtOption<Self> {
|
||||
pallas::Base::from_bytes(bytes).map(ExtractedNoteCommitment)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue