/src/openssl/providers/implementations/digests/kt_prov.inc
Line | Count | Source |
1 | | /* |
2 | | * Copyright 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 | | /* Machine generated by util/perl/OpenSSL/paramnames.pm */ |
12 | | #include <string.h> |
13 | | #include <openssl/params.h> |
14 | | #include <openssl/e_os2.h> |
15 | | #include "internal/common.h" |
16 | | #include "prov/proverr.h" |
17 | | |
18 | | /* Machine generated */ |
19 | | #ifndef kt_get_ctx_params_list |
20 | | static ossl_unused const OSSL_PARAM kt_get_ctx_params_list[] = { |
21 | | OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_XOFLEN, NULL), |
22 | | OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL), |
23 | | OSSL_PARAM_END |
24 | | }; |
25 | | #endif |
26 | | |
27 | | #ifndef kt_get_ctx_params_st |
28 | | struct kt_get_ctx_params_st { |
29 | | OSSL_PARAM *size; |
30 | | OSSL_PARAM *xoflen; |
31 | | }; |
32 | | #endif |
33 | | |
34 | | #ifndef kt_get_ctx_params_decoder |
35 | | static ossl_unused int kt_get_ctx_params_decoder |
36 | | (const OSSL_PARAM *p, struct kt_get_ctx_params_st *r) |
37 | 0 | { |
38 | 0 | const char *s; |
39 | |
|
40 | 0 | memset(r, 0, sizeof(*r)); |
41 | 0 | if (p != NULL) |
42 | 0 | for (; (s = p->key) != NULL; p++) |
43 | 0 | switch(s[0]) { |
44 | 0 | default: |
45 | 0 | break; |
46 | 0 | case 's': |
47 | 0 | if (ossl_likely(strcmp("ize", s + 1) == 0)) { |
48 | | /* OSSL_DIGEST_PARAM_SIZE */ |
49 | 0 | if (ossl_unlikely(r->size != NULL)) { |
50 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
51 | 0 | "param %s is repeated", s); |
52 | 0 | return 0; |
53 | 0 | } |
54 | 0 | r->size = (OSSL_PARAM *)p; |
55 | 0 | } |
56 | 0 | break; |
57 | 0 | case 'x': |
58 | 0 | if (ossl_likely(strcmp("oflen", s + 1) == 0)) { |
59 | | /* OSSL_DIGEST_PARAM_XOFLEN */ |
60 | 0 | if (ossl_unlikely(r->xoflen != NULL)) { |
61 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
62 | 0 | "param %s is repeated", s); |
63 | 0 | return 0; |
64 | 0 | } |
65 | 0 | r->xoflen = (OSSL_PARAM *)p; |
66 | 0 | } |
67 | 0 | } |
68 | 0 | return 1; |
69 | 0 | } |
70 | | #endif |
71 | | /* End of machine generated */ |
72 | | |
73 | | /* Machine generated */ |
74 | | #ifndef kt_set_ctx_params_list |
75 | | static ossl_unused const OSSL_PARAM kt_set_ctx_params_list[] = { |
76 | | OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_XOFLEN, NULL), |
77 | | OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL), |
78 | | OSSL_PARAM_octet_string(OSSL_DIGEST_PARAM_CUSTOMIZATION, NULL, 0), |
79 | | OSSL_PARAM_END |
80 | | }; |
81 | | #endif |
82 | | |
83 | | #ifndef kt_set_ctx_params_st |
84 | | struct kt_set_ctx_params_st { |
85 | | OSSL_PARAM *custom; |
86 | | OSSL_PARAM *xoflen; |
87 | | }; |
88 | | #endif |
89 | | |
90 | | #ifndef kt_set_ctx_params_decoder |
91 | | static ossl_unused int kt_set_ctx_params_decoder |
92 | | (const OSSL_PARAM *p, struct kt_set_ctx_params_st *r) |
93 | 0 | { |
94 | 0 | const char *s; |
95 | |
|
96 | 0 | memset(r, 0, sizeof(*r)); |
97 | 0 | if (p != NULL) |
98 | 0 | for (; (s = p->key) != NULL; p++) |
99 | 0 | switch(s[0]) { |
100 | 0 | default: |
101 | 0 | break; |
102 | 0 | case 'c': |
103 | 0 | if (ossl_likely(strcmp("ustomization", s + 1) == 0)) { |
104 | | /* OSSL_DIGEST_PARAM_CUSTOMIZATION */ |
105 | 0 | if (ossl_unlikely(r->custom != NULL)) { |
106 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
107 | 0 | "param %s is repeated", s); |
108 | 0 | return 0; |
109 | 0 | } |
110 | 0 | r->custom = (OSSL_PARAM *)p; |
111 | 0 | } |
112 | 0 | break; |
113 | 0 | case 's': |
114 | 0 | if (ossl_likely(strcmp("ize", s + 1) == 0)) { |
115 | | /* OSSL_DIGEST_PARAM_SIZE */ |
116 | 0 | if (ossl_unlikely(r->xoflen != NULL)) { |
117 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
118 | 0 | "param %s is repeated", s); |
119 | 0 | return 0; |
120 | 0 | } |
121 | 0 | r->xoflen = (OSSL_PARAM *)p; |
122 | 0 | } |
123 | 0 | break; |
124 | 0 | case 'x': |
125 | 0 | if (ossl_likely(strcmp("oflen", s + 1) == 0)) { |
126 | | /* OSSL_DIGEST_PARAM_XOFLEN */ |
127 | 0 | if (ossl_unlikely(r->xoflen != NULL)) { |
128 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
129 | 0 | "param %s is repeated", s); |
130 | 0 | return 0; |
131 | 0 | } |
132 | 0 | r->xoflen = (OSSL_PARAM *)p; |
133 | 0 | } |
134 | 0 | } |
135 | 0 | return 1; |
136 | 0 | } |
137 | | #endif |
138 | | /* End of machine generated */ |