simple-gf2-times-demo.rb
def gf2_element_times(a, b)
  if (a == 0 || b == 0)
    return 0
  else
    logA = LOG_TABLE[a & 0xFF]
    logB = LOG_TABLE[b & 0xFF]
    logResult = logA + logB
    return EXP_TABLE[logResult]
  end
end
# Multiplies two elements of the field.
Multiplies two elements of the field.
Multiplies two elements of the field .
def gf2_element_times(a, b)
  if (a == 0 || b == 0)
    return 0
  else
    logA = LOG_TABLE[a & 0xFF]
    logB = LOG_TABLE[b & 0xFF]
    logResult = logA + logB
    return EXP_TABLE[logResult]
  end
end
def gf2_element_times ( a , b ) if ( a == 0 || b == 0 ) return 0 else logA = LOG_TABLE [ a & 0xFF ] logB = LOG_TABLE [ b & 0xFF ] logResult = logA + logB return EXP_TABLE [ logResult ] end end
Multiplies two elements of the field.
Multiplies two elements of the field .
a
b