Lines Matching +full:function +full:- +full:mask
1 /* SPDX-License-Identifier: GPL-2.0 */
40 * Function codes for the KM (CIPHER MESSAGE) instruction
58 * Function codes for the KMC (CIPHER MESSAGE WITH CHAINING)
74 * Function codes for the KMCTR (CIPHER MESSAGE WITH COUNTER)
89 * Function codes for the KIMD (COMPUTE INTERMEDIATE MESSAGE DIGEST)
103 * Function codes for the KLMD (COMPUTE LAST MESSAGE DIGEST)
116 * function codes for the KMAC (COMPUTE MESSAGE AUTHENTICATION CODE)
125 * Function codes for the PCKMO (PERFORM CRYPTOGRAPHIC KEY MANAGEMENT)
142 * Function codes for the PRNO (PERFORM RANDOM NUMBER OPERATION)
152 * Function codes for the KMA (CIPHER MESSAGE WITH AUTHENTICATION)
163 #define CPACF_KMA_LPC 0x100 /* Last-Plaintext/Ciphertext */
164 #define CPACF_KMA_LAAD 0x200 /* Last-AAD */
165 #define CPACF_KMA_HS 0x400 /* Hash-subkey Supplied */
170 * cpacf_query() - check if a specific CPACF function is available
172 * @func: the function code to test for
174 * Executes the query function for the given crypto instruction @opcode
179 static __always_inline void __cpacf_query(unsigned int opcode, cpacf_mask_t *mask) in __cpacf_query() argument
182 " lghi 0,0\n" /* query function */ in __cpacf_query()
183 " lgr 1,%[mask]\n" in __cpacf_query()
188 : "=m" (*mask) in __cpacf_query()
189 : [mask] "d" ((unsigned long)mask), [opc] "i" (opcode) in __cpacf_query()
218 static __always_inline int cpacf_query(unsigned int opcode, cpacf_mask_t *mask) in cpacf_query() argument
221 __cpacf_query(opcode, mask); in cpacf_query()
224 memset(mask, 0, sizeof(*mask)); in cpacf_query()
228 static inline int cpacf_test_func(cpacf_mask_t *mask, unsigned int func) in cpacf_test_func() argument
230 return (mask->bytes[func >> 3] & (0x80 >> (func & 7))) != 0; in cpacf_test_func()
235 cpacf_mask_t mask; in cpacf_query_func() local
237 if (cpacf_query(opcode, &mask)) in cpacf_query_func()
238 return cpacf_test_func(&mask, func); in cpacf_query_func()
243 * cpacf_km() - executes the KM (CIPHER MESSAGE) instruction
244 * @func: the function code passed to KM; see CPACF_KM_xxx defines
271 return src_len - s.odd; in cpacf_km()
275 * cpacf_kmc() - executes the KMC (CIPHER MESSAGE WITH CHAINING) instruction
276 * @func: the function code passed to KM; see CPACF_KMC_xxx defines
303 return src_len - s.odd; in cpacf_kmc()
307 * cpacf_kimd() - executes the KIMD (COMPUTE INTERMEDIATE MESSAGE DIGEST)
309 * @func: the function code passed to KM; see CPACF_KIMD_xxx defines
333 * cpacf_klmd() - executes the KLMD (COMPUTE LAST MESSAGE DIGEST) instruction
334 * @func: the function code passed to KM; see CPACF_KLMD_xxx defines
358 * cpacf_kmac() - executes the KMAC (COMPUTE MESSAGE AUTHENTICATION CODE)
360 * @func: the function code passed to KM; see CPACF_KMAC_xxx defines
384 return src_len - s.odd; in cpacf_kmac()
388 * cpacf_kmctr() - executes the KMCTR (CIPHER MESSAGE WITH COUNTER) instruction
389 * @func: the function code passed to KMCTR; see CPACF_KMCTR_xxx defines
419 return src_len - s.odd; in cpacf_kmctr()
423 * cpacf_prno() - executes the PRNO (PERFORM RANDOM NUMBER OPERATION)
425 * @func: the function code passed to PRNO; see CPACF_PRNO_xxx defines
454 * cpacf_trng() - executes the TRNG subfunction of the PRNO instruction
479 * cpacf_pcc() - executes the PCC (PERFORM CRYPTOGRAPHIC COMPUTATION)
481 * @func: the function code passed to PCC; see CPACF_KM_xxx defines
498 * cpacf_pckmo() - executes the PCKMO (PERFORM CRYPTOGRAPHIC KEY
500 * @func: the function code passed to PCKMO; see CPACF_PCKMO_xxx defines
518 * cpacf_kma() - executes the KMA (CIPHER MESSAGE WITH AUTHENTICATION)
520 * @func: the function code passed to KMA; see CPACF_KMA_xxx defines