primitives::sinsemilla.rs: Document panic in hash()

Document that hash() panics if a message is longer than K * C.
This commit is contained in:
therealyingtong 2021-06-30 20:01:05 +08:00
parent ba7e1892de
commit 74456acea1
1 changed files with 4 additions and 0 deletions

View File

@ -127,6 +127,10 @@ impl HashDomain {
/// $\mathsf{SinsemillaHash}$ from [§ 5.4.1.9][concretesinsemillahash].
///
/// [concretesinsemillahash]: https://zips.z.cash/protocol/nu5.pdf#concretesinsemillahash
///
/// # Panics
///
/// This panics if the message length is greater than [`K`] * [`C`]
pub(crate) fn hash(&self, msg: impl Iterator<Item = bool>) -> CtOption<pallas::Base> {
extract_p_bottom(self.hash_to_point(msg))
}