26 #if !defined(MBEDTLS_CONFIG_FILE) 29 #include MBEDTLS_CONFIG_FILE 35 #if defined(MBEDTLS_THREADING_C) 42 #define MBEDTLS_ERR_RSA_BAD_INPUT_DATA -0x4080 43 #define MBEDTLS_ERR_RSA_INVALID_PADDING -0x4100 44 #define MBEDTLS_ERR_RSA_KEY_GEN_FAILED -0x4180 45 #define MBEDTLS_ERR_RSA_KEY_CHECK_FAILED -0x4200 46 #define MBEDTLS_ERR_RSA_PUBLIC_FAILED -0x4280 47 #define MBEDTLS_ERR_RSA_PRIVATE_FAILED -0x4300 48 #define MBEDTLS_ERR_RSA_VERIFY_FAILED -0x4380 49 #define MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE -0x4400 50 #define MBEDTLS_ERR_RSA_RNG_FAILED -0x4480 55 #define MBEDTLS_RSA_PUBLIC 0 56 #define MBEDTLS_RSA_PRIVATE 1 58 #define MBEDTLS_RSA_PKCS_V15 0 59 #define MBEDTLS_RSA_PKCS_V21 1 61 #define MBEDTLS_RSA_SIGN 1 62 #define MBEDTLS_RSA_CRYPT 2 64 #define MBEDTLS_RSA_SALT_LEN_ANY -1 70 #if defined(MBEDTLS_RSA_C) 107 #if defined(MBEDTLS_THREADING_C) 108 mbedtls_threading_mutex_t
mutex;
166 int (*f_rng)(
void *,
unsigned char *,
size_t),
216 const unsigned char *
input,
234 int (*f_rng)(
void *,
unsigned char *,
size_t),
236 const unsigned char *
input,
259 int (*f_rng)(
void *,
unsigned char *,
size_t),
261 int mode,
size_t ilen,
262 const unsigned char *
input,
282 int (*f_rng)(
void *,
unsigned char *,
size_t),
284 int mode,
size_t ilen,
285 const unsigned char *
input,
308 int (*f_rng)(
void *,
unsigned char *,
size_t),
311 const unsigned char *
label,
size_t label_len,
313 const unsigned char *
input,
343 int (*f_rng)(
void *,
unsigned char *,
size_t),
345 int mode,
size_t *olen,
346 const unsigned char *
input,
348 size_t output_max_len );
375 int (*f_rng)(
void *,
unsigned char *,
size_t),
377 int mode,
size_t *olen,
378 const unsigned char *
input,
380 size_t output_max_len );
409 int (*f_rng)(
void *,
unsigned char *,
size_t),
412 const unsigned char *
label,
size_t label_len,
414 const unsigned char *
input,
416 size_t output_max_len );
443 int (*f_rng)(
void *,
unsigned char *,
size_t),
447 unsigned int hashlen,
448 const unsigned char *hash,
449 unsigned char *sig );
470 int (*f_rng)(
void *,
unsigned char *,
size_t),
474 unsigned int hashlen,
475 const unsigned char *hash,
476 unsigned char *sig );
503 int (*f_rng)(
void *,
unsigned char *,
size_t),
507 unsigned int hashlen,
508 const unsigned char *hash,
509 unsigned char *sig );
535 int (*f_rng)(
void *,
unsigned char *,
size_t),
539 unsigned int hashlen,
540 const unsigned char *hash,
541 const unsigned char *sig );
562 int (*f_rng)(
void *,
unsigned char *,
size_t),
566 unsigned int hashlen,
567 const unsigned char *hash,
568 const unsigned char *sig );
596 int (*f_rng)(
void *,
unsigned char *,
size_t),
600 unsigned int hashlen,
601 const unsigned char *hash,
602 const unsigned char *sig );
629 int (*f_rng)(
void *,
unsigned char *,
size_t),
633 unsigned int hashlen,
634 const unsigned char *hash,
636 int expected_salt_len,
637 const unsigned char *sig );
int mbedtls_rsa_private(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, const unsigned char *input, unsigned char *output)
Do an RSA private key operation.
Definition: rsa.c:390
size_t len
Definition: rsa.h:82
mbedtls_mpi DP
Definition: rsa.h:90
int mbedtls_rsa_public(mbedtls_rsa_context *ctx, const unsigned char *input, unsigned char *output)
Do an RSA public key operation.
Definition: rsa.c:285
int mbedtls_rsa_rsaes_oaep_encrypt(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, const unsigned char *label, size_t label_len, size_t ilen, const unsigned char *input, unsigned char *output)
Perform a PKCS#1 v2.1 OAEP encryption (RSAES-OAEP-ENCRYPT)
Definition: rsa.c:610
mbedtls_mpi QP
Definition: rsa.h:92
int padding
Definition: rsa.h:101
GLenum mode
Definition: glext.h:6857
Threading abstraction layer.
int mbedtls_rsa_rsaes_pkcs1_v15_decrypt(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, size_t *olen, const unsigned char *input, unsigned char *output, size_t output_max_len)
Perform a PKCS#1 v1.5 decryption (RSAES-PKCS1-v1_5-DECRYPT)
Definition: rsa.c:918
mbedtls_mpi E
Definition: rsa.h:85
Configuration options (set of defines)
int mbedtls_rsa_rsaes_oaep_decrypt(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, const unsigned char *label, size_t label_len, size_t *olen, const unsigned char *input, unsigned char *output, size_t output_max_len)
Perform a PKCS#1 v2.1 OAEP decryption (RSAES-OAEP-DECRYPT)
Definition: rsa.c:783
int mbedtls_rsa_gen_key(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, unsigned int nbits, int exponent)
Generate an RSA keypair.
Definition: rsa.c:101
int ver
Definition: rsa.h:81
int mbedtls_rsa_copy(mbedtls_rsa_context *dst, const mbedtls_rsa_context *src)
Copy the components of an RSA context.
Definition: rsa.c:1617
mbedtls_mpi D
Definition: rsa.h:87
static sys_sem mutex
Definition: memp.c:120
mbedtls_mpi P
Definition: rsa.h:88
GLenum GLenum GLenum input
Definition: glext.h:9938
void mbedtls_rsa_init(mbedtls_rsa_context *ctx, int padding, int hash_id)
Initialize an RSA context.
Definition: rsa.c:74
GLuint GLsizei const GLchar * label
Definition: glext.h:8583
mbedtls_md_type_t
Definition: md.h:39
int hash_id
Definition: rsa.h:103
int mbedtls_rsa_rsassa_pss_verify(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, const unsigned char *hash, const unsigned char *sig)
Perform a PKCS#1 v2.1 PSS verification (RSASSA-PSS-VERIFY) (This is the "simple" version....
Definition: rsa.c:1431
mbedtls_mpi RP
Definition: rsa.h:95
mbedtls_mpi Q
Definition: rsa.h:89
void mbedtls_rsa_free(mbedtls_rsa_context *ctx)
Free the components of an RSA key.
Definition: rsa.c:1654
AVFormatContext * ctx
Definition: record_ffmpeg.c:247
int mbedtls_rsa_pkcs1_decrypt(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, size_t *olen, const unsigned char *input, unsigned char *output, size_t output_max_len)
Generic wrapper to perform a PKCS#1 decryption using the mode from the context. Do an RSA operation,...
Definition: rsa.c:1014
Generic message digest wrapper.
int mbedtls_rsa_check_privkey(const mbedtls_rsa_context *ctx)
Check a private RSA key.
Definition: rsa.c:203
mbedtls_mpi RN
Definition: rsa.h:94
GLenum src
Definition: glext.h:6980
mbedtls_mpi RQ
Definition: rsa.h:96
int mbedtls_rsa_rsassa_pkcs1_v15_verify(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, const unsigned char *hash, const unsigned char *sig)
Perform a PKCS#1 v1.5 verification (RSASSA-PKCS1-v1_5-VERIFY)
Definition: rsa.c:1456
void mbedtls_rsa_set_padding(mbedtls_rsa_context *ctx, int padding, int hash_id)
Set padding for an already initialized RSA context See mbedtls_rsa_init() for details.
Definition: rsa.c:90
mbedtls_mpi Vi
Definition: rsa.h:98
mbedtls_mpi Vf
Definition: rsa.h:99
GLint * exponent
Definition: glsym_gl.h:1069
MPI structure.
Definition: bignum.h:179
std::string output
Definition: Config.FromFile.cpp:44
int mbedtls_rsa_rsassa_pss_sign(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, const unsigned char *hash, unsigned char *sig)
Perform a PKCS#1 v2.1 PSS signature (RSASSA-PSS-SIGN)
Definition: rsa.c:1046
int mbedtls_rsa_check_pub_priv(const mbedtls_rsa_context *pub, const mbedtls_rsa_context *prv)
Check a public-private RSA key pair. Check each of the contexts, and make sure they match.
Definition: rsa.c:265
int mbedtls_rsa_rsassa_pkcs1_v15_sign(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, const unsigned char *hash, unsigned char *sig)
Perform a PKCS#1 v1.5 signature (RSASSA-PKCS1-v1_5-SIGN)
Definition: rsa.c:1149
int mbedtls_rsa_rsaes_pkcs1_v15_encrypt(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, size_t ilen, const unsigned char *input, unsigned char *output)
Perform a PKCS#1 v1.5 encryption (RSAES-PKCS1-v1_5-ENCRYPT)
Definition: rsa.c:687
Multi-precision integer library.
int mbedtls_rsa_pkcs1_verify(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, const unsigned char *hash, const unsigned char *sig)
Generic wrapper to perform a PKCS#1 verification using the mode from the context. Do a public RSA ope...
Definition: rsa.c:1586
GLenum GLenum dst
Definition: glext.h:6980
mbedtls_mpi DQ
Definition: rsa.h:91
int mbedtls_rsa_pkcs1_sign(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, const unsigned char *hash, unsigned char *sig)
Generic wrapper to perform a PKCS#1 signature using the mode from the context. Do a private RSA opera...
Definition: rsa.c:1273
RSA context structure.
Definition: rsa.h:79
int mbedtls_rsa_pkcs1_encrypt(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, size_t ilen, const unsigned char *input, unsigned char *output)
Generic wrapper to perform a PKCS#1 encryption using the mode from the context. Add the message paddi...
Definition: rsa.c:753
int mbedtls_rsa_check_pubkey(const mbedtls_rsa_context *ctx)
Check a public RSA key.
Definition: rsa.c:180
mbedtls_mpi N
Definition: rsa.h:84
int mbedtls_rsa_self_test(int verbose)
Checkup routine.
Definition: rsa.c:1750
int mbedtls_rsa_rsassa_pss_verify_ext(mbedtls_rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, const unsigned char *hash, mbedtls_md_type_t mgf1_hash_id, int expected_salt_len, const unsigned char *sig)
Perform a PKCS#1 v2.1 PSS verification (RSASSA-PSS-VERIFY) (This is the version with "full" options....
Definition: rsa.c:1305