Coverage Report

Created: 2026-09-12 06:55

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