Coverage Report

Created: 2026-02-22 06:11

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/crypto/evp/e_rc2.c
Line
Count
Source
1
/*
2
 * Copyright 1995-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
#include <openssl/macros.h>
10
11
#ifndef OPENSSL_NO_RC2
12
#include "crypto/evp.h"
13
#include <openssl/rc2.h>
14
15
IMPLEMENT_BLOCK_CIPHER(rc2, ks, RC2, EVP_RC2_KEY, NID_rc2,
16
    8,
17
    RC2_KEY_LENGTH, 8, 64,
18
    EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT)
19
20
static const EVP_CIPHER r2_64_cbc_cipher = {
21
    NID_rc2_64_cbc,
22
    8, 8 /* 64 bit */, 8,
23
    EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
24
    EVP_ORIG_GLOBAL
25
};
26
27
static const EVP_CIPHER r2_40_cbc_cipher = {
28
    NID_rc2_40_cbc,
29
    8, 5 /* 40 bit */, 8,
30
    EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
31
    EVP_ORIG_GLOBAL
32
};
33
34
const EVP_CIPHER *EVP_rc2_64_cbc(void)
35
3
{
36
3
    return &r2_64_cbc_cipher;
37
3
}
38
39
const EVP_CIPHER *EVP_rc2_40_cbc(void)
40
3
{
41
3
    return &r2_40_cbc_cipher;
42
3
}
43
44
#else
45
NON_EMPTY_TRANSLATION_UNIT
46
#endif