[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/vendor/phpseclib/phpseclib/phpseclib/Math/BinaryField/

FolderUp one level  
FileInteger.php     [source] [516 lines]   Binary Finite Fields In a binary finite field numbers are actually polynomial equations. If you represent the number as a sequence of bits you get a sequence of 1's or 0's. These 1's or 0's represent the coefficients of the x**n, where n is the location of the given bit. When you add numbers over a binary finite field the result should have a coefficient of 1 or 0 as well. Hence addition and subtraction become the same operation as XOR. eg. 1 + 1 + 1 == 3 % 2 == 1 or 0 - 1 == -1 % 2 == 1