Merge branch 'dev'

update-fork
MITSUNARI Shigeo 4 years ago
commit 94c59af7f7
  1. 9
      ffi/python/Makefile
  2. 7
      ffi/python/readme.md
  3. 2
      ffi/python/she.py

@ -0,0 +1,9 @@
include ../../common.mk
SHE384_256_SLIB=libmclshe384_256.$(LIB_SUF)
she_test: ../../lib/$(SHE384_256_SLIB)
cd ../../lib && env LD_LIBRARY_PATH=./ python3 ../ffi/python/she.py
../../lib/$(SHE384_256_SLIB):
make -C ../../ lib/$(SHE384_256_SLIB)

@ -0,0 +1,7 @@
# sample for Python
## SHE
```
make she_test
```

@ -1,6 +1,7 @@
import os import os
import platform import platform
from ctypes import * from ctypes import *
#from ctypes.util import find_library
BN254 = 0 BN254 = 0
BLS12_381 = 5 BLS12_381 = 5
@ -34,6 +35,7 @@ def init(curveType=BN254):
libName = 'mclshe384_256.dll' libName = 'mclshe384_256.dll'
else: else:
raise RuntimeError("not support yet", name) raise RuntimeError("not support yet", name)
# lib = cdll.LoadLibrary(find_library(libName))
lib = cdll.LoadLibrary(libName) lib = cdll.LoadLibrary(libName)
ret = lib.sheInit(curveType, MCLBN_COMPILED_TIME_VAR) ret = lib.sheInit(curveType, MCLBN_COMPILED_TIME_VAR)
if ret != 0: if ret != 0:

Loading…
Cancel
Save