cryprot_codes/lib.rs
1use std::ops::{BitXor, BitXorAssign};
2
3use bytemuck::Pod;
4use cryprot_core::Block;
5
6pub mod ex_conv;
7
8/// Sealed trait implemented for [`Block`] and [`u8`].
9pub trait Coeff:
10 BitXor<Output = Self> + BitXorAssign + Copy + Clone + Pod + Sized + private::Sealed
11{
12 const ZERO: Self;
13}
14
15impl Coeff for Block {
16 const ZERO: Self = Block::ZERO;
17}
18
19impl Coeff for u8 {
20 const ZERO: Self = 0;
21}
22
23mod private {
24 pub trait Sealed {}
25
26 impl Sealed for super::Block {}
27 impl Sealed for u8 {}
28}