src/Mayaqua/Encrypt.c
// Decrypt with the RSA private key

Decrypt with the RSA private key
Decrypt with the RSA private key
bool RsaPrivateDecrypt(void *dst, void *src, UINT size, K *k)
{
	void *tmp;
	int ret;
	if (src == NULL || size == 0 || k == NULL)
	{
		return false;
	}
	tmp = ZeroMalloc(size);
	Lock(openssl_lock);
	{
		ret = RSA_private_decrypt(size, src, tmp, EVP_PKEY_get0_RSA(k->pkey), RSA_NO_PADDING);
	}
	Unlock(openssl_lock);
	if (ret <= 0)
	{
		return false;
	}
	Copy(dst, tmp, size);
	Free(tmp);
	return true;
}
bool RsaPrivateDecrypt ( void * dst , void * src , UINT size , K * k ) { void * tmp ; int ret ; if ( src == NULL || size == 0 || k == NULL ) { return false ; } tmp = ZeroMalloc ( size ) ; Lock ( openssl_lock ) ; { ret = RSA_private_decrypt ( size , src , tmp , EVP_PKEY_get0_RSA ( k -> pkey ) , RSA_NO_PADDING ) ; } Unlock ( openssl_lock ) ; if ( ret <= 0 ) { return false ; } Copy ( dst , tmp , size ) ; Free ( tmp ) ; return true ; }
Decrypt with the RSA private key
Decrypt with the RSA private key
// Validate arguments
