Coverage Report

Created: 2026-09-12 06:55

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl41/providers/implementations/ciphers/cipher_sm4_xts.inc
Line
Count
Source
1
/*
2
 * Copyright 2025 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
12
/* Machine generated by util/perl/OpenSSL/paramnames.pm */
13
#include <string.h>
14
#include <openssl/params.h>
15
#include <openssl/e_os2.h>
16
#include "internal/common.h"
17
#include "prov/proverr.h"
18
19
/* Machine generated */
20
#ifndef sm4_xts_set_ctx_params_list
21
static ossl_unused const OSSL_PARAM sm4_xts_set_ctx_params_list[] = {
22
    OSSL_PARAM_utf8_string(OSSL_CIPHER_PARAM_XTS_STANDARD, NULL, 0),
23
    OSSL_PARAM_END
24
};
25
#endif
26
27
#ifndef sm4_xts_set_ctx_params_st
28
struct sm4_xts_set_ctx_params_st {
29
    OSSL_PARAM *std;
30
};
31
#endif
32
33
#ifndef sm4_xts_set_ctx_params_decoder
34
static ossl_unused int sm4_xts_set_ctx_params_decoder
35
    (const OSSL_PARAM *p, struct sm4_xts_set_ctx_params_st *r)
36
28
{
37
28
    const char *s;
38
39
28
    memset(r, 0, sizeof(*r));
40
28
    if (p != NULL)
41
28
        for (; (s = p->key) != NULL; p++)
42
14
            if (ossl_likely(strcmp("xts_standard", s + 0) == 0)) {
43
                /* OSSL_CIPHER_PARAM_XTS_STANDARD */
44
14
                if (ossl_unlikely(r->std != NULL)) {
45
0
                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
46
0
                                   "param %s is repeated", s);
47
0
                    return 0;
48
0
                }
49
14
                r->std = (OSSL_PARAM *)p;
50
14
            }
51
28
    return 1;
52
28
}
53
#endif
54
/* End of machine generated */