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