Unverified Commit 228cb221 authored by kladko's avatar kladko

SKALE-1880-fix-ecdsa

parent 7acee1a7
#include "secure_enclave/Point.c"
#include "secure_enclave/DomainParameters.c"
#include "secure_enclave/NumberTheory.c"
#include "secure_enclave/Signature.c"
#include "secure_enclave/Curves.c"
\ No newline at end of file
......@@ -45,7 +45,7 @@ secure_enclave.edl: secure_enclave/secure_enclave.edl
#AM_CPPFLAGS += -g -Og
AM_CFLAGS = -g -Og -rdynamic -Wl,--no-as-needed -lSegFault
AM_CFLAGS = -DUSER_SPACE -g -Og -rdynamic -Wl,--no-as-needed -lSegFault
AM_CXXFLAGS = ${AM_CPPFLAGS} -rdynamic -Wl,--no-as-needed -lSegFault
......@@ -68,11 +68,10 @@ bin_PROGRAMS = sgxwallet testw cert_util
COMMON_SRC = InvalidStateException.cpp Exception.cpp InvalidArgumentException.cpp Log.cpp \
SGXWalletServer.cpp SGXRegistrationServer.cpp CSRManagerServer.cpp RPCException.cpp BLSCrypto.cpp \
secure_enclave/DomainParameters.c ECDSACrypto.cpp \
ECDSACrypto.cpp \
DKGCrypto.cpp ServerInit.cpp BLSPrivateKeyShareSGX.cpp LevelDB.cpp ServerDataChecker.cpp SEKManager.cpp \
sgx_stub.c sgx_detect_linux.c create_enclave.c oc_alloc.c \
secure_enclave/NumberTheory.c secure_enclave/Signature.c \
secure_enclave/Curves.c secure_enclave/Point.c
ECDSAImpl.c
COMMON_ENCLAVE_SRC = secure_enclave_u.c secure_enclave_u.h
sgxwallet_SOURCES = sgxwallet.c $(COMMON_SRC)
......@@ -118,4 +117,4 @@ cert_util_SOURCES= InvalidStateException.cpp Exception.cpp InvalidArgumentExcep
cert_util_LDADD=-LlibBLS/deps/deps_inst/x86_or_x64/lib -Lleveldb/build -LlibBLS/build \
-LlibBLS/build/libff/libff \
-l:libbls.a -l:libleveldb.a \
-l:libff.a -lgmp -ljsonrpccpp-stub -ljsonrpccpp-server -ljsonrpccpp-client -ljsonrpccpp-common -ljsoncpp -lmicrohttpd -lgnutls -lgcrypt -lcurl -lssl -lcrypto -lz -lpthread -ldl
-l:libff.a -lgmp -ljsonrpccpp-stub -ljsonrpccpp-server -ljsonrpccpp-client -ljsonrpccpp-common -ljsoncpp -lmicrohttpd -lgnutls -lgcrypt -lcurl -lssl -lcrypto -lz -lpthread -ldl
\ No newline at end of file
......@@ -33,7 +33,7 @@ using namespace std;
#include <memory>
#define USER_SPACE
#include <gmp.h>
#include "secure_enclave/Verify.h"
#include "InvalidStateException.h"
......
......@@ -31,6 +31,7 @@
#endif
#ifdef USER_SPACE
#include <gmp.h>
#else
#include <../tgmp-build/include/sgx_tgmp.h>
......
......@@ -28,6 +28,8 @@
#ifdef USER_SPACE
#include <gmp.h>
#else
#include <../tgmp-build/include/sgx_tgmp.h>
#endif
......@@ -90,6 +92,7 @@ void signature_extract_public_key(point public_key, mpz_t private_key, domain_pa
point_multiplication(public_key, private_key, curve->G, curve);
}
#ifndef USER_SPACE
/*Generate signature for a message*/
void signature_sign(signature sig, mpz_t message, mpz_t private_key, domain_parameters curve) {
//message must not have a bit length longer than that of n
......@@ -177,7 +180,7 @@ void signature_sign(signature sig, mpz_t message, mpz_t private_key, domain_para
}
#endif
/*Release signature*/
void signature_free(signature sig) {
......
......@@ -22,6 +22,9 @@
*/
#ifndef SGXWALLET_VERIFY_H
#define SGXWALLET_VERIFY_H
#define USER_SPACE 1
#include "secure_enclave/Point.h"
#include "secure_enclave/DomainParameters.h"
#include "secure_enclave/NumberTheory.h"
......
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