Skip to content

Commit

Permalink
Revert back to inlined files due to verify perf regression
Browse files Browse the repository at this point in the history
  • Loading branch information
sakridge committed Oct 31, 2019
1 parent ec8a282 commit c00960e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
16 changes: 3 additions & 13 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ all: $V/$(CHACHA_TEST_BIN) $V/$(ECC_TEST_BIN) $(V)/lib$(LIB).so

ECC_DIR:=cuda-ecc-ed25519

SC_SRCS:=$(addprefix $(ECC_DIR)/,sc.cu ed25519.h ge.h)
$V/sc.o: $(SC_SRCS)
@mkdir -p $(@D)
$(NVCC) -rdc=true $(CFLAGS) -c $< -o $@

KEYPAIR_SRCS:=$(addprefix $(ECC_DIR)/,keypair.cu ed25519.h ge.h)
$V/keypair.o: $(KEYPAIR_SRCS)
@mkdir -p $(@D)
Expand All @@ -40,17 +35,12 @@ $V/seed.o: $(SEED_SRCS)
@mkdir -p $(@D)
$(NVCC) -rdc=true $(CFLAGS) -c $< -o $@

GE_SRCS:=$(addprefix $(ECC_DIR)/,ge.cu ge.h precomp_data.h)
$V/ge.o: $(GE_SRCS)
@mkdir -p $(@D)
$(NVCC) -rdc=true $(CFLAGS) -c $< -o $@

SIGN_SRCS:=$(addprefix $(ECC_DIR)/,sign.cu sha512.h ge.h sc.h fe.cu ../$(CUDA_HEADER_DIR)/gpu_common.h ed25519.h)
$V/sign.o: $(SIGN_SRCS)
@mkdir -p $(@D)
$(NVCC) -rdc=true $(CFLAGS) -c $< -o $@

VERIFY_SRCS:=$(addprefix $(ECC_DIR)/,verify.cu seed.cu sha512.cu ge.h sc.cu fe.cu keypair.cu common.cu ed25519.h)
VERIFY_SRCS:=$(addprefix $(ECC_DIR)/,verify.cu sha512.cu ge.cu sc.cu fe.cu keypair.cu common.cu ed25519.h)
$V/verify.o: $(VERIFY_SRCS)
@mkdir -p $(@D)
$(NVCC) -rdc=true $(CFLAGS) -c $< -o $@
Expand Down Expand Up @@ -79,10 +69,10 @@ $V/poh_verify.o: $(POH_SRCS)
@mkdir -p $(@D)
$(NVCC) -rdc=true $(CFLAGS) -c $< -o $@

CPU_GPU_OBJS=$(addprefix $V/,chacha_cbc.o aes_cbc.o verify.o poh_verify.o gpu_ctx.o sign.o ge.o seed.o keypair.o sc.o)
CPU_GPU_OBJS=$(addprefix $V/,chacha_cbc.o aes_cbc.o verify.o poh_verify.o gpu_ctx.o sign.o seed.o keypair.o)

$V/crypt-dlink.o: $(CPU_GPU_OBJS)
$(NVCC) -Xcompiler "-fPIC" --gpu-architecture=compute_61 --device-link $^ --output-file $@
$(NVCC) -Xcompiler "-fPIC" $(CFLAGS) --device-link $^ --output-file $@

$V/lib$(LIB).so: $V/crypt-dlink.o $(CPU_GPU_OBJS)
$(NVCC) -Xcompiler "-fPIC" --shared --output-file $@ $^
Expand Down
4 changes: 2 additions & 2 deletions src/cuda-ecc-ed25519/verify.cu
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "sha512.h"
#include <algorithm>
#include <stdio.h>
#include "sc.h"
#include "sc.cu"
#include "fe.cu"
#include "ge.h"
#include "ge.cu"
#include "sha512.cu"

#include "ed25519.h"
Expand Down

0 comments on commit c00960e

Please sign in to comment.