Represent an element of an extension of GF2, this class is a POD (Plain Old Data) because of the alignement required in class Matrix.
More...
#include <element-gf2-extension.h>
template<typename baseType>
class F4::ElementGF2Extension< baseType >
Represent an element of an extension of GF2, this class is a POD (Plain Old Data) because of the alignement required in class Matrix.
- Examples:
- tutorial-gf2-extension-method3.cpp.
Definition at line 48 of file element-gf2-extension.h.
template<typename baseType>
Set this+=(mult*element).
- Parameters
-
element | Element of the field GF2[t]/MODULO. |
mult | Element of the field GF2[t]/MODULO. |
- Precondition
- mult has a degree lower than MODULO.
-
element has a degree lower than MODULO.
- Postcondition
- this mult has a degree lower than MODULO.
- Returns
- this.
template<typename baseType>
Set this+=(mult*element). Use a base of 16.
- Parameters
-
element | Element of the field GF2[t]/MODULO. |
mult | Element of the field GF2[t]/MODULO. |
- Precondition
- mult has a degree lower than MODULO.
-
element has a degree lower than MODULO.
- Postcondition
- this mult has a degree lower than MODULO.
- Returns
- this.
template<typename baseType>
Set this+=(mult*element). Use a base of 2.
- Parameters
-
element | Element of the field GF2[t]/MODULO. |
mult | Element of the field GF2[t]/MODULO. |
- Precondition
- mult has a degree lower than MODULO.
-
element has a degree lower than MODULO.
- Postcondition
- this mult has a degree lower than MODULO.
- Returns
- this.
template<typename baseType>
Set this+=(mult*element). Use a base of 256.
- Parameters
-
element | Element of the field GF2[t]/MODULO. |
mult | Element of the field GF2[t]/MODULO. |
- Precondition
- mult has a degree lower than MODULO.
-
element has a degree lower than MODULO.
- Postcondition
- this mult has a degree lower than MODULO.
- Returns
- this.
template<typename baseType>
Set this+=(mult*element). Use a base of 4.
- Parameters
-
element | Element of the field GF2[t]/MODULO. |
mult | Element of the field GF2[t]/MODULO. |
- Precondition
- mult has a degree lower than MODULO.
-
element has a degree lower than MODULO.
- Postcondition
- this mult has a degree lower than MODULO.
- Returns
- this.
template<typename baseType>
Return this.
- Returns
- Integer form of this.
template<typename baseType>
Get the static variable MASK.
- Returns
- Maximum power of 2 lower than MODULO.
template<typename baseType>
Get the static variable MASK_BIT.
- Returns
- Number j such that MASK = 1 << j.
template<typename baseType>
Get the static variable MODULO.
- Returns
- Irreducible polynomial used to construct GF(2^n). MODULO is under bits representation (ex: 0x10011001 = t^7+t^4+t^3+1).
template<typename baseType>
Inverse this according to the base field.
- Precondition
- The static variable MODULO must be set beforehand. Beware, baseType must be signed.
- Postcondition
- this is set in [-MODULO/2, MODULO/2].
- Returns
- this.
template<typename baseType>
Test if this is one (neutral multiplicative element).
- Returns
- true if this==one.
-
false otherwise.
template<typename baseType>
Test if this is nul.
- Returns
- true if this==zero.
-
false otherwise.
template<typename baseType>
Set this with a degree lower than MODULO.
- Postcondition
- this with a degree lower than MODULO.
- Returns
- Integer form of this.
template<typename baseType>
Multiply this by mult using base16 decomposition.
- Precondition
- The static variable MODULO must be set beforehand.
- Parameters
-
element | Element of the field GF2[t]/MODULO. |
- Precondition
- mult has a degree lower than MODULO.
- Postcondition
- this has a degree lower than MODULO.
- Returns
- Reference on this.
template<typename baseType>
Multiply this by mult using base2 decomposition.
- Precondition
- The static variable MODULO must be set beforehand.
- Parameters
-
element | Element of the field GF2[t]/MODULO. |
- Precondition
- mult has a degree lower than MODULO.
- Postcondition
- this has a degree lower than MODULO.
- Returns
- Reference on this.
template<typename baseType>
Multiply this by mult using base256 decomposition.
- Precondition
- The static variable MODULO must be set beforehand.
- Parameters
-
element | Element of the field GF2[t]/MODULO. |
- Precondition
- mult has a degree lower than MODULO.
- Postcondition
- this has a degree lower than MODULO.
- Returns
- Reference on this.
template<typename baseType>
Multiply this by mult using base4 decomposition.
- Precondition
- The static variable MODULO must be set beforehand.
- Parameters
-
element | Element of the field GF2[t]/MODULO. |
- Precondition
- mult has a degree lower than MODULO.
- Postcondition
- this has a degree lower than MODULO.
- Returns
- Reference on this.
template<typename baseType>
Overload the operator *=.
- Precondition
- The static variable MODULO must be set beforehand.
- Parameters
-
element | Element of the field GF2[t]/MODULO. |
- Precondition
- mult has a degree lower than MODULO.
- Postcondition
- this has a degree lower than MODULO.
- Returns
- Reference on this.
template<typename baseType>
Overload the operator =.
- Parameters
-
element | Element of GF(2^n) under binary representation. |
- Returns
- Reference on this.
template<typename baseType>
Overload the operator =.
- Precondition
- The static variable MODULO must be set beforehand.
- Postcondition
- this has a degree lower than MODULO.
- Parameters
-
element | Element of GF(2^n) under string representation. |
- Returns
- Reference on this.
template<typename baseType>
Set the static variable MODULO.
- Parameters
-
modulo | Irreducible polynomial used to construct GF(2^n). MODULO is under bits representation (ex: 0x10011001 = t^7+t^4+t^3+1). |
template<typename baseType>
Set the static variable MODULO.
- Parameters
-
modulo | Irreducible polynomial used to construct GF(2^n). MODULO is under string representation (ex: "t^7+t^4+t^3+1"). |
template<typename baseType>
Set the static variable VARIABLE_NAME.
- Parameters
-
var | Letter (or string) used to define a polynomial in GF2, default is 't'. |
template<typename baseType>
template<typename baseType>
template<typename baseType>
template<typename baseType>
Irreducible polynomial used to construct GF(2^n). MODULO is under bits representation (ex: 0x10011001 = t^7+t^4+t^3+1).
Definition at line 276 of file element-gf2-extension.h.
template<typename baseType>
The documentation for this class was generated from the following file: