SPRUJ17H March 2022 – October 2024 AM2631 , AM2631-Q1 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1
The GF(2m) multiplication procedure in pseudo code is as follows:
for (i=m-1; i>=0; i--)
temp = Cm-1
for (j=m-1; j>=0; j--)
Cj = ((Bj&Ai) ^ (Pj&temp)) ^ Cj-1
Basis for the operation is an AND-XOR tree in a matrix structure of 571x571 entries:
The outer loop will always perform a fixed number (4) of instructions. Because the number of operand bits is not always exactly divisible by four, there will be some remaining 'dummy' operations. For example, a 571-bit multiply operation needs exactly 571 AND-XOR row operations, while implementing 4 rows at a time, this forces 143 x 4 = 572 row operations (one extra operation). To solve this problem, dummy AND-XOR row operations must be performed for field sizes that are non-exact multiples of four. The dummy operation must be such that it does not influence the end-result despite extra AND-XOR row operations. To achieve this, the dummy operations are done before the actual bit operations start by making sure that the inputs 'temp' and are b-operand are zero.