/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 | | #ifndef eddsa_get_ctx_params_list |
14 | | static const OSSL_PARAM eddsa_get_ctx_params_list[] = { |
15 | | OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_ALGORITHM_ID, NULL, 0), |
16 | | OSSL_PARAM_END |
17 | | }; |
18 | | #endif |
19 | | |
20 | | #ifndef eddsa_get_ctx_params_st |
21 | | struct eddsa_get_ctx_params_st { |
22 | | OSSL_PARAM *id; |
23 | | }; |
24 | | #endif |
25 | | |
26 | | #ifndef eddsa_get_ctx_params_decoder |
27 | | static int eddsa_get_ctx_params_decoder |
28 | | (const OSSL_PARAM *p, struct eddsa_get_ctx_params_st *r) |
29 | 0 | { |
30 | 0 | const char *s; |
31 | |
|
32 | 0 | memset(r, 0, sizeof(*r)); |
33 | 0 | if (p != NULL) |
34 | 0 | for (; (s = p->key) != NULL; p++) |
35 | 0 | if (ossl_likely(strcmp("algorithm-id", s + 0) == 0)) { |
36 | | /* OSSL_SIGNATURE_PARAM_ALGORITHM_ID */ |
37 | 0 | if (ossl_unlikely(r->id != NULL)) { |
38 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
39 | 0 | "param %s is repeated", s); |
40 | 0 | return 0; |
41 | 0 | } |
42 | 0 | r->id = (OSSL_PARAM *)p; |
43 | 0 | } |
44 | 0 | return 1; |
45 | 0 | } |
46 | | #endif |
47 | | /* End of machine generated */ |
48 | | |
49 | | /* Machine generated by util/perl/OpenSSL/paramnames.pm */ |
50 | | #ifndef eddsa_set_ctx_params_list |
51 | | static const OSSL_PARAM eddsa_set_ctx_params_list[] = { |
52 | | OSSL_PARAM_utf8_string(OSSL_SIGNATURE_PARAM_INSTANCE, NULL, 0), |
53 | | OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING, NULL, 0), |
54 | | OSSL_PARAM_END |
55 | | }; |
56 | | #endif |
57 | | |
58 | | #ifndef eddsa_set_ctx_params_st |
59 | | struct eddsa_set_ctx_params_st { |
60 | | OSSL_PARAM *ctx; |
61 | | OSSL_PARAM *inst; |
62 | | }; |
63 | | #endif |
64 | | |
65 | | #ifndef eddsa_set_ctx_params_decoder |
66 | | static int eddsa_set_ctx_params_decoder |
67 | | (const OSSL_PARAM *p, struct eddsa_set_ctx_params_st *r) |
68 | 0 | { |
69 | 0 | const char *s; |
70 | |
|
71 | 0 | memset(r, 0, sizeof(*r)); |
72 | 0 | if (p != NULL) |
73 | 0 | for (; (s = p->key) != NULL; p++) |
74 | 0 | switch(s[0]) { |
75 | 0 | default: |
76 | 0 | break; |
77 | 0 | case 'c': |
78 | 0 | if (ossl_likely(strcmp("ontext-string", s + 1) == 0)) { |
79 | | /* OSSL_SIGNATURE_PARAM_CONTEXT_STRING */ |
80 | 0 | if (ossl_unlikely(r->ctx != NULL)) { |
81 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
82 | 0 | "param %s is repeated", s); |
83 | 0 | return 0; |
84 | 0 | } |
85 | 0 | r->ctx = (OSSL_PARAM *)p; |
86 | 0 | } |
87 | 0 | break; |
88 | 0 | case 'i': |
89 | 0 | if (ossl_likely(strcmp("nstance", s + 1) == 0)) { |
90 | | /* OSSL_SIGNATURE_PARAM_INSTANCE */ |
91 | 0 | if (ossl_unlikely(r->inst != NULL)) { |
92 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
93 | 0 | "param %s is repeated", s); |
94 | 0 | return 0; |
95 | 0 | } |
96 | 0 | r->inst = (OSSL_PARAM *)p; |
97 | 0 | } |
98 | 0 | } |
99 | 0 | return 1; |
100 | 0 | } |
101 | | #endif |
102 | | /* End of machine generated */ |
103 | | |
104 | | /* Machine generated by util/perl/OpenSSL/paramnames.pm */ |
105 | | #ifndef eddsa_set_variant_ctx_params_list |
106 | | static const OSSL_PARAM eddsa_set_variant_ctx_params_list[] = { |
107 | | OSSL_PARAM_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING, NULL, 0), |
108 | | OSSL_PARAM_END |
109 | | }; |
110 | | #endif |
111 | | |
112 | | #ifndef eddsa_set_variant_ctx_params_st |
113 | | struct eddsa_set_variant_ctx_params_st { |
114 | | OSSL_PARAM *ctx; |
115 | | }; |
116 | | #endif |
117 | | |
118 | | #ifndef eddsa_set_variant_ctx_params_decoder |
119 | | static int eddsa_set_variant_ctx_params_decoder |
120 | | (const OSSL_PARAM *p, struct eddsa_set_variant_ctx_params_st *r) |
121 | 0 | { |
122 | 0 | const char *s; |
123 | |
|
124 | 0 | memset(r, 0, sizeof(*r)); |
125 | 0 | if (p != NULL) |
126 | 0 | for (; (s = p->key) != NULL; p++) |
127 | 0 | if (ossl_likely(strcmp("context-string", s + 0) == 0)) { |
128 | | /* OSSL_SIGNATURE_PARAM_CONTEXT_STRING */ |
129 | 0 | if (ossl_unlikely(r->ctx != NULL)) { |
130 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
131 | 0 | "param %s is repeated", s); |
132 | 0 | return 0; |
133 | 0 | } |
134 | 0 | r->ctx = (OSSL_PARAM *)p; |
135 | 0 | } |
136 | 0 | return 1; |
137 | 0 | } |
138 | | #endif |
139 | | /* End of machine generated */ |