/src/openssl40/providers/implementations/kem/ml_kem_kem.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 ml_kem_set_ctx_params_list |
14 | | static ossl_unused const OSSL_PARAM ml_kem_set_ctx_params_list[] = { |
15 | | OSSL_PARAM_octet_string(OSSL_KEM_PARAM_IKME, NULL, 0), |
16 | | OSSL_PARAM_END |
17 | | }; |
18 | | #endif |
19 | | |
20 | | #ifndef ml_kem_set_ctx_params_st |
21 | | struct ml_kem_set_ctx_params_st { |
22 | | OSSL_PARAM *ikme; |
23 | | }; |
24 | | #endif |
25 | | |
26 | | #ifndef ml_kem_set_ctx_params_decoder |
27 | | static ossl_unused int ml_kem_set_ctx_params_decoder |
28 | | (const OSSL_PARAM *p, struct ml_kem_set_ctx_params_st *r) |
29 | 317 | { |
30 | 317 | const char *s; |
31 | | |
32 | 317 | memset(r, 0, sizeof(*r)); |
33 | 317 | if (p != NULL) |
34 | 0 | for (; (s = p->key) != NULL; p++) |
35 | 0 | if (ossl_likely(strcmp("ikme", s + 0) == 0)) { |
36 | | /* OSSL_KEM_PARAM_IKME */ |
37 | 0 | if (ossl_unlikely(r->ikme != 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->ikme = (OSSL_PARAM *)p; |
43 | 0 | } |
44 | 317 | return 1; |
45 | 317 | } |
46 | | #endif |
47 | | /* End of machine generated */ |
48 | | |
49 | | /* Machine generated by util/perl/OpenSSL/paramnames.pm */ |
50 | | #ifndef ml_kem_get_ctx_params_list |
51 | | static ossl_unused const OSSL_PARAM ml_kem_get_ctx_params_list[] = { |
52 | | # if defined(FIPS_MODULE) |
53 | | OSSL_PARAM_int(OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR, NULL), |
54 | | # endif |
55 | | OSSL_PARAM_END |
56 | | }; |
57 | | #endif |
58 | | |
59 | | #ifndef ml_kem_get_ctx_params_st |
60 | | struct ml_kem_get_ctx_params_st { |
61 | | # if defined(FIPS_MODULE) |
62 | | OSSL_PARAM *ind; |
63 | | # else |
64 | | int dummy; /* unused */ |
65 | | # endif |
66 | | }; |
67 | | #endif |
68 | | |
69 | | #ifndef ml_kem_get_ctx_params_decoder |
70 | | static ossl_unused int ml_kem_get_ctx_params_decoder |
71 | | (const OSSL_PARAM *p, struct ml_kem_get_ctx_params_st *r) |
72 | 0 | { |
73 | 0 | const char *s; |
74 | 0 |
|
75 | 0 | memset(r, 0, sizeof(*r)); |
76 | 0 | if (p != NULL) |
77 | 0 | for (; (s = p->key) != NULL; p++) |
78 | 0 | # if defined(FIPS_MODULE) |
79 | 0 | if (ossl_likely(strcmp("fips-indicator", s + 0) == 0)) { |
80 | 0 | /* OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR */ |
81 | 0 | if (ossl_unlikely(r->ind != NULL)) { |
82 | 0 | ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER, |
83 | 0 | "param %s is repeated", s); |
84 | 0 | return 0; |
85 | 0 | } |
86 | 0 | r->ind = (OSSL_PARAM *)p; |
87 | 0 | } |
88 | 0 | # else |
89 | 0 | ; |
90 | 0 | # endif |
91 | 0 | return 1; |
92 | 0 | } |
93 | | #endif |
94 | | /* End of machine generated */ |