Coverage Report

Created: 2025-10-10 07:01

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/providers/implementations/ciphers/cipher_camellia.c
Line
Count
Source
1
/*
2
 * Copyright 2019-2021 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
 * Camellia low level APIs are deprecated for public use, but still ok for
12
 * internal use.
13
 */
14
#include "internal/deprecated.h"
15
16
/* Dispatch functions for CAMELLIA cipher modes ecb, cbc, ofb, cfb, ctr */
17
18
#include "cipher_camellia.h"
19
#include "prov/implementations.h"
20
#include "prov/providercommon.h"
21
22
static OSSL_FUNC_cipher_freectx_fn camellia_freectx;
23
static OSSL_FUNC_cipher_dupctx_fn camellia_dupctx;
24
25
static void camellia_freectx(void *vctx)
26
0
{
27
0
    PROV_CAMELLIA_CTX *ctx = (PROV_CAMELLIA_CTX *)vctx;
28
29
0
    ossl_cipher_generic_reset_ctx((PROV_CIPHER_CTX *)vctx);
30
0
    OPENSSL_clear_free(ctx,  sizeof(*ctx));
31
0
}
32
33
static void *camellia_dupctx(void *ctx)
34
0
{
35
0
    PROV_CAMELLIA_CTX *in = (PROV_CAMELLIA_CTX *)ctx;
36
0
    PROV_CAMELLIA_CTX *ret;
37
38
0
    if (!ossl_prov_is_running())
39
0
        return NULL;
40
41
0
    ret = OPENSSL_malloc(sizeof(*ret));
42
0
    if (ret == NULL)
43
0
        return NULL;
44
0
    in->base.hw->copyctx(&ret->base, &in->base);
45
46
0
    return ret;
47
0
}
48
49
/* ossl_camellia256ecb_functions */
50
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, ecb, ECB, 0, 256, 128, 0, block)
51
0
/* ossl_camellia192ecb_functions */
52
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, ecb, ECB, 0, 192, 128, 0, block)
53
0
/* ossl_camellia128ecb_functions */
54
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, ecb, ECB, 0, 128, 128, 0, block)
55
0
/* ossl_camellia256cbc_functions */
56
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cbc, CBC, 0, 256, 128, 128, block)
57
0
/* ossl_camellia192cbc_functions */
58
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cbc, CBC, 0, 192, 128, 128, block)
59
0
/* ossl_camellia128cbc_functions */
60
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cbc, CBC, 0, 128, 128, 128, block)
61
0
/* ossl_camellia256ofb_functions */
62
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, ofb, OFB, 0, 256, 8, 128, stream)
63
0
/* ossl_camellia192ofb_functions */
64
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, ofb, OFB, 0, 192, 8, 128, stream)
65
0
/* ossl_camellia128ofb_functions */
66
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, ofb, OFB, 0, 128, 8, 128, stream)
67
0
/* ossl_camellia256cfb_functions */
68
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cfb,  CFB, 0, 256, 8, 128, stream)
69
0
/* ossl_camellia192cfb_functions */
70
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cfb,  CFB, 0, 192, 8, 128, stream)
71
0
/* ossl_camellia128cfb_functions */
72
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cfb,  CFB, 0, 128, 8, 128, stream)
73
0
/* ossl_camellia256cfb1_functions */
74
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cfb1, CFB, 0, 256, 8, 128, stream)
75
0
/* ossl_camellia192cfb1_functions */
76
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cfb1, CFB, 0, 192, 8, 128, stream)
77
0
/* ossl_camellia128cfb1_functions */
78
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cfb1, CFB, 0, 128, 8, 128, stream)
79
0
/* ossl_camellia256cfb8_functions */
80
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cfb8, CFB, 0, 256, 8, 128, stream)
81
0
/* ossl_camellia192cfb8_functions */
82
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cfb8, CFB, 0, 192, 8, 128, stream)
83
0
/* ossl_camellia128cfb8_functions */
84
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, cfb8, CFB, 0, 128, 8, 128, stream)
85
0
/* ossl_camellia256ctr_functions */
86
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, ctr, CTR, 0, 256, 8, 128, stream)
87
0
/* ossl_camellia192ctr_functions */
88
0
IMPLEMENT_generic_cipher(camellia, CAMELLIA, ctr, CTR, 0, 192, 8, 128, stream)
89
0
/* ossl_camellia128ctr_functions */
90
IMPLEMENT_generic_cipher(camellia, CAMELLIA, ctr, CTR, 0, 128, 8, 128, stream)
91
92
#include "cipher_camellia_cts.inc"