Lines Matching +full:len +full:- +full:or +full:- +full:define

3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * This program is free software; you can redistribute it and/or modify
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * information or have any questions.
41 #define CHKSUM_BLOCK_SIZE 1
42 #define CHKSUM_DIGEST_SIZE 4
44 #define PCLMUL_MIN_LEN 64L /* minimum size of buffer
46 #define SCALE_F 16L /* size of xmm register */
47 #define SCALE_F_MASK (SCALE_F - 1)
49 u32 crc32_pclmul_le_16(unsigned char const *buffer, size_t len, u32 crc32);
52 crc32_pclmul_le(u32 crc, unsigned char const *p, size_t len) in crc32_pclmul_le() argument
58 if (len < PCLMUL_MIN_LEN + SCALE_F_MASK || !crypto_simd_usable()) in crc32_pclmul_le()
59 return crc32_le(crc, p, len); in crc32_pclmul_le()
63 prealign = SCALE_F - ((long)p & SCALE_F_MASK); in crc32_pclmul_le()
66 len -= prealign; in crc32_pclmul_le()
70 iquotient = len & (~SCALE_F_MASK); in crc32_pclmul_le()
71 iremainder = len & SCALE_F_MASK; in crc32_pclmul_le()
98 return -EINVAL; in crc32_pclmul_setkey()
105 u32 *mctx = crypto_shash_ctx(desc->tfm); in crc32_pclmul_init()
114 unsigned int len) in crc32_pclmul_update() argument
118 *crcp = crc32_pclmul_le(*crcp, data, len); in crc32_pclmul_update()
123 static int __crc32_pclmul_finup(u32 *crcp, const u8 *data, unsigned int len, in __crc32_pclmul_finup() argument
126 *(__le32 *)out = cpu_to_le32(crc32_pclmul_le(*crcp, data, len)); in __crc32_pclmul_finup()
131 unsigned int len, u8 *out) in crc32_pclmul_finup() argument
133 return __crc32_pclmul_finup(shash_desc_ctx(desc), data, len, out); in crc32_pclmul_finup()
145 unsigned int len, u8 *out) in crc32_pclmul_digest() argument
147 return __crc32_pclmul_finup(crypto_shash_ctx(desc->tfm), data, len, in crc32_pclmul_digest()
162 .cra_driver_name = "crc32-pclmul",
183 pr_info("PCLMULQDQ-NI instructions are not detected.\n"); in crc32_pclmul_mod_init()
184 return -ENODEV; in crc32_pclmul_mod_init()
202 MODULE_ALIAS_CRYPTO("crc32-pclmul");