diff --git a/ffi/cs/mcl/mcl.cs b/ffi/cs/mcl/mcl.cs index 17d69f83..9f311095 100644 --- a/ffi/cs/mcl/mcl.cs +++ b/ffi/cs/mcl/mcl.cs @@ -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); @@ -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;