aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2019-03-25 17:18:16 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2019-03-25 17:18:16 +0800
commit4aa8511de2b7bec2b61e4c53cfa0f92d49f6dd57 (patch)
tree38ed3da74139b0850cb24a064c4dd3e1836bba2e
parentf09ec7ce253b0f14d63c7a78c558d54672eba724 (diff)
downloaddexon-bls-4aa8511de2b7bec2b61e4c53cfa0f92d49f6dd57.tar
dexon-bls-4aa8511de2b7bec2b61e4c53cfa0f92d49f6dd57.tar.gz
dexon-bls-4aa8511de2b7bec2b61e4c53cfa0f92d49f6dd57.tar.bz2
dexon-bls-4aa8511de2b7bec2b61e4c53cfa0f92d49f6dd57.tar.lz
dexon-bls-4aa8511de2b7bec2b61e4c53cfa0f92d49f6dd57.tar.xz
dexon-bls-4aa8511de2b7bec2b61e4c53cfa0f92d49f6dd57.tar.zst
dexon-bls-4aa8511de2b7bec2b61e4c53cfa0f92d49f6dd57.zip
[cs] update arguments of blsInit
-rw-r--r--ffi/cs/bls256.cs8
-rwxr-xr-xmkdll.bat8
2 files changed, 5 insertions, 11 deletions
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");
}
diff --git a/mkdll.bat b/mkdll.bat
deleted file mode 100755
index 17e934f..0000000
--- a/mkdll.bat
+++ /dev/null
@@ -1,8 +0,0 @@
-rem @echo off
-
-call setvar.bat dll
-echo make bls384.dll
-cl /c %CFLAGS% /DBLS_NO_AUTOLINK /Foobj/bls_c.obj src/bls_c.cpp
-cl /c %CFLAGS% /DBLS_NO_AUTOLINK /Foobj/fp.obj ../mcl/src/fp.cpp
-lib /OUT:lib/bls384.lib /nodefaultlib obj/bls_c.obj obj/fp.obj %LDFLAGS%
-cl /LD /MT obj/bls_c.obj obj/fp.obj %CFLAGS% /link /out:bin/bls384.dll %LDFLAGS%