2
我在C#等語言中沒有太多經驗,所以如果你們能幫助我,我會很高興。我寫在C++這種方法使用MPIR庫:C#編組數據#
mpz_class SchnorrProtocol::getX(const mpz_class& r) const
{
mpz_class x;
mpz_powm(x.get_mpz_t(), this->params_.getBeta().get_mpz_t(), r.get_mpz_t(), this->params_.getP().get_mpz_t());
return x;
}
,現在我想將其導入到C#:
#region Filter & P/Invoke
#if DEBUG
private const string DLL = "schnorrd.DLL";
#else
private const string DLL = "schnorr.DLL";
#endif
[DllImport(DLL)]
"method definition"
...... SchnorrProtocol::getX(......);
我的問題,我不知道該怎麼做。你能幫我嗎?
問題是: mpz_class是C++類,這是avalable用: #include 所以標準的運算符和各種標準函數都是overloa讓這個類允許算術。 我不知道如何寫這樣的類的定義。:( –
Tatiana
2009-10-21 15:34:59