binius_field/arch/portable/
packed_8.rs1use super::{
4 packed::{impl_broadcast, impl_ops_for_zero_height, PackedPrimitiveType},
5 packed_arithmetic::{alphas, impl_tower_constants},
6};
7use crate::{
8 arch::{PackedStrategy, PairwiseRecursiveStrategy, PairwiseStrategy, PairwiseTableStrategy},
9 arithmetic_traits::{
10 impl_invert_with, impl_mul_alpha_with, impl_mul_with, impl_square_with,
11 impl_transformation_with_strategy,
12 },
13 BinaryField1b, BinaryField2b, BinaryField4b, BinaryField8b,
14};
15
16pub type PackedBinaryField8x1b = PackedPrimitiveType<u8, BinaryField1b>;
18pub type PackedBinaryField4x2b = PackedPrimitiveType<u8, BinaryField2b>;
19pub type PackedBinaryField2x4b = PackedPrimitiveType<u8, BinaryField4b>;
20pub type PackedBinaryField1x8b = PackedPrimitiveType<u8, BinaryField8b>;
21
22impl_broadcast!(u8, BinaryField1b);
24impl_broadcast!(u8, BinaryField2b);
25impl_broadcast!(u8, BinaryField4b);
26impl_broadcast!(u8, BinaryField8b);
27
28impl_ops_for_zero_height!(PackedBinaryField8x1b);
30
31impl_tower_constants!(BinaryField1b, u8, { alphas!(u8, 0) });
33impl_tower_constants!(BinaryField2b, u8, { alphas!(u8, 1) });
34impl_tower_constants!(BinaryField4b, u8, { alphas!(u8, 2) });
35
36impl_mul_with!(PackedBinaryField4x2b @ PackedStrategy);
38impl_mul_with!(PackedBinaryField2x4b @ PackedStrategy);
39impl_mul_with!(PackedBinaryField1x8b @ PairwiseTableStrategy);
40
41impl_square_with!(PackedBinaryField4x2b @ PackedStrategy);
43impl_square_with!(PackedBinaryField2x4b @ PackedStrategy);
44impl_square_with!(PackedBinaryField1x8b @ PairwiseTableStrategy);
45
46impl_invert_with!(PackedBinaryField4x2b @ PairwiseRecursiveStrategy);
48impl_invert_with!(PackedBinaryField2x4b @ PairwiseRecursiveStrategy);
49impl_invert_with!(PackedBinaryField1x8b @ PairwiseTableStrategy);
50
51impl_mul_alpha_with!(PackedBinaryField4x2b @ PackedStrategy);
53impl_mul_alpha_with!(PackedBinaryField2x4b @ PackedStrategy);
54impl_mul_alpha_with!(PackedBinaryField1x8b @ PairwiseTableStrategy);
55
56impl_transformation_with_strategy!(PackedBinaryField8x1b, PackedStrategy);
58impl_transformation_with_strategy!(PackedBinaryField4x2b, PackedStrategy);
59impl_transformation_with_strategy!(PackedBinaryField2x4b, PackedStrategy);
60impl_transformation_with_strategy!(PackedBinaryField1x8b, PairwiseStrategy);