]>
Commit | Line | Data |
---|---|---|
e1178600 SL |
1 | /* |
2 | * Copyright 2019 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 | /* Dispatch functions for ARIA cipher modes ecb, cbc, ofb, cfb, ctr */ | |
11 | ||
12 | #include "cipher_locl.h" | |
13 | ||
14 | static OSSL_OP_cipher_freectx_fn aria_freectx; | |
15 | static OSSL_OP_cipher_dupctx_fn aria_dupctx; | |
16 | ||
17 | static void aria_freectx(void *vctx) | |
18 | { | |
19 | PROV_ARIA_CTX *ctx = (PROV_ARIA_CTX *)vctx; | |
20 | ||
21 | OPENSSL_clear_free(ctx, sizeof(*ctx)); | |
22 | } | |
23 | ||
24 | static void *aria_dupctx(void *ctx) | |
25 | { | |
26 | PROV_ARIA_CTX *in = (PROV_ARIA_CTX *)ctx; | |
27 | PROV_ARIA_CTX *ret = OPENSSL_malloc(sizeof(*ret)); | |
28 | ||
29 | if (ret == NULL) { | |
30 | ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE); | |
31 | return NULL; | |
32 | } | |
33 | *ret = *in; | |
34 | ||
35 | return ret; | |
36 | } | |
37 | ||
38 | /* aria256ecb_functions */ | |
39 | IMPLEMENT_generic_cipher(aria, ARIA, ecb, ECB, 0, 256, 128, 0, block) | |
40 | /* aria192ecb_functions */ | |
41 | IMPLEMENT_generic_cipher(aria, ARIA, ecb, ECB, 0, 192, 128, 0, block) | |
42 | /* aria128ecb_functions */ | |
43 | IMPLEMENT_generic_cipher(aria, ARIA, ecb, ECB, 0, 128, 128, 0, block) | |
44 | /* aria256cbc_functions */ | |
45 | IMPLEMENT_generic_cipher(aria, ARIA, cbc, CBC, 0, 256, 128, 128, block) | |
46 | /* aria192cbc_functions */ | |
47 | IMPLEMENT_generic_cipher(aria, ARIA, cbc, CBC, 0, 192, 128, 128, block) | |
48 | /* aria128cbc_functions */ | |
49 | IMPLEMENT_generic_cipher(aria, ARIA, cbc, CBC, 0, 128, 128, 128, block) | |
50 | /* aria256ofb_functions */ | |
51 | IMPLEMENT_generic_cipher(aria, ARIA, ofb, OFB, 0, 256, 8, 128, stream) | |
52 | /* aria192ofb_functions */ | |
53 | IMPLEMENT_generic_cipher(aria, ARIA, ofb, OFB, 0, 192, 8, 128, stream) | |
54 | /* aria128ofb_functions */ | |
55 | IMPLEMENT_generic_cipher(aria, ARIA, ofb, OFB, 0, 128, 8, 128, stream) | |
56 | /* aria256cfb_functions */ | |
57 | IMPLEMENT_generic_cipher(aria, ARIA, cfb, CFB, 0, 256, 8, 128, stream) | |
58 | /* aria192cfb_functions */ | |
59 | IMPLEMENT_generic_cipher(aria, ARIA, cfb, CFB, 0, 192, 8, 128, stream) | |
60 | /* aria128cfb_functions */ | |
61 | IMPLEMENT_generic_cipher(aria, ARIA, cfb, CFB, 0, 128, 8, 128, stream) | |
62 | /* aria256cfb1_functions */ | |
63 | IMPLEMENT_generic_cipher(aria, ARIA, cfb1, CFB, 0, 256, 8, 128, stream) | |
64 | /* aria192cfb1_functions */ | |
65 | IMPLEMENT_generic_cipher(aria, ARIA, cfb1, CFB, 0, 192, 8, 128, stream) | |
66 | /* aria128cfb1_functions */ | |
67 | IMPLEMENT_generic_cipher(aria, ARIA, cfb1, CFB, 0, 128, 8, 128, stream) | |
68 | /* aria256cfb8_functions */ | |
69 | IMPLEMENT_generic_cipher(aria, ARIA, cfb8, CFB, 0, 256, 8, 128, stream) | |
70 | /* aria192cfb8_functions */ | |
71 | IMPLEMENT_generic_cipher(aria, ARIA, cfb8, CFB, 0, 192, 8, 128, stream) | |
72 | /* aria128cfb8_functions */ | |
73 | IMPLEMENT_generic_cipher(aria, ARIA, cfb8, CFB, 0, 128, 8, 128, stream) | |
74 | /* aria256ctr_functions */ | |
75 | IMPLEMENT_generic_cipher(aria, ARIA, ctr, CTR, 0, 256, 8, 128, stream) | |
76 | /* aria192ctr_functions */ | |
77 | IMPLEMENT_generic_cipher(aria, ARIA, ctr, CTR, 0, 192, 8, 128, stream) | |
78 | /* aria128ctr_functions */ | |
79 | IMPLEMENT_generic_cipher(aria, ARIA, ctr, CTR, 0, 128, 8, 128, stream) |