crypto_bigint/limb/bit_xor.rs
1//! Limb bit xor operations.
2
3use super::Limb;
4use core::ops::{BitXor, BitXorAssign};
5
6impl Limb {
7 /// Calculates `a ^ b`.
8 #[inline(always)]
9 pub const fn bitxor(self, rhs: Self) -> Self {
10 Limb(self.0 ^ rhs.0)
11 }
12}
13
14impl BitXor for Limb {
15 type Output = Limb;
16
17 fn bitxor(self, rhs: Self) -> Self::Output {
18 self.bitxor(rhs)
19 }
20}
21
22impl BitXorAssign for Limb {
23 fn bitxor_assign(&mut self, rhs: Self) {
24 self.0 ^= rhs.0;
25 }
26}