linux/crypto/rsa-pkcs1pad.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * RSA padding templates.
 *
 * Copyright (c) 2015  Intel Corporation
 */

#include <crypto/algapi.h>
#include <crypto/akcipher.h>
#include <crypto/internal/akcipher.h>
#include <crypto/internal/rsa.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/random.h>
#include <linux/scatterlist.h>

/*
 * Hash algorithm OIDs plus ASN.1 DER wrappings [RFC4880 sec 5.2.2].
 */
static const u8 rsa_digest_info_md5[] =;

static const u8 rsa_digest_info_sha1[] =;

static const u8 rsa_digest_info_rmd160[] =;

static const u8 rsa_digest_info_sha224[] =;

static const u8 rsa_digest_info_sha256[] =;

static const u8 rsa_digest_info_sha384[] =;

static const u8 rsa_digest_info_sha512[] =;

static const u8 rsa_digest_info_sha3_256[] =;

static const u8 rsa_digest_info_sha3_384[] =;

static const u8 rsa_digest_info_sha3_512[] =;

static const struct rsa_asn1_template {} rsa_asn1_templates[] =;

static const struct rsa_asn1_template *rsa_lookup_asn1(const char *name)
{}

struct pkcs1pad_ctx {};

struct pkcs1pad_inst_ctx {};

struct pkcs1pad_request {};

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

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

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

static void pkcs1pad_sg_set_buf(struct scatterlist *sg, void *buf, size_t len,
		struct scatterlist *next)
{}

static int pkcs1pad_encrypt_sign_complete(struct akcipher_request *req, int err)
{}

static void pkcs1pad_encrypt_sign_complete_cb(void *data, int err)
{}

static int pkcs1pad_encrypt(struct akcipher_request *req)
{}

static int pkcs1pad_decrypt_complete(struct akcipher_request *req, int err)
{}

static void pkcs1pad_decrypt_complete_cb(void *data, int err)
{}

static int pkcs1pad_decrypt(struct akcipher_request *req)
{}

static int pkcs1pad_sign(struct akcipher_request *req)
{}

static int pkcs1pad_verify_complete(struct akcipher_request *req, int err)
{}

static void pkcs1pad_verify_complete_cb(void *data, int err)
{}

/*
 * The verify operation is here for completeness similar to the verification
 * defined in RFC2313 section 10.2 except that block type 0 is not accepted,
 * as in RFC2437.  RFC2437 section 9.2 doesn't define any operation to
 * retrieve the DigestInfo from a signature, instead the user is expected
 * to call the sign operation to generate the expected signature and compare
 * signatures instead of the message-digests.
 */
static int pkcs1pad_verify(struct akcipher_request *req)
{}

static int pkcs1pad_init_tfm(struct crypto_akcipher *tfm)
{}

static void pkcs1pad_exit_tfm(struct crypto_akcipher *tfm)
{}

static void pkcs1pad_free(struct akcipher_instance *inst)
{}

static int pkcs1pad_create(struct crypto_template *tmpl, struct rtattr **tb)
{}

struct crypto_template rsa_pkcs1pad_tmpl =;

MODULE_ALIAS_CRYPTO();