/* degenerate case (also disallow negative lengths) */ if len2 <= 0 { return crc1;
}
/* put operator for one zero bit in odd */
odd[0] = 0xedb88320; /* CRC-32 polynomial */
row = 1; for n in1..GF2_DIM {
odd[n] = row;
row <<= 1;
}
/* put operator for two zero bits in even */
gf2_matrix_square(&mut even, &odd);
/* put operator for four zero bits in odd */
gf2_matrix_square(&mut odd, &even);
/* apply len2 zeros to crc1 (first square will put the operator for one
zero byte, eight zero bits, in even) */ loop { /* apply zeros operator for this bit of len2 */
gf2_matrix_square(&mut even, &odd); if len2 & 1 == 1 {
crc1 = gf2_matrix_times(&even, crc1);
}
len2 >>= 1;
/* if no more bits set, then done */ if len2 == 0 { break;
}
/* another iteration of the loop with odd and even swapped */
gf2_matrix_square(&mut odd, &even); if len2 & 1 == 1 {
crc1 = gf2_matrix_times(&odd, crc1);
}
len2 >>= 1;
/* if no more bits set, then done */ if len2 == 0 { break;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.