[python] add makefile

update-fork
MITSUNARI Shigeo 4 years ago
parent f3c39617ee
commit 4eb4b2bd36
  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)
env LD_LIBRARY_PATH=../../lib python3 she.py
../../lib/$(SHE384_256_SLIB):
make -C ../../ lib/$(SHE384_256_SLIB)

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

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

Loading…
Cancel
Save