Carry-less Product
   HOME

TheInfoList



OR:

The carry-less product of two
binary number A binary number is a number expressed in the Radix, base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically "0" (zero) and "1" (one). A ''binary number'' may ...
s is the result of carry-less multiplication of these numbers. This operation conceptually works like long multiplication except for the fact that the
carry Carry or carrying may refer to: People *Carry (name) Finance * Carried interest (or carry), the share of profits in an investment fund paid to the fund manager * Carry (investment), a financial term: the carry of an asset is the gain or cost of ...
is discarded instead of applied to the more significant position. It can be used to model operations over
finite field In mathematics, a finite field or Galois field (so-named in honor of Évariste Galois) is a field (mathematics), field that contains a finite number of Element (mathematics), elements. As with any field, a finite field is a Set (mathematics), s ...
s, in particular multiplication of polynomials from GF(2) 'X'' the
polynomial ring In mathematics, especially in the field of algebra, a polynomial ring or polynomial algebra is a ring formed from the set of polynomials in one or more indeterminates (traditionally also called variables) with coefficients in another ring, ...
over
GF(2) (also denoted \mathbb F_2, or \mathbb Z/2\mathbb Z) is the finite field with two elements. is the Field (mathematics), field with the smallest possible number of elements, and is unique if the additive identity and the multiplicative identity ...
. The operation is also known as an XOR multiplication, as carry-discarding addition is equivalent to an exclusive or.


Definition

Given two numbers \textstyle a=\sum_i a_i2^i and \textstyle b=\sum_i b_i2^i, with a_i,b_i\in\ denoting the bits of these numbers, the carry-less product of these two numbers is defined to be \textstyle c=\sum_i c_i2^i, with each bit c_i computed as the
exclusive or Exclusive or, exclusive disjunction, exclusive alternation, logical non-equivalence, or logical inequality is a logical operator whose negation is the logical biconditional. With two inputs, XOR is true if and only if the inputs differ (on ...
of products of bits from the input numbers as follows: : c_i=\bigoplus_^i a_jb_


Example

Consider ''a'' = 101000102 and ''b'' = 100101102, with all numbers given in binary. Then the carry-less multiplication of these is essentially what one would get from performing a long multiplication but ignoring the carries. 1 0 1 0 0 0 1 0 = a ---------------, ---, -------, -- 1 0 0 1 0 1 1 0, 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0, 0 0 0 0 0 1 0 0 1 0 1 1 0, 0 ------------------------------ 1 0 1 1 0 0 0 1 1 1 0 1 1 0 0 ^ ^ For every logic 1 bit in the number ''a'', the number ''b'' is shifted to the left as many bits as indicated by the position these bits ''a''. All these shifted versions are then "added" by using an
XOR Exclusive or, exclusive disjunction, exclusive alternation, logical non-equivalence, or logical inequality is a logical operator whose negation is the logical biconditional. With two inputs, XOR is true if and only if the inputs differ (one ...
instead of the regular binary addition used in regular long multiplication. Results of XOR are indicated by ^ . In full binary adder these would result in a carry to the column to the left. Here this does not happen so the carry-less product of ''a'' and ''b'' would be ''c'' = 1011000111011002.


Multiplication of polynomials

The carry-less product can also be seen as a multiplication of polynomials over the field
GF(2) (also denoted \mathbb F_2, or \mathbb Z/2\mathbb Z) is the finite field with two elements. is the Field (mathematics), field with the smallest possible number of elements, and is unique if the additive identity and the multiplicative identity ...
. This is because the exclusive or corresponds to the addition in this field. In the example above, the numbers ''a'' and ''b'' correspond to polynomials : A=\sum_i a_i X^i=X^7+X^5+X^1\qquad B=\sum_i b_i X^i=X^7+X^4+X^2+X^1 and the product of these is : C=A\cdot B=\sum_i c_i X^i=X^+X^+X^+X^7+X^6+X^5+X^3+X^2 which is what the number ''c'' computed above encodes. Notice how (X^7\cdot X^1)+(X^1\cdot X^7)\equiv0 and (X^7\cdot X^2)+(X^5\cdot X^4)\equiv0 thanks to the arithmetic in GF(2). This corresponds to the columns marked ^ in the example.


Applications

The elements of GF(2''n''), i.e. a
finite field In mathematics, a finite field or Galois field (so-named in honor of Évariste Galois) is a field (mathematics), field that contains a finite number of Element (mathematics), elements. As with any field, a finite field is a Set (mathematics), s ...
whose order is a
power of two A power of two is a number of the form where is an integer, that is, the result of exponentiation with number 2, two as the Base (exponentiation), base and integer  as the exponent. In the fast-growing hierarchy, is exactly equal to f_1^ ...
, are usually represented as polynomials in GF(2) 'X''
Multiplication Multiplication is one of the four elementary mathematical operations of arithmetic, with the other ones being addition, subtraction, and division (mathematics), division. The result of a multiplication operation is called a ''Product (mathem ...
of two such field elements consists of multiplication of the corresponding polynomials, followed by a reduction with respect to some irreducible polynomial which is taken from the construction of the field. If the polynomials are encoded as binary numbers, carry-less multiplication can be used to perform the first step of this computation. Such fields have applications in
cryptography Cryptography, or cryptology (from "hidden, secret"; and ''graphein'', "to write", or ''-logy, -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of Adversary (cryptography), ...
and for some
checksum A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify dat ...
algorithms.


Implementations

Recent
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel, based on the 8086 microprocessor and its 8-bit-external-bus variant, the 8088. Th ...
processors support the
CLMUL instruction set Carry-less Multiplication (CLMUL) is an extension to the x86 instruction set used by microprocessors from Intel and AMD which was proposed by Intel in March 2008 and made available in the Intel Westmere processors announced in early 2010. Mathema ...
and thus provide a hardware instruction to perform this operation. It's also part of
RISC-V RISC-V (pronounced "risk-five") is an open standard instruction set architecture (ISA) based on established reduced instruction set computer (RISC) principles. The project commenced in 2010 at the University of California, Berkeley. It transfer ...
Bit-Manipulation ISA-extensions Zbc: Carry-less multiplication. For other targets it is possible to implement the computation above as a software algorithm, and many cryptography libraries will contain an implementation as part of their finite field arithmetic operations.


Other bases

The definition of a carry-less product as the result of a long multiplication discarding carry would readily apply to bases other than 2. But the result depends on the basis, which is therefore an essential part of the operation. As this operation is typically being used on computers operating in binary, the binary form discussed above is the one employed in practice. Polynomials over other finite fields of prime order do have applications, but treating the coefficients of such a polynomial as the digits of a single number is rather uncommon, so the multiplication of such polynomials would not be seen as a carry-less multiplication of numbers.


See also

*
CLMUL instruction set Carry-less Multiplication (CLMUL) is an extension to the x86 instruction set used by microprocessors from Intel and AMD which was proposed by Intel in March 2008 and made available in the Intel Westmere processors announced in early 2010. Mathema ...
, an x86 ISA extension *
Finite field arithmetic In mathematics, finite field arithmetic is arithmetic in a finite field (a field containing a finite number of elements) contrary to arithmetic in a field with an infinite number of elements, like the field of rational numbers. There are infinit ...
*
Galois/Counter Mode In cryptography, Galois/Counter Mode (GCM) is a mode of operation for symmetric-key cryptographic block ciphers which is widely adopted for its performance. GCM throughput rates for state-of-the-art, high-speed communication channels can be achi ...


References

{{reflist Binary arithmetic Computer arithmetic Multiplication