binding of she supports windows

pull/2/head
MITSUNARI Shigeo 6 years ago
parent 9dc5b41fbc
commit ba980c7ced
  1. 9
      ffi/python/she.py
  2. 5
      mklib.bat

@ -26,13 +26,14 @@ def init(curveType=MCL_BN254):
global lib global lib
name = platform.system() name = platform.system()
if name == 'Linux': if name == 'Linux':
suf = 'so' libName = 'libmclshe256.so'
elif name == 'Darwin': elif name == 'Darwin':
suf = 'dylib' libName = 'libmclshe256.dylib'
elif name == 'Windows':
libName = 'mclshe256.dll'
else: else:
raise RuntimeError("not support yet", name) raise RuntimeError("not support yet", name)
libname = "libmclshe256." + suf lib = cdll.LoadLibrary(libName)
lib = cdll.LoadLibrary(libname)
ret = lib.sheInit(MCL_BN254, MCLBN_COMPILED_TIME_VAR) ret = lib.sheInit(MCL_BN254, MCLBN_COMPILED_TIME_VAR)
if ret != 0: if ret != 0:
raise RuntimeError("sheInit", ret) raise RuntimeError("sheInit", ret)

@ -23,6 +23,11 @@ if "%1"=="dll" (
cl /c %CFLAGS% src\bn_c384.cpp /Foobj\bn_c384.obj /DMCLBN_NO_AUTOLINK cl /c %CFLAGS% src\bn_c384.cpp /Foobj\bn_c384.obj /DMCLBN_NO_AUTOLINK
echo link /nologo /DLL /OUT:bin\mclbn384.dll obj\bn_c384.obj obj\fp.obj %LDFLAGS% /implib:lib\mclbn384.lib echo link /nologo /DLL /OUT:bin\mclbn384.dll obj\bn_c384.obj obj\fp.obj %LDFLAGS% /implib:lib\mclbn384.lib
link /nologo /DLL /OUT:bin\mclbn384.dll obj\bn_c384.obj obj\fp.obj %LDFLAGS% /implib:lib\mclbn384.lib link /nologo /DLL /OUT:bin\mclbn384.dll obj\bn_c384.obj obj\fp.obj %LDFLAGS% /implib:lib\mclbn384.lib
echo cl /c %CFLAGS% src\she_c256.cpp /Foobj\she_c256.obj /DMCLBN_NO_AUTOLINK
cl /c %CFLAGS% src\she_c256.cpp /Foobj\she_c256.obj /DMCLBN_NO_AUTOLINK
echo link /nologo /DLL /OUT:bin\mclshe256.dll obj\she_c256.obj obj\fp.obj %LDFLAGS% /implib:lib\mclshe_c256.lib
link /nologo /DLL /OUT:bin\mclshe256.dll obj\she_c256.obj obj\fp.obj %LDFLAGS% /implib:lib\mclshe_c256.lib
) else ( ) else (
echo cl /c %CFLAGS% src\bn_c256.cpp /Foobj\bn_c256.obj echo cl /c %CFLAGS% src\bn_c256.cpp /Foobj\bn_c256.obj
cl /c %CFLAGS% src\bn_c256.cpp /Foobj\bn_c256.obj cl /c %CFLAGS% src\bn_c256.cpp /Foobj\bn_c256.obj

Loading…
Cancel
Save