Index: yc_rsa.h
===================================================================
--- /YC3121_SDK/fw/crypt/yc_rsa.h	(revision 570)
+++ /YC3121_SDK/fw/crypt/yc_rsa.h	(working copy)
@@ -40,6 +40,24 @@
 	uint8_t  n_q[4];                      //模数 n 参数 Q，用于 n 的模幂运算
 }RSA_PublicKeyTypeDef;
 
+
+typedef struct 
+{
+  uint32_t bytes;                       //RSA密钥长度字节数，即 RSA 密钥为 bytes * 8bits ，由于固定参数 MAX_RSA_MODULUS_BYTES 的限定，bytes 最大值为 256
+	uint8_t  e[4];                        //RSA 公钥指数
+	uint8_t  n[MAX_RSA_MODULUS_BYTES];    //RSA 模数 n
+}RSA_PublicKeyTypeDef2;
+
+
+typedef struct 
+{
+  uint32_t bytes;                       //RSA密钥长度字节数，即 RSA 密钥为 bytes * 8bits ，由于固定参数 MAX_RSA_MODULUS_BYTES 的限定，bytes 最大值为 256
+	uint8_t  e[4];                        //RSA 公钥指数
+	uint8_t  n[MAX_RSA_MODULUS_BYTES];    //RSA 模数 n
+  uint8_t  d[MAX_RSA_MODULUS_BYTES];    //RSA 私钥指数
+}RSA_PrivateKeyTypeDef2;
+
+
 typedef enum
 {
 	RSA_1024	= 1024,
@@ -170,6 +188,39 @@
   * @retval RET_CALC_IMPLEMENT_SUCCESS or RET_RSA_IMPLEMENT_ERROR
   */
 uint32_t RSA_GeneratePrime( uint32_t *result, uint32_t nbits, rng_callback f_rng, void *p_rng);
+
+/*
+***************************************************************************
+* Name: RSA_Private_Func
+* Description: Perform RSA standard decryption or signing operation.
+* Input: content: a pointer the context need to be signed or be decrypted.
+		 para->bytes: the word-length of the value pointed to by content
+		 para->e: RSA public key
+		 para->n: a pointer to RSA public modulus
+		 para->d: a pointer to RSA private key
+* Output: result: a pointer to a variable to store the result of para->wlen words got from RSA_Private_Func().
+* Return value: RET_RSA_IMPLEMENT_SUCCESS - The operation is successful.
+                RET_RSA_IMPLEMENT_ERROR - The operation is failed.
+***************************************************************************
+*/
+
+uint32_t RSA_Private_Func(uint8_t *output,uint8_t *input, RSA_PrivateKeyTypeDef2 *para,rng_callback f_rng, void *p_rng);
+
+
+/**
+  * @method	RSA_Public_Func
+  * @brief	Raw RSA public-key operation. 
+  * @param	output		:output data buffer
+  * @param	input		:input data buffer
+  * @param	key			:RSA public key
+  * 		para->bytes: the word-length of the value pointed to by content
+		 	para->e: RSA public key
+		 	para->n: a pointer to RSA public modulus
+  * @param	f_rng		:true random number generation function point
+  * @param	p_rng		:true random number generation para
+  * @retval				:RET_RSA_SUCCESS or RET_RSA_FAILURE
+  */
+uint32_t RSA_Public_Func(uint8_t *output, uint8_t *input, RSA_PublicKeyTypeDef2 *para,rng_callback f_rng, void *p_rng);
 							
 #endif
 
Index: yc_rsa.c
===================================================================
--- /YC3121_SDK/fw/crypt/yc_rsa.c	(revision 570)
+++ /YC3121_SDK/fw/crypt/yc_rsa.c	(working copy)
@@ -1951,3 +1951,65 @@
 }
 
 #endif
+
+
+
+/*
+***************************************************************************
+* Name: RSA_Private_Func
+* Description: Perform RSA standard decryption or signing operation.
+* Input: content: a pointer the context need to be signed or be decrypted.
+		 para->bytes: the word-length of the value pointed to by content
+		 para->e: RSA public key
+		 para->n: a pointer to RSA public modulus
+		 para->d: a pointer to RSA private key
+* Output: result: a pointer to a variable to store the result of para->wlen words got from RSA_Private_Func().
+* Return value: RET_RSA_IMPLEMENT_SUCCESS - The operation is successful.
+                RET_RSA_IMPLEMENT_ERROR - The operation is failed.
+***************************************************************************
+*/
+
+uint32_t RSA_Private_Func(uint8_t *output,uint8_t *input, RSA_PrivateKeyTypeDef2 *para,rng_callback f_rng, void *p_rng)
+{
+	RSA_PrivateKeyTypeDef pri_key;
+
+	pri_key.bytes = para->bytes;
+	memcpy(pri_key.e, para->e, sizeof(pri_key.e));
+	memcpy(pri_key.d, para->d, sizeof(pri_key.d));
+	memcpy(pri_key.n, para->n, sizeof(pri_key.n));
+	
+	memset(pri_key.p,0,sizeof(pri_key.p));
+	pri_key.p_xor = 0;
+	memset(pri_key.q,0,sizeof(pri_key.q));
+	pri_key.q_xor = 0;
+	RSA_GetPrativeKey_C_Q(&pri_key,f_rng,p_rng);
+	return 	RSA_Private_Standard(output,input,&pri_key,f_rng,p_rng);
+}
+
+
+/**
+  * @method	RSA_Public_Func
+  * @brief	Raw RSA public-key operation. 
+  * @param	output		:output data buffer
+  * @param	input		:input data buffer
+  * @param	key			:RSA public key
+  * 		para->bytes: the word-length of the value pointed to by content
+		 	para->e: RSA public key
+		 	para->n: a pointer to RSA public modulus
+  * @param	f_rng		:true random number generation function point
+  * @param	p_rng		:true random number generation para
+  * @retval				:RET_RSA_SUCCESS or RET_RSA_FAILURE
+  */
+uint32_t RSA_Public_Func(uint8_t *output, uint8_t *input, RSA_PublicKeyTypeDef2 *para,rng_callback f_rng, void *p_rng)
+{
+	RSA_PublicKeyTypeDef pub_key;
+
+	pub_key.bytes = para->bytes;
+	memcpy(pub_key.e, para->e, sizeof(pub_key.e));
+	memcpy(pub_key.n, para->n, sizeof(pub_key.n));
+
+	memset(pub_key.n_c,0,sizeof(pub_key.n_c));
+	memset(pub_key.n_q,0,sizeof(pub_key.n_q));
+
+	return RSA_Public(output, input, &pub_key,f_rng,p_rng);
+}
