crypto_bigint/limb/
neg.rs

1//! Limb negation
2
3use crate::{Limb, Wrapping};
4use core::ops::Neg;
5
6impl Neg for Wrapping<Limb> {
7    type Output = Self;
8
9    fn neg(self) -> Self::Output {
10        Self(self.0.wrapping_neg())
11    }
12}
13
14impl Limb {
15    /// Perform wrapping negation.
16    #[inline(always)]
17    pub const fn wrapping_neg(self) -> Self {
18        Limb(self.0.wrapping_neg())
19    }
20}