/src/openssl/providers/implementations/include/prov/ciphercommon.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved. |
3 | | * |
4 | | * Licensed under the Apache License 2.0 (the "License"). You may not use |
5 | | * this file except in compliance with the License. You can obtain a copy |
6 | | * in the file LICENSE in the source distribution or at |
7 | | * https://www.openssl.org/source/license.html |
8 | | */ |
9 | | |
10 | | #ifndef OSSL_PROV_CIPHERCOMMON_H |
11 | | # define OSSL_PROV_CIPHERCOMMON_H |
12 | | # pragma once |
13 | | |
14 | | # include <openssl/params.h> |
15 | | # include <openssl/core_dispatch.h> |
16 | | # include <openssl/core_names.h> |
17 | | # include <openssl/evp.h> |
18 | | # include "internal/cryptlib.h" |
19 | | # include "crypto/modes.h" |
20 | | |
21 | 3.97k | # define MAXCHUNK ((size_t)1 << 30) |
22 | 674 | # define MAXBITCHUNK ((size_t)1 << (sizeof(size_t) * 8 - 4)) |
23 | | |
24 | | # define GENERIC_BLOCK_SIZE 16 |
25 | 4.24k | # define IV_STATE_UNINITIALISED 0 /* initial state is not initialized */ |
26 | 5.20k | # define IV_STATE_BUFFERED 1 /* iv has been copied to the iv buffer */ |
27 | 927 | # define IV_STATE_COPIED 2 /* iv has been copied from the iv buffer */ |
28 | 4.01k | # define IV_STATE_FINISHED 3 /* the iv has been used - so don't reuse it */ |
29 | | |
30 | | # define PROV_CIPHER_FUNC(type, name, args) typedef type (* OSSL_##name##_fn)args |
31 | | |
32 | | typedef struct prov_cipher_hw_st PROV_CIPHER_HW; |
33 | | typedef struct prov_cipher_ctx_st PROV_CIPHER_CTX; |
34 | | |
35 | | typedef int (PROV_CIPHER_HW_FN)(PROV_CIPHER_CTX *dat, unsigned char *out, |
36 | | const unsigned char *in, size_t len); |
37 | | |
38 | | /* Internal flags that can be queried */ |
39 | 403 | # define PROV_CIPHER_FLAG_AEAD 0x0001 |
40 | 556 | # define PROV_CIPHER_FLAG_CUSTOM_IV 0x0002 |
41 | 256 | # define PROV_CIPHER_FLAG_CTS 0x0004 |
42 | 256 | # define PROV_CIPHER_FLAG_TLS1_MULTIBLOCK 0x0008 |
43 | 256 | # define PROV_CIPHER_FLAG_RAND_KEY 0x0010 |
44 | | /* Internal flags that are only used within the provider */ |
45 | 5.41k | # define PROV_CIPHER_FLAG_VARIABLE_LENGTH 0x0100 |
46 | 5.41k | # define PROV_CIPHER_FLAG_INVERSE_CIPHER 0x0200 |
47 | | |
48 | | struct prov_cipher_ctx_st { |
49 | | /* place buffer at the beginning for memory alignment */ |
50 | | /* The original value of the iv */ |
51 | | unsigned char oiv[GENERIC_BLOCK_SIZE]; |
52 | | /* Buffer of partial blocks processed via update calls */ |
53 | | unsigned char buf[GENERIC_BLOCK_SIZE]; |
54 | | unsigned char iv[GENERIC_BLOCK_SIZE]; |
55 | | |
56 | | block128_f block; |
57 | | union { |
58 | | cbc128_f cbc; |
59 | | ctr128_f ctr; |
60 | | ecb128_f ecb; |
61 | | } stream; |
62 | | |
63 | | unsigned int mode; |
64 | | size_t keylen; /* key size (in bytes) */ |
65 | | size_t ivlen; |
66 | | size_t blocksize; |
67 | | size_t bufsz; /* Number of bytes in buf */ |
68 | | unsigned int cts_mode; /* Use to set the type for CTS modes */ |
69 | | unsigned int pad : 1; /* Whether padding should be used or not */ |
70 | | unsigned int enc : 1; /* Set to 1 for encrypt, or 0 otherwise */ |
71 | | unsigned int iv_set : 1; /* Set when the iv is copied to the iv/oiv buffers */ |
72 | | unsigned int key_set : 1; /* Set when key is set on the context */ |
73 | | unsigned int updated : 1; /* Set to 1 during update for one shot ciphers */ |
74 | | unsigned int variable_keylength : 1; |
75 | | unsigned int inverse_cipher : 1; /* set to 1 to use inverse cipher */ |
76 | | unsigned int use_bits : 1; /* Set to 0 for cfb1 to use bits instead of bytes */ |
77 | | |
78 | | unsigned int tlsversion; /* If TLS padding is in use the TLS version number */ |
79 | | unsigned char *tlsmac; /* tls MAC extracted from the last record */ |
80 | | int alloced; /* |
81 | | * Whether the tlsmac data has been allocated or |
82 | | * points into the user buffer. |
83 | | */ |
84 | | size_t tlsmacsize; /* Size of the TLS MAC */ |
85 | | int removetlspad; /* Whether TLS padding should be removed or not */ |
86 | | size_t removetlsfixed; /* |
87 | | * Length of the fixed size data to remove when |
88 | | * processing TLS data (equals mac size plus |
89 | | * IV size if applicable) |
90 | | */ |
91 | | |
92 | | /* |
93 | | * num contains the number of bytes of |iv| which are valid for modes that |
94 | | * manage partial blocks themselves. |
95 | | */ |
96 | | unsigned int num; |
97 | | const PROV_CIPHER_HW *hw; /* hardware specific functions */ |
98 | | const void *ks; /* Pointer to algorithm specific key data */ |
99 | | OSSL_LIB_CTX *libctx; |
100 | | }; |
101 | | |
102 | | struct prov_cipher_hw_st { |
103 | | int (*init)(PROV_CIPHER_CTX *dat, const uint8_t *key, size_t keylen); |
104 | | PROV_CIPHER_HW_FN *cipher; |
105 | | void (*copyctx)(PROV_CIPHER_CTX *dst, const PROV_CIPHER_CTX *src); |
106 | | }; |
107 | | |
108 | | void ossl_cipher_generic_reset_ctx(PROV_CIPHER_CTX *ctx); |
109 | | OSSL_FUNC_cipher_encrypt_init_fn ossl_cipher_generic_einit; |
110 | | OSSL_FUNC_cipher_decrypt_init_fn ossl_cipher_generic_dinit; |
111 | | OSSL_FUNC_cipher_update_fn ossl_cipher_generic_block_update; |
112 | | OSSL_FUNC_cipher_final_fn ossl_cipher_generic_block_final; |
113 | | OSSL_FUNC_cipher_update_fn ossl_cipher_generic_stream_update; |
114 | | OSSL_FUNC_cipher_final_fn ossl_cipher_generic_stream_final; |
115 | | OSSL_FUNC_cipher_cipher_fn ossl_cipher_generic_cipher; |
116 | | OSSL_FUNC_cipher_get_ctx_params_fn ossl_cipher_generic_get_ctx_params; |
117 | | OSSL_FUNC_cipher_set_ctx_params_fn ossl_cipher_generic_set_ctx_params; |
118 | | OSSL_FUNC_cipher_gettable_params_fn ossl_cipher_generic_gettable_params; |
119 | | OSSL_FUNC_cipher_gettable_ctx_params_fn ossl_cipher_generic_gettable_ctx_params; |
120 | | OSSL_FUNC_cipher_settable_ctx_params_fn ossl_cipher_generic_settable_ctx_params; |
121 | | OSSL_FUNC_cipher_set_ctx_params_fn ossl_cipher_var_keylen_set_ctx_params; |
122 | | OSSL_FUNC_cipher_settable_ctx_params_fn ossl_cipher_var_keylen_settable_ctx_params; |
123 | | OSSL_FUNC_cipher_gettable_ctx_params_fn ossl_cipher_aead_gettable_ctx_params; |
124 | | OSSL_FUNC_cipher_settable_ctx_params_fn ossl_cipher_aead_settable_ctx_params; |
125 | | |
126 | | int ossl_cipher_generic_get_params(OSSL_PARAM params[], unsigned int md, |
127 | | uint64_t flags, |
128 | | size_t kbits, size_t blkbits, size_t ivbits); |
129 | | void ossl_cipher_generic_initkey(void *vctx, size_t kbits, size_t blkbits, |
130 | | size_t ivbits, unsigned int mode, |
131 | | uint64_t flags, |
132 | | const PROV_CIPHER_HW *hw, void *provctx); |
133 | | |
134 | | # define IMPLEMENT_generic_cipher_func(alg, UCALG, lcmode, UCMODE, flags, kbits,\ |
135 | | blkbits, ivbits, typ) \ |
136 | | const OSSL_DISPATCH ossl_##alg##kbits##lcmode##_functions[] = { \ |
137 | | { OSSL_FUNC_CIPHER_NEWCTX, \ |
138 | | (void (*)(void)) alg##_##kbits##_##lcmode##_newctx }, \ |
139 | | { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void)) alg##_freectx }, \ |
140 | | { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void)) alg##_dupctx }, \ |
141 | | { OSSL_FUNC_CIPHER_ENCRYPT_INIT, (void (*)(void))ossl_cipher_generic_einit }, \ |
142 | | { OSSL_FUNC_CIPHER_DECRYPT_INIT, (void (*)(void))ossl_cipher_generic_dinit }, \ |
143 | | { OSSL_FUNC_CIPHER_UPDATE, (void (*)(void))ossl_cipher_generic_##typ##_update },\ |
144 | | { OSSL_FUNC_CIPHER_FINAL, (void (*)(void))ossl_cipher_generic_##typ##_final }, \ |
145 | | { OSSL_FUNC_CIPHER_CIPHER, (void (*)(void))ossl_cipher_generic_cipher }, \ |
146 | | { OSSL_FUNC_CIPHER_GET_PARAMS, \ |
147 | | (void (*)(void)) alg##_##kbits##_##lcmode##_get_params }, \ |
148 | | { OSSL_FUNC_CIPHER_GET_CTX_PARAMS, \ |
149 | | (void (*)(void))ossl_cipher_generic_get_ctx_params }, \ |
150 | | { OSSL_FUNC_CIPHER_SET_CTX_PARAMS, \ |
151 | | (void (*)(void))ossl_cipher_generic_set_ctx_params }, \ |
152 | | { OSSL_FUNC_CIPHER_GETTABLE_PARAMS, \ |
153 | | (void (*)(void))ossl_cipher_generic_gettable_params }, \ |
154 | | { OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS, \ |
155 | | (void (*)(void))ossl_cipher_generic_gettable_ctx_params }, \ |
156 | | { OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS, \ |
157 | | (void (*)(void))ossl_cipher_generic_settable_ctx_params }, \ |
158 | | OSSL_DISPATCH_END \ |
159 | | }; |
160 | | |
161 | | # define IMPLEMENT_var_keylen_cipher_func(alg, UCALG, lcmode, UCMODE, flags, \ |
162 | | kbits, blkbits, ivbits, typ) \ |
163 | | const OSSL_DISPATCH ossl_##alg##kbits##lcmode##_functions[] = { \ |
164 | | { OSSL_FUNC_CIPHER_NEWCTX, \ |
165 | | (void (*)(void)) alg##_##kbits##_##lcmode##_newctx }, \ |
166 | | { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void)) alg##_freectx }, \ |
167 | | { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void)) alg##_dupctx }, \ |
168 | | { OSSL_FUNC_CIPHER_ENCRYPT_INIT, (void (*)(void))ossl_cipher_generic_einit },\ |
169 | | { OSSL_FUNC_CIPHER_DECRYPT_INIT, (void (*)(void))ossl_cipher_generic_dinit },\ |
170 | | { OSSL_FUNC_CIPHER_UPDATE, (void (*)(void))ossl_cipher_generic_##typ##_update },\ |
171 | | { OSSL_FUNC_CIPHER_FINAL, (void (*)(void))ossl_cipher_generic_##typ##_final }, \ |
172 | | { OSSL_FUNC_CIPHER_CIPHER, (void (*)(void))ossl_cipher_generic_cipher }, \ |
173 | | { OSSL_FUNC_CIPHER_GET_PARAMS, \ |
174 | | (void (*)(void)) alg##_##kbits##_##lcmode##_get_params }, \ |
175 | | { OSSL_FUNC_CIPHER_GET_CTX_PARAMS, \ |
176 | | (void (*)(void))ossl_cipher_generic_get_ctx_params }, \ |
177 | | { OSSL_FUNC_CIPHER_SET_CTX_PARAMS, \ |
178 | | (void (*)(void))ossl_cipher_var_keylen_set_ctx_params }, \ |
179 | | { OSSL_FUNC_CIPHER_GETTABLE_PARAMS, \ |
180 | | (void (*)(void))ossl_cipher_generic_gettable_params }, \ |
181 | | { OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS, \ |
182 | | (void (*)(void))ossl_cipher_generic_gettable_ctx_params }, \ |
183 | | { OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS, \ |
184 | | (void (*)(void))ossl_cipher_var_keylen_settable_ctx_params }, \ |
185 | | OSSL_DISPATCH_END \ |
186 | | }; |
187 | | |
188 | | |
189 | | # define IMPLEMENT_generic_cipher_genfn(alg, UCALG, lcmode, UCMODE, flags, \ |
190 | | kbits, blkbits, ivbits, typ) \ |
191 | | static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_##lcmode##_get_params; \ |
192 | 136 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ |
193 | 136 | { \ |
194 | 136 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ |
195 | 136 | flags, kbits, blkbits, ivbits); \ |
196 | 136 | } \ cipher_aes.c:aes_256_ecb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_192_ecb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_128_ecb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_256_cbc_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_192_cbc_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_128_cbc_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_256_ofb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_192_ofb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_128_ofb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_256_cfb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_192_cfb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_128_cfb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_256_cfb1_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_192_cfb1_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_128_cfb1_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_256_cfb8_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_192_cfb8_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_128_cfb8_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_256_ctr_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_192_ctr_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aes.c:aes_128_ctr_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_256_ecb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_192_ecb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_128_ecb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_256_cbc_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_192_cbc_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_128_cbc_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_256_ofb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_192_ofb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_128_ofb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_256_cfb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_192_cfb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_128_cfb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_256_cfb1_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_192_cfb1_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_128_cfb1_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_256_cfb8_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_192_cfb8_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_128_cfb8_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_256_ctr_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_192_ctr_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_aria.c:aria_128_ctr_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_256_ecb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_192_ecb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_128_ecb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_256_cbc_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_192_cbc_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_128_cbc_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_256_ofb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_192_ofb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_128_ofb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_256_cfb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_192_cfb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_128_cfb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_256_cfb1_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_192_cfb1_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_128_cfb1_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_256_cfb8_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_192_cfb8_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_128_cfb8_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_256_ctr_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_192_ctr_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_camellia.c:camellia_128_ctr_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_sm4.c:sm4_128_ecb_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_sm4.c:sm4_128_cbc_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_sm4.c:sm4_128_ctr_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_sm4.c:sm4_128_ofb128_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
cipher_sm4.c:sm4_128_cfb128_get_params Line | Count | Source | 192 | 2 | static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ | 193 | 2 | { \ | 194 | 2 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 195 | 2 | flags, kbits, blkbits, ivbits); \ | 196 | 2 | } \ |
|
197 | | static OSSL_FUNC_cipher_newctx_fn alg##_##kbits##_##lcmode##_newctx; \ |
198 | 3.92k | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ |
199 | 3.92k | { \ |
200 | 3.92k | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ |
201 | 3.92k | : NULL; \ |
202 | 3.92k | if (ctx != NULL) { \ |
203 | 3.92k | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ |
204 | 3.92k | EVP_CIPH_##UCMODE##_MODE, flags, \ |
205 | 3.92k | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ |
206 | 3.92k | provctx); \ |
207 | 3.92k | } \ |
208 | 3.92k | return ctx; \ |
209 | 3.92k | } \ cipher_aes.c:aes_256_ecb_newctx Line | Count | Source | 198 | 29 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 29 | { \ | 200 | 29 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 29 | : NULL; \ | 202 | 29 | if (ctx != NULL) { \ | 203 | 29 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 29 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 29 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 29 | provctx); \ | 207 | 29 | } \ | 208 | 29 | return ctx; \ | 209 | 29 | } \ |
cipher_aes.c:aes_192_ecb_newctx Line | Count | Source | 198 | 70 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 70 | { \ | 200 | 70 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 70 | : NULL; \ | 202 | 70 | if (ctx != NULL) { \ | 203 | 70 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 70 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 70 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 70 | provctx); \ | 207 | 70 | } \ | 208 | 70 | return ctx; \ | 209 | 70 | } \ |
cipher_aes.c:aes_128_ecb_newctx Line | Count | Source | 198 | 93 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 93 | { \ | 200 | 93 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 93 | : NULL; \ | 202 | 93 | if (ctx != NULL) { \ | 203 | 93 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 93 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 93 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 93 | provctx); \ | 207 | 93 | } \ | 208 | 93 | return ctx; \ | 209 | 93 | } \ |
cipher_aes.c:aes_256_cbc_newctx Line | Count | Source | 198 | 4 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 4 | { \ | 200 | 4 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 4 | : NULL; \ | 202 | 4 | if (ctx != NULL) { \ | 203 | 4 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 4 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 4 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 4 | provctx); \ | 207 | 4 | } \ | 208 | 4 | return ctx; \ | 209 | 4 | } \ |
cipher_aes.c:aes_192_cbc_newctx Line | Count | Source | 198 | 73 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 73 | { \ | 200 | 73 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 73 | : NULL; \ | 202 | 73 | if (ctx != NULL) { \ | 203 | 73 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 73 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 73 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 73 | provctx); \ | 207 | 73 | } \ | 208 | 73 | return ctx; \ | 209 | 73 | } \ |
cipher_aes.c:aes_128_cbc_newctx Line | Count | Source | 198 | 153 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 153 | { \ | 200 | 153 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 153 | : NULL; \ | 202 | 153 | if (ctx != NULL) { \ | 203 | 153 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 153 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 153 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 153 | provctx); \ | 207 | 153 | } \ | 208 | 153 | return ctx; \ | 209 | 153 | } \ |
cipher_aes.c:aes_256_ofb_newctx Line | Count | Source | 198 | 67 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 67 | { \ | 200 | 67 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 67 | : NULL; \ | 202 | 67 | if (ctx != NULL) { \ | 203 | 67 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 67 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 67 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 67 | provctx); \ | 207 | 67 | } \ | 208 | 67 | return ctx; \ | 209 | 67 | } \ |
cipher_aes.c:aes_192_ofb_newctx Line | Count | Source | 198 | 73 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 73 | { \ | 200 | 73 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 73 | : NULL; \ | 202 | 73 | if (ctx != NULL) { \ | 203 | 73 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 73 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 73 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 73 | provctx); \ | 207 | 73 | } \ | 208 | 73 | return ctx; \ | 209 | 73 | } \ |
cipher_aes.c:aes_128_ofb_newctx Line | Count | Source | 198 | 25 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 25 | { \ | 200 | 25 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 25 | : NULL; \ | 202 | 25 | if (ctx != NULL) { \ | 203 | 25 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 25 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 25 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 25 | provctx); \ | 207 | 25 | } \ | 208 | 25 | return ctx; \ | 209 | 25 | } \ |
cipher_aes.c:aes_256_cfb_newctx Line | Count | Source | 198 | 5 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 5 | { \ | 200 | 5 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 5 | : NULL; \ | 202 | 5 | if (ctx != NULL) { \ | 203 | 5 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 5 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 5 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 5 | provctx); \ | 207 | 5 | } \ | 208 | 5 | return ctx; \ | 209 | 5 | } \ |
cipher_aes.c:aes_192_cfb_newctx Line | Count | Source | 198 | 65 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 65 | { \ | 200 | 65 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 65 | : NULL; \ | 202 | 65 | if (ctx != NULL) { \ | 203 | 65 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 65 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 65 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 65 | provctx); \ | 207 | 65 | } \ | 208 | 65 | return ctx; \ | 209 | 65 | } \ |
cipher_aes.c:aes_128_cfb_newctx Line | Count | Source | 198 | 76 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 76 | { \ | 200 | 76 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 76 | : NULL; \ | 202 | 76 | if (ctx != NULL) { \ | 203 | 76 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 76 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 76 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 76 | provctx); \ | 207 | 76 | } \ | 208 | 76 | return ctx; \ | 209 | 76 | } \ |
cipher_aes.c:aes_256_cfb1_newctx Line | Count | Source | 198 | 2 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 2 | { \ | 200 | 2 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 2 | : NULL; \ | 202 | 2 | if (ctx != NULL) { \ | 203 | 2 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 2 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 2 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 2 | provctx); \ | 207 | 2 | } \ | 208 | 2 | return ctx; \ | 209 | 2 | } \ |
cipher_aes.c:aes_192_cfb1_newctx Line | Count | Source | 198 | 2 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 2 | { \ | 200 | 2 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 2 | : NULL; \ | 202 | 2 | if (ctx != NULL) { \ | 203 | 2 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 2 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 2 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 2 | provctx); \ | 207 | 2 | } \ | 208 | 2 | return ctx; \ | 209 | 2 | } \ |
cipher_aes.c:aes_128_cfb1_newctx Line | Count | Source | 198 | 63 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 63 | { \ | 200 | 63 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 63 | : NULL; \ | 202 | 63 | if (ctx != NULL) { \ | 203 | 63 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 63 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 63 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 63 | provctx); \ | 207 | 63 | } \ | 208 | 63 | return ctx; \ | 209 | 63 | } \ |
cipher_aes.c:aes_256_cfb8_newctx Line | Count | Source | 198 | 80 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 80 | { \ | 200 | 80 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 80 | : NULL; \ | 202 | 80 | if (ctx != NULL) { \ | 203 | 80 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 80 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 80 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 80 | provctx); \ | 207 | 80 | } \ | 208 | 80 | return ctx; \ | 209 | 80 | } \ |
cipher_aes.c:aes_192_cfb8_newctx Line | Count | Source | 198 | 65 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 65 | { \ | 200 | 65 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 65 | : NULL; \ | 202 | 65 | if (ctx != NULL) { \ | 203 | 65 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 65 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 65 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 65 | provctx); \ | 207 | 65 | } \ | 208 | 65 | return ctx; \ | 209 | 65 | } \ |
cipher_aes.c:aes_128_cfb8_newctx Line | Count | Source | 198 | 36 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 36 | { \ | 200 | 36 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 36 | : NULL; \ | 202 | 36 | if (ctx != NULL) { \ | 203 | 36 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 36 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 36 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 36 | provctx); \ | 207 | 36 | } \ | 208 | 36 | return ctx; \ | 209 | 36 | } \ |
cipher_aes.c:aes_256_ctr_newctx Line | Count | Source | 198 | 81 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 81 | { \ | 200 | 81 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 81 | : NULL; \ | 202 | 81 | if (ctx != NULL) { \ | 203 | 81 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 81 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 81 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 81 | provctx); \ | 207 | 81 | } \ | 208 | 81 | return ctx; \ | 209 | 81 | } \ |
cipher_aes.c:aes_192_ctr_newctx Line | Count | Source | 198 | 132 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 132 | { \ | 200 | 132 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 132 | : NULL; \ | 202 | 132 | if (ctx != NULL) { \ | 203 | 132 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 132 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 132 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 132 | provctx); \ | 207 | 132 | } \ | 208 | 132 | return ctx; \ | 209 | 132 | } \ |
cipher_aes.c:aes_128_ctr_newctx Line | Count | Source | 198 | 26 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 26 | { \ | 200 | 26 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 26 | : NULL; \ | 202 | 26 | if (ctx != NULL) { \ | 203 | 26 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 26 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 26 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 26 | provctx); \ | 207 | 26 | } \ | 208 | 26 | return ctx; \ | 209 | 26 | } \ |
cipher_aria.c:aria_256_ecb_newctx Line | Count | Source | 198 | 5 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 5 | { \ | 200 | 5 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 5 | : NULL; \ | 202 | 5 | if (ctx != NULL) { \ | 203 | 5 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 5 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 5 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 5 | provctx); \ | 207 | 5 | } \ | 208 | 5 | return ctx; \ | 209 | 5 | } \ |
cipher_aria.c:aria_192_ecb_newctx Line | Count | Source | 198 | 72 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 72 | { \ | 200 | 72 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 72 | : NULL; \ | 202 | 72 | if (ctx != NULL) { \ | 203 | 72 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 72 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 72 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 72 | provctx); \ | 207 | 72 | } \ | 208 | 72 | return ctx; \ | 209 | 72 | } \ |
cipher_aria.c:aria_128_ecb_newctx Line | Count | Source | 198 | 69 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 69 | { \ | 200 | 69 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 69 | : NULL; \ | 202 | 69 | if (ctx != NULL) { \ | 203 | 69 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 69 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 69 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 69 | provctx); \ | 207 | 69 | } \ | 208 | 69 | return ctx; \ | 209 | 69 | } \ |
cipher_aria.c:aria_256_cbc_newctx Line | Count | Source | 198 | 9 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 9 | { \ | 200 | 9 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 9 | : NULL; \ | 202 | 9 | if (ctx != NULL) { \ | 203 | 9 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 9 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 9 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 9 | provctx); \ | 207 | 9 | } \ | 208 | 9 | return ctx; \ | 209 | 9 | } \ |
cipher_aria.c:aria_192_cbc_newctx Line | Count | Source | 198 | 167 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 167 | { \ | 200 | 167 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 167 | : NULL; \ | 202 | 167 | if (ctx != NULL) { \ | 203 | 167 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 167 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 167 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 167 | provctx); \ | 207 | 167 | } \ | 208 | 167 | return ctx; \ | 209 | 167 | } \ |
cipher_aria.c:aria_128_cbc_newctx Line | Count | Source | 198 | 52 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 52 | { \ | 200 | 52 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 52 | : NULL; \ | 202 | 52 | if (ctx != NULL) { \ | 203 | 52 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 52 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 52 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 52 | provctx); \ | 207 | 52 | } \ | 208 | 52 | return ctx; \ | 209 | 52 | } \ |
cipher_aria.c:aria_256_ofb_newctx Line | Count | Source | 198 | 29 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 29 | { \ | 200 | 29 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 29 | : NULL; \ | 202 | 29 | if (ctx != NULL) { \ | 203 | 29 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 29 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 29 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 29 | provctx); \ | 207 | 29 | } \ | 208 | 29 | return ctx; \ | 209 | 29 | } \ |
cipher_aria.c:aria_192_ofb_newctx Line | Count | Source | 198 | 56 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 56 | { \ | 200 | 56 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 56 | : NULL; \ | 202 | 56 | if (ctx != NULL) { \ | 203 | 56 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 56 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 56 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 56 | provctx); \ | 207 | 56 | } \ | 208 | 56 | return ctx; \ | 209 | 56 | } \ |
cipher_aria.c:aria_128_ofb_newctx Line | Count | Source | 198 | 71 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 71 | { \ | 200 | 71 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 71 | : NULL; \ | 202 | 71 | if (ctx != NULL) { \ | 203 | 71 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 71 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 71 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 71 | provctx); \ | 207 | 71 | } \ | 208 | 71 | return ctx; \ | 209 | 71 | } \ |
cipher_aria.c:aria_256_cfb_newctx Line | Count | Source | 198 | 27 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 27 | { \ | 200 | 27 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 27 | : NULL; \ | 202 | 27 | if (ctx != NULL) { \ | 203 | 27 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 27 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 27 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 27 | provctx); \ | 207 | 27 | } \ | 208 | 27 | return ctx; \ | 209 | 27 | } \ |
cipher_aria.c:aria_192_cfb_newctx Line | Count | Source | 198 | 89 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 89 | { \ | 200 | 89 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 89 | : NULL; \ | 202 | 89 | if (ctx != NULL) { \ | 203 | 89 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 89 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 89 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 89 | provctx); \ | 207 | 89 | } \ | 208 | 89 | return ctx; \ | 209 | 89 | } \ |
cipher_aria.c:aria_128_cfb_newctx Line | Count | Source | 198 | 22 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 22 | { \ | 200 | 22 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 22 | : NULL; \ | 202 | 22 | if (ctx != NULL) { \ | 203 | 22 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 22 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 22 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 22 | provctx); \ | 207 | 22 | } \ | 208 | 22 | return ctx; \ | 209 | 22 | } \ |
cipher_aria.c:aria_256_cfb1_newctx Line | Count | Source | 198 | 3 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 3 | { \ | 200 | 3 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 3 | : NULL; \ | 202 | 3 | if (ctx != NULL) { \ | 203 | 3 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 3 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 3 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 3 | provctx); \ | 207 | 3 | } \ | 208 | 3 | return ctx; \ | 209 | 3 | } \ |
cipher_aria.c:aria_192_cfb1_newctx Line | Count | Source | 198 | 73 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 73 | { \ | 200 | 73 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 73 | : NULL; \ | 202 | 73 | if (ctx != NULL) { \ | 203 | 73 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 73 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 73 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 73 | provctx); \ | 207 | 73 | } \ | 208 | 73 | return ctx; \ | 209 | 73 | } \ |
cipher_aria.c:aria_128_cfb1_newctx Line | Count | Source | 198 | 73 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 73 | { \ | 200 | 73 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 73 | : NULL; \ | 202 | 73 | if (ctx != NULL) { \ | 203 | 73 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 73 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 73 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 73 | provctx); \ | 207 | 73 | } \ | 208 | 73 | return ctx; \ | 209 | 73 | } \ |
cipher_aria.c:aria_256_cfb8_newctx Line | Count | Source | 198 | 57 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 57 | { \ | 200 | 57 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 57 | : NULL; \ | 202 | 57 | if (ctx != NULL) { \ | 203 | 57 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 57 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 57 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 57 | provctx); \ | 207 | 57 | } \ | 208 | 57 | return ctx; \ | 209 | 57 | } \ |
cipher_aria.c:aria_192_cfb8_newctx Line | Count | Source | 198 | 89 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 89 | { \ | 200 | 89 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 89 | : NULL; \ | 202 | 89 | if (ctx != NULL) { \ | 203 | 89 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 89 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 89 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 89 | provctx); \ | 207 | 89 | } \ | 208 | 89 | return ctx; \ | 209 | 89 | } \ |
cipher_aria.c:aria_128_cfb8_newctx Line | Count | Source | 198 | 85 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 85 | { \ | 200 | 85 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 85 | : NULL; \ | 202 | 85 | if (ctx != NULL) { \ | 203 | 85 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 85 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 85 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 85 | provctx); \ | 207 | 85 | } \ | 208 | 85 | return ctx; \ | 209 | 85 | } \ |
cipher_aria.c:aria_256_ctr_newctx Line | Count | Source | 198 | 86 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 86 | { \ | 200 | 86 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 86 | : NULL; \ | 202 | 86 | if (ctx != NULL) { \ | 203 | 86 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 86 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 86 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 86 | provctx); \ | 207 | 86 | } \ | 208 | 86 | return ctx; \ | 209 | 86 | } \ |
cipher_aria.c:aria_192_ctr_newctx Line | Count | Source | 198 | 67 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 67 | { \ | 200 | 67 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 67 | : NULL; \ | 202 | 67 | if (ctx != NULL) { \ | 203 | 67 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 67 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 67 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 67 | provctx); \ | 207 | 67 | } \ | 208 | 67 | return ctx; \ | 209 | 67 | } \ |
cipher_aria.c:aria_128_ctr_newctx Line | Count | Source | 198 | 22 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 22 | { \ | 200 | 22 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 22 | : NULL; \ | 202 | 22 | if (ctx != NULL) { \ | 203 | 22 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 22 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 22 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 22 | provctx); \ | 207 | 22 | } \ | 208 | 22 | return ctx; \ | 209 | 22 | } \ |
cipher_camellia.c:camellia_256_ecb_newctx Line | Count | Source | 198 | 5 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 5 | { \ | 200 | 5 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 5 | : NULL; \ | 202 | 5 | if (ctx != NULL) { \ | 203 | 5 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 5 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 5 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 5 | provctx); \ | 207 | 5 | } \ | 208 | 5 | return ctx; \ | 209 | 5 | } \ |
cipher_camellia.c:camellia_192_ecb_newctx Line | Count | Source | 198 | 79 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 79 | { \ | 200 | 79 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 79 | : NULL; \ | 202 | 79 | if (ctx != NULL) { \ | 203 | 79 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 79 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 79 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 79 | provctx); \ | 207 | 79 | } \ | 208 | 79 | return ctx; \ | 209 | 79 | } \ |
cipher_camellia.c:camellia_128_ecb_newctx Line | Count | Source | 198 | 6 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 6 | { \ | 200 | 6 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 6 | : NULL; \ | 202 | 6 | if (ctx != NULL) { \ | 203 | 6 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 6 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 6 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 6 | provctx); \ | 207 | 6 | } \ | 208 | 6 | return ctx; \ | 209 | 6 | } \ |
cipher_camellia.c:camellia_256_cbc_newctx Line | Count | Source | 198 | 63 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 63 | { \ | 200 | 63 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 63 | : NULL; \ | 202 | 63 | if (ctx != NULL) { \ | 203 | 63 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 63 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 63 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 63 | provctx); \ | 207 | 63 | } \ | 208 | 63 | return ctx; \ | 209 | 63 | } \ |
cipher_camellia.c:camellia_192_cbc_newctx Line | Count | Source | 198 | 94 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 94 | { \ | 200 | 94 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 94 | : NULL; \ | 202 | 94 | if (ctx != NULL) { \ | 203 | 94 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 94 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 94 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 94 | provctx); \ | 207 | 94 | } \ | 208 | 94 | return ctx; \ | 209 | 94 | } \ |
cipher_camellia.c:camellia_128_cbc_newctx Line | Count | Source | 198 | 39 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 39 | { \ | 200 | 39 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 39 | : NULL; \ | 202 | 39 | if (ctx != NULL) { \ | 203 | 39 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 39 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 39 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 39 | provctx); \ | 207 | 39 | } \ | 208 | 39 | return ctx; \ | 209 | 39 | } \ |
cipher_camellia.c:camellia_256_ofb_newctx Line | Count | Source | 198 | 5 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 5 | { \ | 200 | 5 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 5 | : NULL; \ | 202 | 5 | if (ctx != NULL) { \ | 203 | 5 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 5 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 5 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 5 | provctx); \ | 207 | 5 | } \ | 208 | 5 | return ctx; \ | 209 | 5 | } \ |
cipher_camellia.c:camellia_192_ofb_newctx Line | Count | Source | 198 | 6 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 6 | { \ | 200 | 6 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 6 | : NULL; \ | 202 | 6 | if (ctx != NULL) { \ | 203 | 6 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 6 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 6 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 6 | provctx); \ | 207 | 6 | } \ | 208 | 6 | return ctx; \ | 209 | 6 | } \ |
cipher_camellia.c:camellia_128_ofb_newctx Line | Count | Source | 198 | 25 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 25 | { \ | 200 | 25 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 25 | : NULL; \ | 202 | 25 | if (ctx != NULL) { \ | 203 | 25 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 25 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 25 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 25 | provctx); \ | 207 | 25 | } \ | 208 | 25 | return ctx; \ | 209 | 25 | } \ |
cipher_camellia.c:camellia_256_cfb_newctx Line | Count | Source | 198 | 7 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 7 | { \ | 200 | 7 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 7 | : NULL; \ | 202 | 7 | if (ctx != NULL) { \ | 203 | 7 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 7 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 7 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 7 | provctx); \ | 207 | 7 | } \ | 208 | 7 | return ctx; \ | 209 | 7 | } \ |
cipher_camellia.c:camellia_192_cfb_newctx Line | Count | Source | 198 | 124 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 124 | { \ | 200 | 124 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 124 | : NULL; \ | 202 | 124 | if (ctx != NULL) { \ | 203 | 124 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 124 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 124 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 124 | provctx); \ | 207 | 124 | } \ | 208 | 124 | return ctx; \ | 209 | 124 | } \ |
cipher_camellia.c:camellia_128_cfb_newctx Line | Count | Source | 198 | 53 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 53 | { \ | 200 | 53 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 53 | : NULL; \ | 202 | 53 | if (ctx != NULL) { \ | 203 | 53 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 53 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 53 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 53 | provctx); \ | 207 | 53 | } \ | 208 | 53 | return ctx; \ | 209 | 53 | } \ |
cipher_camellia.c:camellia_256_cfb1_newctx Line | Count | Source | 198 | 68 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 68 | { \ | 200 | 68 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 68 | : NULL; \ | 202 | 68 | if (ctx != NULL) { \ | 203 | 68 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 68 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 68 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 68 | provctx); \ | 207 | 68 | } \ | 208 | 68 | return ctx; \ | 209 | 68 | } \ |
cipher_camellia.c:camellia_192_cfb1_newctx Line | Count | Source | 198 | 41 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 41 | { \ | 200 | 41 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 41 | : NULL; \ | 202 | 41 | if (ctx != NULL) { \ | 203 | 41 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 41 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 41 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 41 | provctx); \ | 207 | 41 | } \ | 208 | 41 | return ctx; \ | 209 | 41 | } \ |
cipher_camellia.c:camellia_128_cfb1_newctx Line | Count | Source | 198 | 71 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 71 | { \ | 200 | 71 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 71 | : NULL; \ | 202 | 71 | if (ctx != NULL) { \ | 203 | 71 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 71 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 71 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 71 | provctx); \ | 207 | 71 | } \ | 208 | 71 | return ctx; \ | 209 | 71 | } \ |
cipher_camellia.c:camellia_256_cfb8_newctx Line | Count | Source | 198 | 71 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 71 | { \ | 200 | 71 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 71 | : NULL; \ | 202 | 71 | if (ctx != NULL) { \ | 203 | 71 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 71 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 71 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 71 | provctx); \ | 207 | 71 | } \ | 208 | 71 | return ctx; \ | 209 | 71 | } \ |
cipher_camellia.c:camellia_192_cfb8_newctx Line | Count | Source | 198 | 72 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 72 | { \ | 200 | 72 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 72 | : NULL; \ | 202 | 72 | if (ctx != NULL) { \ | 203 | 72 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 72 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 72 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 72 | provctx); \ | 207 | 72 | } \ | 208 | 72 | return ctx; \ | 209 | 72 | } \ |
cipher_camellia.c:camellia_128_cfb8_newctx Line | Count | Source | 198 | 34 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 34 | { \ | 200 | 34 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 34 | : NULL; \ | 202 | 34 | if (ctx != NULL) { \ | 203 | 34 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 34 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 34 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 34 | provctx); \ | 207 | 34 | } \ | 208 | 34 | return ctx; \ | 209 | 34 | } \ |
cipher_camellia.c:camellia_256_ctr_newctx Line | Count | Source | 198 | 6 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 6 | { \ | 200 | 6 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 6 | : NULL; \ | 202 | 6 | if (ctx != NULL) { \ | 203 | 6 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 6 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 6 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 6 | provctx); \ | 207 | 6 | } \ | 208 | 6 | return ctx; \ | 209 | 6 | } \ |
cipher_camellia.c:camellia_192_ctr_newctx Line | Count | Source | 198 | 122 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 122 | { \ | 200 | 122 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 122 | : NULL; \ | 202 | 122 | if (ctx != NULL) { \ | 203 | 122 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 122 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 122 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 122 | provctx); \ | 207 | 122 | } \ | 208 | 122 | return ctx; \ | 209 | 122 | } \ |
cipher_camellia.c:camellia_128_ctr_newctx Line | Count | Source | 198 | 131 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 131 | { \ | 200 | 131 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 131 | : NULL; \ | 202 | 131 | if (ctx != NULL) { \ | 203 | 131 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 131 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 131 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 131 | provctx); \ | 207 | 131 | } \ | 208 | 131 | return ctx; \ | 209 | 131 | } \ |
cipher_sm4.c:sm4_128_ecb_newctx Line | Count | Source | 198 | 28 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 28 | { \ | 200 | 28 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 28 | : NULL; \ | 202 | 28 | if (ctx != NULL) { \ | 203 | 28 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 28 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 28 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 28 | provctx); \ | 207 | 28 | } \ | 208 | 28 | return ctx; \ | 209 | 28 | } \ |
cipher_sm4.c:sm4_128_cbc_newctx Line | Count | Source | 198 | 81 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 81 | { \ | 200 | 81 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 81 | : NULL; \ | 202 | 81 | if (ctx != NULL) { \ | 203 | 81 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 81 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 81 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 81 | provctx); \ | 207 | 81 | } \ | 208 | 81 | return ctx; \ | 209 | 81 | } \ |
cipher_sm4.c:sm4_128_ctr_newctx Line | Count | Source | 198 | 30 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 30 | { \ | 200 | 30 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 30 | : NULL; \ | 202 | 30 | if (ctx != NULL) { \ | 203 | 30 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 30 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 30 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 30 | provctx); \ | 207 | 30 | } \ | 208 | 30 | return ctx; \ | 209 | 30 | } \ |
cipher_sm4.c:sm4_128_ofb128_newctx Line | Count | Source | 198 | 202 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 202 | { \ | 200 | 202 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 202 | : NULL; \ | 202 | 202 | if (ctx != NULL) { \ | 203 | 202 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 202 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 202 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 202 | provctx); \ | 207 | 202 | } \ | 208 | 202 | return ctx; \ | 209 | 202 | } \ |
cipher_sm4.c:sm4_128_cfb128_newctx Line | Count | Source | 198 | 23 | static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \ | 199 | 23 | { \ | 200 | 23 | PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\ | 201 | 23 | : NULL; \ | 202 | 23 | if (ctx != NULL) { \ | 203 | 23 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, \ | 204 | 23 | EVP_CIPH_##UCMODE##_MODE, flags, \ | 205 | 23 | ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\ | 206 | 23 | provctx); \ | 207 | 23 | } \ | 208 | 23 | return ctx; \ | 209 | 23 | } \ |
|
210 | | |
211 | | # define IMPLEMENT_generic_cipher(alg, UCALG, lcmode, UCMODE, flags, kbits, \ |
212 | | blkbits, ivbits, typ) \ |
213 | | IMPLEMENT_generic_cipher_genfn(alg, UCALG, lcmode, UCMODE, flags, kbits, \ |
214 | | blkbits, ivbits, typ) \ |
215 | | IMPLEMENT_generic_cipher_func(alg, UCALG, lcmode, UCMODE, flags, kbits, \ |
216 | | blkbits, ivbits, typ) |
217 | | |
218 | | # define IMPLEMENT_var_keylen_cipher(alg, UCALG, lcmode, UCMODE, flags, kbits, \ |
219 | | blkbits, ivbits, typ) \ |
220 | | IMPLEMENT_generic_cipher_genfn(alg, UCALG, lcmode, UCMODE, flags, kbits, \ |
221 | | blkbits, ivbits, typ) \ |
222 | | IMPLEMENT_var_keylen_cipher_func(alg, UCALG, lcmode, UCMODE, flags, kbits, \ |
223 | | blkbits, ivbits, typ) |
224 | | |
225 | | PROV_CIPHER_HW_FN ossl_cipher_hw_generic_cbc; |
226 | | PROV_CIPHER_HW_FN ossl_cipher_hw_generic_ecb; |
227 | | PROV_CIPHER_HW_FN ossl_cipher_hw_generic_ofb128; |
228 | | PROV_CIPHER_HW_FN ossl_cipher_hw_generic_cfb128; |
229 | | PROV_CIPHER_HW_FN ossl_cipher_hw_generic_cfb8; |
230 | | PROV_CIPHER_HW_FN ossl_cipher_hw_generic_cfb1; |
231 | | PROV_CIPHER_HW_FN ossl_cipher_hw_generic_ctr; |
232 | | PROV_CIPHER_HW_FN ossl_cipher_hw_chunked_cbc; |
233 | | PROV_CIPHER_HW_FN ossl_cipher_hw_chunked_cfb8; |
234 | | PROV_CIPHER_HW_FN ossl_cipher_hw_chunked_cfb128; |
235 | | PROV_CIPHER_HW_FN ossl_cipher_hw_chunked_ofb128; |
236 | | # define ossl_cipher_hw_chunked_ecb ossl_cipher_hw_generic_ecb |
237 | | # define ossl_cipher_hw_chunked_ctr ossl_cipher_hw_generic_ctr |
238 | | # define ossl_cipher_hw_chunked_cfb1 ossl_cipher_hw_generic_cfb1 |
239 | | |
240 | | # define IMPLEMENT_CIPHER_HW_OFB(MODE, NAME, CTX_NAME, KEY_NAME, FUNC_PREFIX) \ |
241 | | static int cipher_hw_##NAME##_##MODE##_cipher(PROV_CIPHER_CTX *ctx, \ |
242 | | unsigned char *out, \ |
243 | | const unsigned char *in, size_t len) \ |
244 | | { \ |
245 | | int num = ctx->num; \ |
246 | | KEY_NAME *key = &(((CTX_NAME *)ctx)->ks.ks); \ |
247 | | \ |
248 | | while (len >= MAXCHUNK) { \ |
249 | | FUNC_PREFIX##_encrypt(in, out, MAXCHUNK, key, ctx->iv, &num); \ |
250 | | len -= MAXCHUNK; \ |
251 | | in += MAXCHUNK; \ |
252 | | out += MAXCHUNK; \ |
253 | | } \ |
254 | | if (len > 0) { \ |
255 | | FUNC_PREFIX##_encrypt(in, out, (long)len, key, ctx->iv, &num); \ |
256 | | } \ |
257 | | ctx->num = num; \ |
258 | | return 1; \ |
259 | | } |
260 | | |
261 | | # define IMPLEMENT_CIPHER_HW_ECB(MODE, NAME, CTX_NAME, KEY_NAME, FUNC_PREFIX) \ |
262 | | static int cipher_hw_##NAME##_##MODE##_cipher(PROV_CIPHER_CTX *ctx, \ |
263 | | unsigned char *out, \ |
264 | | const unsigned char *in, size_t len) \ |
265 | | { \ |
266 | | size_t i, bl = ctx->blocksize; \ |
267 | | KEY_NAME *key = &(((CTX_NAME *)ctx)->ks.ks); \ |
268 | | \ |
269 | | if (len < bl) \ |
270 | | return 1; \ |
271 | | for (i = 0, len -= bl; i <= len; i += bl) \ |
272 | | FUNC_PREFIX##_encrypt(in + i, out + i, key, ctx->enc); \ |
273 | | return 1; \ |
274 | | } |
275 | | |
276 | | # define IMPLEMENT_CIPHER_HW_CBC(MODE, NAME, CTX_NAME, KEY_NAME, FUNC_PREFIX) \ |
277 | | static int cipher_hw_##NAME##_##MODE##_cipher(PROV_CIPHER_CTX *ctx, \ |
278 | | unsigned char *out, \ |
279 | | const unsigned char *in, size_t len) \ |
280 | | { \ |
281 | | KEY_NAME *key = &(((CTX_NAME *)ctx)->ks.ks); \ |
282 | | \ |
283 | | while (len >= MAXCHUNK) { \ |
284 | | FUNC_PREFIX##_encrypt(in, out, MAXCHUNK, key, ctx->iv, ctx->enc); \ |
285 | | len -= MAXCHUNK; \ |
286 | | in += MAXCHUNK; \ |
287 | | out += MAXCHUNK; \ |
288 | | } \ |
289 | | if (len > 0) \ |
290 | | FUNC_PREFIX##_encrypt(in, out, (long)len, key, ctx->iv, ctx->enc); \ |
291 | | return 1; \ |
292 | | } |
293 | | |
294 | | # define IMPLEMENT_CIPHER_HW_CFB(MODE, NAME, CTX_NAME, KEY_NAME, FUNC_PREFIX) \ |
295 | | static int cipher_hw_##NAME##_##MODE##_cipher(PROV_CIPHER_CTX *ctx, \ |
296 | | unsigned char *out, \ |
297 | | const unsigned char *in, size_t len) \ |
298 | | { \ |
299 | | size_t chunk = MAXCHUNK; \ |
300 | | KEY_NAME *key = &(((CTX_NAME *)ctx)->ks.ks); \ |
301 | | int num = ctx->num; \ |
302 | | \ |
303 | | if (len < chunk) \ |
304 | | chunk = len; \ |
305 | | while (len > 0 && len >= chunk) { \ |
306 | | FUNC_PREFIX##_encrypt(in, out, (long)chunk, key, ctx->iv, &num, \ |
307 | | ctx->enc); \ |
308 | | len -= chunk; \ |
309 | | in += chunk; \ |
310 | | out += chunk; \ |
311 | | if (len < chunk) \ |
312 | | chunk = len; \ |
313 | | } \ |
314 | | ctx->num = num; \ |
315 | | return 1; \ |
316 | | } |
317 | | |
318 | | # define IMPLEMENT_CIPHER_HW_COPYCTX(name, CTX_TYPE) \ |
319 | 78.5k | static void name(PROV_CIPHER_CTX *dst, const PROV_CIPHER_CTX *src) \ |
320 | 78.5k | { \ |
321 | 78.5k | CTX_TYPE *sctx = (CTX_TYPE *)src; \ |
322 | 78.5k | CTX_TYPE *dctx = (CTX_TYPE *)dst; \ |
323 | 78.5k | \ |
324 | 78.5k | *dctx = *sctx; \ |
325 | 78.5k | dst->ks = &dctx->ks.ks; \ |
326 | 78.5k | } cipher_aes_hw.c:cipher_hw_aes_copyctx Line | Count | Source | 319 | 22.6k | static void name(PROV_CIPHER_CTX *dst, const PROV_CIPHER_CTX *src) \ | 320 | 22.6k | { \ | 321 | 22.6k | CTX_TYPE *sctx = (CTX_TYPE *)src; \ | 322 | 22.6k | CTX_TYPE *dctx = (CTX_TYPE *)dst; \ | 323 | 22.6k | \ | 324 | 22.6k | *dctx = *sctx; \ | 325 | 22.6k | dst->ks = &dctx->ks.ks; \ | 326 | 22.6k | } |
cipher_aria_hw.c:cipher_hw_aria_copyctx Line | Count | Source | 319 | 23.4k | static void name(PROV_CIPHER_CTX *dst, const PROV_CIPHER_CTX *src) \ | 320 | 23.4k | { \ | 321 | 23.4k | CTX_TYPE *sctx = (CTX_TYPE *)src; \ | 322 | 23.4k | CTX_TYPE *dctx = (CTX_TYPE *)dst; \ | 323 | 23.4k | \ | 324 | 23.4k | *dctx = *sctx; \ | 325 | 23.4k | dst->ks = &dctx->ks.ks; \ | 326 | 23.4k | } |
cipher_camellia_hw.c:cipher_hw_camellia_copyctx Line | Count | Source | 319 | 19.2k | static void name(PROV_CIPHER_CTX *dst, const PROV_CIPHER_CTX *src) \ | 320 | 19.2k | { \ | 321 | 19.2k | CTX_TYPE *sctx = (CTX_TYPE *)src; \ | 322 | 19.2k | CTX_TYPE *dctx = (CTX_TYPE *)dst; \ | 323 | 19.2k | \ | 324 | 19.2k | *dctx = *sctx; \ | 325 | 19.2k | dst->ks = &dctx->ks.ks; \ | 326 | 19.2k | } |
cipher_sm4_hw.c:cipher_hw_sm4_copyctx Line | Count | Source | 319 | 13.1k | static void name(PROV_CIPHER_CTX *dst, const PROV_CIPHER_CTX *src) \ | 320 | 13.1k | { \ | 321 | 13.1k | CTX_TYPE *sctx = (CTX_TYPE *)src; \ | 322 | 13.1k | CTX_TYPE *dctx = (CTX_TYPE *)dst; \ | 323 | 13.1k | \ | 324 | 13.1k | *dctx = *sctx; \ | 325 | 13.1k | dst->ks = &dctx->ks.ks; \ | 326 | 13.1k | } |
|
327 | | |
328 | | # define CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_START(name) \ |
329 | | static const OSSL_PARAM name##_known_gettable_ctx_params[] = { \ |
330 | | OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_KEYLEN, NULL), \ |
331 | | OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_IVLEN, NULL), \ |
332 | | OSSL_PARAM_uint(OSSL_CIPHER_PARAM_PADDING, NULL), \ |
333 | | OSSL_PARAM_uint(OSSL_CIPHER_PARAM_NUM, NULL), \ |
334 | | OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_IV, NULL, 0), \ |
335 | | OSSL_PARAM_octet_string(OSSL_CIPHER_PARAM_UPDATED_IV, NULL, 0), |
336 | | |
337 | | # define CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_END(name) \ |
338 | | OSSL_PARAM_END \ |
339 | | }; \ |
340 | | const OSSL_PARAM * name##_gettable_ctx_params(ossl_unused void *cctx, \ |
341 | 200 | ossl_unused void *provctx) \ |
342 | 200 | { \ |
343 | 200 | return name##_known_gettable_ctx_params; \ |
344 | 200 | } cipher_aes.c:aes_cbc_cts_gettable_ctx_params Line | Count | Source | 341 | 6 | ossl_unused void *provctx) \ | 342 | 6 | { \ | 343 | 6 | return name##_known_gettable_ctx_params; \ | 344 | 6 | } |
cipher_camellia.c:camellia_cbc_cts_gettable_ctx_params Line | Count | Source | 341 | 6 | ossl_unused void *provctx) \ | 342 | 6 | { \ | 343 | 6 | return name##_known_gettable_ctx_params; \ | 344 | 6 | } |
ossl_tdes_gettable_ctx_params Line | Count | Source | 341 | 22 | ossl_unused void *provctx) \ | 342 | 22 | { \ | 343 | 22 | return name##_known_gettable_ctx_params; \ | 344 | 22 | } |
ossl_cipher_generic_gettable_ctx_params Line | Count | Source | 341 | 166 | ossl_unused void *provctx) \ | 342 | 166 | { \ | 343 | 166 | return name##_known_gettable_ctx_params; \ | 344 | 166 | } |
|
345 | | |
346 | | # define CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_START(name) \ |
347 | | static const OSSL_PARAM name##_known_settable_ctx_params[] = { \ |
348 | | OSSL_PARAM_uint(OSSL_CIPHER_PARAM_PADDING, NULL), \ |
349 | | OSSL_PARAM_uint(OSSL_CIPHER_PARAM_NUM, NULL), |
350 | | # define CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_END(name) \ |
351 | | OSSL_PARAM_END \ |
352 | | }; \ |
353 | | const OSSL_PARAM * name##_settable_ctx_params(ossl_unused void *cctx, \ |
354 | 1.04k | ossl_unused void *provctx) \ |
355 | 1.04k | { \ |
356 | 1.04k | return name##_known_settable_ctx_params; \ |
357 | 1.04k | } Unexecuted instantiation: cipher_aes.c:aes_cbc_cts_settable_ctx_params Unexecuted instantiation: cipher_camellia.c:camellia_cbc_cts_settable_ctx_params ossl_tdes_settable_ctx_params Line | Count | Source | 354 | 138 | ossl_unused void *provctx) \ | 355 | 138 | { \ | 356 | 138 | return name##_known_settable_ctx_params; \ | 357 | 138 | } |
ossl_cipher_generic_settable_ctx_params Line | Count | Source | 354 | 909 | ossl_unused void *provctx) \ | 355 | 909 | { \ | 356 | 909 | return name##_known_settable_ctx_params; \ | 357 | 909 | } |
Unexecuted instantiation: ossl_cipher_var_keylen_settable_ctx_params |
358 | | |
359 | | int ossl_cipher_generic_initiv(PROV_CIPHER_CTX *ctx, const unsigned char *iv, |
360 | | size_t ivlen); |
361 | | |
362 | | size_t ossl_cipher_fillblock(unsigned char *buf, size_t *buflen, |
363 | | size_t blocksize, |
364 | | const unsigned char **in, size_t *inlen); |
365 | | int ossl_cipher_trailingdata(unsigned char *buf, size_t *buflen, |
366 | | size_t blocksize, |
367 | | const unsigned char **in, size_t *inlen); |
368 | | |
369 | | #endif |