From 4aa8511de2b7bec2b61e4c53cfa0f92d49f6dd57 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Mon, 25 Mar 2019 18:18:16 +0900 Subject: [cs] update arguments of blsInit --- ffi/cs/bls256.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ffi') diff --git a/ffi/cs/bls256.cs b/ffi/cs/bls256.cs index 174da0a..3ef5fab 100644 --- a/ffi/cs/bls256.cs +++ b/ffi/cs/bls256.cs @@ -5,9 +5,11 @@ using System.Runtime.InteropServices; namespace mcl { class BLS256 { const int IoEcComp = 512; // fixed byte representation - public const int maxUnitSize = 4; + public const int MCLBN_FR_UNIT_SIZE = 4; + public const int MCLBN_FP_UNIT_SIZE = 4; + public const int MCLBN_COMPILED_TIME_VAR = MCLBN_FR_UNIT_SIZE * 10 + MCLBN_FP_UNIT_SIZE; [DllImport("bls256.dll")] - public static extern int blsInit(int curve, int maxUnitSize); + public static extern int blsInit(int curve, int compiledTimeVar); [DllImport("bls256.dll")] public static extern void blsIdSetInt(ref Id id, int x); [DllImport("bls256.dll")] public static extern int blsIdSetDecStr(ref Id id, [In][MarshalAs(UnmanagedType.LPStr)] string buf, ulong bufSize); @@ -98,7 +100,7 @@ namespace mcl { if (!System.Environment.Is64BitProcess) { throw new PlatformNotSupportedException("not 64-bit system"); } - int err = blsInit(CurveFp254BNb, maxUnitSize); + int err = blsInit(CurveFp254BNb, MCLBN_COMPILED_TIME_VAR); if (err != 0) { throw new ArgumentException("blsInit"); } -- cgit v1.2.3