mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
- First replacement of xyssl by polarssl where needed
This commit is contained in:
@ -1,18 +1,18 @@
|
||||
/**
|
||||
* \file rsa.h
|
||||
*/
|
||||
#ifndef XYSSL_RSA_H
|
||||
#define XYSSL_RSA_H
|
||||
#ifndef POLARSSL_RSA_H
|
||||
#define POLARSSL_RSA_H
|
||||
|
||||
#include "polarssl/bignum.h"
|
||||
|
||||
#define XYSSL_ERR_RSA_BAD_INPUT_DATA -0x0400
|
||||
#define XYSSL_ERR_RSA_INVALID_PADDING -0x0410
|
||||
#define XYSSL_ERR_RSA_KEY_GEN_FAILED -0x0420
|
||||
#define XYSSL_ERR_RSA_KEY_CHECK_FAILED -0x0430
|
||||
#define XYSSL_ERR_RSA_PUBLIC_FAILED -0x0440
|
||||
#define XYSSL_ERR_RSA_PRIVATE_FAILED -0x0450
|
||||
#define XYSSL_ERR_RSA_VERIFY_FAILED -0x0460
|
||||
#define POLARSSL_ERR_RSA_BAD_INPUT_DATA -0x0400
|
||||
#define POLARSSL_ERR_RSA_INVALID_PADDING -0x0410
|
||||
#define POLARSSL_ERR_RSA_KEY_GEN_FAILED -0x0420
|
||||
#define POLARSSL_ERR_RSA_KEY_CHECK_FAILED -0x0430
|
||||
#define POLARSSL_ERR_RSA_PUBLIC_FAILED -0x0440
|
||||
#define POLARSSL_ERR_RSA_PRIVATE_FAILED -0x0450
|
||||
#define POLARSSL_ERR_RSA_VERIFY_FAILED -0x0460
|
||||
|
||||
/*
|
||||
* PKCS#1 constants
|
||||
@ -114,7 +114,7 @@ void rsa_init( rsa_context *ctx,
|
||||
* \note rsa_init() must be called beforehand to setup
|
||||
* the RSA context (especially f_rng and p_rng).
|
||||
*
|
||||
* \return 0 if successful, or an XYSSL_ERR_RSA_XXX error code
|
||||
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
||||
*/
|
||||
int rsa_gen_key( rsa_context *ctx, int nbits, int exponent );
|
||||
|
||||
@ -123,7 +123,7 @@ int rsa_gen_key( rsa_context *ctx, int nbits, int exponent );
|
||||
*
|
||||
* \param ctx RSA context to be checked
|
||||
*
|
||||
* \return 0 if successful, or an XYSSL_ERR_RSA_XXX error code
|
||||
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
||||
*/
|
||||
int rsa_check_pubkey( rsa_context *ctx );
|
||||
|
||||
@ -132,7 +132,7 @@ int rsa_check_pubkey( rsa_context *ctx );
|
||||
*
|
||||
* \param ctx RSA context to be checked
|
||||
*
|
||||
* \return 0 if successful, or an XYSSL_ERR_RSA_XXX error code
|
||||
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
||||
*/
|
||||
int rsa_check_privkey( rsa_context *ctx );
|
||||
|
||||
@ -143,7 +143,7 @@ int rsa_check_privkey( rsa_context *ctx );
|
||||
* \param input input buffer
|
||||
* \param output output buffer
|
||||
*
|
||||
* \return 0 if successful, or an XYSSL_ERR_RSA_XXX error code
|
||||
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
||||
*
|
||||
* \note This function does NOT take care of message
|
||||
* padding. Also, be sure to set input[0] = 0.
|
||||
@ -162,7 +162,7 @@ int rsa_public( rsa_context *ctx,
|
||||
* \param input input buffer
|
||||
* \param output output buffer
|
||||
*
|
||||
* \return 0 if successful, or an XYSSL_ERR_RSA_XXX error code
|
||||
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
||||
*
|
||||
* \note The input and output buffers must be large
|
||||
* enough (eg. 128 bytes if RSA-1024 is used).
|
||||
@ -180,7 +180,7 @@ int rsa_private( rsa_context *ctx,
|
||||
* \param input buffer holding the data to be encrypted
|
||||
* \param output buffer that will hold the ciphertext
|
||||
*
|
||||
* \return 0 if successful, or an XYSSL_ERR_RSA_XXX error code
|
||||
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
||||
*
|
||||
* \note The output buffer must be as large as the size
|
||||
* of ctx->N (eg. 128 bytes if RSA-1024 is used).
|
||||
@ -199,7 +199,7 @@ int rsa_pkcs1_encrypt( rsa_context *ctx,
|
||||
* \param output buffer that will hold the plaintext
|
||||
* \param olen will contain the plaintext length
|
||||
*
|
||||
* \return 0 if successful, or an XYSSL_ERR_RSA_XXX error code
|
||||
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
||||
*
|
||||
* \note The output buffer must be as large as the size
|
||||
* of ctx->N (eg. 128 bytes if RSA-1024 is used).
|
||||
@ -220,7 +220,7 @@ int rsa_pkcs1_decrypt( rsa_context *ctx,
|
||||
* \param sig buffer that will hold the ciphertext
|
||||
*
|
||||
* \return 0 if the signing operation was successful,
|
||||
* or an XYSSL_ERR_RSA_XXX error code
|
||||
* or an POLARSSL_ERR_RSA_XXX error code
|
||||
*
|
||||
* \note The "sig" buffer must be as large as the size
|
||||
* of ctx->N (eg. 128 bytes if RSA-1024 is used).
|
||||
@ -243,7 +243,7 @@ int rsa_pkcs1_sign( rsa_context *ctx,
|
||||
* \param sig buffer holding the ciphertext
|
||||
*
|
||||
* \return 0 if the verify operation was successful,
|
||||
* or an XYSSL_ERR_RSA_XXX error code
|
||||
* or an POLARSSL_ERR_RSA_XXX error code
|
||||
*
|
||||
* \note The "sig" buffer must be as large as the size
|
||||
* of ctx->N (eg. 128 bytes if RSA-1024 is used).
|
||||
|
Reference in New Issue
Block a user