binius_field/arch/strategies.rs
1// Copyright 2024-2025 Irreducible Inc.
2
3/// Packed strategy for arithmetic operations.
4/// (Uses arithmetic operations with underlier and subfield to simultaneously calculate the result for all packed values)
5pub struct PackedStrategy;
6/// This strategies uses bot operations over packed subfield and operations over sub-elements.
7pub struct HybridRecursiveStrategy;
8/// Pairwise recursive strategy. Calculates the result by applying recursive algorithm for each packed value independently.
9pub struct PairwiseRecursiveStrategy;
10/// Pairwise strategy. Apply the result of the operation to each packed element independently.
11pub struct PairwiseStrategy;
12/// Get result of operation from the table for each sub-element
13pub struct PairwiseTableStrategy;
14/// Similar to `PackedStrategy`, but uses SIMD operations supported by the platform.
15pub struct SimdStrategy;
16/// Applicable only for multiply by alpha and square operations.
17/// Reuse multiplication operation for that.
18pub struct ReuseMultiplyStrategy;
19
20/// Use operations with GFNI instructions
21pub struct GfniStrategy;
22/// Specialized versions of the above to resolve conflicting implementations
23pub struct GfniSpecializedStrategy256b;
24pub struct GfniSpecializedStrategy512b;
25
26/// Strategy for packed canonical tower fields.
27/// Performs conversion to the packed isomorphic AES field, applies the operation and
28/// converts the result back to the canonical tower field.
29pub struct AESIsomorphicStrategy;