4:35
     �_’I|¥‰ÓMjqØ‚¦ð¬÷À¿      File not found.
  +   ˆl–Ðz¾”ªe¶…8 ^¸ÜdJbÑ¿Â„„ûÿ_†I|¥�+ÂÁ ?÷     /*
 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the Apache License 2.0 (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#ifndef OPENSSL_RSA_H
#define OPENSSL_RSA_H
#pragma once

#include <openssl/macros.h>
#ifndef OPENSSL_NO_DEPRECATED_3_0
#define HEADER_RSA_H
#endif

#include <openssl/opensslconf.h>

#include <openssl/asn1.h>
#include <openssl/bio.h>
#include <openssl/crypto.h>
#include <openssl/types.h>
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
#include <openssl/bn.h>
#endif
#include <openssl/rsaerr.h>
#include <openssl/safestack.h>
#ifndef OPENSSL_NO_STDIO
#include <stdio.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifndef OPENSSL_RSA_MAX_MODULUS_BITS
#define OPENSSL_RSA_MAX_MODULUS_BITS 16384
#endif

#define RSA_3 0x3L
#define RSA_F4 0x10001L

#ifndef OPENSSL_NO_DEPRECATED_3_0
/* The types RSA and RSA_METHOD are defined in ossl_typ.h */

#define OPENSSL_RSA_FIPS_MIN_MODULUS_BITS 2048

#ifndef OPENSSL_RSA_SMALL_MODULUS_BITS
#define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
#endif

/* exponent limit enforced for "large" modulus only */
#ifndef OPENSSL_RSA_MAX_PUBEXP_BITS
#define OPENSSL_RSA_MAX_PUBEXP_BITS 64
#endif
/* based on RFC 8017 appendix A.1.2 */
#define RSA_ASN1_VERSION_DEFAULT 0
#define RSA_ASN1_VERSION_MULTI 1

#define RSA_DEFAULT_PRIME_NUM 2

#define RSA_METHOD_FLAG_NO_CHECK 0x0001
#define RSA_FLAG_CACHE_PUBLIC 0x0002
#define RSA_FLAG_CACHE_PRIVATE 0x0004
#define RSA_FLAG_BLINDING 0x0008
#define RSA_FLAG_THREAD_SAFE 0x0010
/*
 * This flag means the private key operations will be handled by rsa_mod_exp
 * and that they do not depend on the private key components being present:
 * for example a key stored in external hardware. Without this flag
 * bn_mod_exp gets called when private key components are absent.
 */
#define RSA_FLAG_EXT_PKEY 0x0020

/*
 * new with 0.9.6j and 0.9.7b; the built-in
 * RSA implementation now uses blinding by
 * default (ignoring RSA_FLAG_BLINDING),
 * but other engines might not need it
 */
#define RSA_FLAG_NO_BLINDING 0x0080
#endif /* OPENSSL_NO_DEPRECATED_3_0 */
/*
 * Does nothing. Previously this switched off constant time behaviour.
 */
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
#define RSA_FLAG_NO_CONSTTIME 0x0000
#endif
/* deprecated name for the flag*/
/*
 * new with 0.9.7h; the built-in RSA
 * implementation now uses constant time
 * modular exponentiation for secret exponents
 * by default. This flag causes the
 * faster variable sliding window method to
 * be used for all exponents.
 */
#ifndef OPENSSL_NO_DEPRECATED_0_9_8
#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME
#endif

/*-
 * New with 3.0: use part of the flags to denote exact type of RSA key,
 * some of which are limited to specific signature and encryption schemes.
 * These different types share the same RSA structure, but indicate the
 * use of certain fields in that structure.
 * Currently known are:
 * RSA          - this is the "normal" unlimited RSA structure (typenum 0)
 * RSASSA-PSS   - indicates that the PSS parameters are used.
 * RSAES-OAEP   - no specific field used for the moment, but OAEP padding
 *                is expected.  (currently unused)
 *
 * 4 bits allow for 16 types
 */
#define RSA_FLAG_TYPE_MASK 0xF000
#define RSA_FLAG_TYPE_RSA 0x0000
#define RSA_FLAG_TYPE_RSASSAPSS 0x1000
#define RSA_FLAG_TYPE_RSAESOAEP 0x2000

int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int pad_mode);
int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *pad_mode);

int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *saltlen);

int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int bits);
int EVP_PKEY_CTX_set1_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
int EVP_PKEY_CTX_set_rsa_keygen_p