Open knotgrass opened 1 year ago
I build shared library by using command cd ref && make shared. The outputs file is
cd ref && make shared
ref/libpqcrystals_aes256ctr_ref.so ref/libpqcrystals_fips202_ref.so ref/libpqcrystals_sha2_ref.so ref/libpqcrystals_kyber512-90s_ref.so ref/libpqcrystals_kyber512_ref.so ref/libpqcrystals_kyber768-90s_ref.so ref/libpqcrystals_kyber768_ref.so ref/libpqcrystals_kyber1024-90s_ref.so ref/libpqcrystals_kyber1024_ref.so
After that, I using python try to open these .so file
.so
import os from ctypes import cdll shared_lib = os.path.abspath(os.path.join(__file__, '..', 'ref')) aes256ctr = cdll.LoadLibrary(os.path.join(shared_lib, 'libpqcrystals_aes256ctr_ref.so' )) fips202 = cdll.LoadLibrary(os.path.join(shared_lib, 'libpqcrystals_fips202_ref.so' )) sha2 = cdll.LoadLibrary(os.path.join(shared_lib, 'libpqcrystals_sha2_ref.so' )) try: kyber512 = cdll.LoadLibrary(os.path.join(shared_lib, 'libpqcrystals_kyber512_ref.so')) except Exception as ex: print(ex) try: kyber512_90s = cdll.LoadLibrary(os.path.join(shared_lib, 'libpqcrystals_kyber512-90s_ref.so')) except Exception as ex: print(ex) try: kyber768 = cdll.LoadLibrary(os.path.join(shared_lib, 'libpqcrystals_kyber768_ref.so')) except Exception as ex: print(ex) try: kyber768_90s = cdll.LoadLibrary(os.path.join(shared_lib, 'libpqcrystals_kyber768-90s_ref.so')) except Exception as ex: print(ex) try: kyber1024 = cdll.LoadLibrary(os.path.join(shared_lib, 'libpqcrystals_kyber1024_ref.so')) except Exception as ex: print(ex) try: kyber1024_90s = cdll.LoadLibrary(os.path.join(shared_lib, 'libpqcrystals_kyber1024-90s_ref.so')) except Exception as ex: print(ex)
And i have a problem
Traceback (most recent call last): /home/tz/Documents/KYBER/kyber_python/ref/libpqcrystals_kyber512_ref.so: undefined symbol: pqcrystals_kyber_fips202_ref_shake256 /home/tz/Documents/KYBER/kyber_python/ref/libpqcrystals_kyber512-90s_ref.so: undefined symbol: pqcrystals_kyber_aes256ctr_ref_init /home/tz/Documents/KYBER/kyber_python/ref/libpqcrystals_kyber768_ref.so: undefined symbol: pqcrystals_kyber_fips202_ref_shake256 /home/tz/Documents/KYBER/kyber_python/ref/libpqcrystals_kyber768-90s_ref.so: undefined symbol: pqcrystals_kyber_aes256ctr_ref_init /home/tz/Documents/KYBER/kyber_python/ref/libpqcrystals_kyber1024_ref.so: undefined symbol: pqcrystals_kyber_fips202_ref_shake256 /home/tz/Documents/KYBER/kyber_python/ref/libpqcrystals_kyber1024-90s_ref.so: undefined symbol: pqcrystals_kyber_aes256ctr_ref_init
I am new in C/C++. Please help me fix these thing.
I edited the Makefile, and It worked
I build shared library by using command
cd ref && make shared
. The outputs file isAfter that, I using python try to open these
.so
fileAnd i have a problem
I am new in C/C++. Please help me fix these thing.