xref: /qemu/include/crypto/clmul.h (revision 9a65a570)
1 /*
2  * Carry-less multiply operations.
3  * SPDX-License-Identifier: GPL-2.0-or-later
4  *
5  * Copyright (C) 2023 Linaro, Ltd.
6  */
7 
8 #ifndef CRYPTO_CLMUL_H
9 #define CRYPTO_CLMUL_H
10 
11 /**
12  * clmul_8x8_low:
13  *
14  * Perform eight 8x8->8 carry-less multiplies.
15  */
16 uint64_t clmul_8x8_low(uint64_t, uint64_t);
17 
18 /**
19  * clmul_8x4_even:
20  *
21  * Perform four 8x8->16 carry-less multiplies.
22  * The odd bytes of the inputs are ignored.
23  */
24 uint64_t clmul_8x4_even(uint64_t, uint64_t);
25 
26 /**
27  * clmul_8x4_odd:
28  *
29  * Perform four 8x8->16 carry-less multiplies.
30  * The even bytes of the inputs are ignored.
31  */
32 uint64_t clmul_8x4_odd(uint64_t, uint64_t);
33 
34 /**
35  * clmul_8x4_packed:
36  *
37  * Perform four 8x8->16 carry-less multiplies.
38  */
39 uint64_t clmul_8x4_packed(uint32_t, uint32_t);
40 
41 /**
42  * clmul_16x2_even:
43  *
44  * Perform two 16x16->32 carry-less multiplies.
45  * The odd words of the inputs are ignored.
46  */
47 uint64_t clmul_16x2_even(uint64_t, uint64_t);
48 
49 /**
50  * clmul_16x2_odd:
51  *
52  * Perform two 16x16->32 carry-less multiplies.
53  * The even words of the inputs are ignored.
54  */
55 uint64_t clmul_16x2_odd(uint64_t, uint64_t);
56 
57 /**
58  * clmul_32:
59  *
60  * Perform a 32x32->64 carry-less multiply.
61  */
62 uint64_t clmul_32(uint32_t, uint32_t);
63 
64 #endif /* CRYPTO_CLMUL_H */
65