binius_field/arch/portable/
packed_aes_64.rs

1// Copyright 2024-2025 Irreducible Inc.
2
3use cfg_if::cfg_if;
4
5use super::{
6	packed::PackedPrimitiveType, packed_arithmetic::impl_tower_constants,
7	packed_macros::impl_broadcast,
8};
9use crate::{
10	AESTowerField8b,
11	arch::portable::packed_macros::{portable_macros::*, *},
12	arithmetic_traits::{
13		impl_invert_with, impl_mul_alpha_with, impl_mul_with, impl_square_with,
14		impl_transformation_with_strategy,
15	},
16};
17
18define_packed_binary_fields!(
19	underlier: u64,
20	packed_fields: [
21		packed_field {
22			name: PackedAESBinaryField8x8b,
23			scalar: AESTowerField8b,
24			alpha_idx: _,
25			mul:       (if gfni_x86 PackedAESBinaryField16x8b else PairwiseTableStrategy),
26			square:    (if gfni_x86 PackedAESBinaryField16x8b else PairwiseTableStrategy),
27			invert:    (if gfni_x86 PackedAESBinaryField16x8b else PairwiseTableStrategy),
28			mul_alpha: (PairwiseTableStrategy),
29			transform: (PackedStrategy),
30		},
31	]
32);
33
34impl_tower_constants!(AESTowerField8b, u64, 0x00d300d300d300d3);