This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CRC64 with ARM RAN Library

Hello, 

I am trying to used crc64 function in crc_common.hpp to compute crc64. However is is nor clear to me what should be  the const poly64_t constants[] parameter. According to the function description: 

/**
 * Computes a CRC64 in big- or little-endian mode using the specified shifts
 * and polynomials. This can be used for smaller polynomials by shifting
 * them to a degree 64 polynomial.
 *
 * @tparam     BarretShift     the shift used when computing @c ls1_divp.
 * @param[in]  size            number of bytes of the given buffer
 * @param[in]  input           points to the input byte sequence
 * @param[out] crc24           the computed CRC on 24 bits
 * @param[in]  constants       the constants specific to each polynomial:
                               constants[0] = padding
                               constants[1] = (1<<128) / P - (1<<64)
                               constants[2:11] = [ (1<<(64*k)) mod P,
                                 for k in [1,1,2,3,4,5,6,7,8,9] ]
 */

What "constants[1] = (1<<128) / P - (1<<64)" stands for? The result doesnt seems to be a 64th bit polynomial.

Thanks


Parents
  • Hi there,

    “constants” is an array of poly64_t. Each poly64_t is an unsigned integer representation of the coefficients of a GF(2) polynomial (that is, a polynomial with coefficients 0 or 1). For example, 1<<64 can represent x^64. P is the generator polynomial of the CRC being calculated. The modulus and division operators here are polynomial modulus and division, so:

    (1<<128) / P - (1<<64)

    is the poly64_t representation of the polynomial

    x^128 / (some degree 64 polynomial) - x^64

    Please note that crc64 isn’t intended to be a user-callable function so it does not include full documentation on how to generate all the parameters. Instead it is a common implementation that underlies all our user-callable CRC routines.

    Regards,

    Nick

Reply
  • Hi there,

    “constants” is an array of poly64_t. Each poly64_t is an unsigned integer representation of the coefficients of a GF(2) polynomial (that is, a polynomial with coefficients 0 or 1). For example, 1<<64 can represent x^64. P is the generator polynomial of the CRC being calculated. The modulus and division operators here are polynomial modulus and division, so:

    (1<<128) / P - (1<<64)

    is the poly64_t representation of the polynomial

    x^128 / (some degree 64 polynomial) - x^64

    Please note that crc64 isn’t intended to be a user-callable function so it does not include full documentation on how to generate all the parameters. Instead it is a common implementation that underlies all our user-callable CRC routines.

    Regards,

    Nick

Children