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