Adds reference impl for cSIDH
This commit is contained in:
parent
7590e84d38
commit
67c6788ad9
33
csidh/Makefile
Normal file
33
csidh/Makefile
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
objify = $(patsubst %.c,$(BUILD_DIR)/%.$2,$(patsubst %.s,$(BUILD_DIR)/%.$2,$1))
|
||||||
|
|
||||||
|
CFLAGS=-Wall -Wextra -Wpedantic -O3 -funroll-loops
|
||||||
|
LDFLAGS=
|
||||||
|
BUILD_DIR=build
|
||||||
|
AR=ar rcs
|
||||||
|
RANLIB=ranlib
|
||||||
|
|
||||||
|
CODE_SRC_C = \
|
||||||
|
ref/csidh/rng.c \
|
||||||
|
ref/csidh/mont.c \
|
||||||
|
ref/csidh/csidh.c
|
||||||
|
CODE_SRC_S = \
|
||||||
|
ref/csidh/u512.s \
|
||||||
|
ref/csidh/fp.s
|
||||||
|
CODE_OBJ = \
|
||||||
|
$(call objify,$(CODE_SRC_C),o) \
|
||||||
|
$(call objify,$(CODE_SRC_S),o)
|
||||||
|
|
||||||
|
$(BUILD_DIR)/%.o: %.c
|
||||||
|
case $@ in */*) f=$@; mkdir -p $${f%/*} ;; esac
|
||||||
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||||||
|
|
||||||
|
$(BUILD_DIR)/%.o: %.s
|
||||||
|
case $@ in */*) f=$@; mkdir -p $${f%/*} ;; esac
|
||||||
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||||||
|
|
||||||
|
all: $(CODE_OBJ)
|
||||||
|
$(AR) $(BUILD_DIR)/libcsidh.a $^
|
||||||
|
$(RANLIB) $(BUILD_DIR)/libcsidh.a
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf build
|
Loading…
Reference in New Issue
Block a user