/src/openssl33/providers/implementations/ciphers/cipher_aes_wrp.c
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 | | /* |
11 | | * This file uses the low level AES functions (which are deprecated for |
12 | | * non-internal use) in order to implement provider AES ciphers. |
13 | | */ |
14 | | #include "internal/deprecated.h" |
15 | | |
16 | | #include <openssl/proverr.h> |
17 | | #include "cipher_aes.h" |
18 | | #include "prov/providercommon.h" |
19 | | #include "prov/implementations.h" |
20 | | |
21 | | /* AES wrap with padding has IV length of 4, without padding 8 */ |
22 | 9 | #define AES_WRAP_PAD_IVLEN 4 |
23 | | #define AES_WRAP_NOPAD_IVLEN 8 |
24 | | |
25 | | #define WRAP_FLAGS (PROV_CIPHER_FLAG_CUSTOM_IV) |
26 | | #define WRAP_FLAGS_INV (WRAP_FLAGS | PROV_CIPHER_FLAG_INVERSE_CIPHER) |
27 | | |
28 | | typedef size_t (*aeswrap_fn)(void *key, const unsigned char *iv, |
29 | | unsigned char *out, const unsigned char *in, |
30 | | size_t inlen, block128_f block); |
31 | | |
32 | | static OSSL_FUNC_cipher_encrypt_init_fn aes_wrap_einit; |
33 | | static OSSL_FUNC_cipher_decrypt_init_fn aes_wrap_dinit; |
34 | | static OSSL_FUNC_cipher_update_fn aes_wrap_cipher; |
35 | | static OSSL_FUNC_cipher_final_fn aes_wrap_final; |
36 | | static OSSL_FUNC_cipher_freectx_fn aes_wrap_freectx; |
37 | | static OSSL_FUNC_cipher_set_ctx_params_fn aes_wrap_set_ctx_params; |
38 | | |
39 | | typedef struct prov_aes_wrap_ctx_st { |
40 | | PROV_CIPHER_CTX base; |
41 | | union { |
42 | | OSSL_UNION_ALIGN; |
43 | | AES_KEY ks; |
44 | | } ks; |
45 | | aeswrap_fn wrapfn; |
46 | | |
47 | | } PROV_AES_WRAP_CTX; |
48 | | |
49 | | static void *aes_wrap_newctx(size_t kbits, size_t blkbits, |
50 | | size_t ivbits, unsigned int mode, uint64_t flags) |
51 | 9 | { |
52 | 9 | PROV_AES_WRAP_CTX *wctx; |
53 | 9 | PROV_CIPHER_CTX *ctx; |
54 | | |
55 | 9 | if (!ossl_prov_is_running()) |
56 | 0 | return NULL; |
57 | | |
58 | 9 | wctx = OPENSSL_zalloc(sizeof(*wctx)); |
59 | 9 | ctx = (PROV_CIPHER_CTX *)wctx; |
60 | 9 | if (ctx != NULL) { |
61 | 9 | ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits, mode, flags, |
62 | 9 | NULL, NULL); |
63 | 9 | ctx->pad = (ctx->ivlen == AES_WRAP_PAD_IVLEN); |
64 | 9 | } |
65 | 9 | return wctx; |
66 | 9 | } |
67 | | |
68 | | static void *aes_wrap_dupctx(void *wctx) |
69 | 0 | { |
70 | 0 | PROV_AES_WRAP_CTX *ctx = wctx; |
71 | 0 | PROV_AES_WRAP_CTX *dctx = wctx; |
72 | |
|
73 | 0 | if (ctx == NULL) |
74 | 0 | return NULL; |
75 | 0 | dctx = OPENSSL_memdup(ctx, sizeof(*ctx)); |
76 | |
|
77 | 0 | if (dctx != NULL && dctx->base.tlsmac != NULL && dctx->base.alloced) { |
78 | 0 | dctx->base.tlsmac = OPENSSL_memdup(dctx->base.tlsmac, |
79 | 0 | dctx->base.tlsmacsize); |
80 | 0 | if (dctx->base.tlsmac == NULL) { |
81 | 0 | OPENSSL_free(dctx); |
82 | 0 | dctx = NULL; |
83 | 0 | } |
84 | 0 | } |
85 | 0 | return dctx; |
86 | 0 | } |
87 | | |
88 | | static void aes_wrap_freectx(void *vctx) |
89 | 9 | { |
90 | 9 | PROV_AES_WRAP_CTX *wctx = (PROV_AES_WRAP_CTX *)vctx; |
91 | | |
92 | 9 | ossl_cipher_generic_reset_ctx((PROV_CIPHER_CTX *)vctx); |
93 | 9 | OPENSSL_clear_free(wctx, sizeof(*wctx)); |
94 | 9 | } |
95 | | |
96 | | static int aes_wrap_init(void *vctx, const unsigned char *key, |
97 | | size_t keylen, const unsigned char *iv, |
98 | | size_t ivlen, const OSSL_PARAM params[], int enc) |
99 | 15 | { |
100 | 15 | PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx; |
101 | 15 | PROV_AES_WRAP_CTX *wctx = (PROV_AES_WRAP_CTX *)vctx; |
102 | | |
103 | 15 | if (!ossl_prov_is_running()) |
104 | 0 | return 0; |
105 | | |
106 | 15 | ctx->enc = enc; |
107 | 15 | if (ctx->pad) |
108 | 0 | wctx->wrapfn = enc ? CRYPTO_128_wrap_pad : CRYPTO_128_unwrap_pad; |
109 | 15 | else |
110 | 15 | wctx->wrapfn = enc ? CRYPTO_128_wrap : CRYPTO_128_unwrap; |
111 | | |
112 | 15 | if (iv != NULL) { |
113 | 0 | if (!ossl_cipher_generic_initiv(ctx, iv, ivlen)) |
114 | 0 | return 0; |
115 | 0 | } |
116 | 15 | if (key != NULL) { |
117 | 6 | int use_forward_transform; |
118 | | |
119 | 6 | if (keylen != ctx->keylen) { |
120 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH); |
121 | 0 | return 0; |
122 | 0 | } |
123 | | /* |
124 | | * See SP800-38F : Section 5.1 |
125 | | * The forward and inverse transformations for the AES block |
126 | | * cipher—called “cipher” and “inverse cipher” are informally known as |
127 | | * the AES encryption and AES decryption functions, respectively. |
128 | | * If the designated cipher function for a key-wrap algorithm is chosen |
129 | | * to be the AES decryption function, then CIPH-1K will be the AES |
130 | | * encryption function. |
131 | | */ |
132 | 6 | if (ctx->inverse_cipher == 0) |
133 | 6 | use_forward_transform = ctx->enc; |
134 | 0 | else |
135 | 0 | use_forward_transform = !ctx->enc; |
136 | 6 | if (use_forward_transform) { |
137 | 6 | AES_set_encrypt_key(key, keylen * 8, &wctx->ks.ks); |
138 | 6 | ctx->block = (block128_f)AES_encrypt; |
139 | 6 | } else { |
140 | 0 | AES_set_decrypt_key(key, keylen * 8, &wctx->ks.ks); |
141 | 0 | ctx->block = (block128_f)AES_decrypt; |
142 | 0 | } |
143 | 6 | } |
144 | 15 | return aes_wrap_set_ctx_params(ctx, params); |
145 | 15 | } |
146 | | |
147 | | static int aes_wrap_einit(void *ctx, const unsigned char *key, size_t keylen, |
148 | | const unsigned char *iv, size_t ivlen, |
149 | | const OSSL_PARAM params[]) |
150 | 15 | { |
151 | 15 | return aes_wrap_init(ctx, key, keylen, iv, ivlen, params, 1); |
152 | 15 | } |
153 | | |
154 | | static int aes_wrap_dinit(void *ctx, const unsigned char *key, size_t keylen, |
155 | | const unsigned char *iv, size_t ivlen, |
156 | | const OSSL_PARAM params[]) |
157 | 0 | { |
158 | 0 | return aes_wrap_init(ctx, key, keylen, iv, ivlen, params, 0); |
159 | 0 | } |
160 | | |
161 | | static int aes_wrap_cipher_internal(void *vctx, unsigned char *out, |
162 | | const unsigned char *in, size_t inlen) |
163 | 3 | { |
164 | 3 | PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx; |
165 | 3 | PROV_AES_WRAP_CTX *wctx = (PROV_AES_WRAP_CTX *)vctx; |
166 | 3 | size_t rv; |
167 | 3 | int pad = ctx->pad; |
168 | | |
169 | | /* No final operation so always return zero length */ |
170 | 3 | if (in == NULL) |
171 | 0 | return 0; |
172 | | |
173 | | /* Input length must always be non-zero */ |
174 | 3 | if (inlen == 0) { |
175 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_INPUT_LENGTH); |
176 | 0 | return -1; |
177 | 0 | } |
178 | | |
179 | | /* If decrypting need at least 16 bytes and multiple of 8 */ |
180 | 3 | if (!ctx->enc && (inlen < 16 || inlen & 0x7)) { |
181 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_INPUT_LENGTH); |
182 | 0 | return -1; |
183 | 0 | } |
184 | | |
185 | | /* If not padding input must be multiple of 8 */ |
186 | 3 | if (!pad && inlen & 0x7) { |
187 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_INPUT_LENGTH); |
188 | 0 | return -1; |
189 | 0 | } |
190 | | |
191 | 3 | if (out == NULL) { |
192 | 0 | if (ctx->enc) { |
193 | | /* If padding round up to multiple of 8 */ |
194 | 0 | if (pad) |
195 | 0 | inlen = (inlen + 7) / 8 * 8; |
196 | | /* 8 byte prefix */ |
197 | 0 | return inlen + 8; |
198 | 0 | } else { |
199 | | /* |
200 | | * If not padding output will be exactly 8 bytes smaller than |
201 | | * input. If padding it will be at least 8 bytes smaller but we |
202 | | * don't know how much. |
203 | | */ |
204 | 0 | return inlen - 8; |
205 | 0 | } |
206 | 0 | } |
207 | | |
208 | 3 | rv = wctx->wrapfn(&wctx->ks.ks, ctx->iv_set ? ctx->iv : NULL, out, in, |
209 | 3 | inlen, ctx->block); |
210 | 3 | if (!rv) { |
211 | 3 | ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED); |
212 | 3 | return -1; |
213 | 3 | } |
214 | 0 | if (rv > INT_MAX) { |
215 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_OUTPUT_LENGTH); |
216 | 0 | return -1; |
217 | 0 | } |
218 | 0 | return (int)rv; |
219 | 0 | } |
220 | | |
221 | | static int aes_wrap_final(void *vctx, unsigned char *out, size_t *outl, |
222 | | size_t outsize) |
223 | 0 | { |
224 | 0 | if (!ossl_prov_is_running()) |
225 | 0 | return 0; |
226 | | |
227 | 0 | *outl = 0; |
228 | 0 | return 1; |
229 | 0 | } |
230 | | |
231 | | static int aes_wrap_cipher(void *vctx, |
232 | | unsigned char *out, size_t *outl, size_t outsize, |
233 | | const unsigned char *in, size_t inl) |
234 | 6 | { |
235 | 6 | PROV_AES_WRAP_CTX *ctx = (PROV_AES_WRAP_CTX *)vctx; |
236 | 6 | size_t len; |
237 | | |
238 | 6 | if (!ossl_prov_is_running()) |
239 | 0 | return 0; |
240 | | |
241 | 6 | if (inl == 0) { |
242 | 0 | *outl = 0; |
243 | 0 | return 1; |
244 | 0 | } |
245 | | |
246 | 6 | if (outsize < inl) { |
247 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL); |
248 | 0 | return 0; |
249 | 0 | } |
250 | | |
251 | 6 | len = aes_wrap_cipher_internal(ctx, out, in, inl); |
252 | 6 | if (len <= 0) |
253 | 0 | return 0; |
254 | | |
255 | 6 | *outl = len; |
256 | 6 | return 1; |
257 | 6 | } |
258 | | |
259 | | static int aes_wrap_set_ctx_params(void *vctx, const OSSL_PARAM params[]) |
260 | 10 | { |
261 | 10 | PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx; |
262 | 10 | const OSSL_PARAM *p; |
263 | 10 | size_t keylen = 0; |
264 | | |
265 | 10 | if (params == NULL) |
266 | 7 | return 1; |
267 | | |
268 | 3 | p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN); |
269 | 3 | if (p != NULL) { |
270 | 0 | if (!OSSL_PARAM_get_size_t(p, &keylen)) { |
271 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER); |
272 | 0 | return 0; |
273 | 0 | } |
274 | 0 | if (ctx->keylen != keylen) { |
275 | 0 | ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH); |
276 | 0 | return 0; |
277 | 0 | } |
278 | 0 | } |
279 | 3 | return 1; |
280 | 3 | } |
281 | | |
282 | | #define IMPLEMENT_cipher(mode, fname, UCMODE, flags, kbits, blkbits, ivbits) \ |
283 | | static OSSL_FUNC_cipher_get_params_fn aes_##kbits##_##fname##_get_params; \ |
284 | | static int aes_##kbits##_##fname##_get_params(OSSL_PARAM params[]) \ |
285 | 768 | { \ |
286 | 768 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ |
287 | 768 | flags, kbits, blkbits, ivbits); \ |
288 | 768 | } \ cipher_aes_wrp.c:aes_256_wrap_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_192_wrap_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_128_wrap_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_256_wrappad_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_192_wrappad_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_128_wrappad_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_256_wrapinv_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_192_wrapinv_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_128_wrapinv_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_256_wrappadinv_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_192_wrappadinv_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
cipher_aes_wrp.c:aes_128_wrappadinv_get_params Line | Count | Source | 285 | 64 | { \ | 286 | 64 | return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \ | 287 | 64 | flags, kbits, blkbits, ivbits); \ | 288 | 64 | } \ |
|
289 | | static OSSL_FUNC_cipher_newctx_fn aes_##kbits##fname##_newctx; \ |
290 | | static void *aes_##kbits##fname##_newctx(void *provctx) \ |
291 | 9 | { \ |
292 | 9 | return aes_##mode##_newctx(kbits, blkbits, ivbits, \ |
293 | 9 | EVP_CIPH_##UCMODE##_MODE, flags); \ |
294 | 9 | } \ cipher_aes_wrp.c:aes_256wrap_newctx Line | Count | Source | 291 | 6 | { \ | 292 | 6 | return aes_##mode##_newctx(kbits, blkbits, ivbits, \ | 293 | 6 | EVP_CIPH_##UCMODE##_MODE, flags); \ | 294 | 6 | } \ |
cipher_aes_wrp.c:aes_192wrap_newctx Line | Count | Source | 291 | 1 | { \ | 292 | 1 | return aes_##mode##_newctx(kbits, blkbits, ivbits, \ | 293 | 1 | EVP_CIPH_##UCMODE##_MODE, flags); \ | 294 | 1 | } \ |
cipher_aes_wrp.c:aes_128wrap_newctx Line | Count | Source | 291 | 2 | { \ | 292 | 2 | return aes_##mode##_newctx(kbits, blkbits, ivbits, \ | 293 | 2 | EVP_CIPH_##UCMODE##_MODE, flags); \ | 294 | 2 | } \ |
Unexecuted instantiation: cipher_aes_wrp.c:aes_256wrappad_newctx Unexecuted instantiation: cipher_aes_wrp.c:aes_192wrappad_newctx Unexecuted instantiation: cipher_aes_wrp.c:aes_128wrappad_newctx Unexecuted instantiation: cipher_aes_wrp.c:aes_256wrapinv_newctx Unexecuted instantiation: cipher_aes_wrp.c:aes_192wrapinv_newctx Unexecuted instantiation: cipher_aes_wrp.c:aes_128wrapinv_newctx Unexecuted instantiation: cipher_aes_wrp.c:aes_256wrappadinv_newctx Unexecuted instantiation: cipher_aes_wrp.c:aes_192wrappadinv_newctx Unexecuted instantiation: cipher_aes_wrp.c:aes_128wrappadinv_newctx |
295 | | const OSSL_DISPATCH ossl_##aes##kbits##fname##_functions[] = { \ |
296 | | { OSSL_FUNC_CIPHER_NEWCTX, \ |
297 | | (void (*)(void))aes_##kbits##fname##_newctx }, \ |
298 | | { OSSL_FUNC_CIPHER_ENCRYPT_INIT, (void (*)(void))aes_##mode##_einit }, \ |
299 | | { OSSL_FUNC_CIPHER_DECRYPT_INIT, (void (*)(void))aes_##mode##_dinit }, \ |
300 | | { OSSL_FUNC_CIPHER_UPDATE, (void (*)(void))aes_##mode##_cipher }, \ |
301 | | { OSSL_FUNC_CIPHER_FINAL, (void (*)(void))aes_##mode##_final }, \ |
302 | | { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void))aes_##mode##_freectx }, \ |
303 | | { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void))aes_##mode##_dupctx }, \ |
304 | | { OSSL_FUNC_CIPHER_GET_PARAMS, \ |
305 | | (void (*)(void))aes_##kbits##_##fname##_get_params }, \ |
306 | | { OSSL_FUNC_CIPHER_GETTABLE_PARAMS, \ |
307 | | (void (*)(void))ossl_cipher_generic_gettable_params }, \ |
308 | | { OSSL_FUNC_CIPHER_GET_CTX_PARAMS, \ |
309 | | (void (*)(void))ossl_cipher_generic_get_ctx_params }, \ |
310 | | { OSSL_FUNC_CIPHER_SET_CTX_PARAMS, \ |
311 | | (void (*)(void))aes_wrap_set_ctx_params }, \ |
312 | | { OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS, \ |
313 | | (void (*)(void))ossl_cipher_generic_gettable_ctx_params }, \ |
314 | | { OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS, \ |
315 | | (void (*)(void))ossl_cipher_generic_settable_ctx_params }, \ |
316 | | OSSL_DISPATCH_END \ |
317 | | } |
318 | | |
319 | | IMPLEMENT_cipher(wrap, wrap, WRAP, WRAP_FLAGS, 256, 64, AES_WRAP_NOPAD_IVLEN * 8); |
320 | | IMPLEMENT_cipher(wrap, wrap, WRAP, WRAP_FLAGS, 192, 64, AES_WRAP_NOPAD_IVLEN * 8); |
321 | | IMPLEMENT_cipher(wrap, wrap, WRAP, WRAP_FLAGS, 128, 64, AES_WRAP_NOPAD_IVLEN * 8); |
322 | | IMPLEMENT_cipher(wrap, wrappad, WRAP, WRAP_FLAGS, 256, 64, AES_WRAP_PAD_IVLEN * 8); |
323 | | IMPLEMENT_cipher(wrap, wrappad, WRAP, WRAP_FLAGS, 192, 64, AES_WRAP_PAD_IVLEN * 8); |
324 | | IMPLEMENT_cipher(wrap, wrappad, WRAP, WRAP_FLAGS, 128, 64, AES_WRAP_PAD_IVLEN * 8); |
325 | | |
326 | | IMPLEMENT_cipher(wrap, wrapinv, WRAP, WRAP_FLAGS_INV, 256, 64, AES_WRAP_NOPAD_IVLEN * 8); |
327 | | IMPLEMENT_cipher(wrap, wrapinv, WRAP, WRAP_FLAGS_INV, 192, 64, AES_WRAP_NOPAD_IVLEN * 8); |
328 | | IMPLEMENT_cipher(wrap, wrapinv, WRAP, WRAP_FLAGS_INV, 128, 64, AES_WRAP_NOPAD_IVLEN * 8); |
329 | | IMPLEMENT_cipher(wrap, wrappadinv, WRAP, WRAP_FLAGS_INV, 256, 64, AES_WRAP_PAD_IVLEN * 8); |
330 | | IMPLEMENT_cipher(wrap, wrappadinv, WRAP, WRAP_FLAGS_INV, 192, 64, AES_WRAP_PAD_IVLEN * 8); |
331 | | IMPLEMENT_cipher(wrap, wrappadinv, WRAP, WRAP_FLAGS_INV, 128, 64, AES_WRAP_PAD_IVLEN * 8); |