binius_field/arch/portable/
packed_2.rs

1// Copyright 2024-2025 Irreducible Inc.
2
3use super::{packed::PackedPrimitiveType, packed_arithmetic::TowerConstants};
4use crate::{
5	BinaryField1b,
6	arch::portable::packed_macros::{portable_macros::*, *},
7	arithmetic_traits::impl_transformation_with_strategy,
8	underlier::{U2, UnderlierType},
9};
10
11define_packed_binary_fields!(
12	underlier: U2,
13	packed_fields: [
14		packed_field {
15			name: PackedBinaryField2x1b,
16			scalar: BinaryField1b,
17			alpha_idx: _,
18			mul: (None),
19			square: (None),
20			invert: (None),
21			mul_alpha: (None),
22			transform: (PackedStrategy),
23		},
24	]
25);
26
27// Define operations for height 0
28impl_ops_for_zero_height!(PackedBinaryField2x1b);
29
30// Define constants
31impl TowerConstants<U2> for BinaryField1b {
32	const ALPHAS_ODD: U2 = U2::new(<Self as TowerConstants<u8>>::ALPHAS_ODD);
33}