Added LevelDB

parent a3528e64
...@@ -9,10 +9,22 @@ ...@@ -9,10 +9,22 @@
#include "bls.h" #include "bls.h"
extern "C" void init_bls() {
#include "leveldb/db.h"
extern "C" void init_daemon() {
libff::init_alt_bn128_params(); libff::init_alt_bn128_params();
// Set up database connection information and open database
leveldb::DB* db;
leveldb::Options options;
options.create_if_missing = true;
leveldb::Status status = leveldb::DB::Open(options, "./keysdb", &db);
} }
class BLSCrypto { class BLSCrypto {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define EXTERNC #define EXTERNC
#endif #endif
EXTERNC void init_bls(); EXTERNC void init_daemon();
......
...@@ -45,7 +45,7 @@ secure_enclave.edl: secure_enclave/secure_enclave.edl ...@@ -45,7 +45,7 @@ secure_enclave.edl: secure_enclave/secure_enclave.edl
## AM_CFLAGS = ## AM_CFLAGS =
## AM_CXXFLAGS = ## AM_CXXFLAGS =
AM_CPPFLAGS += -DSKALE_SGX=1 -DBINARY_OUTPUT=1 -IlibBLS/bls -IlibBLS/libff -IlibBLS -fno-builtin-memset $(GMP_CPPFLAGS) AM_CPPFLAGS += -DSKALE_SGX=1 -DBINARY_OUTPUT=1 -Ileveldb/include -IlibBLS/bls -IlibBLS/libff -IlibBLS -fno-builtin-memset $(GMP_CPPFLAGS)
## Additional targets to remove with 'make clean'. You must list ## Additional targets to remove with 'make clean'. You must list
## any edger8r generated files here. ## any edger8r generated files here.
...@@ -87,5 +87,5 @@ secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so ...@@ -87,5 +87,5 @@ secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so
## Use the variables, not the actual library names to ensure these ## Use the variables, not the actual library names to ensure these
## targets work on simulation builds. ## targets work on simulation builds.
sgxd_LDADD=-l$(SGX_URTS_LIB) -LlibBLS/build/libff/libff -l:libff.a -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a -lpthread sgxd_LDADD=-l$(SGX_URTS_LIB) -Lleveldb/build -LlibBLS/build/libff/libff -l:libleveldb.a -l:libff.a -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a -lpthread
...@@ -167,7 +167,7 @@ int main(int argc, char *argv[]) { ...@@ -167,7 +167,7 @@ int main(int argc, char *argv[]) {
if (argc != 0) if (argc != 0)
usage(); usage();
init_bls(); init_daemon();
init_enclave(); init_enclave();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment