binius_field/arch/portable/
packed_1.rs

1// Copyright 2024-2025 Irreducible Inc.
2
3use super::packed::PackedPrimitiveType;
4use crate::{
5	BinaryField1b,
6	arch::{
7		PairwiseStrategy,
8		portable::packed_macros::{
9			assert_scalar_matches_canonical, impl_broadcast, impl_ops_for_zero_height,
10			impl_serialize_deserialize_for_packed_binary_field,
11		},
12	},
13	arithmetic_traits::impl_transformation_with_strategy,
14	underlier::U1,
15};
16
17// Define 1 bit packed field types
18pub type PackedBinaryField1x1b = PackedPrimitiveType<U1, BinaryField1b>;
19
20// Define (de)serialize
21impl_serialize_deserialize_for_packed_binary_field!(PackedBinaryField1x1b);
22
23// Define broadcast
24impl_broadcast!(U1, BinaryField1b);
25
26// Define operations for height 0
27impl_ops_for_zero_height!(PackedBinaryField1x1b);
28
29// Define linear transformations
30impl_transformation_with_strategy!(PackedBinaryField1x1b, PairwiseStrategy);