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