Path: blob/main/crypto/openssl/providers/implementations/include/prov/mlx_kem.h
48534 views
/*1* Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.2*3* Licensed under the Apache License 2.0 (the "License"). You may not use4* this file except in compliance with the License. You can obtain a copy5* in the file LICENSE in the source distribution or at6* https://www.openssl.org/source/license.html7*/89#ifndef OSSL_MLX_KEM_H10# define OSSL_MLX_KEM_H11# pragma once1213#include <openssl/evp.h>14#include <openssl/ml_kem.h>15#include <crypto/ml_kem.h>16#include <crypto/ecx.h>1718typedef struct ecdh_vinfo_st {19const char *algorithm_name;20const char *group_name;21size_t pubkey_bytes;22size_t prvkey_bytes;23size_t shsec_bytes;24int ml_kem_slot;25int ml_kem_variant;26} ECDH_VINFO;2728typedef struct mlx_key_st {29OSSL_LIB_CTX *libctx;30char *propq;31const ML_KEM_VINFO *minfo;32const ECDH_VINFO *xinfo;33EVP_PKEY *mkey;34EVP_PKEY *xkey;35unsigned int state;36} MLX_KEY;3738#define MLX_HAVE_NOKEYS 039#define MLX_HAVE_PUBKEY 140#define MLX_HAVE_PRVKEY 24142/* Both key parts have whatever the ML-KEM component has */43#define mlx_kem_have_pubkey(key) ((key)->state > 0)44#define mlx_kem_have_prvkey(key) ((key)->state > 1)4546#endif474849