Skip to main content

binius_field/arch/x86_64/
packed_aes_128.rs

1// Copyright 2024-2025 Irreducible Inc.
2// Copyright 2026 The Binius Developers
3
4use cfg_if::cfg_if;
5
6cfg_if! {
7	if #[cfg(all(target_arch = "x86_64", target_feature = "sse2", target_feature = "gfni"))] {
8		pub type AesWideMul16x<T> = super::gfni::gfni_arithmetics::GfniWideMul<T>;
9		pub type AesSquare16x<T> = crate::arch::ReuseMultiply<T>;
10		pub type AesInvert16x<T> = super::gfni::gfni_arithmetics::Gfni<T>;
11	} else {
12		// Divide into 16 `u8` lanes (the 1×8b AES packing) for all three ops.
13		pub type AesWideMul16x<T> = crate::arch::Divide<u8, T, 16>;
14		pub type AesSquare16x<T> = crate::arch::Divide<u8, T, 16>;
15		pub type AesInvert16x<T> = crate::arch::Divide<u8, T, 16>;
16	}
17}