/src/openssl/providers/implementations/signature/eddsa_sig.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 eddsa_get_ctx_params_list |
21 | | static ossl_unused const OSSL_PARAM eddsa_get_ctx_params_list[] = { |
22 | | OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0), |
23 | | # if defined(FIPS_MODULE) |
24 | | OSSL_PARAM_int(OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR, NULL), |
25 | | # endif |
26 | | OSSL_PARAM_END |
27 | | }; |
28 | | #endif |
29 | | |
30 | | #ifndef eddsa_get_ctx_params_st |
31 | | struct eddsa_get_ctx_params_st { |
32 | | OSSL_PARAM *id; |
33 | | }; |
34 | | #endif |
35 | | |
36 | | #ifndef eddsa_get_ctx_params_decoder |
37 | | static ossl_unused int eddsa_get_ctx_params_decoder |
38 | | (const OSSL_PARAM *p, struct eddsa_get_ctx_params_st *r) |
39 | 0 | { |
40 | 0 | const char *s; |
41 | |
|
42 | 0 | memset(r, 0, sizeof(*r)); |
43 | 0 | if (p != NULL) |
44 | 0 | for (; (s = p->key) != NULL; p++) |
45 | 0 | switch(s[0]) { |
46 | 0 | default: |
47 | 0 | break; |
48 | 0 | case 'a': |
49 | 0 | if (ossl_likely(strcmp("lgorithm-id", s + 1) == 0)) { |
50 | | /* OSSL_SIGNATURE_PARAM_ALGORITHM_ID */ |
51 | 0 | if (ossl_unlikely(r->id != NULL)) { |
52 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
53 | 0 | "param %s is repeated", s); |
54 | 0 | return 0; |
55 | 0 | } |
56 | 0 | r->id = (OSSL_PARAM *)p; |
57 | 0 | } |
58 | 0 | break; |
59 | 0 | case 'f': |
60 | | # if defined(FIPS_MODULE) |
61 | | if (ossl_likely(strcmp("ips-indicator", s + 1) == 0)) { |
62 | | /* OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR */ |
63 | | if (!OSSL_PARAM_set_int((OSSL_PARAM *)p, 1)) |
64 | | return 0; |
65 | | } |
66 | | # endif |
67 | 0 | break; |
68 | 0 | } |
69 | 0 | return 1; |
70 | 0 | } |
71 | | #endif |
72 | | /* End of machine generated */ |
73 | | |
74 | | /* Machine generated */ |
75 | | #ifndef eddsa_set_ctx_params_list |
76 | | static ossl_unused const OSSL_PARAM eddsa_set_ctx_params_list[] = { |
77 | | OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_INSTANCE, NULL, 0), |
78 | | OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING, NULL, 0), |
79 | | OSSL_PARAM_END |
80 | | }; |
81 | | #endif |
82 | | |
83 | | #ifndef eddsa_set_ctx_params_st |
84 | | struct eddsa_set_ctx_params_st { |
85 | | OSSL_PARAM *ctx; |
86 | | OSSL_PARAM *inst; |
87 | | }; |
88 | | #endif |
89 | | |
90 | | #ifndef eddsa_set_ctx_params_decoder |
91 | | static ossl_unused int eddsa_set_ctx_params_decoder |
92 | | (const OSSL_PARAM *p, struct eddsa_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("ontext-string", s + 1) == 0)) { |
104 | | /* OSSL_SIGNATURE_PARAM_CONTEXT_STRING */ |
105 | 0 | if (ossl_unlikely(r->ctx != 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->ctx = (OSSL_PARAM *)p; |
111 | 0 | } |
112 | 0 | break; |
113 | 0 | case 'i': |
114 | 0 | if (ossl_likely(strcmp("nstance", s + 1) == 0)) { |
115 | | /* OSSL_SIGNATURE_PARAM_INSTANCE */ |
116 | 0 | if (ossl_unlikely(r->inst != 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->inst = (OSSL_PARAM *)p; |
122 | 0 | } |
123 | 0 | } |
124 | 0 | return 1; |
125 | 0 | } |
126 | | #endif |
127 | | /* End of machine generated */ |
128 | | |
129 | | /* Machine generated */ |
130 | | #ifndef eddsa_set_variant_ctx_params_list |
131 | | static ossl_unused const OSSL_PARAM eddsa_set_variant_ctx_params_list[] = { |
132 | | OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING, NULL, 0), |
133 | | OSSL_PARAM_END |
134 | | }; |
135 | | #endif |
136 | | |
137 | | #ifndef eddsa_set_variant_ctx_params_st |
138 | | struct eddsa_set_variant_ctx_params_st { |
139 | | OSSL_PARAM *ctx; |
140 | | }; |
141 | | #endif |
142 | | |
143 | | #ifndef eddsa_set_variant_ctx_params_decoder |
144 | | static ossl_unused int eddsa_set_variant_ctx_params_decoder |
145 | | (const OSSL_PARAM *p, struct eddsa_set_variant_ctx_params_st *r) |
146 | 0 | { |
147 | 0 | const char *s; |
148 | |
|
149 | 0 | memset(r, 0, sizeof(*r)); |
150 | 0 | if (p != NULL) |
151 | 0 | for (; (s = p->key) != NULL; p++) |
152 | 0 | if (ossl_likely(strcmp("context-string", s + 0) == 0)) { |
153 | | /* OSSL_SIGNATURE_PARAM_CONTEXT_STRING */ |
154 | 0 | if (ossl_unlikely(r->ctx != NULL)) { |
155 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
156 | 0 | "param %s is repeated", s); |
157 | 0 | return 0; |
158 | 0 | } |
159 | 0 | r->ctx = (OSSL_PARAM *)p; |
160 | 0 | } |
161 | 0 | return 1; |
162 | 0 | } |
163 | | #endif |
164 | | /* End of machine generated */ |