ffrs.GFi16¶
- class ffrs.GFi16¶
Finite-field operations for prime fields <= 65537
Methods
Instantiate type for operations over \(GF(65537)\)
Addition: \(\text{lhs} + \text{rhs}\)
Division: \(\frac{\text{num}}{\text{den}}\)
Exponential function: \(a^{\text{value}}\)
Reciprocal: \(\frac{1}{\text{value}}\)
Logarithm: \(\log_a (\text{value})\)
Multiplication: \(\text{lhs} \times \text{rhs}\)
Power: \(\text{base}^\text{exponent}\)
Subtraction: \(\text{lhs} - \text{rhs}\)
Attributes
GFi16.field_elements\(p\)
GFi16.powerAlways 1
GFi16.prime\(p\)
GFi16.primitivePrimitive value used to generate the field
- __init__(self: libffrs.GFi16, primitive: SupportsInt | SupportsIndex) None¶
Instantiate type for operations over \(GF(65537)\)
- Parameters:
primitive – \(a\) – primitive value used to generate the field
- add(self: libffrs.GFi16, lhs: SupportsInt | SupportsIndex, rhs: SupportsInt | SupportsIndex) int¶
Addition: \(\text{lhs} + \text{rhs}\)
- div(self: libffrs.GFi16, num: SupportsInt | SupportsIndex, den: SupportsInt | SupportsIndex) int¶
Division: \(\frac{\text{num}}{\text{den}}\)
- exp(self: libffrs.GFi16, value: SupportsInt | SupportsIndex) int¶
Exponential function: \(a^{\text{value}}\)
- inv(self: libffrs.GFi16, value: SupportsInt | SupportsIndex) int¶
Reciprocal: \(\frac{1}{\text{value}}\)
- log(self: libffrs.GFi16, value: SupportsInt | SupportsIndex) int¶
Logarithm: \(\log_a (\text{value})\)
- mul(self: libffrs.GFi16, lhs: SupportsInt | SupportsIndex, rhs: SupportsInt | SupportsIndex) int¶
Multiplication: \(\text{lhs} \times \text{rhs}\)
- pow(self: libffrs.GFi16, base: SupportsInt | SupportsIndex, exponent: SupportsInt | SupportsIndex) int¶
Power: \(\text{base}^\text{exponent}\)
- sub(self: libffrs.GFi16, lhs: SupportsInt | SupportsIndex, rhs: SupportsInt | SupportsIndex) int¶
Subtraction: \(\text{lhs} - \text{rhs}\)