Skip to main content

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/// Pairwise strategy. Apply the result of the operation to each packed element independently.
8pub struct PairwiseStrategy;
9/// Get result of operation from the table for each sub-element
10pub struct PairwiseTableStrategy;
11/// Applicable only for multiply by alpha and square operations.
12/// Reuse multiplication operation for that.
13pub struct ReuseMultiplyStrategy;
14
15/// Use operations with GFNI instructions
16pub struct GfniStrategy;
17/// Use SIMD operations for packed arithmetic
18pub struct SimdStrategy;
19/// Specialized versions of the above to resolve conflicting implementations
20pub struct GfniSpecializedStrategy256b;
21pub struct GfniSpecializedStrategy512b;
22
23/// Strategy for BinaryField1b operations using bitwise AND for multiplication.
24pub struct BitwiseAndStrategy;
25
26/// Strategy for ScaledUnderlier operations that delegate to sub-underlier operations.
27pub struct ScaledStrategy;