cnfy-uint 0.2.3

Zero-dependency 256-bit unsigned integer arithmetic for cryptographic applications
Documentation
//! [`Default`] implementation for [`U384`], returning zero.
use super::U384;

/// Returns the zero value as the default for [`U384`].
///
/// All six limbs are set to zero, consistent with the standard library
/// convention where numeric types default to zero.
///
/// # Examples
///
/// ```
/// use cnfy_uint::u384::U384;
///
/// let d: U384 = Default::default();
/// assert_eq!(d, U384::from_be_limbs([0; 6]));
/// ```
impl Default for U384 {
    #[inline]
    fn default() -> Self {
        Self([0; 6])
    }
}

#[cfg(test)]
mod ai_tests {
    use super::*;

    /// Default produces the zero value.
    #[test]
    fn default_is_zero() {
        assert_eq!(U384::default(), U384::from_be_limbs([0; 6]));
    }

    /// Default equals explicit zero construction.
    #[test]
    fn default_matches_explicit_zero() {
        assert_eq!(U384::default(), U384::from_be_limbs([0, 0, 0, 0, 0, 0]));
    }
}