linux/crypto/rsa.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* RSA asymmetric public-key algorithm [RFC3447]
 *
 * Copyright (c) 2015, Intel Corporation
 * Authors: Tadeusz Struk <[email protected]>
 */

#include <linux/fips.h>
#include <linux/module.h>
#include <linux/mpi.h>
#include <crypto/internal/rsa.h>
#include <crypto/internal/akcipher.h>
#include <crypto/akcipher.h>
#include <crypto/algapi.h>

struct rsa_mpi_key {};

static int rsa_check_payload(MPI x, MPI n)
{}

/*
 * RSAEP function [RFC3447 sec 5.1.1]
 * c = m^e mod n;
 */
static int _rsa_enc(const struct rsa_mpi_key *key, MPI c, MPI m)
{}

/*
 * RSADP function [RFC3447 sec 5.1.2]
 * m_1 = c^dP mod p;
 * m_2 = c^dQ mod q;
 * h = (m_1 - m_2) * qInv mod p;
 * m = m_2 + q * h;
 */
static int _rsa_dec_crt(const struct rsa_mpi_key *key, MPI m_or_m1_or_h, MPI c)
{}

static inline struct rsa_mpi_key *rsa_get_key(struct crypto_akcipher *tfm)
{}

static int rsa_enc(struct akcipher_request *req)
{}

static int rsa_dec(struct akcipher_request *req)
{}

static void rsa_free_mpi_key(struct rsa_mpi_key *key)
{}

static int rsa_check_key_length(unsigned int len)
{}

static int rsa_check_exponent_fips(MPI e)
{}

static int rsa_set_pub_key(struct crypto_akcipher *tfm, const void *key,
			   unsigned int keylen)
{}

static int rsa_set_priv_key(struct crypto_akcipher *tfm, const void *key,
			    unsigned int keylen)
{}

static unsigned int rsa_max_size(struct crypto_akcipher *tfm)
{}

static void rsa_exit_tfm(struct crypto_akcipher *tfm)
{}

static struct akcipher_alg rsa =;

static int __init rsa_init(void)
{}

static void __exit rsa_exit(void)
{}

subsys_initcall(rsa_init);
module_exit(rsa_exit);
MODULE_ALIAS_CRYPTO();
MODULE_LICENSE();
MODULE_DESCRIPTION();