Lines Matching +full:use +full:- +full:case
9 * SPDX-License-Identifier: Apache-2.0
34 /* Initial value expected to be used at the beginning of the OpenPGP CRC-24 computation. */
37 * The CRC-24 value is stored on a 32-bit value, only the 3 least significant bytes
38 * are meaningful. Use the following mask to only keep the CRC-24 value.
59 CRC4, /**< Use @ref crc4 */
60 CRC4_TI, /**< Use @ref crc4_ti */
61 CRC7_BE, /**< Use @ref crc7_be */
62 CRC8, /**< Use @ref crc8 */
63 CRC8_CCITT, /**< Use @ref crc8_ccitt */
64 CRC8_ROHC, /**< Use @ref crc8_rohc */
65 CRC16, /**< Use @ref crc16 */
66 CRC16_ANSI, /**< Use @ref crc16_ansi */
67 CRC16_CCITT, /**< Use @ref crc16_ccitt */
68 CRC16_ITU_T, /**< Use @ref crc16_itu_t */
69 CRC24_PGP, /**< Use @ref crc24_pgp */
70 CRC32_C, /**< Use @ref crc32_c */
71 CRC32_IEEE, /**< Use @ref crc32_ieee */
75 * @brief Generic function for computing a CRC-16 without input or output
78 * Compute CRC-16 by passing in the address of the input, the input length
82 * @note If you are planning to use a CRC based on poly 0x1012 the functions
85 * @param poly The polynomial to use omitting the leading x^16
96 * @brief Generic function for computing a CRC-16 with input and output
99 * Compute CRC-16 by passing in the address of the input, the input length
103 * @note If you are planning to use a CRC based on poly 0x1012 the function
110 * - CRC-16/ANSI, CRC-16/MODBUS, CRC-16/USB, CRC-16/IBM
111 * https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-modbus
114 * @param poly The polynomial to use omitting the leading x^16
116 * use 0xA001 instead of 0x8005 for CRC-16-MODBUS.
132 * @param polynomial The polynomial to use omitting the leading x^8
135 * @param reversed Should we use reflected/reversed values or not
154 * - CRC-16/CCITT, CRC-16/CCITT-TRUE, CRC-16/KERMIT
155 * https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-kermit
158 * - CRC-16/X-25, CRC-16/IBM-SDLC, CRC-16/ISO-HDLC
159 * https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-ibm-sdlc
162 * @note To calculate the CRC across non-contiguous blocks use the return
163 * value from block N-1 as the seed for block N.
165 * See ITU-T Recommendation V.41 (November 1988).
187 * - CRC-16/XMODEM, CRC-16/ACORN, CRC-16/LTE
188 * https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-xmodem
191 * - CRC16/CCITT-FALSE, CRC-16/IBM-3740, CRC-16/AUTOSAR
192 * https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-ibm-3740
195 * - CRC-16/GSM
196 * https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-gsm
199 * @note To calculate the CRC across non-contiguous blocks use the return
200 * value from block N-1 as the seed for block N.
202 * See ITU-T Recommendation V.41 (November 1988) (MSB first).
213 * @brief Compute the ANSI (or Modbus) variant of CRC-16
215 * The ANSI variant of CRC-16 uses 0x8005 (0xA001 reflected) as its polynomial
294 * @brief Compute the CRC-7 checksum of a buffer.
296 * See JESD84-A441. Used by the MMC protocol. Uses 0x09 as the
309 * @brief Compute the CRC-4 checksum of a buffer.
333 * @param polynomial The polynomial to use omitting the leading x^4
336 * @param reversed Should we use reflected/reversed values or not
344 * @brief Generate an OpenPGP CRC-24 checksum as defined in RFC 4880 section 6.1.
349 * @return The CRC-24 value.
354 * @brief Update an OpenPGP CRC-24 checksum.
356 * @param crc The CRC-24 checksum that needs to be updated. The full 32-bit value of the CRC needs
361 * @return The CRC-24 value. When the last buffer of data has been processed, mask the value
372 * For 7, 8, 16 and 24-bit CRCs, the relevant @p seed and @p poly values should
373 * be passed in via the least-significant byte(s).
375 * Similarly, for 7, 8, 16 and 24-bit CRCs, the relevant result is stored in the
376 * least-significant byte(s) of the returned value.
378 * @param type CRC algorithm to use.
382 * @param poly The polynomial to use omitting the leading coefficient
383 * @param reflect Should we use reflected/reversed values or not
393 case CRC4: in crc_by_type()
395 case CRC4_TI: in crc_by_type()
397 case CRC7_BE: in crc_by_type()
399 case CRC8: in crc_by_type()
401 case CRC8_CCITT: in crc_by_type()
403 case CRC8_ROHC: in crc_by_type()
405 case CRC16: in crc_by_type()
411 case CRC16_ANSI: in crc_by_type()
413 case CRC16_CCITT: in crc_by_type()
415 case CRC16_ITU_T: in crc_by_type()
417 case CRC24_PGP: { in crc_by_type()
424 case CRC32_C: in crc_by_type()
426 case CRC32_IEEE: in crc_by_type()
433 return -1; in crc_by_type()