| Home | Trees | Indices | Help |
|
|---|
|
|
|
|||
|
field Models an element of the GF(2^8) field. |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
modulus = 256GF(2^8) modulus, always 256. |
|||
|
|||
|
Inherited from |
|||
|
|||
Initialize new element. The value given is modulo reduced so the following holds: >>> GF256(1) == GF256(257) True
|
Add this and another GF256 element. >>> GF256(0x01) + GF256(0x01) [0] >>> GF256(0x01) + GF256(0x02) [3] Adding integers works too, the other operand is coerced into a GF256 element automatically: >>> GF256(0x01) + 1 [0] |
Add this and another number (reflected argument version). other is not Share, otherwise Share.__add__() would have been called, and other is not a GF256, otherwise GF256.__add__() would have been called. |
Subtract this and another GF256 element. Addition is its own inverse in GF(2^8) and so this is the same as __add__. |
|
Exclusive-or. This is just addition for GF256 elements. |
|
Multiply this and another number (reflected argument version). other is not Share, otherwise Share.__mul__() would have been called, and other is not a GF256, otherwise GF256.__mul__() would have been called. |
Invertion. Raises ZeroDivisionError if trying to inverse the zero element. |
repr(x)
|
str(x)
|
Equality testing. Testing for equality with integers works as expected: >>> GF256(10) == 10 True |
|
Truth value testing. Returns False if this element is zero, True otherwise. This allows GF256 elements to be used directly in Boolean formula: >>> bool(GF256(0)) False >>> bool(GF256(1)) True >>> x = GF256(1) >>> not x False |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Oct 19 16:43:41 2009 | http://epydoc.sourceforge.net |