#NEWLINE# def _CrcMultiply( p , q ) : #NEWLINE# #INDENT# 'Multiplies two polynomials together modulo CASTAGNOLI_POLY.\n\n  Args:\n    p: The first polynomial.\n    q: The second polynomial.\n\n  Returns:\n    Result of the multiplication.\n  ' #NEWLINE# result = 0 #NEWLINE# top_bit = ( 1 << DEGREE ) #NEWLINE# for _ in range ( DEGREE ) : #NEWLINE# #INDENT# if ( p & 1 ) : #NEWLINE# #INDENT# result ^= q #NEWLINE# #UNINDENT# q <<= 1 #NEWLINE# if ( q & top_bit ) : #NEWLINE# #INDENT# q ^= CASTAGNOLI_POLY #NEWLINE# #UNINDENT# p >>= 1 #NEWLINE# #UNINDENT# return result