I need to implement Shamir's Secret algorithm in EOS smart contract. Looking for some open source libraries which will support EOS. I researched some here https://github.com/topics/shamir from which I am trying C++ library https://github.com/onbitSyn/shamir_secret_share. Called this library's functions in smart contract. When compile eosio-cpp shamirkey.cpp -o shamirkey.abi, getting errors like:

/usr/opt/eosio.cdt/1.7.0/bin/wasm-ld: error: /tmp/shamirkey.cpp.o: undefined symbol: shamir::init()
/usr/opt/eosio.cdt/1.7.0/bin/wasm-ld: error: /tmp/shamirkey.cpp.o: undefined symbol: shamir::scheme::scheme(int, int)
/usr/opt/eosio.cdt/1.7.0/bin/wasm-ld: error: /tmp/shamirkey.cpp.o: undefined symbol: shamir::scheme::createShares(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
/usr/opt/eosio.cdt/1.7.0/bin/wasm-ld: error: /tmp/shamirkey.cpp.o: undefined symbol: GF256::byte::print()

Question 1: How to resolve the above errors if I want to continue with this library?

Question 2: Please suggest best MIT License Shamir's libraries which can be used in the latest EOS smart contract.

For Question 1, if needed I will add smart contract code. Any help would be appreciated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.