xref: /freebsd/crypto/openssl/providers/implementations/encode_decode/ml_dsa_codecs.h (revision e7be843b4a162e68651d3911f0357ed464915629)
1*e7be843bSPierre Pronchery /*
2*e7be843bSPierre Pronchery  * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
3*e7be843bSPierre Pronchery  *
4*e7be843bSPierre Pronchery  * Licensed under the Apache License 2.0 (the "License").  You may not use
5*e7be843bSPierre Pronchery  * this file except in compliance with the License.  You can obtain a copy
6*e7be843bSPierre Pronchery  * in the file LICENSE in the source distribution or at
7*e7be843bSPierre Pronchery  * https://www.openssl.org/source/license.html
8*e7be843bSPierre Pronchery  */
9*e7be843bSPierre Pronchery 
10*e7be843bSPierre Pronchery #ifndef PROV_ML_DSA_CODECS_H
11*e7be843bSPierre Pronchery # define PROV_ML_DSA_CODECS_H
12*e7be843bSPierre Pronchery # pragma once
13*e7be843bSPierre Pronchery 
14*e7be843bSPierre Pronchery # ifndef OPENSSL_NO_ML_DSA
15*e7be843bSPierre Pronchery #  include <openssl/e_os2.h>
16*e7be843bSPierre Pronchery #  include "crypto/ml_dsa.h"
17*e7be843bSPierre Pronchery #  include "prov/provider_ctx.h"
18*e7be843bSPierre Pronchery #  include "ml_common_codecs.h"
19*e7be843bSPierre Pronchery 
20*e7be843bSPierre Pronchery __owur
21*e7be843bSPierre Pronchery ML_DSA_KEY *ossl_ml_dsa_d2i_PUBKEY(const uint8_t *pubenc, int publen,
22*e7be843bSPierre Pronchery                                    int evp_type, PROV_CTX *provctx,
23*e7be843bSPierre Pronchery                                    const char *propq);
24*e7be843bSPierre Pronchery __owur
25*e7be843bSPierre Pronchery ML_DSA_KEY *ossl_ml_dsa_d2i_PKCS8(const uint8_t *prvenc, int prvlen,
26*e7be843bSPierre Pronchery                                   int evp_type, PROV_CTX *provctx,
27*e7be843bSPierre Pronchery                                   const char *propq);
28*e7be843bSPierre Pronchery __owur
29*e7be843bSPierre Pronchery int ossl_ml_dsa_key_to_text(BIO *out, const ML_DSA_KEY *key, int selection);
30*e7be843bSPierre Pronchery __owur
31*e7be843bSPierre Pronchery __owur
32*e7be843bSPierre Pronchery int ossl_ml_dsa_i2d_pubkey(const ML_DSA_KEY *key, unsigned char **out);
33*e7be843bSPierre Pronchery __owur
34*e7be843bSPierre Pronchery __owur
35*e7be843bSPierre Pronchery int ossl_ml_dsa_i2d_prvkey(const ML_DSA_KEY *key, unsigned char **out,
36*e7be843bSPierre Pronchery                            PROV_CTX *provctx);
37*e7be843bSPierre Pronchery 
38*e7be843bSPierre Pronchery # endif /* OPENSSL_NO_ML_DSA */
39*e7be843bSPierre Pronchery #endif  /* PROV_ML_DSA_CODECS_H */
40