#include <openssl/rsa.h>
#include <assert.h>
#include <limits.h>
#include <string.h>
#include <openssl/bn.h>
#include <openssl/digest.h>
#include <openssl/engine.h>
#include <openssl/err.h>
#include <openssl/ex_data.h>
#include <openssl/md5.h>
#include <openssl/mem.h>
#include <openssl/nid.h>
#include <openssl/sha.h>
#include <openssl/thread.h>
#include "../bn/internal.h"
#include "../delocate.h"
#include "../../internal.h"
#include "internal.h"
OPENSSL_DECLARE_ERROR_REASON(…)
DEFINE_STATIC_EX_DATA_CLASS(…) …
static int bn_dup_into(BIGNUM **dst, const BIGNUM *src) { … }
RSA *RSA_new_public_key(const BIGNUM *n, const BIGNUM *e) { … }
RSA *RSA_new_private_key(const BIGNUM *n, const BIGNUM *e, const BIGNUM *d,
const BIGNUM *p, const BIGNUM *q, const BIGNUM *dmp1,
const BIGNUM *dmq1, const BIGNUM *iqmp) { … }
RSA *RSA_new_private_key_no_crt(const BIGNUM *n, const BIGNUM *e,
const BIGNUM *d) { … }
RSA *RSA_new_private_key_no_e(const BIGNUM *n, const BIGNUM *d) { … }
RSA *RSA_new_public_key_large_e(const BIGNUM *n, const BIGNUM *e) { … }
RSA *RSA_new_private_key_large_e(const BIGNUM *n, const BIGNUM *e,
const BIGNUM *d, const BIGNUM *p,
const BIGNUM *q, const BIGNUM *dmp1,
const BIGNUM *dmq1, const BIGNUM *iqmp) { … }
RSA *RSA_new(void) { … }
RSA *RSA_new_method(const ENGINE *engine) { … }
RSA *RSA_new_method_no_e(const ENGINE *engine, const BIGNUM *n) { … }
void RSA_free(RSA *rsa) { … }
int RSA_up_ref(RSA *rsa) { … }
unsigned RSA_bits(const RSA *rsa) { … }
const BIGNUM *RSA_get0_n(const RSA *rsa) { … }
const BIGNUM *RSA_get0_e(const RSA *rsa) { … }
const BIGNUM *RSA_get0_d(const RSA *rsa) { … }
const BIGNUM *RSA_get0_p(const RSA *rsa) { … }
const BIGNUM *RSA_get0_q(const RSA *rsa) { … }
const BIGNUM *RSA_get0_dmp1(const RSA *rsa) { … }
const BIGNUM *RSA_get0_dmq1(const RSA *rsa) { … }
const BIGNUM *RSA_get0_iqmp(const RSA *rsa) { … }
void RSA_get0_key(const RSA *rsa, const BIGNUM **out_n, const BIGNUM **out_e,
const BIGNUM **out_d) { … }
void RSA_get0_factors(const RSA *rsa, const BIGNUM **out_p,
const BIGNUM **out_q) { … }
const RSA_PSS_PARAMS *RSA_get0_pss_params(const RSA *rsa) { … }
void RSA_get0_crt_params(const RSA *rsa, const BIGNUM **out_dmp1,
const BIGNUM **out_dmq1, const BIGNUM **out_iqmp) { … }
int RSA_set0_key(RSA *rsa, BIGNUM *n, BIGNUM *e, BIGNUM *d) { … }
int RSA_set0_factors(RSA *rsa, BIGNUM *p, BIGNUM *q) { … }
int RSA_set0_crt_params(RSA *rsa, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) { … }
static int rsa_sign_raw_no_self_test(RSA *rsa, size_t *out_len, uint8_t *out,
size_t max_out, const uint8_t *in,
size_t in_len, int padding) { … }
int RSA_sign_raw(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
const uint8_t *in, size_t in_len, int padding) { … }
unsigned RSA_size(const RSA *rsa) { … }
int RSA_is_opaque(const RSA *rsa) { … }
int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused,
CRYPTO_EX_dup *dup_unused, CRYPTO_EX_free *free_func) { … }
int RSA_set_ex_data(RSA *rsa, int idx, void *arg) { … }
void *RSA_get_ex_data(const RSA *rsa, int idx) { … }
static const unsigned SSL_SIG_LENGTH = …;
struct pkcs1_sig_prefix { … };
static const struct pkcs1_sig_prefix kPKCS1SigPrefixes[] = …;
static int rsa_check_digest_size(int hash_nid, size_t digest_len) { … }
int RSA_add_pkcs1_prefix(uint8_t **out_msg, size_t *out_msg_len,
int *is_alloced, int hash_nid, const uint8_t *digest,
size_t digest_len) { … }
int rsa_sign_no_self_test(int hash_nid, const uint8_t *digest,
size_t digest_len, uint8_t *out, unsigned *out_len,
RSA *rsa) { … }
int RSA_sign(int hash_nid, const uint8_t *digest, size_t digest_len,
uint8_t *out, unsigned *out_len, RSA *rsa) { … }
int RSA_sign_pss_mgf1(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
const uint8_t *digest, size_t digest_len,
const EVP_MD *md, const EVP_MD *mgf1_md, int salt_len) { … }
int rsa_verify_no_self_test(int hash_nid, const uint8_t *digest,
size_t digest_len, const uint8_t *sig,
size_t sig_len, RSA *rsa) { … }
int RSA_verify(int hash_nid, const uint8_t *digest, size_t digest_len,
const uint8_t *sig, size_t sig_len, RSA *rsa) { … }
int RSA_verify_pss_mgf1(RSA *rsa, const uint8_t *digest, size_t digest_len,
const EVP_MD *md, const EVP_MD *mgf1_md, int salt_len,
const uint8_t *sig, size_t sig_len) { … }
static int check_mod_inverse(int *out_ok, const BIGNUM *a, const BIGNUM *ainv,
const BIGNUM *m, unsigned m_min_bits,
BN_CTX *ctx) { … }
int RSA_check_key(const RSA *key) { … }
static const BN_ULONG kSmallFactorsLimbs[] = …;
DEFINE_LOCAL_DATA(BIGNUM, g_small_factors) { … }
int RSA_check_fips(RSA *key) { … }
int rsa_private_transform_no_self_test(RSA *rsa, uint8_t *out,
const uint8_t *in, size_t len) { … }
int rsa_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in,
size_t len) { … }
int RSA_flags(const RSA *rsa) { … }
int RSA_test_flags(const RSA *rsa, int flags) { … }
int RSA_blinding_on(RSA *rsa, BN_CTX *ctx) { … }