/src/openssl40/providers/implementations/digests/sha3_prov.inc
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2025-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 | | |
12 | | /* Machine generated by util/perl/OpenSSL/paramnames.pm */ |
13 | | #ifndef shake_get_ctx_params_list |
14 | | static ossl_unused const OSSL_PARAM shake_get_ctx_params_list[] = { |
15 | | OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_XOFLEN, NULL), |
16 | | OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL), |
17 | | # if defined(FIPS_MODULE) |
18 | | OSSL_PARAM_int(OSSL_DIGEST_PARAM_FIPS_APPROVED_INDICATOR, NULL), |
19 | | # endif |
20 | | OSSL_PARAM_END |
21 | | }; |
22 | | #endif |
23 | | |
24 | | #ifndef shake_get_ctx_params_st |
25 | | struct shake_get_ctx_params_st { |
26 | | OSSL_PARAM *size; |
27 | | OSSL_PARAM *xoflen; |
28 | | }; |
29 | | #endif |
30 | | |
31 | | #ifndef shake_get_ctx_params_decoder |
32 | | static ossl_unused int shake_get_ctx_params_decoder |
33 | | (const OSSL_PARAM *p, struct shake_get_ctx_params_st *r) |
34 | 408 | { |
35 | 408 | const char *s; |
36 | | |
37 | 408 | memset(r, 0, sizeof(*r)); |
38 | 408 | if (p != NULL) |
39 | 816 | for (; (s = p->key) != NULL; p++) |
40 | 408 | switch(s[0]) { |
41 | 0 | default: |
42 | 0 | break; |
43 | 0 | case 'f': |
44 | | # if defined(FIPS_MODULE) |
45 | | if (ossl_likely(strcmp("ips-indicator", s + 1) == 0)) { |
46 | | /* OSSL_DIGEST_PARAM_FIPS_APPROVED_INDICATOR */ |
47 | | if (!OSSL_PARAM_set_int((OSSL_PARAM *)p, 1)) |
48 | | return 0; |
49 | | } |
50 | | # endif |
51 | 0 | break; |
52 | 408 | case 's': |
53 | 408 | if (ossl_likely(strcmp("ize", s + 1) == 0)) { |
54 | | /* OSSL_DIGEST_PARAM_SIZE */ |
55 | 408 | if (ossl_unlikely(r->size != NULL)) { |
56 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
57 | 0 | "param %s is repeated", s); |
58 | 0 | return 0; |
59 | 0 | } |
60 | 408 | r->size = (OSSL_PARAM *)p; |
61 | 408 | } |
62 | 408 | break; |
63 | 408 | case 'x': |
64 | 0 | if (ossl_likely(strcmp("oflen", s + 1) == 0)) { |
65 | | /* OSSL_DIGEST_PARAM_XOFLEN */ |
66 | 0 | if (ossl_unlikely(r->xoflen != NULL)) { |
67 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
68 | 0 | "param %s is repeated", s); |
69 | 0 | return 0; |
70 | 0 | } |
71 | 0 | r->xoflen = (OSSL_PARAM *)p; |
72 | 0 | } |
73 | 408 | } |
74 | 408 | return 1; |
75 | 408 | } |
76 | | #endif |
77 | | /* End of machine generated */ |
78 | | |
79 | | /* Machine generated by util/perl/OpenSSL/paramnames.pm */ |
80 | | #ifndef shake_set_ctx_params_list |
81 | | static ossl_unused const OSSL_PARAM shake_set_ctx_params_list[] = { |
82 | | OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_XOFLEN, NULL), |
83 | | OSSL_PARAM_size_t(OSSL_DIGEST_PARAM_SIZE, NULL), |
84 | | OSSL_PARAM_END |
85 | | }; |
86 | | #endif |
87 | | |
88 | | #ifndef shake_set_ctx_params_st |
89 | | struct shake_set_ctx_params_st { |
90 | | OSSL_PARAM *xoflen; |
91 | | }; |
92 | | #endif |
93 | | |
94 | | #ifndef shake_set_ctx_params_decoder |
95 | | static ossl_unused int shake_set_ctx_params_decoder |
96 | | (const OSSL_PARAM *p, struct shake_set_ctx_params_st *r) |
97 | 371M | { |
98 | 371M | const char *s; |
99 | | |
100 | 371M | memset(r, 0, sizeof(*r)); |
101 | 371M | if (p != NULL) |
102 | 370M | for (; (s = p->key) != NULL; p++) |
103 | 185M | switch(s[0]) { |
104 | 0 | default: |
105 | 0 | break; |
106 | 8 | case 's': |
107 | 8 | if (ossl_likely(strcmp("ize", s + 1) == 0)) { |
108 | | /* OSSL_DIGEST_PARAM_SIZE */ |
109 | 8 | if (ossl_unlikely(r->xoflen != NULL)) { |
110 | 8 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
111 | 8 | "param %s is repeated", s); |
112 | 8 | return 0; |
113 | 8 | } |
114 | 0 | r->xoflen = (OSSL_PARAM *)p; |
115 | 0 | } |
116 | 0 | break; |
117 | 185M | case 'x': |
118 | 185M | if (ossl_likely(strcmp("oflen", s + 1) == 0)) { |
119 | | /* OSSL_DIGEST_PARAM_XOFLEN */ |
120 | 185M | if (ossl_unlikely(r->xoflen != NULL)) { |
121 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
122 | 0 | "param %s is repeated", s); |
123 | 0 | return 0; |
124 | 0 | } |
125 | 185M | r->xoflen = (OSSL_PARAM *)p; |
126 | 185M | } |
127 | 185M | } |
128 | 371M | return 1; |
129 | 371M | } |
130 | | #endif |
131 | | /* End of machine generated */ |