Skip to content

Commit

Permalink
[C#] add GT::IsValid()
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Feb 18, 2024
1 parent 6c7c72a commit 0e6074a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ffi/cs/mcl/mcl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public class MCL {

[DllImport(dllName)] public static extern void mclBnGT_clear(ref GT x);
[DllImport(dllName)] public static extern int mclBnGT_setStr(ref GT x, [In][MarshalAs(UnmanagedType.LPStr)] string buf, long bufSize, int ioMode);
[DllImport(dllName)] public static extern int mclBnGT_isValid(in GT x);
[DllImport(dllName)] public static extern int mclBnGT_isEqual(in GT x, in GT y);
[DllImport(dllName)] public static extern int mclBnGT_isZero(in GT x);
[DllImport(dllName)] public static extern int mclBnGT_isOne(in GT x);
Expand Down Expand Up @@ -929,6 +930,10 @@ public void SetStr(String s, int ioMode)
throw new ArgumentException("mclBnGT_setStr:" + s);
}
}
public bool IsValid()
{
return mclBnGT_isValid(this) == 1;
}
public bool Equals(in GT rhs)
{
return mclBnGT_isEqual(this, rhs) == 1;
Expand Down

0 comments on commit 0e6074a

Please sign in to comment.