__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * RSA internal helpers
 *
 * Copyright (c) 2015, Intel Corporation
 * Authors: Tadeusz Struk <[email protected]>
 */
#ifndef _RSA_HELPER_
#define _RSA_HELPER_
#include <linux/types.h>
#include <crypto/akcipher.h>

/**
 * rsa_key - RSA key structure
 * @n           : RSA modulus raw byte stream
 * @e           : RSA public exponent raw byte stream
 * @d           : RSA private exponent raw byte stream
 * @p           : RSA prime factor p of n raw byte stream
 * @q           : RSA prime factor q of n raw byte stream
 * @dp          : RSA exponent d mod (p - 1) raw byte stream
 * @dq          : RSA exponent d mod (q - 1) raw byte stream
 * @qinv        : RSA CRT coefficient q^(-1) mod p raw byte stream
 * @n_sz        : length in bytes of RSA modulus n
 * @e_sz        : length in bytes of RSA public exponent
 * @d_sz        : length in bytes of RSA private exponent
 * @p_sz        : length in bytes of p field
 * @q_sz        : length in bytes of q field
 * @dp_sz       : length in bytes of dp field
 * @dq_sz       : length in bytes of dq field
 * @qinv_sz     : length in bytes of qinv field
 */
struct rsa_key {
	const u8 *n;
	const u8 *e;
	const u8 *d;
	const u8 *p;
	const u8 *q;
	const u8 *dp;
	const u8 *dq;
	const u8 *qinv;
	size_t n_sz;
	size_t e_sz;
	size_t d_sz;
	size_t p_sz;
	size_t q_sz;
	size_t dp_sz;
	size_t dq_sz;
	size_t qinv_sz;
};

int rsa_parse_pub_key(struct rsa_key *rsa_key, const void *key,
		      unsigned int key_len);

int rsa_parse_priv_key(struct rsa_key *rsa_key, const void *key,
		       unsigned int key_len);

#define RSA_PUB (true)
#define RSA_PRIV (false)

static inline int rsa_set_key(struct crypto_akcipher *child,
			      unsigned int *key_size, bool is_pubkey,
			      const void *key, unsigned int keylen)
{
	int err;

	*key_size = 0;

	if (is_pubkey)
		err = crypto_akcipher_set_pub_key(child, key, keylen);
	else
		err = crypto_akcipher_set_priv_key(child, key, keylen);
	if (err)
		return err;

	/* Find out new modulus size from rsa implementation */
	err = crypto_akcipher_maxsize(child);
	if (err > PAGE_SIZE)
		return -ENOTSUPP;

	*key_size = err;
	return 0;
}

extern struct crypto_template rsa_pkcs1pad_tmpl;
extern struct crypto_template rsassa_pkcs1_tmpl;
#endif

Filemanager

Name Type Size Permission Actions
acompress.h File 3.18 KB 0644
aead.h File 4.03 KB 0644
akcipher.h File 3.84 KB 0644
blake2b.h File 3.06 KB 0644
blake2s.h File 586 B 0644
chacha.h File 969 B 0644
cipher.h File 6.77 KB 0644
des.h File 3.25 KB 0644
ecc.h File 9.6 KB 0644
engine.h File 2.19 KB 0644
geniv.h File 702 B 0644
hash.h File 6.25 KB 0644
kdf_selftest.h File 1.5 KB 0644
kpp.h File 7.04 KB 0644
poly1305.h File 1.1 KB 0644
rng.h File 1021 B 0644
rsa.h File 2.24 KB 0644
scompress.h File 3.31 KB 0644
sig.h File 2.32 KB 0644
simd.h File 1.91 KB 0644
skcipher.h File 7.26 KB 0644
Filemanager