diff --git a/networks/monero/primitives/src/lib.rs b/networks/monero/primitives/src/lib.rs index 783275fb..0b6ed790 100644 --- a/networks/monero/primitives/src/lib.rs +++ b/networks/monero/primitives/src/lib.rs @@ -73,7 +73,11 @@ pub fn keccak256_to_scalar(data: impl AsRef<[u8]>) -> Scalar { // This library acknowledges its practical impossibility of it occurring, and doesn't bother to // code in logic to handle it. That said, if it ever occurs, something must happen in order to // not generate/verify a proof we believe to be valid when it isn't - assert!(scalar != Scalar::ZERO, "ZERO HASH: {:?}", data.as_ref()); + assert!( + scalar != Scalar::ZERO, + "keccak256(preimage) \\cong 0 \\mod l! Preimage: {:?}", + data.as_ref() + ); scalar } diff --git a/networks/monero/ringct/bulletproofs/src/plus/mod.rs b/networks/monero/ringct/bulletproofs/src/plus/mod.rs index 6b7eb820..465b878a 100644 --- a/networks/monero/ringct/bulletproofs/src/plus/mod.rs +++ b/networks/monero/ringct/bulletproofs/src/plus/mod.rs @@ -65,7 +65,10 @@ impl BpPlusGenerators { pub(crate) fn reduce(&self, generators: usize) -> Self { // Round to the nearest power of 2 let generators = padded_pow_of_2(generators); - assert!(generators <= self.g_bold.len()); + assert!( + generators <= self.g_bold.len(), + "instantiated with less generators than application required" + ); BpPlusGenerators { g_bold: &self.g_bold[.. generators], h_bold: &self.h_bold[.. generators] } }