1/* Copyright (c) (2021-2023) Apple Inc. All rights reserved.
2 *
3 * corecrypto is licensed under Apple Inc.’s Internal Use License Agreement (which
4 * is contained in the License.txt file distributed with corecrypto) and only to
5 * people who accept that license. IMPORTANT: Any license rights granted to you by
6 * Apple Inc. (if any) are limited to internal use within your organization only on
7 * devices and computers you own or control, for the sole purpose of verifying the
8 * security characteristics and correct functioning of the Apple Software. You may
9 * not, directly or indirectly, redistribute the Apple Software or any portions thereof.
10 *
11 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
12 *
13 * This file contains Original Code and/or Modifications of Original Code
14 * as defined in and that are subject to the Apple Public Source License
15 * Version 2.0 (the 'License'). You may not use this file except in
16 * compliance with the License. The rights granted to you under the License
17 * may not be used to create, or enable the creation or redistribution of,
18 * unlawful or unlicensed copies of an Apple operating system, or to
19 * circumvent, violate, or enable the circumvention or violation of, any
20 * terms of an Apple operating system software license agreement.
21 *
22 * Please obtain a copy of the License at
23 * http://www.opensource.apple.com/apsl/ and read it before using this file.
24 *
25 * The Original Code and all software distributed under the License are
26 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
27 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
28 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
29 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
30 * Please see the License for the specific language governing rights and
31 * limitations under the License.
32 *
33 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
34 */
35
36#ifndef _CORECRYPTO_CC_WORKSPACES_H_
37#define _CORECRYPTO_CC_WORKSPACES_H_
38
39CC_PURE size_t sizeof_cc_unit(void);
40
41CC_PURE size_t sizeof_struct_ccbfv_cipher_plain_ctx(void);
42
43CC_PURE size_t sizeof_struct_ccbfv_ciphertext(void);
44
45CC_PURE size_t sizeof_struct_ccbfv_dcrt_plaintext(void);
46
47CC_PURE size_t sizeof_struct_ccbfv_decrypt_ctx(void);
48
49CC_PURE size_t sizeof_struct_ccbfv_encrypt_params(void);
50
51CC_PURE size_t sizeof_struct_ccbfv_galois_key(void);
52
53CC_PURE size_t sizeof_struct_ccbfv_param_ctx(void);
54
55CC_PURE size_t sizeof_struct_ccbfv_plaintext(void);
56
57CC_PURE size_t sizeof_struct_ccbfv_relin_key(void);
58
59CC_PURE size_t sizeof_struct_ccdh_full_ctx(void);
60
61CC_PURE size_t sizeof_struct_ccdh_pub_ctx(void);
62
63CC_PURE size_t sizeof_struct_ccec_full_ctx(void);
64
65CC_PURE size_t sizeof_struct_ccec_pub_ctx(void);
66
67CC_PURE size_t sizeof_struct_ccpolyzp_po2cyc(void);
68
69CC_PURE size_t sizeof_struct_ccpolyzp_po2cyc_base_convert(void);
70
71CC_PURE size_t sizeof_struct_ccpolyzp_po2cyc_block_rng_state(void);
72
73CC_PURE size_t sizeof_struct_ccpolyzp_po2cyc_ctx(void);
74
75CC_PURE size_t sizeof_struct_ccpolyzp_po2cyc_ctx_chain(void);
76
77CC_PURE size_t sizeof_struct_ccrns_mul_modulus(void);
78
79CC_PURE size_t sizeof_struct_ccrsa_full_ctx(void);
80
81CC_PURE size_t sizeof_struct_ccrsa_pub_ctx(void);
82
83CC_PURE size_t sizeof_struct_cczp(void);
84
85CC_PURE cc_size CCBFV_CIPHERTEXT_APPLY_GALOIS_WORKSPACE_N(cc_size degree, cc_size num_ctext_moduli);
86
87CC_PURE cc_size CCBFV_CIPHERTEXT_GALOIS_KEY_SWITCH_WORKSPACE_N(cc_size degree, cc_size num_galois_key_moduli);
88
89CC_PURE cc_size CCBFV_CIPHERTEXT_PLAINTEXT_ADD_WORKSPACE_N(cc_size degree);
90
91CC_PURE cc_size CCBFV_CIPHERTEXT_COEFF_PLAINTEXT_MUL_WORKSPACE_N(cc_size degree, cc_size num_moduli);
92
93CC_PURE cc_size CCBFV_CIPHERTEXT_EVAL_PLAINTEXT_MUL_WORKSPACE_N(cc_size degree, cc_size num_moduli);
94
95CC_PURE cc_size CCBFV_CIPHERTEXT_ROTATE_ROWS_LEFT_WORKSPACE_N(cc_size degree, cc_size num_ctext_moduli);
96
97CC_PURE cc_size CCBFV_CIPHERTEXT_ROTATE_ROWS_RIGHT_WORKSPACE_N(cc_size degree, cc_size num_ctext_moduli);
98
99CC_PURE cc_size CCBFV_CIPHERTEXT_SWAP_COLUMNS_WORKSPACE_N(cc_size degree, cc_size num_ctext_moduli);
100
101CC_PURE cc_size CCBFV_CIPHER_PLAIN_CTX_INIT_WORKSPACE_N(cc_size num_moduli);
102
103CC_PURE cc_size CCBFV_DECODE_SIMD_INT64_WORKSPACE_N(cc_size degree, cc_size num_moduli);
104
105CC_PURE cc_size CCBFV_DECODE_SIMD_UINT64_WORKSPACE_N(cc_size degree, cc_size num_moduli);
106
107CC_PURE cc_size CCBFV_DECRYPT_WORKSPACE_N(cc_size degree, cc_size num_moduli);
108
109CC_PURE cc_size CCBFV_DESERIALIZE_SEEDED_CIPHERTEXT_EVAL_WORKSPACE_N(cc_size degree);
110
111CC_PURE cc_size CCBFV_ENCRYPT_SYMMETRIC_WORKSPACE_N(cc_size degree, cc_size num_moduli);
112
113CC_PURE cc_size CCBFV_ENCRYPT_ZERO_SYMMETRIC_COEFF_WORKSPACE_N(cc_size degree, cc_size num_moduli);
114
115CC_PURE cc_size CCBFV_ENCRYPT_ZERO_SYMMETRIC_EVAL_WORKSPACE_N(cc_size degree, cc_size num_moduli);
116
117CC_PURE cc_size CCBFV_ENCRYPT_ZERO_SYMMETRIC_HELPER_WORKSPACE_N(cc_size degree, cc_size nmoduli);
118
119CC_PURE cc_size CCBFV_GALOIS_KEY_GENERATE_SINGLE_WORKSPACE_N(cc_size degree, cc_size num_moduli);
120
121CC_PURE cc_size CCBFV_GALOIS_KEY_GENERATE_WORKSPACE_N(cc_size degree, cc_size num_moduli);
122
123CC_PURE cc_size CCBFV_RELIN_KEY_GENERATE_WORKSPACE_N(cc_size degree, cc_size num_moduli);
124
125CC_PURE cc_size CCDH_POWER_BLINDED_WORKSPACE_N(cc_size n);
126
127CC_PURE cc_size CCEC_AFFINIFY_POINTS_WORKSPACE_N(cc_size n, cc_size npoints);
128
129CC_PURE cc_size CCN_P224_INV_ASM_WORKSPACE_N(cc_size n);
130
131CC_PURE cc_size CCN_P256_INV_ASM_WORKSPACE_N(cc_size n);
132
133CC_PURE cc_size CCN_P384_INV_ASM_WORKSPACE_N(cc_size n);
134
135CC_PURE cc_size CCN_SQR_WORKSPACE_N(cc_size n);
136
137CC_PURE cc_size CCPOLYZP_PO2CYC_BASE_CONVERT_DIVIDE_AND_ROUND_WORKSPACE_N(cc_size degree, cc_size num_moduli);
138
139CC_PURE cc_size CCPOLYZP_PO2CYC_BASE_CONVERT_INIT_PUNC_PROD_WORKSPACE_N(cc_size num_moduli);
140
141CC_PURE cc_size CCPOLYZP_PO2CYC_BASE_CONVERT_INIT_WORKSPACE_N(cc_size num_moduli);
142
143CC_PURE cc_size CCPOLYZP_PO2CYC_CTX_Q_PROD_WORKSPACE_N(cc_size num_moduli);
144
145CC_PURE cc_size CCPOLYZP_PO2CYC_CTX_WORKSPACE_N(cc_size degree);
146
147CC_PURE cc_size CCPOLYZP_PO2CYC_CTX_INIT_WORKSPACE_N(cc_size n);
148
149CC_PURE cc_size CCPOLYZP_PO2CYC_DESERIALIZE_POLY_WORKSPACE_N(cc_size degree);
150
151CC_PURE cc_size CCPOLYZP_PO2CYC_RANDOM_TERNARY_WORKSPACE_N(cc_size degree);
152
153CC_PURE cc_size CCPOLYZP_PO2CYC_RANDOM_UNIFORM_WORKSPACE_N(cc_size degree);
154
155CC_PURE cc_size CCPOLYZP_PO2CYC_RANDOM_CBD_WORKSPACE_N(cc_size degree);
156
157CC_PURE cc_size CCPOLYZP_PO2CYC_SERIALIZE_POLY_WORKSPACE_N(cc_size degree);
158
159CC_PURE cc_size CCPOLYZP_PO2CYC_WORKSPACE_N(cc_size degree, cc_size num_moduli);
160
161CC_PURE cc_size CCRSA_CRT_POWER_BLINDED_WORKSPACE_N(cc_size n);
162
163#include "cc_workspaces_generated.h"
164
165#endif // _CORECRYPTO_CC_WORKSPACES_H_
166